KamoCRM

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

FeatureInitializerService
Shipped
8 ஜூலை, 2026 அன்று 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?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing