Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Carminepo2 committed Nov 13, 2024
1 parent f77d8fb commit a298109
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions proto/v2/eservice/eservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ message EServiceDescriptorV2 {
optional int64 deprecatedAt = 16;
optional int64 archivedAt = 17;
EServiceAttributesV2 attributes = 18;
repeated DescriptorRejectionReasonV2 rejectionReasons = 19;
}

message EServiceDocumentV2 {
Expand Down
15 changes: 15 additions & 0 deletions proto/v2/eservice/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
36 changes: 36 additions & 0 deletions src/eservice/eventsV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import {
EServiceDraftDescriptorUpdatedV2,
EServiceDescriptorQuotasUpdatedV2,
EServiceDescriptionUpdatedV2,
EServiceDescriptorDelegateSubmittedV2,
EServiceDescriptorDelegatorApprovedV2,
EServiceDescriptorDelegatorRejectedV2,
} from "../gen/v2/eservice/events.js";

export function eServiceEventToBinaryDataV2(
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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<typeof EServiceEventV2>;
1 change: 1 addition & 0 deletions tests/eservice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe("eservice", () => {
verified: [],
declared: [],
},
rejectionReasons: [],
},
],
},
Expand Down

0 comments on commit a298109

Please sign in to comment.