cadrumo.entrypoints.tui.declarations.controller module

Pure controller and common shell for the Declarations workspace.

declarations_copy(key, **values)[source]

Resolve authored display copy through the canonical catalogue.

Return type:

str

Parameters:
natural_address(modelo, year, period)[source]

Render the public Modelo/year/period coordinate.

Return type:

str

Parameters:
timestamp_label(value)[source]

Render a deterministic minute-bearing UTC timestamp without locale ambiguity.

Return type:

str

Parameters:

value (datetime)

calendar_date_label(value)[source]

Render one non-ambiguous legal date.

Return type:

str

Parameters:

value (date | None)

work_state_label(value)[source]

Render a local declaration state.

Return type:

str

Parameters:

value (WorkUnitState)

revision_state_label(value)[source]

Render a calculation-revision state.

Return type:

str

Parameters:

value (CalculationRevisionState)

filing_state_label(value)[source]

Render local filing-record currency.

Return type:

str

Parameters:

value (ModeloRecordStatus)

evidence_label(value)[source]

Render separately observed AEAT evidence metadata.

Return type:

str

Parameters:

value (ExternalEvidenceKind | None)

class DeclarationsWorkspaceController(context, projection, *, work_action, revisions_action, filing_action, modelo_workspace_factory=None, revision_handoff=None, filing_handoff=None, calendar_projection=None, calendar_entry_handoff=None, calendar_recovery_handoff=None)[source]

Bases: object

Custody of an injected safe projection and admitted read references.

Parameters:
zone_state(zone)[source]

Return one closed zone state.

Return type:

DeclarationsWorkspaceZoneStateV1

Parameters:

zone (DeclarationsWorkspaceZone)

target(destination)[source]

Construct a typed target from the closed route map.

Return type:

DeclarationsRouteTargetV1

Parameters:

destination (DeclarationsDestinationIdV1)

destination_availability(destination)[source]

Return truthful availability for one route authority.

Return type:

DeclarationsWorkspaceAvailability | HomeAvailability

Parameters:

destination (DeclarationsDestinationIdV1)

destination_reason_code(destination)[source]

Return why one destination is not available, as the application said it.

Return type:

str | None

Parameters:

destination (DeclarationsDestinationIdV1)

restored_id(semantic_key)[source]

Return the matching opaque semantic restore token, if any.

Return type:

str | None

Parameters:

semantic_key (str)

class DeclarationsWorkspaceScreen(controller, *, id)[source]

Bases: AccountChromeScreen

One-scroll host-neutral shell with semantic internal navigation.

Parameters:
BINDINGS: ClassVar

A list of key bindings.

IS_WORKSPACE_OVERVIEW: ClassVar[bool]

Whether Back from this body leaves the workspace rather than returning to its overview.

CSS: ClassVar[str]

Inline CSS, useful for quick scripts. Rules here take priority over CSS_PATH.

Note

This CSS applies to the whole app.

populate_navigation()[source]

Populate every closed internal destination exactly once.

Return type:

None

handle_navigation(event)[source]

Handle a navigation selection without reading application state.

Return type:

bool

Parameters:

event (RowSelected)

show_empty()[source]

Say that a table has nothing in it, on the muted line, not the warning one.

Return type:

None

refuse_handoff()[source]

Show an explicit refusal when the host omitted a target.

Return type:

None

action_back()[source]

Return an area to the Declarations overview; leave the workspace only from the overview.

Return type:

None

on_declarations_route_requested(event)[source]

Resolve the requested internal body here and hand it to the host.

Return type:

None

Parameters:

event (DeclarationsRouteRequested)

can_focus: bool

Widget may receive focus.

can_focus_children: bool

Widget’s children may receive focus.

class DeclarationsRouteRequested(target)[source]

Bases: Message

Request that the owning host replace the current internal body.

Parameters:

target (DeclarationsRouteTargetV1)

time
bubble: ClassVar[bool]
handler_name: ClassVar[str]

Name of the default message handler.

no_dispatch: ClassVar[bool]
verbose: ClassVar[bool]
class DeclarationsCalendarController(context, projection, *, entry_handoff=None, recovery_handoff=None)[source]

Bases: object

Pure custody and filtering for one injected safe calendar projection.

Parameters:
source(source)[source]

Return one explicit source state.

Return type:

DeclarationsCalendarSourceStateV1

Parameters:

source (DeclarationsCalendarSource)

replace_projection(projection)[source]

Accept a fresh injected snapshot without performing a read.

Return type:

None

Parameters:

projection (DeclarationsCalendarProjectionV1)

visible_entries(scope, query)[source]

Apply closed scope semantics and Unicode AND search to safe fields only.

Return type:

tuple[DeclarationsCalendarEntryRefV1, ...]

Parameters:
context_identity()[source]

Resolve a safe natural row identity carried by the route focus key.

Return type:

str | None

calendar_focus_key(row)[source]

Return a NamespacedId-compatible public natural calendar focus key.

Return type:

str

Parameters:

row (DeclarationsCalendarEntryRefV1)

calendar_address_focus_key(modelo, year, period)[source]

Return the calendar focus key for a Modelo, filing year and period.

Separate from calendar_focus_key() so a caller holding only the natural address – a Home agenda row – lands on the same calendar row.

Return type:

str

Parameters:

Render legal deadline status.

Return type:

str

Parameters:

value (ObligationStatus)

calendar_user_label(value)[source]

Render the safe derived user-facing schedule state.

Return type:

str

Parameters:

value (OverviewPeriodState)

calendar_local_label(value)[source]

Render local filing state without implying AEAT acceptance.

Return type:

str

Parameters:

value (OverviewLocalFilingState | None)

calendar_aeat_label(value)[source]

Render observed AEAT evidence state without inference.

Return type:

str

Parameters:

value (OverviewAeatSubmissionState | None)