@hastehaul/common 2.0.21 → 2.0.23
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.
- package/build/events/base/base-consumer.js +1 -1
- package/build/events/base/base-publisher.js +1 -1
- package/build/events/common/enums/durable-names/customer-dname.d.ts +1 -0
- package/build/events/common/enums/durable-names/customer-dname.js +1 -0
- package/build/events/common/enums/subjects/customer-subjects.d.ts +4 -0
- package/build/events/common/enums/subjects/customer-subjects.js +4 -0
- package/build/events/common/interfaces/customer-events-interfaces/customer-created-notification-event.d.ts +34 -0
- package/build/events/common/interfaces/customer-events-interfaces/customer-created-notification-event.js +2 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
@@ -36,7 +36,7 @@ class NatsPublisher {
|
|
36
36
|
return yield jetStreamClient.publish(this.subject, typeof data === "string" ? this.sc.encode(data) : this.jc.encode(data));
|
37
37
|
}
|
38
38
|
catch (error) {
|
39
|
-
console.error(error
|
39
|
+
console.error(error);
|
40
40
|
throw new Error(`Failed to publish message. Error: [${error.message}]`);
|
41
41
|
}
|
42
42
|
});
|
@@ -14,6 +14,7 @@ export declare enum CustomerDurableName {
|
|
14
14
|
* The durable name for the consumer handling customer created events.
|
15
15
|
*/
|
16
16
|
CustomerCreatedDurablename = "customer-created-consumer",
|
17
|
+
CustomerCreatedNotificationDurablename = "customer-created-notification-consumer",
|
17
18
|
CustomerOtpRequestDurablename = "customer-otp-request",
|
18
19
|
CustomerPaymentMethodRequestDurablename = "customer-paymentmethod-request",
|
19
20
|
CustomerPaymentMethodDurablename = "customer-paymentmethod"
|
@@ -18,6 +18,7 @@ var CustomerDurableName;
|
|
18
18
|
* The durable name for the consumer handling customer created events.
|
19
19
|
*/
|
20
20
|
CustomerDurableName["CustomerCreatedDurablename"] = "customer-created-consumer";
|
21
|
+
CustomerDurableName["CustomerCreatedNotificationDurablename"] = "customer-created-notification-consumer";
|
21
22
|
CustomerDurableName["CustomerOtpRequestDurablename"] = "customer-otp-request";
|
22
23
|
CustomerDurableName["CustomerPaymentMethodRequestDurablename"] = "customer-paymentmethod-request";
|
23
24
|
CustomerDurableName["CustomerPaymentMethodDurablename"] = "customer-paymentmethod";
|
@@ -10,6 +10,10 @@ export declare enum CustomerSubjects {
|
|
10
10
|
* The subject for customer created events.
|
11
11
|
*/
|
12
12
|
CustomerCreated = "customer.created",
|
13
|
+
/**
|
14
|
+
* The subject for customer created events.
|
15
|
+
*/
|
16
|
+
CustomerCreatedNotification = "customer.created-notification",
|
13
17
|
/**
|
14
18
|
* The subject for customer unblocked events.
|
15
19
|
*/
|
@@ -14,6 +14,10 @@ var CustomerSubjects;
|
|
14
14
|
* The subject for customer created events.
|
15
15
|
*/
|
16
16
|
CustomerSubjects["CustomerCreated"] = "customer.created";
|
17
|
+
/**
|
18
|
+
* The subject for customer created events.
|
19
|
+
*/
|
20
|
+
CustomerSubjects["CustomerCreatedNotification"] = "customer.created-notification";
|
17
21
|
/**
|
18
22
|
* The subject for customer unblocked events.
|
19
23
|
*/
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { CustomerDurableName } from '../../enums/durable-names/customer-dname';
|
2
|
+
import { CustomerStream } from '../../enums/streams/customer-stream';
|
3
|
+
import { CustomerSubjects } from '../../enums/subjects/customer-subjects';
|
4
|
+
/**
|
5
|
+
* Interface representing the "Customer Created" event.
|
6
|
+
*
|
7
|
+
* The "CustomerCreatedNotificationEvent" interface defines the structure of an event related to the cancellation of an customer.
|
8
|
+
* Events of this type are used to communicate customer cancellation details across the application.
|
9
|
+
*/
|
10
|
+
export interface CustomerCreatedNotificationEvent {
|
11
|
+
/**
|
12
|
+
* The subject of the event, specifying that it represents an "Customer Created" event.
|
13
|
+
*/
|
14
|
+
subject: CustomerSubjects.CustomerCreatedNotification;
|
15
|
+
/**
|
16
|
+
* The durable name associated with the consumer handling the "Customer Created" event.
|
17
|
+
* This property is optional and may be used to identify the consumer processing the event in a durable manner.
|
18
|
+
*/
|
19
|
+
durableName?: CustomerDurableName.CustomerCreatedNotificationDurablename;
|
20
|
+
/**
|
21
|
+
* The stream to which the event belongs, specifying that it is an "Customer" stream.
|
22
|
+
* Events of different types may be grouped into different streams based on their common characteristics.
|
23
|
+
*/
|
24
|
+
stream: CustomerStream.Customer;
|
25
|
+
/**
|
26
|
+
* The data payload of the "Customer Created" event.
|
27
|
+
* The data payload contains specific details related to the customer cancellation, such as customer ID, version, status, user ID, and trip ID.
|
28
|
+
*/
|
29
|
+
data: {
|
30
|
+
userId: null | string;
|
31
|
+
phoneNumber: string;
|
32
|
+
isNew: boolean;
|
33
|
+
};
|
34
|
+
}
|
package/build/index.d.ts
CHANGED
@@ -134,6 +134,7 @@ export * from "./events/common/interfaces/order-events-interfaces/order-cancelle
|
|
134
134
|
export * from "./events/common/interfaces/order-events-interfaces/order-completed-event";
|
135
135
|
export * from "./events/common/interfaces/order-events-interfaces/order-requested-event";
|
136
136
|
export * from "./events/common/interfaces/customer-events-interfaces/customer-created-event";
|
137
|
+
export * from "./events/common/interfaces/customer-events-interfaces/customer-created-notification-event";
|
137
138
|
export * from "./events/common/interfaces/customer-events-interfaces/customer-unblocked-event";
|
138
139
|
export * from "./events/common/interfaces/customer-events-interfaces/customer-new-event";
|
139
140
|
export * from "./events/common/interfaces/customer-events-interfaces/customer-otp-request-event";
|
package/build/index.js
CHANGED
@@ -166,6 +166,7 @@ __exportStar(require("./events/common/interfaces/order-events-interfaces/order-c
|
|
166
166
|
__exportStar(require("./events/common/interfaces/order-events-interfaces/order-requested-event"), exports);
|
167
167
|
// CUSTOMER EVENTS
|
168
168
|
__exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-created-event"), exports);
|
169
|
+
__exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-created-notification-event"), exports);
|
169
170
|
__exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-unblocked-event"), exports);
|
170
171
|
__exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-new-event"), exports);
|
171
172
|
__exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-otp-request-event"), exports);
|