Technical Debt — Reusable Checkout Orchestration Gaps
By Engineering Team•October 2, 2026•4 min read
| Metadata | Details |
|---|---|
| System | Reusable Product/Checkout Orchestration |
| Document ID | TD-2026-CHO-001 |
| Author | Engineering Team |
| Status | Open |
This document tracks known implementation and documentation gaps in the shared checkout orchestration and checkout-session cache as first-class, ongoing debt items. SR-012 links here rather than restating gap detail, so the requirement text itself doesn’t quietly read as an already-met guarantee.
TD-01 — Architecture diagram mislabels the product-detail lookup node
- Status: Open
- Severity: Low — a documentation-accuracy issue only; the real call wiring is correct, just mislabeled in the diagram image.
- Affected component:
Shoppee-Archiecture-Flow-V1-Product Reusable Orchestration - Checkout.drawio.png, the “Get product info by product id” node. - Evidence: the diagram labels this node
[shipment-service]; the actual call (shop-service’sinternal/repository/product/product_imp_rep.go:146) isdetailClient.GetProductFullDetail, a gRPC client call toproduct-catalog’s product-detail service, notshipment-service. - Impact: a reader following the diagram alone would misattribute which microservice serves product descriptive data, potentially looking in the wrong service when investigating a product-detail issue.
- Remediation direction: correct the node’s label to
[product-catalog]in the diagram’s source. Only the exported.drawio.pngis available in this review — the editable.drawiosource was not available to make the correction directly; the Architecture doc’s own prose states the correct attribution in the meantime. - Related requirement: SR-012 FR-01
TD-02 — order-service’s own documentation states a stale checkout-session TTL
- Status: Open
- Severity: Medium — a factual documentation error that could mislead anyone sizing assumptions (e.g. how long a checkout token stays valid) off the stated figure rather than the real one.
- Affected component:
order-service/CLAUDE.md’scheckout_sessionsection, vs.shop-service’sinternal/repository/checkoutsession/checkoutsession_mapper.go:10. - Evidence:
order-service/CLAUDE.mdstates the collection is “TTL-reaped after 15 minutes.” The authoritative value isconst CheckoutSessionTTL = 1 * time.Hour(checkoutsession_mapper.go:10), used directly inToCheckoutSessionEntity’sExpireAt: now.Add(CheckoutSessionTTL)— the real window is 1 hour, not 15 minutes. - Impact: anyone reading only
order-service/CLAUDE.md(rather than the owning service’s code) would underestimate how long a checkout token remains valid by a factor of four, which could lead to an incorrect assumption about how soon a stale-token error should be expected after a customer starts checkout. - Remediation direction: correct
order-service/CLAUDE.md’s wording to state 1 hour, matchingshop-service’s authoritativeCheckoutSessionTTLconstant. Per this pipeline’s rule, the code is authoritative — the documentation is what should change. - Related requirement: SR-012 FR-10
TD-03 — No enforced schema contract between the two services’ checkout-session structs
- Status: Open
- Severity: Medium — a silent-drift risk that has not yet manifested as an incident, but has no safeguard against doing so.
- Affected component:
shop-service’sinternal/repository/checkoutsession/checkoutsession_entity.go(the writer struct) vs.order-service’srepository/checkoutsession/checkoutsession_entity.go(the reader struct). - Evidence:
order-service’s checkout-session entity is a hand-maintained, bson-tag-compatible mirror ofshop-service’s writer struct, living in a separate Go module with its owngo.mod— nothing (no shared type, no contract test, no schema-version check) fails at compile time or test time if one struct’s field set or bson tags change without the other being updated to match.order-service/CLAUDE.mditself documents this as “keep them aligned by hand whenever either changes.” - Impact: a field added, renamed, or retyped on
shop-service’s writer struct would silently fail to populate (or silently deserialize incorrectly) onorder-service’s reader struct, with no build failure or test failure surfacing the mismatch — only a runtime symptom at order-creation time, potentially long after the change that caused it shipped. - Remediation direction: add a contract test (e.g. a fixture-based round-trip test run in CI for both modules against a shared sample document) or migrate the read path off the direct-database-access exception entirely once a dedicated cache service exists, removing the need for two independently maintained structs altogether.
- Related requirement: SR-012 NFR-05
TD-04 — Rounding/total formula is duplicated between the server and the client for non-default delivery tiers
- Status: Open
- Severity: Low — a known, deliberate scope decision rather than an oversight (documented in
shop-service’s owninternal/service/checkout/CLAUDE.md), but still a genuine logic-duplication point that could drift if either side’s formula changes independently. - Affected component:
shop-service’scheckout_imp_svc.go’sbuildPriceSummary(server, computed only for the default/cheapest shipment tier) vs.ui-application’s checkout screen, which locally re-derives the same round-to-nearest-rupee shipping-fee/round-off/total calculation when the shopper selects a non-default tier. - Evidence:
CheckoutDetails.PriceSummaryis a single struct, not a per-tier array —shop-servicecomputesShippingFee/RoundOff/GrandTotalonce, against the cheapest tier only, by deliberate choice (internal/service/checkout/CLAUDE.md: “a genuine per-tierPriceSummaryarray is unrequested scope expansion under the no-over-engineering rule”). The client independently re-implements the same rounding formula for whichever tier the shopper actually selects. - Impact: if the rounding rule, the shipping-fee source, or the cash-on-delivery surcharge calculation ever changes on the server, the client’s independent copy would not automatically pick up that change, risking the two producing different totals for a non-default tier until the client is separately updated.
- Remediation direction: no action needed while this remains a two-codebase, hand-synchronized formula with low change frequency; if a per-tier price summary ever becomes a real product requirement, move the computation server-side entirely (a
PriceSummaryByTier[]) rather than continuing to duplicate the formula client-side. - Related requirement: SR-012 NFR-03
TD-05 — Cached checkout-session price summary has no freshness re-check at order-creation time
- Status: Open
- Severity: Low — a bounded, accepted staleness window (see ADR-00025’s trade-off), not an observed incident.
- Affected component:
order-service’sorder_create_imp_svc.go’stoDomainCheckoutSessionSnapshot, which copiesPriceSummaryfrom the cachedcheckout_sessiondocument without revalidating it against current inventory/tax/shipment state. - Evidence:
CreateOrderresolves the session once viaFindByTokenand reuses itsPriceSummaryfields verbatim (subtotal, savings, tax, shipping fee, cash-on-delivery charge, round-off, grand total) with no re-check againstinventory-service/shipment-serviceat order-creation time. - Impact: if an underlying price, tax, or shipping rule changes within the checkout-session’s 1-hour lifetime, an order placed late in that window would still be charged the figure quoted at the start of it — a deliberate, accepted trade-off per ADR-00025, not a defect, but worth tracking in case the window or the business’s tolerance for it ever changes.
- Remediation direction: no action needed while the 1-hour window stays short relative to how often pricing/tax/shipping rules actually change; revisit if the TTL is ever extended, or if a pricing-change-mid-session incident is observed.
- Related requirement: SR-012 FR-12
TD-06 — GST rate is a flat per-SKU field, not resolved via a category/HSN-driven slab mapping
- Status: Open
- Severity: Medium — not a crash or data-loss risk, but a real tax-compliance and maintainability gap: every SKU’s rate must be set and kept correct individually, with no structural guarantee that two SKUs in the same GST-rate category actually carry the same rate.
- Affected component:
inventory-service’sinternal/service/tax/tax_calculate_imp_svc.go:24-97(taxServiceImpl.CalculateTax) and thesku_compliance_pricingtable it reads from (migrationinternal/infrastructure/migrations/sql/000009_create_sku_compliance_pricing_tables.up.sql:29-47). - Evidence:
sku_compliance_pricingstores one row persku_idwithhsn_code VARCHAR(20)andtax_percentage DECIMAL(5,2), unique on(tenant_id, sku_id)— there is nocategory_idcolumn and no separate HSN/GST-slab rate table anywhere in the schema.CalculateTax(lines 56-62) readstax_percentagedirectly off that per-SKU row as a flatgstRateand computestaxAmount := taxableValue * gstRate / 100;hsn_codeis stored alongside but never used to derive the rate — it’s descriptive metadata only, not a lookup key.product-catalog’s category model (internal/repository/category/) has zero tax/HSN/GST fields (confirmed by grep across its Mongo schema — name, slug, parent_id, ancestors, spec_template, display_order, node_level, variant_attributes).inventory-service/CLAUDE.md:62self-admits the rate table “currently mirrors compliance-pricing data 1:1; real GST business rules (HSN-driven slabs, cess, exemptions, place-of-supply edge cases) are not yet integrated.” The intra-state vs. inter-state GST split (CGST+SGST vs. IGST, lines 49 and 84-92, comparing shipping state to warehouse state) is correctly implemented — the gap is entirely in rate sourcing, not in that split. - Impact: under real Indian GST rules, the rate for a given good is determined by its HSN code/category, not chosen per SKU independently — today, onboarding a new SKU (or correcting a misclassified one) requires manually setting the right
tax_percentagewith no system-enforced link back to the HSN code also stored on the same row, so two SKUs that should share one GST slab can silently drift to different rates with no validation catching it. A future rate-table refinement, a new cess rule, or a place-of-supply exemption would require updating every affected SKU row individually rather than one category/HSN-level rule. - Remediation direction: introduce an HSN-code-to-GST-rate (and cess/exemption) mapping table, keyed by HSN code or product category rather than by SKU, and have
CalculateTaxresolve the rate through that mapping using the SKU’shsn_codeas the lookup key instead of readingtax_percentagedirectly offsku_compliance_pricing.sku_compliance_pricingwould then hold only the SKU’s HSN classification (and any genuinely SKU-specific compliance override), not a hand-set rate duplicated per SKU. - Related requirement: SR-012 FR-01
Related Documents
- BRD-011 — Reusable Product-to-Order Journey With Trustworthy Totals
- SR-012 — Reusable Checkout Orchestration: System Requirements
- ADR-00024 — Shared Checkout-Info Resolution vs. Per-Screen Enrichment
- ADR-00025 — Cached Checkout-Session Snapshot vs. Recompute at Order Creation
- Architecture: Reusable Product-to-Order Orchestration
- Architecture — Checkout Completion: Payment Capture and Fulfillment Handoff — detailed payment-capture flow downstream of this orchestration
- Architecture — Multi-Courier Fulfillment via Shiprocket — detailed shipment/courier flow downstream of this orchestration
- Technical Debt — Checkout Completion Payment Flow Gaps — payment-capture-side gaps (webhook relay, retry duplication, circuit breaker, reconciliation), tracked separately from this doc’s shared-orchestration scope, not duplicated here
- Technical Debt — Payment Transaction Ledger & Refund Audit Gaps — payment-ledger/refund-audit gaps, likewise tracked separately from this doc
- Technical Debt — Multi-Courier Fulfillment Gaps — shipment/courier-side gaps (Shiprocket integration, SSE broker, NDR workflow), likewise tracked separately from this doc
- shop-service
- order-service
- inventory-service