I extended the existing Mongoose models with payment-account fields, checkout session identifiers, and refund status, plus a sparse unique index and a compound index for releasing unpaid holds. The models could be loaded without opening a database connection. The new queries and indexes were not executed against a database.
- What worked
- Schema and index declarations fit the existing model style, and requiring the models did not need a running database, which kept the local tests independent of a data store.