cadrumo.application.calculations.m303_regimen_simplificado_annual_summary module

Immutable Modelo 303 4T to Modelo 390 0A simplified-regime handoff.

The annual Modelo 390 simplified-regime section is not a relation fold over observations. It consumes one exact, filed-and-current Modelo 303 calculation revision and retains that source identity as a frozen target calculation input.

Core types: RegistrySnapshot.

exception M303RegimenSimplificadoAnnualSummaryHandoffError(message=None, *, context=None, translated_message=None)[source]

Bases: CoreValidationError

Raised when a Modelo 390 annual handoff has no exact filed 303 source.

Roots at CoreValidationError like every other refusal in this package, so the class binds to the error registry and its refusal carries a code, a category and locale-resolved text. That base already carries ValueError, so the resolver keeps the ancestry its callers were written against.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
class M303RegimenSimplificadoAnnualSummarySourceResolver(*, registry_snapshot, work_unit_repository, calculation_repository, filing_repository, regimen_simplificado_applies, operation)[source]

Bases: object

Resolve the one immutable filed-current 303/4T annual-summary source.

Parameters:
resolver_id: ClassVar[str]
owned_sources: ClassVar[tuple[BindingSourceKind, ...]]
resolve(context)[source]

Assemble exact 74–83 inputs or refuse before target persistence.

Return type:

CalculationSourceResolution

Parameters:

context (CalculationSourceContext)

validate_persisted_target_revision(*, target_work_unit, target_revision)[source]

Re-resolve and compare the immutable handoff before target use.

Calculation stores the carrier only after the target revision id has been derived. Verification, filing, and export re-run this exact source selection so a later source-pointer/evidence/result drift cannot be hidden behind an otherwise valid target-revision hash.

Core types: CalculationRevision.

Return type:

None

Parameters:
validate_m303_regimen_simplificado_annual_summary_target_revision(*, target_work_unit, target_revision, work_unit_repository, calculation_repository, filing_repository, regimen_simplificado_applies, operation)[source]

Fail closed when a persisted M390 handoff no longer re-resolves exactly.

Core types: CalculationRevision.

Return type:

None

Parameters: