it0/packages/services
hailin 40ee84a0b7 fix(billing-service): resolve all TypeScript compilation errors
Comprehensive fix of 124 TS errors across the billing-service:

Entity fixes:
- invoice.entity.ts: add InvoiceStatus/InvoiceCurrency const objects,
  rename fields to match DB schema (subtotalCents, taxCents, totalCents,
  amountDueCents), add OneToMany items relation
- invoice-item.entity.ts: add InvoiceItemType const object, add column
  name mappings and currency field
- payment.entity.ts: add PaymentStatus const, rename amount→amountCents
  with column name mapping, add paidAt field
- subscription.entity.ts: add SubscriptionStatus const object
- usage-aggregate.entity.ts: rename periodYear/Month→year/month to match
  DB columns, add periodStart/periodEnd fields
- payment-method.entity.ts: add displayName, expiresAt, updatedAt fields

Port/Provider fixes:
- payment-provider.port.ts: make PaymentProviderType a const object (not
  just a type), add PaymentSessionRequest alias, rename WebhookEvent with
  correct field shape (type vs eventType), make providerPaymentId optional
- All 4 providers: replace PaymentSessionRequest→CreatePaymentParams,
  fix amountCents→amount, remove sessionId from PaymentSession return,
  add confirmPayment() stub, fix Stripe API version to '2023-10-16'

Use case fixes:
- aggregate-usage.use-case.ts: replace 'redis' with 'ioredis' (workspace
  standard); rewrite using ioredis xreadgroup API
- change/check/generate use cases: fix Plan field names
  (monthlyPriceCentsUsd, includedTokens, overageRateCentsPerMTokenUsd)
- generate-monthly-invoice: fix SubscriptionStatus/InvoiceCurrency as
  values (now const objects)
- handle-payment-webhook: fix WebhookResult import, result.type usage,
  payment.paidAt

Controller/Repository fixes:
- plan.controller.ts, plan.repository.ts: fix Plan field names
- webhook.controller.ts: remove express import, use any for req type
- invoice-generator.service.ts: fix overageAmountCents→overageCentsUsd,
  monthlyPriceCny→monthlyPriceFenCny, includedTokensPerMonth→includedTokens

Dependencies:
- billing-service/package.json: replace redis with ioredis dependency
- pnpm-lock.yaml: regenerated after ioredis addition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 23:00:27 -08:00
..
agent-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
audit-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
auth-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
billing-service fix(billing-service): resolve all TypeScript compilation errors 2026-03-03 23:00:27 -08:00
comm-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
inventory-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
monitor-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
ops-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
version-service fix(version-service): use DatabaseModule.forRoot() for correct build path 2026-03-03 08:04:12 -08:00
voice-agent docs: add detailed comments for thinking state indicator mechanism 2026-03-03 06:13:54 -08:00
voice-service feat: add engine type selection (Agent SDK / Claude API) for voice calls 2026-03-02 02:11:51 -08:00