Source code for cadrumo.application.live.censo_ports
"""Application-owned capability for an authenticated censal read.The live censo use case owns the observation it returns and the applicationerror boundary it exposes. Browser navigation, Sede parsing, and theirprovider-specific failures are supplied by an outer composition root throughthis narrow port."""from__future__importannotationsfromtypingimportProtocolfrom...core.configimportSettingsfrom..auth.session_typesimportAeatSessionfrom..user_profile.censal_observationimportCensalObservation
[docs]classCensalFetchPort(Protocol):"""Read the authenticated taxpayer's application-owned censo observation."""asyncdef__call__(self,session:AeatSession,*,taxpayer_nif:str,settings:Settings,)->CensalObservation:"""Return one translated censal observation. The outer implementation translates Sede DTOs and failures into the application contract before returning or raising. In particular, no Sede exception or adapter-owned record type crosses this port. """...