Interface CitizenService
- All Known Implementing Classes:
CitizenServiceImpl
public interface CitizenService
Service contract for citizen consents management.
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<CitizenConsentDTO> createCitizenConsent(String fiscalCode, String tppId) Creates or reuses the consent for the specified TPP.reactor.core.publisher.Mono<CitizenConsentDTO> deleteCitizenConsent(String fiscalCode) Deletes the citizen consent aggregate.reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentsList(String fiscalCode) Retrieves all consents for the citizen.reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentsListEnabled(String fiscalCode) Retrieves only enabled consents for the citizen.reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentStatus(String fiscalCode, String tppId) Retrieves the consent status for the given fiscal code and TPP id.reactor.core.publisher.Mono<List<CitizenConsentDTO>> getCitizenEnabled(String tppId) Retrieves citizens having an enabled consent for the given TPP id.reactor.core.publisher.Mono<Boolean> getCitizenInBloomFilter(String fiscalCode) Checks Bloom filter membership and existence of at least one enabled consent.getTppEnabledList(String fiscalCode) Returns the list of enabled TPP identifiers for the citizen.reactor.core.publisher.Mono<CitizenConsentDTO> switchState(String fiscalCode, String tppId) Toggles the consent state for the specified TPP.
-
Method Details
-
createCitizenConsent
reactor.core.publisher.Mono<CitizenConsentDTO> createCitizenConsent(String fiscalCode, String tppId) Creates or reuses the consent for the specified TPP.
- Parameters:
fiscalCode- plain fiscal codetppId- TPP identifier- Returns:
Mono<CitizenConsentDTO>DTO containing only the requested consent- Throws:
RuntimeException- if TPP is not found
-
switchState
Toggles the consent state for the specified TPP.
- Parameters:
fiscalCode- plain fiscal codetppId- TPP identifier- Returns:
Mono<CitizenConsentDTO>updated consent DTO (only that TPP)- Throws:
RuntimeException- if citizen or consent is missing
-
getCitizenConsentStatus
reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentStatus(String fiscalCode, String tppId) Retrieves the consent status for the given fiscal code and TPP id.
- Parameters:
fiscalCode- plain fiscal codetppId- TPP identifier- Returns:
Mono<CitizenConsentDTO>consent DTO- Throws:
RuntimeException- if consent is missing
-
getTppEnabledList
Returns the list of enabled TPP identifiers for the citizen.
- Parameters:
fiscalCode- plain fiscal code- Returns:
Mono<List<String>>list of enabled TPP ids (possibly empty)
-
getCitizenConsentsList
Retrieves all consents for the citizen.
- Parameters:
fiscalCode- plain fiscal code- Returns:
Mono<CitizenConsentDTO>full consents DTO- Throws:
RuntimeException- if citizen is missing
-
getCitizenConsentsListEnabled
Retrieves only enabled consents for the citizen.
- Parameters:
fiscalCode- plain fiscal code- Returns:
Mono<CitizenConsentDTO>filtered DTO (enabled only)- Throws:
RuntimeException- if citizen is missing
-
getCitizenEnabled
Retrieves citizens having an enabled consent for the given TPP id.
- Parameters:
tppId- TPP identifier- Returns:
Mono<List<CitizenConsentDTO>>list of citizens (possibly empty)
-
deleteCitizenConsent
Deletes the citizen consent aggregate.
- Parameters:
fiscalCode- plain fiscal code- Returns:
Mono<CitizenConsentDTO>deleted snapshot DTO- Throws:
RuntimeException- if citizen is missing
-
getCitizenInBloomFilter
Checks Bloom filter membership and existence of at least one enabled consent.
- Parameters:
fiscalCode- plain fiscal code- Returns:
Mono<Boolean>trueif present and an enabled consent exists
-