Skip to content

Commit 7c4d5f0

Browse files
committed
Move PN activation APIs to services specs
1 parent 5e42272 commit 7c4d5f0

File tree

6 files changed

+143
-202
lines changed

6 files changed

+143
-202
lines changed

openapi/api_pn.template.yaml

Lines changed: 0 additions & 79 deletions
This file was deleted.

openapi/api_services.template.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,69 @@ paths:
305305
application/json:
306306
schema:
307307
$ref: "#/components/schemas/ProblemJson"
308+
/v1/pn/activation:
309+
get:
310+
summary: Get Piattaforma Notifiche Activation
311+
description: |
312+
Get the Piattaforma Notifiche activation for Special Service "Avvisi di Cortesia"
313+
operationId: getPNActivation
314+
parameters:
315+
- name: isTest
316+
in: query
317+
schema:
318+
type: boolean
319+
responses:
320+
"200":
321+
description: Request created.
322+
content:
323+
'*/*':
324+
schema:
325+
$ref: '#/components/schemas/PNActivation'
326+
"401":
327+
description: Bearer token null or expired.
328+
content: {}
329+
"500":
330+
description: Internal Server Error
331+
content:
332+
'*/*':
333+
schema:
334+
$ref: '#/components/schemas/ProblemJson'
335+
post:
336+
summary: Upsert Piattaforma Notifiche Activation
337+
description: |
338+
Upsert the Piattaforma Notifiche activation for Special Service "Avvisi di Cortesia"
339+
operationId: upsertPNActivation
340+
parameters:
341+
- name: isTest
342+
in: query
343+
schema:
344+
type: boolean
345+
requestBody:
346+
content:
347+
'*/*':
348+
schema:
349+
$ref: '#/components/schemas/PNActivation'
350+
required: true
351+
responses:
352+
"204":
353+
description: Request created.
354+
content: {}
355+
"400":
356+
description: Bad request
357+
content:
358+
'*/*':
359+
schema:
360+
$ref: '#/components/schemas/ProblemJson'
361+
"401":
362+
description: Bearer token null or expired.
363+
content: {}
364+
"500":
365+
description: Internal Server Error
366+
content:
367+
'*/*':
368+
schema:
369+
$ref: '#/components/schemas/ProblemJson'
370+
x-codegen-request-body-name: body
308371
components:
309372
securitySchemes:
310373
Bearer:
@@ -572,3 +635,10 @@ components:
572635
$ref: "https://raw.githubusercontent.com/pagopa/io-functions-commons/openapi-v3-definitions/openapi/definitions_v3.yaml#/ServiceScope"
573636
ProblemJson:
574637
$ref: "https://raw.githubusercontent.com/pagopa/io-functions-commons/openapi-v3-definitions/openapi/definitions_v3.yaml#/ProblemJson"
638+
PNActivation:
639+
required:
640+
- activation_status
641+
type: object
642+
properties:
643+
activation_status:
644+
type: boolean

openapi/generated/api_pn.yaml

Lines changed: 0 additions & 121 deletions
This file was deleted.

openapi/generated/api_services.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,71 @@ paths:
319319
application/json:
320320
schema:
321321
$ref: '#/components/schemas/ProblemJson'
322+
/v1/pn/activation:
323+
get:
324+
summary: Get Piattaforma Notifiche Activation
325+
description: >
326+
Get the Piattaforma Notifiche activation for Special Service "Avvisi di
327+
Cortesia"
328+
operationId: getPNActivation
329+
parameters:
330+
- name: isTest
331+
in: query
332+
schema:
333+
type: boolean
334+
responses:
335+
'200':
336+
description: Request created.
337+
content:
338+
'*/*':
339+
schema:
340+
$ref: '#/components/schemas/PNActivation'
341+
'401':
342+
description: Bearer token null or expired.
343+
content: {}
344+
'500':
345+
description: Internal Server Error
346+
content:
347+
'*/*':
348+
schema:
349+
$ref: '#/components/schemas/ProblemJson'
350+
post:
351+
summary: Upsert Piattaforma Notifiche Activation
352+
description: >
353+
Upsert the Piattaforma Notifiche activation for Special Service "Avvisi
354+
di Cortesia"
355+
operationId: upsertPNActivation
356+
parameters:
357+
- name: isTest
358+
in: query
359+
schema:
360+
type: boolean
361+
requestBody:
362+
content:
363+
'*/*':
364+
schema:
365+
$ref: '#/components/schemas/PNActivation'
366+
required: true
367+
responses:
368+
'204':
369+
description: Request created.
370+
content: {}
371+
'400':
372+
description: Bad request
373+
content:
374+
'*/*':
375+
schema:
376+
$ref: '#/components/schemas/ProblemJson'
377+
'401':
378+
description: Bearer token null or expired.
379+
content: {}
380+
'500':
381+
description: Internal Server Error
382+
content:
383+
'*/*':
384+
schema:
385+
$ref: '#/components/schemas/ProblemJson'
386+
x-codegen-request-body-name: body
322387
components:
323388
securitySchemes:
324389
Bearer:
@@ -800,3 +865,10 @@ components:
800865
problem.
801866
802867
It may or may not yield further information if dereferenced.
868+
PNActivation:
869+
required:
870+
- activation_status
871+
type: object
872+
properties:
873+
activation_status:
874+
type: boolean

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"generate:proxy:third-party-service": "rimraf generated/third-party-service && gen-api-models --api-spec openapi/consumed/api-third-party.yaml --out-dir generated/third-party-service --request-types --response-decoders --client",
5454
"generate:proxy:remote-content-service": "rimraf generated/remote-content-service && gen-api-models --api-spec openapi/consumed/api_remote_content.yaml --out-dir generated/remote-content-service --request-types --response-decoders --client",
5555
"generate:proxy:piattaforma-notifiche": "rimraf generated/piattaforma-notifiche && gen-api-models --api-spec openapi/consumed/api-piattaforma-notifiche.yaml --out-dir generated/piattaforma-notifiche --request-types --response-decoders --client",
56-
"generate:api:piattaforma-notifiche-courtesy": "rimraf generated/api_piattaforma-notifiche-courtesy && gen-api-models --api-spec api_pn.yaml --out-dir generated/api_piattaforma-notifiche-courtesy",
5756
"generate:proxy:piattaforma-notifiche-courtesy": "rimraf generated/piattaforma-notifiche-courtesy && gen-api-models --api-spec https://raw.githubusercontent.com/pagopa/pn-user-attributes/13b91a353f6a219c60d5cdadc023cc18c4157554/docs/openapi/pn-address-book-b2b-external-io-v1.yaml --out-dir generated/piattaforma-notifiche-courtesy --request-types --response-decoders --client",
5857
"generate:test-certs": "sh ./scripts/generate-test-certs.sh certs",
5958
"generate:proxy:api-session": "rimraf generated/session && gen-api-models --api-spec api_session.yaml --out-dir generated/session",

src/controllers/pnController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as O from "fp-ts/Option";
1111
import * as TE from "fp-ts/TaskEither";
1212
import { pipe } from "fp-ts/lib/function";
1313

14-
import { PNActivation } from "../../generated/api_piattaforma-notifiche-courtesy/PNActivation";
14+
import { PNActivation } from "../../generated/services/PNActivation";
1515
import { PNEnvironment } from "../clients/pn-clients";
1616
import { PNService } from "../services/pnService";
1717
import { withUserFromRequest } from "../types/user";

0 commit comments

Comments
 (0)