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’s internal/repository/product/product_imp_rep.go:146) is detailClient.GetProductFullDetail, a gRPC client call to product-catalog’s product-detail service, not shipment-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.png is available in this review — the editable .drawio source 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’s checkout_session section, vs. shop-service’s internal/repository/checkoutsession/checkoutsession_mapper.go:10.
  • Evidence: order-service/CLAUDE.md states the collection is “TTL-reaped after 15 minutes.” The authoritative value is const CheckoutSessionTTL = 1 * time.Hour (checkoutsession_mapper.go:10), used directly in ToCheckoutSessionEntity’s ExpireAt: 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, matching shop-service’s authoritative CheckoutSessionTTL constant. 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’s internal/repository/checkoutsession/checkoutsession_entity.go (the writer struct) vs. order-service’s repository/checkoutsession/checkoutsession_entity.go (the reader struct).
  • Evidence: order-service’s checkout-session entity is a hand-maintained, bson-tag-compatible mirror of shop-service’s writer struct, living in a separate Go module with its own go.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.md itself 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) on order-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 own internal/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’s checkout_imp_svc.go’s buildPriceSummary (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.PriceSummary is a single struct, not a per-tier array — shop-service computes ShippingFee/RoundOff/GrandTotal once, against the cheapest tier only, by deliberate choice (internal/service/checkout/CLAUDE.md: “a genuine per-tier PriceSummary array 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’s order_create_imp_svc.go’s toDomainCheckoutSessionSnapshot, which copies PriceSummary from the cached checkout_session document without revalidating it against current inventory/tax/shipment state.
  • Evidence: CreateOrder resolves the session once via FindByToken and reuses its PriceSummary fields verbatim (subtotal, savings, tax, shipping fee, cash-on-delivery charge, round-off, grand total) with no re-check against inventory-service/shipment-service at 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’s internal/service/tax/tax_calculate_imp_svc.go:24-97 (taxServiceImpl.CalculateTax) and the sku_compliance_pricing table it reads from (migration internal/infrastructure/migrations/sql/000009_create_sku_compliance_pricing_tables.up.sql:29-47).
  • Evidence: sku_compliance_pricing stores one row per sku_id with hsn_code VARCHAR(20) and tax_percentage DECIMAL(5,2), unique on (tenant_id, sku_id) — there is no category_id column and no separate HSN/GST-slab rate table anywhere in the schema. CalculateTax (lines 56-62) reads tax_percentage directly off that per-SKU row as a flat gstRate and computes taxAmount := taxableValue * gstRate / 100; hsn_code is 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:62 self-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_percentage with 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 CalculateTax resolve the rate through that mapping using the SKU’s hsn_code as the lookup key instead of reading tax_percentage directly off sku_compliance_pricing. sku_compliance_pricing would 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