cadrumo.application.modelo.declarations_calendar module

Safe frontend-neutral full-calendar projection for Declarations.

The projector accepts an already-built legal calendar and the already-built calendar-evidence projection. It performs no reads. Protected work, filing, calculation, snapshot, CSV, AEAT-reference, event-prose, and URL fields are deliberately absent from the output model.

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

Bases: CadrumoError

The supplied calendar authorities cannot form one coherent safe view.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
class DeclarationsCalendarSource(*values)[source]

Bases: StrEnum

Independent authorities retained by the calendar projection.

SCHEDULE
LOCAL_FILING
AEAT_EVIDENCE
class DeclarationsCalendarSourceObservationV1(**data)[source]

Bases: BaseModel

Explicit availability and freshness for one source authority.

Parameters:

data (Any)

source: DeclarationsCalendarSource
availability: HomeAvailability
observed_at: datetime | None
reason_code: NamespacedId | None
class DeclarationsCalendarSourceStateV1(**data)[source]

Bases: DeclarationsCalendarSourceObservationV1

One source observation plus measured cardinality when observable.

Parameters:
  • source (DeclarationsCalendarSource)

  • availability (HomeAvailability)

  • observed_at (datetime | None)

  • reason_code (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=3, max_length=160, pattern=^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+$, ascii_only=None)] | None)

item_count: NonNegativeInt | None
class DeclarationsCalendarEntryRefV1(**data)[source]

Bases: BaseModel

Safe legal natural identity and independent calendar state axes.

Parameters:

data (Any)

modelo: ModeloCode
filing_year: FilingYear
period: Period
opens_on: date
adjusted_closes_on: date
payment_cutoff_on: date | None
legal_status: ObligationStatus
user_state: OverviewPeriodState
local_filing_state: OverviewLocalFilingState | None
aeat_submission_state: OverviewAeatSubmissionState | None
justificante_verified: bool | None
source: OverviewCalendarEntrySource
recovery_action: DeclaredNextAction | None
semantic_key()[source]

Return the public natural obligation identity.

Return type:

tuple[str, int, str]

class DeclarationsCalendarProjectionV1(**data)[source]

Bases: BaseModel

Immutable safe full calendar suitable for a frontend.

Parameters:

data (Any)

contract_version: int
as_of: date
generated_at: datetime
query_range: OverviewCalendarRange
sources: tuple[DeclarationsCalendarSourceStateV1, ...]
entries: tuple[DeclarationsCalendarEntryRefV1, ...]
project_declarations_calendar(*, calendar, evidence, as_of, schedule_observation)[source]

Join already-built calendar authorities into one deadline projection.

Not “redacted”: this projection’s subject is dates, legal windows and observation states, and it carries all of them. It withholds nothing the operator is entitled to; there is simply no monetary fact in a calendar.

Return type:

DeclarationsCalendarProjectionV1

Parameters: