feat(backend): harden T5 — divergence comment + invariant tests
This commit is contained in:
@@ -233,6 +233,12 @@ class Remittance(Base):
|
||||
String(32), ForeignKey("batches.id", ondelete="CASCADE"), nullable=False
|
||||
)
|
||||
payer_claim_control_number: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
# ORM policy: no ON DELETE (forward FK from Remittance → Claim). A claim
|
||||
# is unlikely to be deleted in normal flow (audit trail); if it ever is,
|
||||
# the application layer (T7 reconciliation) must clear this FK. The
|
||||
# migration predates this rationale; amendment deferred to post-SQLite
|
||||
# rollout. SQLite without `PRAGMA foreign_keys=ON` does not enforce,
|
||||
# so the divergence is benign in this engine.
|
||||
claim_id: Mapped[Optional[str]] = mapped_column(
|
||||
String(64), ForeignKey("claims.id"), nullable=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user