Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SELC-5434] feat: split csv aggregate API for some product #464

Merged
merged 12 commits into from
Sep 11, 2024
166 changes: 165 additions & 1 deletion apps/onboarding-ms/src/main/docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"name" : "support"
} ],
"paths" : {
"/v1/aggregates/verification" : {
"/v1/aggregates/verification/prod-io" : {
"post" : {
"tags" : [ "Aggregates Controller" ],
"summary" : "Validate the data related to the aggregated entities present in a CSV file",
Expand Down Expand Up @@ -68,6 +68,92 @@
} ]
}
},
"/v1/aggregates/verification/prod-pagopa" : {
"post" : {
"tags" : [ "Aggregates Controller" ],
"summary" : "Validate the data related to the aggregated entities present in a CSV file",
"requestBody" : {
"content" : {
"multipart/form-data" : {
"schema" : {
"required" : [ "aggregates" ],
"type" : "object",
"properties" : {
"aggregates" : {
"format" : "binary",
"type" : "string"
}
}
}
}
}
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/VerifyAggregateResponse"
}
}
}
},
"401" : {
"description" : "Not Authorized"
},
"403" : {
"description" : "Not Allowed"
}
},
"security" : [ {
"SecurityScheme" : [ ]
} ]
}
},
"/v1/aggregates/verification/prod-pn" : {
"post" : {
"tags" : [ "Aggregates Controller" ],
"summary" : "Validate the data related to the aggregated entities present in a CSV file",
"requestBody" : {
"content" : {
"multipart/form-data" : {
"schema" : {
"required" : [ "aggregates" ],
"type" : "object",
"properties" : {
"aggregates" : {
"format" : "binary",
"type" : "string"
}
}
}
}
}
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/VerifyAggregateSendResponse"
}
}
}
},
"401" : {
"description" : "Not Authorized"
},
"403" : {
"description" : "Not Allowed"
}
},
"security" : [ {
"SecurityScheme" : [ ]
} ]
}
},
"/v1/notification/resend" : {
"post" : {
"tags" : [ "Notification Controller" ],
Expand Down Expand Up @@ -1291,6 +1377,67 @@
}
}
},
"AggregateSend" : {
"type" : "object",
"properties" : {
"description" : {
"type" : "string"
},
"pec" : {
"type" : "string"
},
"taxCode" : {
"type" : "string"
},
"vatNumber" : {
"type" : "string"
},
"codeSDI" : {
"type" : "string"
},
"address" : {
"type" : "string"
},
"city" : {
"type" : "string"
},
"province" : {
"type" : "string"
},
"subunitType" : {
"type" : "string"
},
"subunitCode" : {
"type" : "string"
},
"users" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/AggregateUser"
}
}
}
},
"AggregateUser" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"surname" : {
"type" : "string"
},
"taxCode" : {
"type" : "string"
},
"email" : {
"type" : "string"
},
"role" : {
"type" : "string"
}
}
},
"BillingPaRequest" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -2343,6 +2490,23 @@
}
}
}
},
"VerifyAggregateSendResponse" : {
"type" : "object",
"properties" : {
"aggregates" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/AggregateSend"
}
},
"errors" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/RowError"
}
}
}
}
},
"securitySchemes" : {
Expand Down
113 changes: 112 additions & 1 deletion apps/onboarding-ms/src/main/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags:
- name: internal-v1
- name: support
paths:
/v1/aggregates/verification:
/v1/aggregates/verification/prod-io:
post:
tags:
- Aggregates Controller
Expand Down Expand Up @@ -46,6 +46,66 @@ paths:
description: Not Allowed
security:
- SecurityScheme: []
/v1/aggregates/verification/prod-pagopa:
post:
tags:
- Aggregates Controller
summary: Validate the data related to the aggregated entities present in a CSV
file
requestBody:
content:
multipart/form-data:
schema:
required:
- aggregates
type: object
properties:
aggregates:
format: binary
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyAggregateResponse"
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
/v1/aggregates/verification/prod-pn:
post:
tags:
- Aggregates Controller
summary: Validate the data related to the aggregated entities present in a CSV
file
requestBody:
content:
multipart/form-data:
schema:
required:
- aggregates
type: object
properties:
aggregates:
format: binary
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/VerifyAggregateSendResponse"
"401":
description: Not Authorized
"403":
description: Not Allowed
security:
- SecurityScheme: []
/v1/notification/resend:
post:
tags:
Expand Down Expand Up @@ -914,6 +974,46 @@ components:
type: string
origin:
$ref: "#/components/schemas/Origin"
AggregateSend:
type: object
properties:
description:
type: string
pec:
type: string
taxCode:
type: string
vatNumber:
type: string
codeSDI:
type: string
address:
type: string
city:
type: string
province:
type: string
subunitType:
type: string
subunitCode:
type: string
users:
type: array
items:
$ref: "#/components/schemas/AggregateUser"
AggregateUser:
type: object
properties:
name:
type: string
surname:
type: string
taxCode:
type: string
email:
type: string
role:
type: string
BillingPaRequest:
type: object
properties:
Expand Down Expand Up @@ -1689,6 +1789,17 @@ components:
type: array
items:
$ref: "#/components/schemas/RowError"
VerifyAggregateSendResponse:
type: object
properties:
aggregates:
type: array
items:
$ref: "#/components/schemas/AggregateSend"
errors:
type: array
items:
$ref: "#/components/schemas/RowError"
securitySchemes:
SecurityScheme:
type: http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
import it.pagopa.selfcare.onboarding.model.VerifyAggregateResponse;
import it.pagopa.selfcare.onboarding.model.VerifyAggregateSendResponse;
import it.pagopa.selfcare.onboarding.service.AggregatesService;
import jakarta.inject.Inject;
import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import lombok.AllArgsConstructor;
import org.eclipse.microprofile.openapi.annotations.Operation;
Expand All @@ -29,12 +27,32 @@ public class AggregatesController {

@Operation(summary = "Validate the data related to the aggregated entities present in a CSV file")
@POST
@Path("/verification")
@Path("/verification/prod-io")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Uni<VerifyAggregateResponse> verifyAggregatesCsv(@NotNull @RestForm("aggregates") File file){
public Uni<VerifyAggregateResponse> verifyAppIoAggregatesCsv(@NotNull @RestForm("aggregates") File file){

return aggregatesService.validateAggregatesCsv(file);
return aggregatesService.validateAppIoAggregatesCsv(file);
}

@Operation(summary = "Validate the data related to the aggregated entities present in a CSV file")
@POST
@Path("/verification/prod-pn")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Uni<VerifyAggregateSendResponse> verifySendAggregatesCsv(@NotNull @RestForm("aggregates") File file){

return aggregatesService.validateSendAggregatesCsv(file);
}

@Operation(summary = "Validate the data related to the aggregated entities present in a CSV file")
@POST
@Path("/verification/prod-pagopa")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Uni<VerifyAggregateResponse> verifyPagoPaAggregatesCsv(@NotNull @RestForm("aggregates") File file){

return aggregatesService.validatePagoPaAggregatesCsv(file);
}


Expand Down
Loading
Loading