[Arch] Manual shipment creation re-implements ingest pipeline's orchestration shape #55
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: Domain
main.py:903-932(api_create_shipment) performs find-existing →db.upsert_shipment→db.add_event→finalize_shipment, mirroringingest.py:346-374's same shape, hand-copied instead of shared.Recommendation: Have
main.api_create_shipmentcall the same underlying functioningest.pyuses internally, with a signature that accommodates "pre-extracted fields" vs "raw email" callers.Full detail:
docs/architecture-review.md§ C, Finding "Manual shipment creation re-implements..."Fixed on branch
architecture-rework, commitf1d8f19: addedingest.upsert_shipment_with_event(), shared by_process_email_innerandmain.api_create_shipment. As a bonus, the manual-creation path is now also atomic (it wasn't before — a gap not covered by the earlierdb.transaction()fix since that only touched the email path). New regression test:test_manual_shipment_creation_atomic_on_event_failure. Full suite: 259 passed.