Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaconsalvi committed Nov 21, 2024
1 parent c6d70d0 commit 8b10730
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.graalvm.buildtools.native' version '0.10.3'
id("org.openapi.generator") version "7.5.0"
id("org.openapi.generator") version "7.10.0"
}

group = 'it.gov.pagopa'
Expand All @@ -27,7 +27,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
// implementation 'com.azure.spring:spring-cloud-azure-starter-actuator'
// implementation 'com.azure.spring:spring-cloud-azure-starter-data-cosmos'
implementation 'com.azure.spring:spring-cloud-azure-starter-data-cosmos'
implementation("io.swagger.core.v3:swagger-annotations:2.2.8")
implementation("org.openapitools:jackson-databind-nullable:0.2.6")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
Expand Down
6 changes: 0 additions & 6 deletions openapi/activation.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,6 @@ components:
description: Identifier of the RTP activation resource.
type: string
format: uuid
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
minLength: 36
maxLength: 36
example: "d0d654e6-97da-4848-b568-99fedccb642b"

ActivationLocation:
Expand All @@ -440,9 +437,6 @@ components:
description: Identifier of the request.
type: string
format: uuid
pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
minLength: 36
maxLength: 36
example: "bd615b4a-066d-443e-8dd2-a28a39931fef"

Version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@

import it.gov.pagopa.rtp.activator.controller.generated.CreateApi;
import it.gov.pagopa.rtp.activator.model.generated.ActivationReqDto;
import it.gov.pagopa.rtp.activator.service.ActivationPayerService;
import reactor.core.publisher.Mono;

@RestController
@Validated
public class ActivationAPIControllerImpl implements CreateApi {

private final ActivationPayerService activationPayerService;

public ActivationAPIControllerImpl(ActivationPayerService activationPayerService){
this.activationPayerService = activationPayerService;
}

@Override
public Mono<ResponseEntity<Void>> activate(UUID requestId, String version, Mono<ActivationReqDto> activationReqDto,
ServerWebExchange exchange) {
// TODO Auto-generated method stub
activationPayerService.activatePayer(activationReqDto.block().getPayer().getFiscalCode(),activationReqDto.block().getPayer().getRtpSpId().toString());
throw new UnsupportedOperationException("Unimplemented method 'activate'");

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package it.gov.pagopa.rtp.activator.service;

import it.gov.pagopa.rtp.activator.model.generated.ActivationDto;

public interface ActivationPayerService {
ActivationDto activatePayer(String payer, String fiscalCode);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package it.gov.pagopa.rtp.activator.service;

import it.gov.pagopa.rtp.activator.model.generated.ActivationDto;

public class ActivationPayerServiceImpl implements ActivationPayerService{

@Override
public ActivationDto activatePayer() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'activatePayer'");
// Try to save params into db
// check the db response
// if it's ok response 200
// if the record already exists
// report 409 error
}

}

0 comments on commit 8b10730

Please sign in to comment.