Interface CitizenService

All Known Implementing Classes:
CitizenServiceImpl

public interface CitizenService

Service contract for citizen consents management.

  • 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 code
      tppId - TPP identifier
      Returns:
      Mono<CitizenConsentDTO> DTO containing only the requested consent
      Throws:
      RuntimeException - if TPP is not found
    • switchState

      reactor.core.publisher.Mono<CitizenConsentDTO> switchState(String fiscalCode, String tppId)

      Toggles the consent state for the specified TPP.

      Parameters:
      fiscalCode - plain fiscal code
      tppId - 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 code
      tppId - TPP identifier
      Returns:
      Mono<CitizenConsentDTO> consent DTO
      Throws:
      RuntimeException - if consent is missing
    • getTppEnabledList

      reactor.core.publisher.Mono<List<String>> getTppEnabledList(String fiscalCode)

      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

      reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentsList(String fiscalCode)

      Retrieves all consents for the citizen.

      Parameters:
      fiscalCode - plain fiscal code
      Returns:
      Mono<CitizenConsentDTO> full consents DTO
      Throws:
      RuntimeException - if citizen is missing
    • getCitizenConsentsListEnabled

      reactor.core.publisher.Mono<CitizenConsentDTO> getCitizenConsentsListEnabled(String fiscalCode)

      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

      reactor.core.publisher.Mono<List<CitizenConsentDTO>> getCitizenEnabled(String tppId)

      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

      reactor.core.publisher.Mono<CitizenConsentDTO> deleteCitizenConsent(String fiscalCode)

      Deletes the citizen consent aggregate.

      Parameters:
      fiscalCode - plain fiscal code
      Returns:
      Mono<CitizenConsentDTO> deleted snapshot DTO
      Throws:
      RuntimeException - if citizen is missing
    • getCitizenInBloomFilter

      reactor.core.publisher.Mono<Boolean> getCitizenInBloomFilter(String fiscalCode)

      Checks Bloom filter membership and existence of at least one enabled consent.

      Parameters:
      fiscalCode - plain fiscal code
      Returns:
      Mono<Boolean> true if present and an enabled consent exists