[Arch] Duplicate/shadow Shipment type definitions (api.ts vs types/shipment.ts) #61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Medium | Category: Frontend
Shipment/ShipmentEvent/Parserare defined independently infrontend/src/lib/api.ts:9-49and again infrontend/src/types/shipment.ts:14-41, with divergent shapes. Every page imports from@/lib/api;types/shipment.tsis effectively dead/shadow duplication.Recommendation: Make one file the single source of truth (fold
types/shipment.tsintoapi.tsor vice versa), delete the other.Full detail:
docs/architecture-review.md§ C + § H.5Fixed on branch
architecture-rework, commit0991956:frontend/src/types/shipment.tsdeleted;ShipmentStateinlined intolib/api.ts, which every page already imported from. Verified:tsc --noEmit,eslint,knip,vite buildall pass.