Skip to content

Commit e261ad3

Browse files
[SELC-7264] New APIs to get details of each of the delegators and delegates (#97)
1 parent de9d0a5 commit e261ad3

File tree

22 files changed

+1055
-134
lines changed

22 files changed

+1055
-134
lines changed

apps/institution-ms/app/src/main/docs/openapi.json

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,196 @@
217217
} ]
218218
}
219219
},
220+
"/delegations/delegates/{institutionId}" : {
221+
"get" : {
222+
"tags" : [ "Delegation", "external-v2" ],
223+
"summary" : "Returns the delegates of an institutions with the details of each",
224+
"description" : "Returns the delegates of an institutions with the details of each",
225+
"operationId" : "getDelegateInstitutionsUsingGET",
226+
"parameters" : [ {
227+
"name" : "institutionId",
228+
"in" : "path",
229+
"description" : "The internal identifier of the institution",
230+
"required" : true,
231+
"style" : "simple",
232+
"schema" : {
233+
"type" : "string"
234+
}
235+
}, {
236+
"name" : "productId",
237+
"in" : "query",
238+
"description" : "Product's unique identifier",
239+
"required" : false,
240+
"style" : "form",
241+
"schema" : {
242+
"type" : "string"
243+
}
244+
}, {
245+
"name" : "type",
246+
"in" : "query",
247+
"description" : "Delegation's type",
248+
"required" : false,
249+
"style" : "form",
250+
"schema" : {
251+
"type" : "string",
252+
"enum" : [ "AOO", "EA", "PT" ]
253+
}
254+
}, {
255+
"name" : "cursor",
256+
"in" : "query",
257+
"description" : "ID of the last returned element from where to continue to get another page of results",
258+
"required" : false,
259+
"style" : "form",
260+
"schema" : {
261+
"type" : "integer",
262+
"format" : "int64"
263+
}
264+
}, {
265+
"name" : "size",
266+
"in" : "query",
267+
"description" : "Page size",
268+
"required" : false,
269+
"style" : "form",
270+
"schema" : {
271+
"type" : "integer",
272+
"format" : "int32"
273+
}
274+
} ],
275+
"responses" : {
276+
"200" : {
277+
"description" : "OK",
278+
"content" : {
279+
"application/json" : {
280+
"schema" : {
281+
"type" : "array",
282+
"items" : {
283+
"$ref" : "#/components/schemas/DelegationInstitutionResponse"
284+
}
285+
}
286+
}
287+
}
288+
},
289+
"400" : {
290+
"description" : "Bad Request",
291+
"content" : {
292+
"application/problem+json" : {
293+
"schema" : {
294+
"$ref" : "#/components/schemas/Problem"
295+
}
296+
}
297+
}
298+
},
299+
"404" : {
300+
"description" : "Not Found",
301+
"content" : {
302+
"application/problem+json" : {
303+
"schema" : {
304+
"$ref" : "#/components/schemas/Problem"
305+
}
306+
}
307+
}
308+
}
309+
},
310+
"security" : [ {
311+
"bearerAuth" : [ "global" ]
312+
} ]
313+
}
314+
},
315+
"/delegations/delegators/{institutionId}" : {
316+
"get" : {
317+
"tags" : [ "Delegation", "external-v2" ],
318+
"summary" : "Returns the delegators of an institution with the details of each",
319+
"description" : "Returns the delegators of an institution with the details of each",
320+
"operationId" : "getDelegatorInstitutionsUsingGET",
321+
"parameters" : [ {
322+
"name" : "institutionId",
323+
"in" : "path",
324+
"description" : "The internal identifier of the institution",
325+
"required" : true,
326+
"style" : "simple",
327+
"schema" : {
328+
"type" : "string"
329+
}
330+
}, {
331+
"name" : "productId",
332+
"in" : "query",
333+
"description" : "Product's unique identifier",
334+
"required" : false,
335+
"style" : "form",
336+
"schema" : {
337+
"type" : "string"
338+
}
339+
}, {
340+
"name" : "type",
341+
"in" : "query",
342+
"description" : "Delegation's type",
343+
"required" : false,
344+
"style" : "form",
345+
"schema" : {
346+
"type" : "string",
347+
"enum" : [ "AOO", "EA", "PT" ]
348+
}
349+
}, {
350+
"name" : "cursor",
351+
"in" : "query",
352+
"description" : "ID of the last returned element from where to continue to get another page of results",
353+
"required" : false,
354+
"style" : "form",
355+
"schema" : {
356+
"type" : "integer",
357+
"format" : "int64"
358+
}
359+
}, {
360+
"name" : "size",
361+
"in" : "query",
362+
"description" : "Page size",
363+
"required" : false,
364+
"style" : "form",
365+
"schema" : {
366+
"type" : "integer",
367+
"format" : "int32"
368+
}
369+
} ],
370+
"responses" : {
371+
"200" : {
372+
"description" : "OK",
373+
"content" : {
374+
"application/json" : {
375+
"schema" : {
376+
"type" : "array",
377+
"items" : {
378+
"$ref" : "#/components/schemas/DelegationInstitutionResponse"
379+
}
380+
}
381+
}
382+
}
383+
},
384+
"400" : {
385+
"description" : "Bad Request",
386+
"content" : {
387+
"application/problem+json" : {
388+
"schema" : {
389+
"$ref" : "#/components/schemas/Problem"
390+
}
391+
}
392+
}
393+
},
394+
"404" : {
395+
"description" : "Not Found",
396+
"content" : {
397+
"application/problem+json" : {
398+
"schema" : {
399+
"$ref" : "#/components/schemas/Problem"
400+
}
401+
}
402+
}
403+
}
404+
},
405+
"security" : [ {
406+
"bearerAuth" : [ "global" ]
407+
} ]
408+
}
409+
},
220410
"/delegations/from-taxcode" : {
221411
"post" : {
222412
"tags" : [ "Delegation", "internal-v1" ],
@@ -2885,6 +3075,29 @@
28853075
}
28863076
}
28873077
},
3078+
"DelegationInstitutionResponse" : {
3079+
"title" : "DelegationInstitutionResponse",
3080+
"type" : "object",
3081+
"properties" : {
3082+
"delegationId" : {
3083+
"type" : "string"
3084+
},
3085+
"delegationProductId" : {
3086+
"type" : "string"
3087+
},
3088+
"delegationType" : {
3089+
"type" : "string",
3090+
"enum" : [ "AOO", "EA", "PT" ]
3091+
},
3092+
"id" : {
3093+
"type" : "integer",
3094+
"format" : "int64"
3095+
},
3096+
"institution" : {
3097+
"$ref" : "#/components/schemas/InstitutionResponse"
3098+
}
3099+
}
3100+
},
28883101
"DelegationRequest" : {
28893102
"title" : "DelegationRequest",
28903103
"type" : "object",

apps/institution-ms/app/src/test/resources/db/institution.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,5 +605,93 @@
605605
"desc": "ROMA - PROVINCIA"
606606
}
607607
]
608+
},
609+
{
610+
"_id": "bf4dcdb6-f223-4996-bfbc-326b119dd101",
611+
"externalId": "00313820540",
612+
"origin": "IPA",
613+
"originId": "isticom",
614+
"description": "Comune di Assisi",
615+
"institutionType": "PA",
616+
"digitalAddress": "test@test.com",
617+
"address": "Via Roma, 1",
618+
"zipCode": "00000",
619+
"taxCode": "00313820540",
620+
"istatCode": "065078",
621+
"imported": false,
622+
"isTest": true,
623+
"createdAt": "2023-11-10T11:45:21.226522053Z",
624+
"_class": "it.pagopa.selfcare.mscore.connector.dao.model.InstitutionEntity",
625+
"updatedAt": "2024-06-04T13:39:01.379003912Z",
626+
"onboarding": [
627+
{
628+
"productId": "prod-pagopa",
629+
"tokenId": "afb6c11d-67f8-44f9-b04f-88d47e0d2fc3",
630+
"status": "ACTIVE",
631+
"billing": {
632+
"vatNumber": "94076720658",
633+
"recipientCode": "isticom",
634+
"publicServices": false
635+
},
636+
"createdAt": "2017-12-22T00:00:00Z",
637+
"updatedAt": "2024-02-24T12:56:40.645708542Z",
638+
"_class": "it.pagopa.selfcare.mscore.model.institution.Onboarding",
639+
"origin": "IPA",
640+
"originId": "isticom",
641+
"institutionType": "PA"
642+
},
643+
{
644+
"productId": "prod-io",
645+
"tokenId": "afb6c11d-67f8-44f9-b04f-88d47e0d2fc3",
646+
"status": "ACTIVE",
647+
"billing": {
648+
"vatNumber": "94076720658",
649+
"recipientCode": "isticom",
650+
"publicServices": false
651+
},
652+
"createdAt": "2017-12-22T00:00:00Z",
653+
"updatedAt": "2024-02-24T12:56:40.645708542Z",
654+
"_class": "it.pagopa.selfcare.mscore.model.institution.Onboarding",
655+
"origin": "testorigin",
656+
"originId": "testoriginid",
657+
"institutionType": "PSP"
658+
}
659+
]
660+
},
661+
{
662+
"_id": "c18d0cd5-e8a5-4f40-894b-f1f4252e1294",
663+
"externalId": "12399999890",
664+
"origin": "IPA",
665+
"originId": "isticom",
666+
"description": "NTT Data",
667+
"institutionType": "PT",
668+
"digitalAddress": "test@test.com",
669+
"address": "Via Roma, 1",
670+
"zipCode": "00000",
671+
"taxCode": "12399999890",
672+
"istatCode": "065078",
673+
"imported": false,
674+
"isTest": true,
675+
"createdAt": "2023-11-10T11:45:21.226522053Z",
676+
"_class": "it.pagopa.selfcare.mscore.connector.dao.model.InstitutionEntity",
677+
"updatedAt": "2024-06-04T13:39:01.379003912Z",
678+
"onboarding": [
679+
{
680+
"productId": "prod-pagopa",
681+
"tokenId": "afb6c11d-67f8-44f9-b04f-88d47e0d2fc3",
682+
"status": "ACTIVE",
683+
"billing": {
684+
"vatNumber": "94076720658",
685+
"recipientCode": "isticom",
686+
"publicServices": false
687+
},
688+
"createdAt": "2017-12-22T00:00:00Z",
689+
"updatedAt": "2024-02-24T12:56:40.645708542Z",
690+
"_class": "it.pagopa.selfcare.mscore.model.institution.Onboarding",
691+
"origin": "IPA",
692+
"originId": "isticom",
693+
"institutionType": "PT"
694+
}
695+
]
608696
}
609697
]

0 commit comments

Comments
 (0)