@lucaapp/service-utils 1.53.2 → 1.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const noContentSchema: z.ZodVoid;
|
|
3
|
-
export declare const okResponse: <T>(schema?: ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
3
|
+
export declare const okResponse: <T>(schema?: z.ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
4
4
|
status: 200;
|
|
5
5
|
description: string;
|
|
6
|
-
schema: z.ZodVoid | ZodType<T, z.ZodTypeDef, T>;
|
|
6
|
+
schema: z.ZodVoid | z.ZodType<T, z.ZodTypeDef, T>;
|
|
7
7
|
};
|
|
8
|
-
export declare const createdResponse: <T>(schema?: ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
8
|
+
export declare const createdResponse: <T>(schema?: z.ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
9
9
|
status: 201;
|
|
10
10
|
description: string;
|
|
11
|
-
schema: z.ZodVoid | ZodType<T, z.ZodTypeDef, T>;
|
|
11
|
+
schema: z.ZodVoid | z.ZodType<T, z.ZodTypeDef, T>;
|
|
12
12
|
};
|
|
13
13
|
export declare const noContentResponse: () => {
|
|
14
14
|
status: 204;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface ConsumerNotification {
|
|
2
|
+
consumerId: string;
|
|
3
|
+
type: NotificationType;
|
|
4
|
+
}
|
|
5
|
+
interface ReservationReminder extends ConsumerNotification {
|
|
6
|
+
type: NotificationType.RESERVATION_REMINDER;
|
|
7
|
+
payload: {
|
|
8
|
+
reservationId: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface ReservationResponse extends ConsumerNotification {
|
|
12
|
+
type: NotificationType.RESERVATION_RESPONSE;
|
|
13
|
+
payload: {
|
|
14
|
+
reservationId: string;
|
|
15
|
+
accepted: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare enum NotificationType {
|
|
19
|
+
RESERVATION_REMINDER = "reservationReminder",
|
|
20
|
+
RESERVATION_RESPONSE = "reservationResponse",
|
|
21
|
+
PAYMENT_REFUNDED = "paymentRefunded"
|
|
22
|
+
}
|
|
23
|
+
export type ConsumerPushNotification = ReservationReminder | ReservationResponse;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationType = void 0;
|
|
4
|
+
var NotificationType;
|
|
5
|
+
(function (NotificationType) {
|
|
6
|
+
NotificationType["RESERVATION_REMINDER"] = "reservationReminder";
|
|
7
|
+
NotificationType["RESERVATION_RESPONSE"] = "reservationResponse";
|
|
8
|
+
NotificationType["PAYMENT_REFUNDED"] = "paymentRefunded";
|
|
9
|
+
})(NotificationType = exports.NotificationType || (exports.NotificationType = {}));
|
|
@@ -10,6 +10,7 @@ import { Location } from './events/location';
|
|
|
10
10
|
import { ReservationFee } from './events/reservationFee';
|
|
11
11
|
import { Reservation } from './events/reservation';
|
|
12
12
|
import { ReservationPrePayment } from './events/reservationPrePayment';
|
|
13
|
+
import { ConsumerPushNotification } from './events/consumerPushNotification';
|
|
13
14
|
declare enum KafkaTopic {
|
|
14
15
|
PAYMENTS = "payments",
|
|
15
16
|
CONSUMERS = "consumers",
|
|
@@ -23,6 +24,7 @@ declare enum KafkaTopic {
|
|
|
23
24
|
RESERVATIONS = "reservations",
|
|
24
25
|
RESERVATION_FEES = "reservation_fees",
|
|
25
26
|
RESERVATION_PRE_PAYMENT = "reservation_pre_payment",
|
|
27
|
+
CONSUMER_PUSH_NOTIFICATION = "consumer_push_notifications",
|
|
26
28
|
WS_EVENT_backend = "wsevent_backend",
|
|
27
29
|
WS_EVENT_backend_pay = "wsevent_backend-pay",
|
|
28
30
|
WS_EVENT_backend_pos = "wsevent_backend-pos"
|
|
@@ -40,6 +42,7 @@ type MessageFormats = {
|
|
|
40
42
|
[KafkaTopic.RESERVATIONS]: Reservation;
|
|
41
43
|
[KafkaTopic.RESERVATION_FEES]: ReservationFee;
|
|
42
44
|
[KafkaTopic.RESERVATION_PRE_PAYMENT]: ReservationPrePayment;
|
|
45
|
+
[KafkaTopic.CONSUMER_PUSH_NOTIFICATION]: ConsumerPushNotification;
|
|
43
46
|
[KafkaTopic.WS_EVENT_backend]: WsEvent;
|
|
44
47
|
[KafkaTopic.WS_EVENT_backend_pay]: WsEvent;
|
|
45
48
|
[KafkaTopic.WS_EVENT_backend_pos]: WsEvent;
|
|
@@ -57,6 +60,7 @@ declare const MessageIssuer: {
|
|
|
57
60
|
reservations: Service;
|
|
58
61
|
reservation_fees: Service;
|
|
59
62
|
reservation_pre_payment: Service;
|
|
63
|
+
consumer_push_notifications: Service;
|
|
60
64
|
wsevent_backend: Service;
|
|
61
65
|
"wsevent_backend-pay": Service;
|
|
62
66
|
"wsevent_backend-pos": Service;
|
package/dist/lib/kafka/events.js
CHANGED
|
@@ -16,6 +16,7 @@ var KafkaTopic;
|
|
|
16
16
|
KafkaTopic["RESERVATIONS"] = "reservations";
|
|
17
17
|
KafkaTopic["RESERVATION_FEES"] = "reservation_fees";
|
|
18
18
|
KafkaTopic["RESERVATION_PRE_PAYMENT"] = "reservation_pre_payment";
|
|
19
|
+
KafkaTopic["CONSUMER_PUSH_NOTIFICATION"] = "consumer_push_notifications";
|
|
19
20
|
KafkaTopic["WS_EVENT_backend"] = "wsevent_backend";
|
|
20
21
|
KafkaTopic["WS_EVENT_backend_pay"] = "wsevent_backend-pay";
|
|
21
22
|
KafkaTopic["WS_EVENT_backend_pos"] = "wsevent_backend-pos";
|
|
@@ -34,6 +35,7 @@ const MessageIssuer = {
|
|
|
34
35
|
[KafkaTopic.RESERVATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
35
36
|
[KafkaTopic.RESERVATION_FEES]: serviceIdentity_1.Service.BACKEND_PAY,
|
|
36
37
|
[KafkaTopic.RESERVATION_PRE_PAYMENT]: serviceIdentity_1.Service.BACKEND_PAY,
|
|
38
|
+
[KafkaTopic.CONSUMER_PUSH_NOTIFICATION]: serviceIdentity_1.Service.BACKEND,
|
|
37
39
|
[KafkaTopic.WS_EVENT_backend]: serviceIdentity_1.Service.BACKEND,
|
|
38
40
|
[KafkaTopic.WS_EVENT_backend_pay]: serviceIdentity_1.Service.BACKEND_PAY,
|
|
39
41
|
[KafkaTopic.WS_EVENT_backend_pos]: serviceIdentity_1.Service.BACKEND_POS,
|