cadrumo.application.overview.status_report module

The overview status report and the advisories it carries.

These four builders were defined directly in the package namespace, which is why that namespace could not be made inert by deleting an export map: there was production code in it. They live in a module of their own now, and the package root re-exports nothing.

build_filing_obligation_advisories(raw_values, *, filing_year=None)[source]

Derive overview-status advisory locale keys from raw profile values.

The helper feeds OverviewStatusReport and stays on the local read-model path. It implements the Art. 96.2.a)/96.3 LIRPF multiple-pagadores rule through domain.deadlines.models.evaluate_multiple_pagadores_obligation(): when the operator has declared irpf.pagadores_count >= 2 and irpf.pagadores_secondary_income > 1500, the work-income exemption limit drops from the general €22,000 to the per-year reduced limit, and Modelo 100 filing is mandatory when irpf.pagadores_total_work_income exceeds that reduced limit. When the total work income is undeclared, the advisory surfaces conservatively rather than granting a false clear.

Parameters:
  • raw_values (Mapping[str, object] | None) – Profile raw values mapping, or None.

  • filing_year (int | None) – The income year selecting the dated reduced limit. A yearless surface cannot make this dated legal assertion and emits no advisory.

Return type:

tuple[str, ...]

Returns a tuple of tr()-resolvable locale keys, empty when no evidence of a mandatory obligation is present. Malformed raw values are logged only by profile-field name and exception type.

build_unsupported_work_create_modelos(raw_values)[source]

Return modelos whose local work-create path is unsupported.

The result feeds OverviewStatusReport and uses canonical core.modelo.Modelo identifiers. Non-resident IRNR profile state currently advertises Modelo 210 because the local work-create path is not available for that filing.

Return type:

tuple[str, ...]

Parameters:

raw_values (Mapping[str, object] | None)

overview_status_report_from_projection(projection, *, raw_values=None)[source]

Project the canonical state projection into the overview status emit shape.

The OverviewStatusReport is a CLI emit shape derived from the one application.state_projection.OperatorStateProjection; it is not a second state-assembly path. Both the declaration-draft domain.filing.schema.ModeloDraft count and the WorkUnitCatalogue count are carried distinctly.

Parameters:
  • projection (OperatorStateProjection) – The canonical state projection to project.

  • raw_values (Mapping[str, object] | None) – Optional profile raw values mapping. When supplied, used to evaluate filing-obligation advisories (e.g., the Art. 96.3 LIRPF multiple-pagadores rule).

Return type:

OverviewStatusReport

Returns:

An OverviewStatusReport derived from the projection.

build_overview_status_report(*, certificate_secret_backend_factory, operator_probe_ports, operator_scope_ports, read_ports, operation, state=None, raw_values=None)[source]

Build and return the OverviewStatusReport used by root and overview status.

Consumes the canonical application.state_projection.build_operator_state_projection() and projects it through overview_status_report_from_projection(); the bespoke per-surface store assembly this function once carried is deleted. overview status therefore reports the same counters as every other operator surface — including the modelo work work units the old assembly never read.

Return type:

OverviewStatusReport

Parameters: