cadrumo.application.live.iva_remote_state_ports module

Inward ports for live IVA remote-state acquisition.

The application service owns orchestration and redacted report projection. AEAT browser access, encrypted evidence persistence, and active-profile session selection are composed at the entrypoint boundary.

class IvaRemoteStatePort(*args, **kwargs)[source]

Bases: Protocol

Concrete capabilities required by the live IVA application service.

property wallet_target_url: str

Return the live IVA wallet endpoint selected by composition.

active_storage_span()[source]

Open the storage scope required for the live acquisition.

Return type:

AbstractContextManager[None]

list_history(*, as_of_year)[source]

Read persisted IVA compensation history through the port.

Return type:

IvaCompensationHistoryReport

Parameters:

as_of_year (int | None)

persist_manifest(manifest)[source]

Persist one acquisition manifest through the secure boundary.

Return type:

None

Parameters:

manifest (IvaRemoteStateAcquisitionManifest)

active_verified_session(*, operation, target_url)[source]

Open the active verified AEAT session for an operation.

Return type:

Awaitable[tuple[AeatSession, Settings]]

Parameters:
  • operation (str)

  • target_url (str | None)

ensure_authenticated_session(settings, *, operation, target_url)[source]

Ensure an AEAT session is authenticated for an operation.

Return type:

Awaitable[AuthenticatedAeatSessionResult]

Parameters:
capture_history(session, *, settings, year_from, year_to, output_root, progress_context)[source]

Capture IVA compensation history for the requested year range.

Return type:

Awaitable[IvaCompensationHistoryCaptureReport]

Parameters:
capture_wallet(session, *, settings, target_year, target_period, taxpayer_nif, output_root, progress_context)[source]

Capture IVA wallet state for one target year and period.

Return type:

Awaitable[IvaWalletCaptureReport]

Parameters: