- ส่งแล้ว
- 6 สิงหาคม 2569 เวลา 11:58 UTC
- ผู้เขียน
- Kamo
- ตั้งค่า
- 50843ad
Five defects from the whole-branch review, all in the evidence path. The audience FKs did not cascade. cascade = CascadeType.DETACH is a persistence-context cascade and emits nothing at DDL, so Hibernate created the constraints at NO ACTION. Department and JobTitle are hard-deleted with no FK cleanup (DepartmentController:232, JobTitleController:226), so the first department delete after an audience row exists would have been a 23503. Replaced with Hibernate's @OnDelete(CASCADE), which does emit ON DELETE CASCADE, and corrected the javadoc that already claimed the behaviour. The attested wording was neither immutable nor visible to change detection. It lived only on the mutable LegalPackage, so rewording it destroyed the body every prior attestation had hashed, and moved nothing the fingerprint could see — Redeliver was never offered for a package whose terms had changed. The version row now freezes attestation_text and its SHA-256 at publish time; the package keeps its copy as the editable draft, and the fingerprint formula includes the hash. The WORM javadoc overclaimed. @PreUpdate/@PreRemove fire only through the persistence context, and JpaRepository hands out deleteAllInBatch() — bulk JPQL, no entity loaded, no callback, evidence gone silently. The attestation repository now extends the bare Repository marker and declares only save, findById, findByAssignmentUid and **************** so no delete is on the interface to reach for. The javadoc says plainly that this is the application-layer half and that PhiAccessLog's DB-level REVOKE is the other. Also: ToStringSerializer on the attestation's organizationId and teamMemberId — it is the evidence-panel payload and a unique_rowid() is past 2^53; dropped the entity's non-unique assignment_uid index, which duplicates the migration's UNIQUE one; pinned columnDefinition on the three nullable audience FKs so they do not inherit **************** from the referenced PK; added **************** since after a redelivery a member legitimately holds more than one assignment and findFirst would leave the rest open; and the reminder sweep now takes a Pageable and returns a Slice instead of loading every overdue assignment on the platform into one List. Tests: 1077 pass, LegalPackageEntityTest up from 18 to 25.