Stop dropping the market and the customer account

Fixkamo-shared-library
Shipped
August 26, 2026 at 6:32 PM UTC
Author
Kamo
Commit
7c3eccb

CreateQuoteRequest has always declared marketUid and accountUid and QuoteService.create has never read either, so Quote.market and Quote.customerAccount were NULL on every quote on the platform — QuoteMapper.customerName has been returning null since it was written. With no market there was nothing to derive an engagement type from, so create() hard-coded RETAIL: every service, healthcare and rental quote sat on a RETAIL engagement. EngagementType.fromCommerceType is an exhaustive switch with no default, so adding a CommerceType is now a compile error rather than a runtime failure on whichever tenant uses it first. Both lookups are org-scoped in SQL, through the scoped finders the repositories already expose — findByIdAndOrganizationId and findByUidAndOrganization — so a caller cannot attach another tenant's market or account to their own quote. The RETAIL fallback survives for quotes created without a market, which is every quote that exists today. Whether those rows should be backfilled from their org's markets is an open migration question, not a design choice.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing