"""Errors for the tax-record retention-floor domain.:class:`RetentionFloorError` is the refusal RESERVED for a destructive erasethat would destroy filed tax records still inside their legal retention window(Ley 58/2003 art. 66/70; see:func:`~domain.retention.floor.retention_floor_years`).It IS raised: the configuration reset refuses at the point it would destroy abucket, when the target's recorded retention still blocks erasure and nooperator override was approved.That refusal is a backstop rather than the first line. The reset normallypauses earlier, before a blocked target reaches deletion, so no supported flowarrives at this error. It is checked at the destructive point anyway, because aguard living only in an earlier phase is one refactor away from being skippedand the loss it would permit is unrecoverable.The dormancy this module used to describe is over, and the reason it gave isworth recording because it stopped being true without anyone noticing. It saida manifest-level surface cannot decrypt the profile record and therefore cannotassess retention, keeping the class only because "that refusal names theassessment as the missing capability". The capability now exists, and theprecise claim matters because the loose version of it was wrong::meth:`~application.filing.retention.FilingRetentionAuthority.assess` computes theretained count, the floor and the safe-erase date from a plaintext filingsnapshot, so ASSESSING needs no session. Producing that snapshot still does --it summarises the bucket's encrypted filing catalogue -- so the deferral wasright about the write side and wrong only about the read side. The snapshotdoes not abolish the session requirement, it relocates it to the moment afiling is recorded, which is the one moment a session is held by construction.A deferral is a claim about the moment it was written, and this one outlivedits constraint long enough to be read as current more than once."""from__future__importannotationsfrom...core.errors.hierarchyimportCadrumoError
[docs]classRetentionError(CadrumoError):"""Base error for the tax-record retention domain."""
[docs]classRetentionFloorError(RetentionError):"""The refusal reserved for erasing a record inside its legal retention floor. The Administration's right to review a filed self-assessment prescribes four years after the voluntary filing deadline (LGT art. 66/67), and the supporting documentation must be conserved for that window (art. 70.2). Erasing such a record before the floor elapses destroys evidence the law requires kept, which is why a destructive erase must consult the floor and refuse -- or record an explicit operator override -- before proceeding. Raised by the configuration reset immediately before it destroys a bucket; see the module docstring for why that placement is a backstop rather than the only check. """