Skip to content

fix(sales): direct confirm-order sends once; in-Thailand stock lines need no lead time - #1185

Merged
waritctd merged 1 commit into
developfrom
fix/direct-confirm-double-click-stock-lead-time
Oct 28, 2026
Merged

waritctd merged 1 commit into
developfrom
fix/direct-confirm-double-click-stock-lead-time

Conversation

@waritctd

Copy link
Copy Markdown
Owner

Two leftovers from the 2026-10-29 UI re-walk of the PR #1182 fixes.

Changes

  • SK-02 / VW-05, direct confirm-order sends twice on a double-click. The direct-quotation confirm dialogs (TicketDetailPage confirmOrderDirect, QuotationEditorPage) now close before mutating, the same as the pricing-request route, so a second click does nothing. The call moves from the promote-to-deal alias to /confirm-order (same handler). The backend alias stays for one deploy so a cached bundle still works.
  • VW-01, a stock-line quotation can't be sent for approval. DealQuotationItemDto now exposes the already-stored stock_source. Submit (requireEveryTileItemHasALeadTime) and the editor (quotationMeta.validateQuotationItem) skip the import lead-time requirement for IN_THAILAND lines only. IN_TRANSIT and import lines still need a lead time (owner ruling 2026-10-29). A copied quotation drops stockSource, matching the server.
  • API digests regenerated: response-fields.json (+DealQuotationItemDto.stockSource), ui-reachable.json (confirm-order replaces promote-to-deal). api-surface.json is unchanged.

Test coverage (written first, each seen red before its fix; Opus reverted every hunk and saw its test go red)

  • Double-click: QuotationEditorPage.promoteToDeal.test.jsx and TicketDetailPage.test.jsx. Two fast clicks on confirm call the API exactly once. serverContract.test.js pins the confirm-order URL.
  • Stock lead time:
    • DealQuotationIntegrationTest#submit_inThailandStockLineNeedsNoLeadTime_butInTransitAndImportStillDo: an IN_THAILAND row with no lead time submits; an IN_TRANSIT or import row with no lead time is refused, naming only that row.
    • quotationMeta.test.js and QuotationEditorPage.v3.test.jsx: the same rule in the editor.
    • quotationCopy.test.jsx: a copy carries no stockSource.

Deliberately not covered: the pricing-request confirm route (it already sends once), the PDF lead-time remark for stock rows (unchanged; an in-Thailand line that has a lead time still prints it), and plain/adjustment rows (unchanged).

Known, not in this PR

  • The backend /promote-to-deal alias can be removed in a later release, together with DealQuotationControllerTest:124 and its SERVER_ONLY contract entry.
  • A quotation row's stock_source is fixed when the row is inserted, so converting an in-transit line to import afterwards doesn't update an existing quotation.

🤖 Generated with Claude Code

…iland stock lines need no import lead time (UI re-walk 2026-10-29)

- SK-02/VW-05: the direct-quotation confirm dialogs (TicketDetailPage, QuotationEditorPage) close before mutating, like the pricing-request door, and call /confirm-order (the backend /promote-to-deal alias stays for one deploy).
- VW-01: DealQuotationItemDto exposes stockSource; submit and the editor skip the import lead-time requirement for IN_THAILAND stock lines only. IN_TRANSIT and import lines still need one (owner ruling 2026-10-29). A copied quotation drops stockSource, as the server does.
- API digests regenerated (response-fields: DealQuotationItemDto.stockSource; ui-reachable: confirm-order).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
demo-glr Ready Ready Preview Oct 28, 2026 6:16pm UTC

Request Review

@waritctd
waritctd merged commit 0867c7a into develop Oct 28, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — cdac04a2 Deployed Oct 28, 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