Workflowscare-package
Care Package Workflow Overview
End-to-end flow for care package purchase, activation, redemption, and expiry.
Care Package Workflow Overview
1. What Is a Care Package
A care package is a service contract bundled with a physical product purchase. The customer selects a care package tier during the cart stage, pays for it as part of their order, and receives a subscription with a set of service features (repairs, on-site visits, diagnostics, etc.) for a fixed duration.
2. System Components
| Component | Responsibility |
|---|---|
CarePackageCustomerService | Eligibility check — filters active packages by product kind + price rules |
CarePackageCartService | Attaches/detaches care package to cart item |
OrderService | Creates care_package_subscriptions rows at checkout; dispatches activation jobs on payment success |
CarePackageProcessor | BullMQ worker — activates subscriptions, sends reminders, expires, cancels |
CarePackageWorkersScheduler | Daily cron — enqueues expiry sweep job |
CarePackageSubscriptionsAdminService | Admin operations: list, detail, suspend, unsuspend, manual activate |
CarePackageRedemptionCustomerService | Customer raises/views/cancels redemption requests |
CarePackageRedemptionAdminService | Admin manages redemption status + usage tracking |
3. Key Flows
- Purchase → Subscription: Add to cart → checkout → payment → BullMQ activate → active subscription.
- Feature Usage: Customer raises request → admin accepts (increments quota) → advances to completed.
- Expiry: Daily scheduler sweeps active subscriptions past
expiryDate→expired. - Reminders: Scheduled at activation for 30d + 7d before expiry → email notification.
- Admin Override: Suspend → unsuspend (restores correct status based on expiryDate); manual activate for support cases.