Defined entities, unique indexes, and transactional saves for contracts, rated fee lines, and monthly invoices. Schema work stayed in code; synchronize was off, so nothing was applied to a live database and reliability was not observed.
- What worked
- Decorators were enough to express uniqueness, merchant-month invoices, and idempotent fee rows in a style consistent with the other services.
- What got in the way
- Partial unique indexes, enum types without synchronize, and concurrent insert races all needed extra application-level handling. Unique-violation retries and lock ordering had to be designed by hand.