Interface CitizenController

All Known Implementing Classes:
CitizenControllerImpl

@RequestMapping("/emd/citizen") public interface CitizenController

Reactive REST contract exposing citizen consent operations.

Each method sanitizes raw inputs in the implementation and delegates business logic to CitizenService.

Error semantics and domain flows are documented in the service layer; controller focuses on HTTP contract.

  • Method Details

    • saveCitizenConsent

      @PostMapping("/{fiscalCode}/{tppId}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> saveCitizenConsent(@PathVariable String fiscalCode, @PathVariable String tppId)

      Creates or reuses a consent for the specified TPP.

      Delegates to CitizenService.createCitizenConsent(String, String).

      Endpoint: POST /emd/citizen/{fiscalCode}/{tppId}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      tppId - TPP identifier (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with requested consent DTO
    • stateSwitch

      @PutMapping("/{fiscalCode}/{tppId}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> stateSwitch(@PathVariable String fiscalCode, @PathVariable String tppId)

      Toggles the consent state for the specified TPP.

      Delegates to CitizenService.switchState(String, String).

      Endpoint: PUT /emd/citizen/{fiscalCode}/{tppId}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      tppId - TPP identifier (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with updated consent DTO
    • getTppEnabledList

      @GetMapping("/list/{fiscalCode}/enabled/tpp") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<List<String>>> getTppEnabledList(@PathVariable String fiscalCode)

      Lists enabled TPP identifiers for the citizen.

      Delegates to CitizenService.getTppEnabledList(String).

      Endpoint: GET /emd/citizen/list/{fiscalCode}/enabled/tpp

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      Returns:
      Mono<ResponseEntity<List<String>>> 200 OK with enabled TPP ids (possibly empty)
    • getCitizenConsentStatus

      @GetMapping("/{fiscalCode}/{tppId}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> getCitizenConsentStatus(@PathVariable String fiscalCode, @PathVariable String tppId)

      Retrieves consent status for the given TPP.

      Delegates to CitizenService.getCitizenConsentStatus(String, String).

      Endpoint: GET /emd/citizen/{fiscalCode}/{tppId}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      tppId - TPP identifier (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with consent DTO
    • getCitizenConsentsList

      @GetMapping("/list/{fiscalCode}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> getCitizenConsentsList(@PathVariable String fiscalCode)

      Retrieves all consents for the citizen.

      Delegates to CitizenService.getCitizenConsentsList(String).

      Endpoint: GET /emd/citizen/list/{fiscalCode}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with full consents DTO
    • getCitizenConsentsListEnabled

      @GetMapping("/list/{fiscalCode}/enabled") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> getCitizenConsentsListEnabled(@PathVariable String fiscalCode)

      Retrieves only enabled consents for the citizen.

      Delegates to CitizenService.getCitizenConsentsListEnabled(String).

      Endpoint: GET /emd/citizen/list/{fiscalCode}/enabled

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with filtered DTO
    • getCitizenEnabled

      @GetMapping("/{tppId}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<List<CitizenConsentDTO>>> getCitizenEnabled(@PathVariable String tppId)

      Retrieves citizens with an enabled consent for a TPP id.

      Delegates to CitizenService.getCitizenEnabled(String).

      Endpoint: GET /emd/citizen/{tppId}

      Parameters:
      tppId - TPP identifier (regex validated)
      Returns:
      Mono<ResponseEntity<List<CitizenConsentDTO>>> 200 OK with list (possibly empty)
    • deleteCitizenConsent

      @DeleteMapping("/test/delete/{fiscalCode}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<CitizenConsentDTO>> deleteCitizenConsent(@PathVariable String fiscalCode)

      Deletes the citizen consent aggregate.

      Delegates to CitizenService.deleteCitizenConsent(String).

      Endpoint: DELETE /emd/citizen/test/delete/{fiscalCode}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      Returns:
      Mono<ResponseEntity<CitizenConsentDTO>> 200 OK with deleted snapshot DTO
    • bloomFilterSearch

      @GetMapping("/filter/{fiscalCode}") reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<String>> bloomFilterSearch(@PathVariable String fiscalCode)

      Checks Bloom filter membership and enabled consent existence.

      Delegates to CitizenService.getCitizenInBloomFilter(String); maps boolean to textual status.

      Endpoint: GET /emd/citizen/filter/{fiscalCode}

      Parameters:
      fiscalCode - plain fiscal code (regex validated)
      Returns:
      Mono<ResponseEntity<String>> 200 OK with status ("OK" or "NO CHANNELS ENABLED")