Skip to content

Commit fba4657

Browse files
authored
[SELC-4988] feat: Add new api to call national-registries for verifying Legals for pnpg (#246)
1 parent e410f1d commit fba4657

File tree

24 files changed

+2569
-34
lines changed

24 files changed

+2569
-34
lines changed

app/src/main/resources/swagger/api-docs.json

+93
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
}, {
2626
"name" : "institutions-pnpg",
2727
"description" : "Pn Pg Controller"
28+
}, {
29+
"name" : "national-registries",
30+
"description" : "National Registry Controller"
2831
}, {
2932
"name" : "onboarding",
3033
"description" : "Onboarding operations"
@@ -589,6 +592,68 @@
589592
} ]
590593
}
591594
},
595+
"/v2/national-registries/legal-tax/verification" : {
596+
"post" : {
597+
"tags" : [ "external-v2", "national-registries" ],
598+
"summary" : "verifyLegal",
599+
"description" : "Verify if given taxId is legal of given institution identified with vatNumber",
600+
"operationId" : "verifyLegalByPOST",
601+
"requestBody" : {
602+
"content" : {
603+
"application/json" : {
604+
"schema" : {
605+
"$ref" : "#/components/schemas/VerifyRequestDto"
606+
}
607+
}
608+
}
609+
},
610+
"responses" : {
611+
"200" : {
612+
"description" : "OK",
613+
"content" : {
614+
"application/json" : {
615+
"schema" : {
616+
"$ref" : "#/components/schemas/LegalVerificationResource"
617+
}
618+
}
619+
}
620+
},
621+
"400" : {
622+
"description" : "Bad Request",
623+
"content" : {
624+
"application/problem+json" : {
625+
"schema" : {
626+
"$ref" : "#/components/schemas/Problem"
627+
}
628+
}
629+
}
630+
},
631+
"401" : {
632+
"description" : "Unauthorized",
633+
"content" : {
634+
"application/problem+json" : {
635+
"schema" : {
636+
"$ref" : "#/components/schemas/Problem"
637+
}
638+
}
639+
}
640+
},
641+
"500" : {
642+
"description" : "Internal Server Error",
643+
"content" : {
644+
"application/problem+json" : {
645+
"schema" : {
646+
"$ref" : "#/components/schemas/Problem"
647+
}
648+
}
649+
}
650+
}
651+
},
652+
"security" : [ {
653+
"bearerAuth" : [ "global" ]
654+
} ]
655+
}
656+
},
592657
"/v2/onboarding" : {
593658
"post" : {
594659
"tags" : [ "onboarding" ],
@@ -1862,6 +1927,21 @@
18621927
}
18631928
}
18641929
},
1930+
"LegalVerificationResource" : {
1931+
"title" : "LegalVerificationResource",
1932+
"type" : "object",
1933+
"properties" : {
1934+
"resultCode" : {
1935+
"type" : "string"
1936+
},
1937+
"resultDetail" : {
1938+
"type" : "string"
1939+
},
1940+
"verificationResult" : {
1941+
"type" : "boolean"
1942+
}
1943+
}
1944+
},
18651945
"LegalsResource" : {
18661946
"title" : "LegalsResource",
18671947
"type" : "object",
@@ -2615,6 +2695,19 @@
26152695
"description" : "User's surname"
26162696
}
26172697
}
2698+
},
2699+
"VerifyRequestDto" : {
2700+
"title" : "VerifyRequestDto",
2701+
"required" : [ "taxId", "vatNumber" ],
2702+
"type" : "object",
2703+
"properties" : {
2704+
"taxId" : {
2705+
"type" : "string"
2706+
},
2707+
"vatNumber" : {
2708+
"type" : "string"
2709+
}
2710+
}
26182711
}
26192712
},
26202713
"securitySchemes" : {
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package it.pagopa.selfcare.external_api.api;
22

33
import it.pagopa.selfcare.external_api.model.institutions.InstitutionResource;
4+
import it.pagopa.selfcare.external_api.model.nationalRegistries.LegalVerification;
45

56
public interface MsPartyRegistryProxyConnector {
67

78
InstitutionResource findInstitution(String institutionExternalId);
89

10+
LegalVerification verifyLegal(String taxId, String vatNumber);
11+
912
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package it.pagopa.selfcare.external_api.model.nationalRegistries;
2+
3+
import lombok.Data;
4+
5+
@Data
6+
public class LegalVerification {
7+
private String resultCode;
8+
private String resultDetail;
9+
private Boolean verificationResult;
10+
}

0 commit comments

Comments
 (0)