Repository navigation
fix(import): dashboard = issued IRs only, direct deals get factories + IR-draft picker, legacy one-click chain removed - #1194
Merged
waritctd merged 2 commits intoOct 29, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…he factory; factory picker on the IR draft; legacy one-click import chain removed (walk3 2026-10-29) - W3-01/02: nextFulfilmentActionCode no longer offers issueImportRequest, so the import dashboard, worklist and deal panel only list deals with an issued IR (same as /fulfilment). ImportOverview counts and lists per-factory IN_TRANSIT shipments. - W3-03: confirm-order on a DEAL_DIRECT quotation copies catalog_price_id and the catalogue factory onto ticket_item. Free-text lines get a factory picker on the IR draft (createDrafts itemFactories; GET /api/factory-configs/names, id + name only, for ceo/import/sales/sales_manager). Lines fully covered from stock are never asked. - W3-04: legacy issueImportRequest is refused (409); ir-sent/shipping/goods-received are refused once a deal has any live per-factory row. Legacy buttons removed from ImportDealPage and DealFulfilmentPanel. Pre-V184 in-flight deals can still finish. - Fixtures that started the legacy chain now use recordFirstImportRequestIssued; e2e-real Case A walks the per-factory flow. API digests regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ory picker DealFulfilmentPanel's imperative createIrDrafts() now calls requestCreateIrDrafts(), the one create entry point, so a free-text line without a factory blocks the create from the deal page too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
waritctd
force-pushed
the
fix/import-dashboard-direct-factory-legacy-chain
branch
from
October 29, 2026 03:59
a87f226 to
c5ca29d
Compare
This was referenced Oct 29, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes walk3 findings from the 2026-10-29 UI re-walk (owner rulings 2026-10-29).
Changes
nextFulfilmentActionCodeno longer offersissueImportRequest, so the import dashboard, worklist and deal panel list only deals with an issued IR, the same as /fulfilment. The IR is a sales step.ImportOverviewfetches stored rows per candidate (like /fulfilment) and counts and lists per-factory IN_TRANSIT shipments.catalog_price_idand the catalogue factory ontoticket_item. A free-text line gets a factory picker on the IR draft:createDraftsaccepts optionalitemFactories;GET /api/factory-configs/namesreturns id + name only and is readable by ceo/import/sales/sales_manager, so the owning rep can pick. The full factory list (security(pricing): supplier cost and margin policy readable by any authenticated user #388 gate) stays ceo/import.issueImportRequest→ 409.ImportDealPageandDealFulfilmentPanel.createIrDrafts()now goes through the samerequestCreateIrDrafts()as the panel button, so the picker can't be skipped.api-surface(+names);ui-reachable(+names, −import-request, which is now inUNREACHABLE_FROM_UI);response-fields(+FactoryNameDto.factoryName).Test coverage (written first, each seen red before its fix; Opus reverted every hunk and saw it go red)
importActions.test.js;ImportOverview.test.jsx: no IR to-do for a null-fulfilment deal, tile counts match /fulfilment, IN_TRANSIT rows counted and listed.DealQuotationConfirmOrderIntegrationTest: factory and catalogue id copied; the IR draft is created instead of a 409. Guard: a free-text line keeps null.ImportRequestFactoryResolutionIntegrationTest: a chosen factory creates the draft; unknown → 400; another deal's line → 400; a non-candidate line is ignored; an existing factory is not overwritten.FactoryConfigControllerTest: names readable by sales, id + name only.DealFulfilmentPanel.test.jsx: the picker shows only for factory-less, non-stock lines on direct deals; the button stays disabled until every line is picked; the payload carries the choice; the country retry resends; the ขั้น 11 handle goes through the picker.ImportRequestFactoryResolutionIntegrationTest: the legacy issue is refused; the legacy steps are refused with a DRAFT row. Guard: an in-flight pre-V184 deal can finish.ImportDealPage.test.jsx,DealFulfilmentPanel.test.jsx,mockApi.legacyImportChain.test.js.recordFirstImportRequestIssued.uat-sales-journeys.spec.jsCase A now walks the per-factory IR (draft → issue → ORDERED…RECEIVED); Case D expectscreateDrafts409 "ครอบคลุมจากสต็อกทั้งหมด". It was not run locally, so CI is the first run.Deliberately not covered:
Known, not in this PR
/nameslists every factory, because factories have no active flag yet./api/tickets/{id}/import-requestendpoint is now unreachable and can be removed later.🤖 Generated with Claude Code