Partial-unique index enforcing one active closing package per loan (eClose double-close backstop)

FeatureInitializerService
Shipped
July 8, 2026 at 3:51 PM UTC
Author
Kamo
Commit
56065a6

CREATE UNIQUE INDEX uk_mlos_closing_pkg_active_loan ON mlos_closing_package (loan_file_uid) WHERE status <> 'CANCELLED'. Durable backstop behind the assembler's in-app idempotency guard: a duplicate active closing package would drive its own MERS registration + funding (a double close). ClosingPackage lives in shared-lib with only non-unique @Index entries and can't express a partial-unique constraint via JPA, so it's hand-written DDL here (KI owns schema). Idempotent; applies on the next KI run.

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