manicanldes-backend/docs/roadmap.md

14 KiB

Delivery roadmap

Source: Mani Candles Commerce Platform specification and project pack created in the earlier project discussion. Stack: modular NestJS/TypeScript application, PostgreSQL/Prisma, with Redis workers and private object storage introduced when needed. Provider adapters isolate external integrations.

Phase 1: Foundation and core commerce

  • 1A (implemented): service bootstrap, configuration, database lifecycle, initial organization migration, health API, test/build baseline, team workflow.
  • 1B (implemented; native CI and deployment configuration pending): authentication, sessions, recovery, users, configurable RBAC, organization access, approval status, audit events. Test denied access and cross-organization access.
  • 1C (implemented; native concurrency CI pending): catalog, variants, collections, addresses, inventory ledger and reservations. Test concurrent reservation and stock reconciliation.
  • 1D (core implemented; tax/shipping rules, payment enablement and native CI pending): cart, checkout, orders, coupons and pricing snapshots. Test money precision, discount eligibility, retries and transaction rollback.
  • 1E (blueprint and supporting pricing/outbox APIs implemented; live providers deferred at user request): verified payments/refunds, shipping/tracking, returns, notifications and operational dashboard. Test signatures, replay, partial fulfillment and reconciliation.

Phase 2: Internal operations

Suppliers, material/urli classification and compatibility, procurement, purchase orders, partial goods receipts, QC, invoices, supplier payments, private versioned documents and validation, BOM, production batches, consumption, wastage, packaging BOM and costing.

  • 2A (implemented): supplier and material master data with supplier-material quotes.
  • 2B (implemented): purchase-order drafts, issuance, and immutable price snapshots.
  • 2C (implemented): partial goods receipts and QC decisions.
  • 2D (implemented): supplier invoice matching and auditable voids. Tax rules, payments, and documents remain separate milestones.
  • 2E (implemented): external supplier payment records, partial balances, idempotent retries, and auditable reversals. Bank reconciliation and proof documents remain separate milestones.
  • 2F (implemented): private PDF versions for supplier documents, independent validation, and gated downloads. Retention and malware scanning remain deployment decisions.
  • 2G (implemented): versioned, organization-scoped product BOM drafts and activation with material snapshots. Production batches, consumption, wastage, packaging BOM and costing remain later milestones.
  • 2H (implemented): production batch planning, lifecycle, yield reconciliation and immutable completion/cancellation records. Material consumption, stock posting, wastage, packaging BOM and costing remain later milestones.
  • 2I (implemented): append-only material consumption and wastage events with plan-versus-actual summaries and idempotent retries. Physical stock posting, packaging BOM and costing remain later milestones.
  • 2J (implemented): separate versioned packaging BOMs for packaging and label materials, with independent activation and permissions. Packaging execution, physical stock posting and costing remain later milestones.
  • 2K (implemented): immutable packaging execution for completed batches, with BOM-line reconciliation, quantity variance, and idempotent retries. Physical stock posting and costing remain later milestones.
  • 2L (implemented): append-only standard material cost rates by currency and live production/packaging BOM cost estimates with exact decimal arithmetic. Batch actual costing and physical stock posting remain later milestones.
  • 2M (implemented): immutable completed-batch standard-cost snapshots from actual material and packaging use, frozen rate revisions, and exact totals. Physical stock posting remains dependent on the stock-location policy.
  • 2N (implemented): per-warehouse raw-material balances and append-only stock postings from QC-accepted goods receipts. Production and packaging stock deduction, transfers, adjustments and finished-goods output remain later milestones.
  • 2O (implemented): atomic per-warehouse production material stock deduction from completed-batch consumption and wastage events. Packaging stock deduction, transfers, adjustments and finished-goods output remain later milestones.
  • 2P (implemented): atomic per-warehouse packaging and label stock deduction from recorded packaging use and wastage. Transfers, adjustments and finished-goods output remain later milestones.
  • 2Q (implemented): single, idempotent finished-goods receipt per completed and stock-posted batch, crediting only good units to an organization-scoped warehouse variant balance. Material transfers and adjustments remain later milestones.
  • 2R (implemented): atomic, idempotent warehouse-to-warehouse material transfers with balanced append-only ledger entries and scoped history. Manual material adjustments remain a later milestone.
  • 2S (implemented): reasoned, permission-gated manual material-stock adjustments with signed immutable ledger entries, idempotent retries and nonnegative warehouse balances.

Phase 3: B2B and white label

Business verification, price lists, MOQ, quotations, credit policies, samples, branding/artwork approvals, partner purchase orders, partial payments, custom candle requests and partner reporting.

  • 3A (implemented): organization-scoped business profiles and manual staff verification with immutable submission/decision history. Partner login and automated external registry checks are outside this milestone.

  • 3B (implemented): account-specific, currency-scoped variant price lists and minimum quantities, with verified-account activation, immutable active terms, and a merchandise price check. Order integration remains a later milestone.

  • 3C (implemented): staff-issued merchandise quotations with immutable account and price snapshots, expiry, idempotent issuance, and one auditable customer response. Tax, shipping, stock reservation, and order conversion remain later milestones.

  • 3D (implemented): staff-proposed credit limits and net terms with independent review, immutable decision history, suspension, and one active policy per business account and currency. Credit exposure, receivables, payment collection, and order enforcement remain later milestones.

  • 3E (implemented): verified-account sample requests with immutable variant snapshots, independent review, and auditable manual dispatch references. Stock deduction, carrier integration, and sample billing remain later milestones.

  • 3F (implemented): verified-account branding/artwork projects with private PostgreSQL file versions, independent per-version review, restricted downloads, and immutable approval history. Trademark clearance, malware scanning, and production linkage remain separate work.

  • 3G (implemented): partner purchase orders captured from accepted, unexpired quotations with immutable merchandise snapshots, idempotent creation, unique partner references, and auditable cancellation. Fulfillment, stock reservation, tax, shipping, payments, and credit utilization remain separate milestones.

  • 3H (implemented): manual, partial external receipt records for partner orders with exact merchandise-balance checks, idempotent reversals, and cancellation protection. Gateway collection, refunds, tax, shipping, and credit utilization remain separate milestones.

  • 3I (implemented): verified-account custom candle specifications with immutable request capture, independent one-time staff review, scoped permissions, and idempotent retries. Quotation, artwork approval, BOM, and production linkage remain separate milestones.

  • 3J (implemented): read-only partner order and payment summaries by currency, with exact outstanding merchandise balances, reversal/cancellation handling, and dedicated report permissions. Credit utilization, overdue receivables, and accounting remain separate milestones.

Phase 4: Growth channels

Wishlist, verified reviews/moderation, seasonal campaigns, discounts, cart recovery, consent-aware messaging, Instagram, Etsy, WhatsApp, blogs/SEO and segmentation.

  • 4A (implemented): private user wishlists with published-variant eligibility, duplicate-safe saves, repeatable removal, paginated current catalog views, unavailable-item redaction, and a per-user quota. Public sharing, guest lists, cart conversion, and notifications remain separate milestones.
  • 4B (implemented): customer reviews gated by independent staff verification of external purchase evidence, immutable submissions, independent approval/rejection/hiding, evidence revocation, and a privacy-preserving public feed. Automated checkout/payment verification, review revisions, and rating analytics remain separate milestones.
  • 4C (implemented): organization-scoped seasonal campaign drafts, versioned editing/publication, immutable published terms, reasoned cancellation, and time-windowed public collection discovery. Campaign discounts, media assets, outbound messaging, and channel integrations remain separate milestones.
  • 4D (implemented): draft-bound campaign coupons, version-aware offer publication, public offer terms, and collection-only fixed/percentage checkout discounts with exact eligible-subtotal snapshots. Generic coupons retain their behavior; payment enablement, media assets and messaging remain separate milestones.
  • 4E (implemented): private discovery and versioned resumption of carts idle for 24 hours, current catalog previews, unavailable-item redaction/removal, and audited activity tracking. Outbound recovery reminders remain dependent on consent-aware messaging and provider enablement.
  • 4F (consent and eligibility implemented; live delivery deferred): explicit, independent email/WhatsApp opt-in and withdrawal for promotions/cart reminders, immutable versioned evidence, private history, and scoped live eligibility checks. Provider delivery, verified channel destinations, suppression-aware dispatch and unsubscribe links remain separate milestones.
  • 4G (backend implemented): versioned blog drafts, separate publication permission, stable-slug public snapshots, private revisions, reasoned withdrawal, and public SEO metadata. Frontend pages, sitemap/canonical integration, rich text/media and historical revision restoration remain separate milestones; live channel integrations remain deferred.
  • 4H (implemented): live staff segmentation for wishlist interest, recoverable carts and externally verified buyers, with deduplicated scoped account IDs/counts and optional separately permissioned current-consent filtering. Saved/custom rules, materialized audiences, exports and provider dispatch remain separate milestones.

Phase 5: Community and optimization

Moderated forums, advanced analytics, forecasts, accounting adapters, profitability and workflow automation. SaaS tenancy/billing requires a separate architecture decision before implementation; an organization table alone does not provide tenant isolation.

  • 5A (backend implemented): immutable discussion threads and flat replies, independent append-only approval/rejection/hiding, private author history, public alias-only discovery, parent visibility gates, and pending-submission quotas. Forum UI, editing/appeals, media, realtime features and notifications remain separate milestones.
  • 5B (implemented): bounded UTC daily checkout activity and frozen variant-demand analytics, current-state/currency separation, exact snapshot values, scoped reporting permissions, and UTC application sessions. Paid/fulfilled revenue, financial recognition, forecasts, cross-channel analytics and dashboard UI remain separate milestones.
  • 5C (baseline implemented): bounded historical daily capture-rate projections with exact unit arithmetic, zero-day inclusion, cancellation exclusion, visible evidence/staleness and current catalog flags. Validated sales/seasonal forecasts, confidence intervals, stock actions and automated production planning remain separate milestones.
  • 5D (source contract implemented): scoped, bounded accounting source-event pages for supplier invoices/payments and partner receipts, with original/correction links, exact captured amounts and deterministic cursor traversal. Provider posting, ledger/tax mapping and durable export acknowledgements remain separate milestones.
  • 5E (material-contribution baseline implemented): explicit net-price scenarios against sealed batch material/packaging cost, signed exact contribution, upward break-even prices and zero-output handling. Realized net profit, complete expense/COGS attribution, sales-to-batch linkage and dashboards remain separate milestones.
  • 5F (expiry workflow implemented): bounded, idempotent expired-order sweeps with shared cancellation/hold-release logic, immutable run history, atomic rollback and an authenticated scheduler-ready command. Deployment scheduling, broader workflow rules, live providers and complete production launch work remain separate milestones.

Phase 6: Production readiness

  • 6A (release gates implemented; operational activation pending): separate embedded quality and native PostgreSQL concurrency jobs, fail-closed native test evidence, and a staging/backup/rollback runbook. Runner/secret setup, required branch checks, observed remote CI, hardened runtime, deployment infrastructure, restore drills, monitoring and live launch remain operational or later milestones.

Definition of done for every feature

Small cohesive files; no duplicated business rules; unit tests for success, failure and boundaries; HTTP/integration tests where behavior crosses boundaries; schema migration and upgrade validation when persistence changes; documented API and permission contract; passing checks; focused Conventional Commit; reviewed pull request. Do not mark an entire phase complete until its end-to-end acceptance criteria pass.

Decisions still needed

Provider accounts; deployment target and PostgreSQL service; tax/invoice and retention rules; approval thresholds; Etsy sync direction; launch feature cut. Raw-material and finished-goods stock use organization-scoped warehouses, with an explicit warehouse selected for each posting.