Files
carmanagement/docs/design/COMMERCIAL_AND_DATA_DESIGN.md
T
root 8fc88ffc14
Build & Push / Pipeline Tests (push) Failing after 59s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Failing after 51s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Carplace Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped
fix production issues
2026-08-12 16:48:41 -04:00

38 lines
1.6 KiB
Markdown

# Commercial and data design updates (Phase 2)
## Plan / entitlement catalog
**Single source of truth:** `packages/types/src/planCatalog.ts`
Exports (via `@rentaldrivego/types` / `api.ts` re-exports):
- `PLAN_PRICES`, `PLAN_ENTITLEMENTS`, capabilities, public marketing map (`launch``STARTER`, etc.)
- Helpers: `getVehicleLimit`, `getPublicMonthlyMajorUnits`, `planHasCapability`
**Consumers:**
- Homepage marketing prices → `apps/homepage/src/content/pricing-config.ts`
- API site/subscription fallbacks → `@rentaldrivego/types`
- Vehicle fleet limits → catalog first (no duplicate hardcoded fallback table)
Contract tests: `packages/types/src/planCatalog.test.ts` (`npm run test:types`).
## Billing & notifications source of truth
See `docs/BILLING_NOTIFICATION_SOURCE_OF_TRUTH.md`:
| Domain | Canonical | Legacy |
|--------|-----------|--------|
| Money | `BillingAccount` / `BillingInvoice` / intents | `SubscriptionInvoice` (compat reads only) |
| Notifications | `NotificationEvent` → recipients → deliveries + **outbox** | Flat `Notification` |
Dispatch design: outbox worker is the delivery executor; direct transactional email remains allowed for auth/security messages.
## Privacy baseline
`docs/PRIVACY_DATA_MAP.md` inventories data classes, storage, access, and open gaps (field encryption, DSAR automation, privileged-read audit). Ops metrics intentionally exclude PII payloads.
## OpenAPI completeness
Design rule: ops endpoints `/health`, `/ready`, `/metrics` must appear in OpenAPI. CI runs `npm run openapi:coverage` (`scripts/check-openapi-coverage.mjs`).