From 21a7c3154affb9b83248fb1f6d6b86de4be4db6f Mon Sep 17 00:00:00 2001 From: giomella Date: Tue, 24 Sep 2024 17:58:25 +0200 Subject: [PATCH 1/3] [PPANTT-135] defined re schema --- templates/payment-options-re.json | 105 ++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 templates/payment-options-re.json diff --git a/templates/payment-options-re.json b/templates/payment-options-re.json new file mode 100644 index 0000000..b0dd650 --- /dev/null +++ b/templates/payment-options-re.json @@ -0,0 +1,105 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "payment-options-re event schema", + "type": "object", + "properties": { + "body": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "insertedTimestamp": { + "type": "string", + "description": "Data inserimento evento su kafka", + "examples": ["2024-09-23T17:27:04.1696470"] + }, + "eventType": { + "type": "string", + "enum": ["REQ","RES","INTERNAL"] + }, + "organizationId": { + "type": "string", + "description": "Id dell’EC" + }, + "stationId": { + "type": "string", + "description": "Id della stazione" + }, + "pspId": { + "type": "string", + "description": "Id del PSP" + }, + "brokerId": { + "type": "string", + "description": "Id del broker" + }, + "iuv": { + "type": "string" + }, + "noticeNumber": { + "type": "string" + }, + "status": { + "type": "string", + "enum": ["OK","KO"] + }, + "errorStatusDesc": { + "type": "string" + }, + "errorStatusCode": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "payload": { + "type": "string" + }, + "eventTimestamp": { + "type": "string", + "description": "Data e ora dell’evento", + "examples": ["2024-09-23T17:27:04.1690000"] + }, + "version": { + "type": "string", + "description": "Versione dell’evento" + } + }, + "required": [ + "id", + "insertedTimestamp", + "eventType", + "organizationId", + "stationId", + "pspId", + "brokerId", + "iuv", + "noticeNumber", + "status", + "errorStatusDesc", + "errorStatusCode", + "sessionId", + "payload", + "eventTimestamp", + "version" + ] + }, + "properties": { + "type": "object", + "properties": { + "serviceIdentifier": { + "type": "string", + "enum": ["ODP"] + } + }, + "required": [ + "serviceIdentifier" + ] + } + }, + "required": [ + "body", + "properties" + ] +} \ No newline at end of file From e8010a7473d4c129a115b5229c55b9cb16afca91 Mon Sep 17 00:00:00 2001 From: giomella Date: Thu, 26 Sep 2024 12:12:14 +0200 Subject: [PATCH 2/3] [PPANTT-135] updated schema with more info --- templates/payment-options-re.json | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/templates/payment-options-re.json b/templates/payment-options-re.json index b0dd650..d4d9bc2 100644 --- a/templates/payment-options-re.json +++ b/templates/payment-options-re.json @@ -11,7 +11,7 @@ }, "insertedTimestamp": { "type": "string", - "description": "Data inserimento evento su kafka", + "description": "Data inserimento evento su kafka (yyyy-MM-dd'T'HH:mm:ss.SSSXXX)", "examples": ["2024-09-23T17:27:04.1696470"] }, "eventType": { @@ -20,6 +20,8 @@ }, "organizationId": { "type": "string", + "minLength": 11, + "maxLength": 11, "description": "Id dell’EC" }, "stationId": { @@ -28,6 +30,8 @@ }, "pspId": { "type": "string", + "minLength": 11, + "maxLength": 11, "description": "Id del PSP" }, "brokerId": { @@ -35,7 +39,8 @@ "description": "Id del broker" }, "iuv": { - "type": "string" + "type": "string", + "pattern": "^\\d{18}$" }, "noticeNumber": { "type": "string" @@ -48,22 +53,25 @@ "type": "string" }, "errorStatusCode": { - "type": "string" + "type": "string", + "pattern": "^ODP-\\d{3}$" }, "sessionId": { "type": "string" }, "payload": { - "type": "string" + "type": "string", + "description": "Base64 or Gzip encoding" }, "eventTimestamp": { "type": "string", - "description": "Data e ora dell’evento", + "description": "Data e ora dell’evento (yyyy-MM-dd'T'HH:mm:ss.SSSXXX)", "examples": ["2024-09-23T17:27:04.1690000"] }, "version": { - "type": "string", - "description": "Versione dell’evento" + "type": "number", + "description": "Versione dell’evento", + "examples": [1] } }, "required": [ From d6ae33420ac640e963d37ab924bddf557b637de8 Mon Sep 17 00:00:00 2001 From: giomella Date: Thu, 26 Sep 2024 12:32:31 +0200 Subject: [PATCH 3/3] [PPANTT-135] added openapi in status code description --- templates/payment-options-re.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/payment-options-re.json b/templates/payment-options-re.json index d4d9bc2..69e5cb8 100644 --- a/templates/payment-options-re.json +++ b/templates/payment-options-re.json @@ -54,7 +54,8 @@ }, "errorStatusCode": { "type": "string", - "pattern": "^ODP-\\d{3}$" + "pattern": "^ODP-\\d{3}$", + "description": "Qui per riferimenti https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-payment-options-service/main/openapi/openapi.json" }, "sessionId": { "type": "string"