58448f5faacb16a3343a82cd066ec3fe06fe4519
jupiter and Fiesta are separate applications (separate repos, separate binaries) that happen to share one Postgres instance. The previous fix (661a08d) repointed queue.workolik.com's createorder from jupiter's v1 to jupiter's v3 handler to stop items being silently dropped - that worked because they share a database, but it was never the right target: jupiter has no item-required guard, no atomic order-number allocation, no stock-insufficient check, because none of that was ever written for jupiter. Fiesta's own CreateOrderv3 already has all of it. Added explicit tenant-based routing in worker.py: FIESTA_TENANT_IDS (seeded with 1147/R mart and 1135/Suriya Store, the two confirmed so far) forces createorder for those tenants to FIESTA_BASE_URL instead of jupiter's mapping. Explicit allowlist rather than a DB heuristic, since jupiter and Fiesta share one `tenants` table with no single column that cleanly separates the two populations (checked: tenanttype/moduleid/categoryid/ configid are all inconsistent across the tenants that are known to belong to each app). Non-Fiesta tenants keep going to jupiter's v3 endpoint (661a08d), unaffected. Verified live through the real queue.workolik.com path: - Zero-item order (tenant 1147): worker log shows "Routing tenant 1147 createorder to Fiesta backend", Fiesta correctly returns 400 "Order must contain at least one item", no phantom order created. - Order with items (tenant 1147): itemcount=1, detail_count=1, product 7076 stock ledger moved 25->24, then restored to 25 on cancel. Expand FIESTA_TENANT_IDS as more Fiesta tenants are identified - there's no programmatic way to auto-detect them from the shared tenants table.
Description
No description provided
Languages
Python
80.9%
Shell
13.4%
HCL
4.7%
Dockerfile
1%