Skip to content

fix(rev-ops): harden paid order truth, owner alerts, fulfillment queues, and commercial repeat purchase - #3

Merged
QaliAI merged 1 commit into
mainfrom
rev-ops/fulfillment-and-order-truth
Sep 25, 2026
Merged

QaliAI merged 1 commit into
mainfrom
rev-ops/fulfillment-and-order-truth

Conversation

@QaliAI

@QaliAI QaliAI commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Revenue Operations Hardening Sprint

1. Paid Order Truth & Stripe Webhook Consistency

  • Backfills missing stripe_checkout_session_id, stripe_payment_intent_id, and stripe_customer_id on duplicate or subsequent settlement events to eliminate session lookup mismatches for customer order confirmation.
  • Automatically associates guest manual_orders with registered customers by email upon payment receipt.
  • Idempotently decrements inventory once per order via database row locks; detects oversell conditions and flags oversold orders into the operational exception queue.

2. Owner Alerts & Error Isolation

  • Added fulfillmentNextStep to internal order notification emails: distinguishes orders ready to pick/pack from orders waiting on inventory replenishment or documentation.
  • Isolated customer and internal email dispatches in dedicated try/catch blocks: email service failure (e.g. Resend rate limit or network glitch) never causes Stripe webhook idempotency rollback or paid order loss.
  • Added owner_alert support to /api/admin/orders/resend-email allowing operators to resend internal alerts on demand.

3. Fulfillment Exception Queues

  • Replaced raw statuses in the admin dashboard with the exact 6 operational queues:
    • PAID — NEEDS FULFILLMENT
    • WAITING ON INVENTORY
    • WAITING ON DOCUMENTATION
    • SHIPPED
    • DELIVERED/COMPLETED
    • REFUND/EXCEPTION
      (plus ALL and AWAITING PAYMENT).
  • Added real-time count badges to tabs and queue pills in table rows.
  • Updated NEXT_STATUSES in order detail drawer to support transitioning between waiting_inventory and waiting_documentation.

4. Commercial Repeat Purchase

  • Added saveRecentOrder and resolveProductForReorder preserving catalog SKU and configuration.
  • Surfaced "Reorder Items" on /order-confirmation/[orderId] and "Reorder Previous Materials" in CartDrawer when empty.
  • Strictly commercial language only: zero medical, clinical, dosing, protocol, or human-use claims.

5. Mobile Flow Polish (390px)

  • Fixed cart drawer horizontal squeeze on mobile viewports by updating padding from pl-10 to pl-0 sm:pl-10 and p-6 to p-4 sm:p-6.
  • Adjusted modal padding in COAModal.tsx to p-4 sm:p-8 for clean viewing on 390px screens.

6. Verification & Quality Gates

  • 171/171 tests passing (npm test).
  • TypeScript check passing (npm run typecheck).
  • ESLint check passing with 0 warnings/errors (npm run lint).
  • Production audit passing with 0 failures (npm run check:prod).
  • Full Next.js production build succeeded with all 125 static/dynamic routes.

@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vialfoundry Building Building Preview Sep 25, 2026 2:34am UTC

@QaliAI
QaliAI merged commit b1a1c46 into main Sep 25, 2026
2 of 3 checks passed
@QaliAI
QaliAI deleted the rev-ops/fulfillment-and-order-truth branch September 25, 2026 02:34

This branch was successfully deployed

1 active deployment
Preview — d3581a47 Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant