# Batch 1 Status - WHMCS Service Files

## What Was Done
Fixed 8 files to import from specific domains instead of bare `@customer-portal/domain`:

1. ✅ `whmcs.service.ts` - Split imports to billing/subscriptions/payments/common
2. ✅ `whmcs-invoice.service.ts` - Now imports from billing
3. ✅ `whmcs-subscription.service.ts` - Now imports from subscriptions
4. ✅ `whmcs-payment.service.ts` - Now imports from payments  
5. ✅ `whmcs-transformer-orchestrator.service.ts` - Split imports
6. ✅ `whmcs-cache.service.ts` - Split imports
7. ✅ `subscriptions.service.ts` - Now imports from subscriptions
8. ⚠️  `subscriptions.controller.ts` - PARTIALLY fixed

## Issues Found

### subscriptions.controller.ts Problem
This file imports SIM-related schemas that **don't exist in the domain yet**:
- `simTopupRequestSchema`
- `simChangePlanRequestSchema`
- `simCancelRequestSchema`
- `simFeaturesRequestSchema`

These schemas exist in the old `packages/domain/src/validation/**` but haven't been moved to the new domain structure yet.

### Missing Schemas/Types Inventory

**In SIM domain (`@customer-portal/domain/sim`):**
- ✅ HAS: `SimDetails`, `SimUsage`, `SimTopUpHistory` (contracts)
- ✅ HAS: Provider raw types and request schemas (freebitAccountDetailsRequestSchema, etc.)
- ❌ MISSING: Business-level request schemas (simTopupRequestSchema, simChangePlanRequestSchema, etc.)
- ❌ MISSING: Query schemas (subscriptionQuerySchema, invoiceListQuerySchema - these are in old domain/src/validation)

**In Billing domain:**
- ✅ HAS: `Invoice`, `InvoiceList`, `invoiceSchema`, `invoiceListSchema`
- ❌ MISSING: `invoiceListQuerySchema` (in old domain/src/validation)

**In Subscriptions domain:**
- ✅ HAS: `Subscription`, `SubscriptionList`
- ❌ MISSING: `subscriptionQuerySchema` (in old domain/src/validation)

## Type Error Count
- **Before batch 1:** 91 errors
- **After batch 1:** 166 errors (increased because I commented out SIM schema imports)

## Decision Point

**Option A:** Create the missing schemas now in the domains
- Add query schemas to billing/subscriptions
- Add business request schemas to sim
- Time: ~30 minutes

**Option B:** Revert subscriptions.controller.ts changes and continue with other files
- Fix the easy files first
- Come back to subscriptions.controller later
- Time: 5 minutes

**Recommendation:** Option B - revert this one file, continue with remaining 30 files, then create all missing schemas together in Phase 2.

## Next Batch
Continue with remaining ~30 files that use bare `@customer-portal/domain` imports.

