Skip to content

Commit

Permalink
Added TenantDelegatedProducerFeatureRemoved event
Browse files Browse the repository at this point in the history
  • Loading branch information
Carminepo2 committed Nov 11, 2024
1 parent dd0ddc1 commit aff4987
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proto/v2/tenant/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ message TenantDelegatedProducerFeatureAddedV2 {
TenantV2 tenant = 1;
}

message TenantDelegatedProducerFeatureRemovedV2 {
TenantV2 tenant = 1;
}
12 changes: 12 additions & 0 deletions src/tenant/eventsV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
TenantKindUpdatedV2,
MaintenanceTenantPromotedToCertifierV2,
TenantDelegatedProducerFeatureAddedV2,
TenantDelegatedProducerFeatureRemovedV2,
} from "../gen/v2/tenant/events.js";
import { protobufDecoder } from "../utils.js";

Expand Down Expand Up @@ -62,6 +63,9 @@ export function tenantEventToBinaryDataV2(event: TenantEventV2): Uint8Array {
.with({ type: "TenantDelegatedProducerFeatureAdded" }, ({ data }) =>
TenantDelegatedProducerFeatureAddedV2.toBinary(data)
)
.with({ type: "TenantDelegatedProducerFeatureRemoved" }, ({ data }) =>
TenantDelegatedProducerFeatureRemovedV2.toBinary(data)
)
.exhaustive();
}

Expand Down Expand Up @@ -178,6 +182,14 @@ export const TenantEventV2 = z.discriminatedUnion("type", [
version: z.number(),
timestamp: z.coerce.date(),
}),
z.object({
event_version: z.literal(2),
type: z.literal("TenantDelegatedProducerFeatureRemoved"),
data: protobufDecoder(TenantDelegatedProducerFeatureRemovedV2),
stream_id: z.string(),
version: z.number(),
timestamp: z.coerce.date(),
}),
]);

export type TenantEventV2 = z.infer<typeof TenantEventV2>;

0 comments on commit aff4987

Please sign in to comment.