From a298109e0b586ece253aff80d71c6a39dcdec2f0 Mon Sep 17 00:00:00 2001 From: Carmine Porricelli Date: Wed, 13 Nov 2024 14:26:41 +0100 Subject: [PATCH] Bump version --- package.json | 2 +- proto/v2/eservice/eservice.proto | 1 + proto/v2/eservice/events.proto | 15 +++++++++++++ src/eservice/eventsV2.ts | 36 ++++++++++++++++++++++++++++++++ tests/eservice.test.ts | 1 + 5 files changed, 54 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fbc62ee..7f20580 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pagopa/interop-outbound-models", - "version": "1.0.10", + "version": "1.0.11a", "description": "PagoPA Interoperability outbound models", "main": "dist", "type": "module", diff --git a/proto/v2/eservice/eservice.proto b/proto/v2/eservice/eservice.proto index 38d56ae..3bfd03a 100644 --- a/proto/v2/eservice/eservice.proto +++ b/proto/v2/eservice/eservice.proto @@ -53,6 +53,7 @@ message EServiceDescriptorV2 { optional int64 deprecatedAt = 16; optional int64 archivedAt = 17; EServiceAttributesV2 attributes = 18; + repeated DescriptorRejectionReasonV2 rejectionReasons = 19; } message EServiceDocumentV2 { diff --git a/proto/v2/eservice/events.proto b/proto/v2/eservice/events.proto index 0b7c97a..c8f4895 100644 --- a/proto/v2/eservice/events.proto +++ b/proto/v2/eservice/events.proto @@ -102,3 +102,18 @@ message EServiceDescriptorDocumentDeletedV2 { message EServiceDescriptionUpdatedV2 { EServiceV2 eservice = 1; } + +message EServiceDescriptorDelegateSubmittedV2 { + string descriptorId = 1; + EServiceV2 eservice = 2; +} + +message EServiceDescriptorDelegatorApprovedV2 { + string descriptorId = 1; + EServiceV2 eservice = 2; +} + +message EServiceDescriptorDelegatorRejectedV2 { + string descriptorId = 1; + EServiceV2 eservice = 2; +} \ No newline at end of file diff --git a/src/eservice/eventsV2.ts b/src/eservice/eventsV2.ts index b21e571..559160b 100644 --- a/src/eservice/eventsV2.ts +++ b/src/eservice/eventsV2.ts @@ -21,6 +21,9 @@ import { EServiceDraftDescriptorUpdatedV2, EServiceDescriptorQuotasUpdatedV2, EServiceDescriptionUpdatedV2, + EServiceDescriptorDelegateSubmittedV2, + EServiceDescriptorDelegatorApprovedV2, + EServiceDescriptorDelegatorRejectedV2, } from "../gen/v2/eservice/events.js"; export function eServiceEventToBinaryDataV2( @@ -84,6 +87,15 @@ export function eServiceEventToBinaryDataV2( .with({ type: "EServiceDescriptionUpdated" }, ({ data }) => EServiceDescriptionUpdatedV2.toBinary(data) ) + .with({ type: "EServiceDescriptorDelegateSubmitted" }, ({ data }) => + EServiceDescriptorDelegateSubmittedV2.toBinary(data) + ) + .with({ type: "EServiceDescriptorDelegatorApproved" }, ({ data }) => + EServiceDescriptorDelegatorApprovedV2.toBinary(data) + ) + .with({ type: "EServiceDescriptorDelegatorRejected" }, ({ data }) => + EServiceDescriptorDelegatorRejectedV2.toBinary(data) + ) .exhaustive(); } @@ -240,6 +252,30 @@ export const EServiceEventV2 = z.discriminatedUnion("type", [ version: z.number(), timestamp: z.coerce.date(), }), + z.object({ + event_version: z.literal(2), + type: z.literal("EServiceDescriptorDelegateSubmitted"), + data: protobufDecoder(EServiceDescriptorDelegateSubmittedV2), + stream_id: z.string(), + version: z.number(), + timestamp: z.coerce.date(), + }), + z.object({ + event_version: z.literal(2), + type: z.literal("EServiceDescriptorDelegatorApproved"), + data: protobufDecoder(EServiceDescriptorDelegatorApprovedV2), + stream_id: z.string(), + version: z.number(), + timestamp: z.coerce.date(), + }), + z.object({ + event_version: z.literal(2), + type: z.literal("EServiceDescriptorDelegatorRejected"), + data: protobufDecoder(EServiceDescriptorDelegatorRejectedV2), + stream_id: z.string(), + version: z.number(), + timestamp: z.coerce.date(), + }), ]); export type EServiceEventV2 = z.infer; diff --git a/tests/eservice.test.ts b/tests/eservice.test.ts index b210641..0ed683a 100644 --- a/tests/eservice.test.ts +++ b/tests/eservice.test.ts @@ -42,6 +42,7 @@ describe("eservice", () => { verified: [], declared: [], }, + rejectionReasons: [], }, ], },