Repository navigation
Conversation
…e on a PCR - Normalise a typed PCR line factory to the master factory name (case/space-insensitive), else leave it blank for Import's picker. - CEO can re-point a factory quote (and its lines and deal lines) to a master factory, also before review starts. - Costing falls back to the sales-entered origin country; the CEO can set it when missing. A line with no freight band is set aside instead of failing the whole costing. - CEO can rename a line (brand/model), synced to the deal line. - Fixes persist when another problem still blocks costing; the remaining error is shown inline.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… fixes - ไทย-สต็อก lines cost as a domestic purchase: same formula with insurance, freight, duty, clearance = 0 (x1.07 kept); excluded from freight grouping and clearance. - CEO can enter a line's total freight when the freight table has no band (V207: pricing_request_item.manual_freight_thb); a no-band line is now uncostable per line instead of failing the whole costing. - Structured uncostable_code (V207) drives which CEO fix the page offers. - Code-review fixes: rename sync with blank brand, event line positions, 409 for origin on catalogue-country lines, Thai origin name in reason, mock model limit, one factory-name read per save, Javadoc placement, single request read in the fix guard.
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.
Why
Prod PCR-2026-0005: sales typed the factory as "Padana marmoker". CEO costing failed with "ไม่พบ factory config", then with "ไม่มีประเทศต้นทาง". The only way out was a hand-written DB fix. This PR stops typed factory names getting in, and lets the CEO repair all of these on the page.
What changes
PricingRequestService#resolveItemmatches a typed factory to the masterprice_catalog.factoriesname, ignoring case and spaces. With no match it saves null, and Import picks the factory with the existing "ระบุโรงงาน" picker.PUT /api/pricing-requests/{id}/factory-quotes/{fqId}/factory{factoryId}.startReviewitself 422'd.LandedCostCalculatorfalls back to the sales-enteredorigin_country(อิตาลี/สเปน/จีน → IT/ES/CN) when the line has no catalog country.PUT …/items/{itemId}/origin-country.PUT …/items/{itemId}/name{brand, model}.ticket_item.model.The three actions:
lockPricingRequest.pricing_request_event.{decision, costingError}. A fix persists even if another problem still blocks costing, and the remaining error shows inline.UI: inline fix forms on the CEO pricing page (prototype reviewed with Ploy).
SearchableComboboxgains disabled options. Both API digests were regenerated (+3 operations).Test coverage
Every new test was shown failing on an assertion before the fix. A reviewer reverted key changes and saw them go red.
PricingRequestServiceTest:LandedCostCalculatorFormulaIntegrationTest:PricingFactoryQuoteCostingIntegrationTest: the free-text-factory fixture now seeds a master factory.PricingRequestDetailPage.test.jsx, "CEO fixes during price review":costingErrorrenders inline with a neutral toastResults (throwaway local Postgres, fork 1; Docker hung):
LandedCostCalculatorFormulaIntegrationTestPricingDecisionIntegrationTestPricingFactoryQuoteCostingIntegrationTestPricingRequestServiceTestsrc/features/pricingRequestssrc/apiPricingDecisionIntegrationTestandPricingFactoryQuoteCostingIntegrationTestwere last run one small change earlier (the rename COALESCE), which neither class touches.Deliberately not covered
Deploy note
Backend change: it reaches prod only with a new backend image. A cleared brand is written as
''onticket_item(NOT NULL column).Update: ไทย-สต็อก, CEO freight, code-review fixes (commit 4457494)
TC = [(C+i+F)(1+T/100)×1.07]+Sand i = F = T = S = 0, so ×1.07 is kept (Thai prices are pre-VAT, owner confirmed). These lines are left out of freight grouping and clearance, so the IT/ES/CN numbers don't change.PUT …/items/{itemId}/freight{freightThb}takes the total THB for the line. It applies only when the group's table lookup has no band.pricing_request_item.manual_freight_thbandpricing_costing_item.uncostable_code. The UI picks the CEO fix from the code, not from the Thai text./code-reviewfindings fixed:CeoFixResultJavadoc sits on its own record.LandedCostCalculatorFormulaIntegrationTestPricingDecisionIntegrationTestPricingFactoryQuoteCostingIntegrationTestPricingRequestServiceTestCeoReviewNoticeTestWith the domestic and manual-freight branches disabled, 6 new tests go red.