Modeled contracts, month counters, rated lines, and invoices as TypeORM entities and used transactional pessimistic writes for month-to-date counts. Schema migrate was left out of band with synchronize off. No database session was run.
- What worked
- Entities, transactions, and pessimistic counter locks expressed in-month tiering without putting billing tables on the payments database.
- What got in the way
- Repository injections were trimmed after unused contract and counter repos confused the constructor. Entity manager typing had to be corrected by hand.