@hastehaul/common 2.0.22 → 2.0.24

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.
Files changed (26) hide show
  1. package/build/events/common/enums/durable-names/customer-dname.d.ts +1 -0
  2. package/build/events/common/enums/durable-names/customer-dname.js +1 -0
  3. package/build/events/common/enums/durable-names/customer-system-dname.d.ts +7 -0
  4. package/build/events/common/enums/durable-names/customer-system-dname.js +11 -0
  5. package/build/events/common/enums/durable-names/index.d.ts +2 -1
  6. package/build/events/common/enums/streams/customer-system-stream.d.ts +9 -0
  7. package/build/events/common/enums/streams/customer-system-stream.js +13 -0
  8. package/build/events/common/enums/streams/index.d.ts +2 -1
  9. package/build/events/common/enums/subjects/customer-subjects.d.ts +4 -0
  10. package/build/events/common/enums/subjects/customer-subjects.js +4 -0
  11. package/build/events/common/enums/subjects/customer-system-subjects.d.ts +9 -0
  12. package/build/events/common/enums/subjects/customer-system-subjects.js +13 -0
  13. package/build/events/common/enums/subjects/index.d.ts +2 -1
  14. package/build/events/common/enums/subjects/main-subjects.d.ts +2 -1
  15. package/build/events/common/enums/subjects/main-subjects.js +1 -0
  16. package/build/events/common/interfaces/customer-events-interfaces/customer-created-notification-event.d.ts +34 -0
  17. package/build/events/common/interfaces/customer-events-interfaces/customer-created-notification-event.js +2 -0
  18. package/build/events/common/interfaces/customer-system-events-interfaces/customer-system-updated-customer-service-event.d.ts +34 -0
  19. package/build/events/common/interfaces/customer-system-events-interfaces/customer-system-updated-customer-service-event.js +2 -0
  20. package/build/events/common/interfaces/customer-system-events-interfaces/customer-system-updated-payment-service-event.d.ts +34 -0
  21. package/build/events/common/interfaces/customer-system-events-interfaces/customer-system-updated-payment-service-event.js +2 -0
  22. package/build/events/common/interfaces/stream-interfaces/customer-system-stream-interface.d.ts +23 -0
  23. package/build/events/common/interfaces/stream-interfaces/customer-system-stream-interface.js +2 -0
  24. package/build/index.d.ts +6 -0
  25. package/build/index.js +8 -0
  26. package/package.json +1 -1
@@ -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";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Enum representing durable names for consumers associated with different customer events.
3
+ */
4
+ export declare enum CustomerSystemDurableName {
5
+ CustomerSystemUpdateCustomerServiceDurablename = "customer-system-update_customer-service-consumer",
6
+ CustomerSystemUpdatePaymentServiceDurablename = "customer-system-update_payment-service-consumer"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerSystemDurableName = void 0;
4
+ /**
5
+ * Enum representing durable names for consumers associated with different customer events.
6
+ */
7
+ var CustomerSystemDurableName;
8
+ (function (CustomerSystemDurableName) {
9
+ CustomerSystemDurableName["CustomerSystemUpdateCustomerServiceDurablename"] = "customer-system-update_customer-service-consumer";
10
+ CustomerSystemDurableName["CustomerSystemUpdatePaymentServiceDurablename"] = "customer-system-update_payment-service-consumer";
11
+ })(CustomerSystemDurableName || (exports.CustomerSystemDurableName = CustomerSystemDurableName = {}));
@@ -1,9 +1,10 @@
1
1
  import { PaymentDurableName } from "./payment-dname";
2
2
  import { OrderDurableName } from "./order-dname";
3
3
  import { CustomerDurableName } from './customer-dname';
4
+ import { CustomerSystemDurableName } from "./customer-system-dname";
4
5
  /**
5
6
  * Type alias representing a durable name that can be associated with different event consumers.
6
7
  *
7
8
  * The `DurableName` type can be one of the durable names defined in `OrderDurableName` or `PaymentDurableName`.
8
9
  */
9
- export type DurableName = OrderDurableName | PaymentDurableName | CustomerDurableName;
10
+ export type DurableName = OrderDurableName | PaymentDurableName | CustomerDurableName | CustomerSystemDurableName;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Enum representing the name of the JetStream stream used for handling customer events.
3
+ */
4
+ export declare enum CustomerSystemStream {
5
+ /**
6
+ * The name of the JetStream stream for customer events.
7
+ */
8
+ CustomerSystem = "CUSTOMER-SYSTEM"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerSystemStream = void 0;
4
+ /**
5
+ * Enum representing the name of the JetStream stream used for handling customer events.
6
+ */
7
+ var CustomerSystemStream;
8
+ (function (CustomerSystemStream) {
9
+ /**
10
+ * The name of the JetStream stream for customer events.
11
+ */
12
+ CustomerSystemStream["CustomerSystem"] = "CUSTOMER-SYSTEM";
13
+ })(CustomerSystemStream || (exports.CustomerSystemStream = CustomerSystemStream = {}));
@@ -1,9 +1,10 @@
1
1
  import { PaymentStream } from './payment-stream';
2
2
  import { OrderStream } from './order-stream';
3
3
  import { CustomerStream } from './customer-stream';
4
+ import { CustomerSystemStream } from './customer-system-stream';
4
5
  /**
5
6
  * Type alias representing a JetStream stream that can handle different event types.
6
7
  *
7
8
  * The `Streams` type can be one of the streams defined in `OrderStream` or `PaymentStream`.
8
9
  */
9
- export type Streams = OrderStream | PaymentStream | CustomerStream;
10
+ export type Streams = OrderStream | PaymentStream | CustomerStream | CustomerSystemStream;
@@ -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,9 @@
1
+ /**
2
+ * Enum representing the subjects for different customer system events.
3
+ */
4
+ export declare enum CustomerSystemSubjects {
5
+ CustomerSystemUpdateCustomerService = "customer-system.update-customer-service",
6
+ CustomerSystemUpdatePaymentService = "customer-system.updadte-notification-service",
7
+ CustomerSystemUpdateDriverService = "customer-system.updadte-driver-service",
8
+ CustomerSystemUpdateDiscountService = "customer-system.updadte-discount-service"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerSystemSubjects = void 0;
4
+ /**
5
+ * Enum representing the subjects for different customer system events.
6
+ */
7
+ var CustomerSystemSubjects;
8
+ (function (CustomerSystemSubjects) {
9
+ CustomerSystemSubjects["CustomerSystemUpdateCustomerService"] = "customer-system.update-customer-service";
10
+ CustomerSystemSubjects["CustomerSystemUpdatePaymentService"] = "customer-system.updadte-notification-service";
11
+ CustomerSystemSubjects["CustomerSystemUpdateDriverService"] = "customer-system.updadte-driver-service";
12
+ CustomerSystemSubjects["CustomerSystemUpdateDiscountService"] = "customer-system.updadte-discount-service";
13
+ })(CustomerSystemSubjects || (exports.CustomerSystemSubjects = CustomerSystemSubjects = {}));
@@ -1,9 +1,10 @@
1
1
  import { PaymentSubjects } from './payment-subjects';
2
2
  import { OrderSubjects } from './order-subjects';
3
3
  import { CustomerSubjects } from './customer-subjects';
4
+ import { CustomerSystemSubjects } from "./customer-system-subjects";
4
5
  /**
5
6
  * Type alias representing the subjects for different event types.
6
7
  *
7
8
  * The `Subjects` type can be one of the subjects defined in `OrderSubjects` or `PaymentSubjects`.
8
9
  */
9
- export type Subjects = OrderSubjects | PaymentSubjects | CustomerSubjects;
10
+ export type Subjects = OrderSubjects | PaymentSubjects | CustomerSubjects | CustomerSystemSubjects;
@@ -5,7 +5,8 @@ export declare enum MainSubjects {
5
5
  ORDER = "order.*",
6
6
  PAYMENT = "payment.*",
7
7
  ETA = "eta.*",
8
- CUSTOMER = "customer.*"
8
+ CUSTOMER = "customer.*",
9
+ CUSTOMER_SYSYTEM = "customer-system.*"
9
10
  }
10
11
  /**
11
12
  * Type utility to concatenate two strings into a valid subject format.
@@ -10,6 +10,7 @@ var MainSubjects;
10
10
  MainSubjects["PAYMENT"] = "payment.*";
11
11
  MainSubjects["ETA"] = "eta.*";
12
12
  MainSubjects["CUSTOMER"] = "customer.*";
13
+ MainSubjects["CUSTOMER_SYSYTEM"] = "customer-system.*";
13
14
  })(MainSubjects || (exports.MainSubjects = MainSubjects = {}));
14
15
  /**
15
16
  * Utility function to spread enum values into an array of strings.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { CustomerSystemDurableName } from '../../enums/durable-names/customer-system-dname';
2
+ import { CustomerSystemStream } from '../../enums/streams/customer-system-stream';
3
+ import { CustomerSystemSubjects } from '../../enums/subjects/customer-system-subjects';
4
+ /**
5
+ * Interface representing the "Customer Updated Customer Service" event.
6
+ *
7
+ * The "CustomerUpdated Customer ServiceEvent" 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 CustomerSystemUpdatedCustomerServiceEvent {
11
+ /**
12
+ * The subject of the event, specifying that it represents an "Customer Updated Customer Service" event.
13
+ */
14
+ subject: CustomerSystemSubjects.CustomerSystemUpdateCustomerService;
15
+ /**
16
+ * The durable name associated with the consumer handling the "Customer Updated Customer Service" event.
17
+ * This property is optional and may be used to identify the consumer processing the event in a durable manner.
18
+ */
19
+ durableName?: CustomerSystemDurableName.CustomerSystemUpdateCustomerServiceDurablename;
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: CustomerSystemStream.CustomerSystem;
25
+ /**
26
+ * The data payload of the "Customer Updated Customer Service" event.
27
+ * The data payload contains specific details related to the customer cancellation, such as key, value and version
28
+ */
29
+ data: {
30
+ key: string;
31
+ value: string;
32
+ version: number;
33
+ };
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { CustomerSystemDurableName } from '../../enums/durable-names/customer-system-dname';
2
+ import { CustomerSystemStream } from '../../enums/streams/customer-system-stream';
3
+ import { CustomerSystemSubjects } from '../../enums/subjects/customer-system-subjects';
4
+ /**
5
+ * Interface representing the "Customer Updated Payment Service" event.
6
+ *
7
+ * The "CustomerUpdated Payment ServiceEvent" 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 CustomerSystemUpdatedPaymentServiceEvent {
11
+ /**
12
+ * The subject of the event, specifying that it represents an "Customer Updated Payment Service" event.
13
+ */
14
+ subject: CustomerSystemSubjects.CustomerSystemUpdatePaymentService;
15
+ /**
16
+ * The durable name associated with the consumer handling the "Customer Updated Payment Service" event.
17
+ * This property is optional and may be used to identify the consumer processing the event in a durable manner.
18
+ */
19
+ durableName?: CustomerSystemDurableName.CustomerSystemUpdatePaymentServiceDurablename;
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: CustomerSystemStream.CustomerSystem;
25
+ /**
26
+ * The data payload of the "Customer Updated Payment Service" event.
27
+ * The data payload contains specific details related to the customer cancellation, such as key, value and version
28
+ */
29
+ data: {
30
+ key: string;
31
+ value: string;
32
+ version: number;
33
+ };
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { CustomerSystemStream } from "../../enums/streams/customer-system-stream";
2
+ import { MainSubjects } from "../../enums/subjects/main-subjects";
3
+ /**
4
+ * Interface representing an event associated with the "Customer System" stream.
5
+ *
6
+ * The "CustomerSystemStreamEvent" interface defines the structure of an event related to the "Customer System" stream.
7
+ * Events of this type are used to communicate specific details related to the "Customer System" stream.
8
+ */
9
+ export interface CustomerSystemStreamEvent {
10
+ /**
11
+ * The subject of the event, specifying that it is associated with the "Customer System" stream.
12
+ *
13
+ * In this case, the subject is derived from the "MainSubjects.CUSTOMER_SYSYTEM" enum value, indicating that this event is related to customers system.
14
+ */
15
+ subject: MainSubjects.CUSTOMER_SYSYTEM;
16
+ /**
17
+ * The stream to which the event belongs, specifying that it is an "Customer System" stream.
18
+ *
19
+ * Events of different types may be grouped into different streams based on their common characteristics.
20
+ * In this case, the stream is of type "CustomerSystemStream.CustomerSystem", indicating that it is an event related to the "Customer System" stream.
21
+ */
22
+ stream: CustomerSystemStream.CustomerSystem;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/build/index.d.ts CHANGED
@@ -134,11 +134,14 @@ 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";
140
141
  export * from "./events/common/interfaces/customer-events-interfaces/customer-paymentmethod-request";
141
142
  export * from "./events/common/interfaces/customer-events-interfaces/customer-paymentmethod";
143
+ export * from "./events/common/interfaces/customer-system-events-interfaces/customer-system-updated-customer-service-event";
144
+ export * from "./events/common/interfaces/customer-system-events-interfaces/customer-system-updated-payment-service-event";
142
145
  /**
143
146
  * Re-exports all the interfaces related to streams from the "stream-interfaces" file.
144
147
  *
@@ -156,6 +159,7 @@ export * from "./events/common/enums/durable-names";
156
159
  export * from "./events/common/enums/durable-names/customer-dname";
157
160
  export * from "./events/common/enums/durable-names/order-dname";
158
161
  export * from "./events/common/enums/durable-names/payment-dname";
162
+ export * from "./events/common/enums/durable-names/customer-system-dname";
159
163
  /**
160
164
  * Re-exports the type related to streams from the "streams" file.
161
165
  *
@@ -165,6 +169,7 @@ export * from "./events/common/enums/streams";
165
169
  export * from "./events/common/enums/streams/order-stream";
166
170
  export * from "./events/common/enums/streams/payment-stream";
167
171
  export * from "./events/common/enums/streams/customer-stream";
172
+ export * from "./events/common/enums/streams/customer-system-stream";
168
173
  /**
169
174
  * Re-exports the type related to subjects from the "subjects" file.
170
175
  *
@@ -175,3 +180,4 @@ export * from "./events/common/enums/subjects/order-subjects";
175
180
  export * from "./events/common/enums/subjects/payment-subjects";
176
181
  export * from "./events/common/enums/subjects/main-subjects";
177
182
  export * from "./events/common/enums/subjects/customer-subjects";
183
+ export * from "./events/common/enums/subjects/customer-system-subjects";
package/build/index.js CHANGED
@@ -166,11 +166,16 @@ __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);
172
173
  __exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-paymentmethod-request"), exports);
173
174
  __exportStar(require("./events/common/interfaces/customer-events-interfaces/customer-paymentmethod"), exports);
175
+ // CUSTOMER SYSTEM EVENTS
176
+ __exportStar(require("./events/common/interfaces/customer-system-events-interfaces/customer-system-updated-customer-service-event"), exports);
177
+ __exportStar(require("./events/common/interfaces/customer-system-events-interfaces/customer-system-updated-payment-service-event"), exports);
178
+ // PAYMENT EVENTS
174
179
  //! Interfaces related to payment events are currently commented out using '//'.
175
180
  // export * from "./payment-event-interfaces";
176
181
  /**
@@ -191,6 +196,7 @@ __exportStar(require("./events/common/enums/durable-names"), exports);
191
196
  __exportStar(require("./events/common/enums/durable-names/customer-dname"), exports);
192
197
  __exportStar(require("./events/common/enums/durable-names/order-dname"), exports);
193
198
  __exportStar(require("./events/common/enums/durable-names/payment-dname"), exports);
199
+ __exportStar(require("./events/common/enums/durable-names/customer-system-dname"), exports);
194
200
  /**
195
201
  * Re-exports the type related to streams from the "streams" file.
196
202
  *
@@ -200,6 +206,7 @@ __exportStar(require("./events/common/enums/streams"), exports);
200
206
  __exportStar(require("./events/common/enums/streams/order-stream"), exports);
201
207
  __exportStar(require("./events/common/enums/streams/payment-stream"), exports);
202
208
  __exportStar(require("./events/common/enums/streams/customer-stream"), exports);
209
+ __exportStar(require("./events/common/enums/streams/customer-system-stream"), exports);
203
210
  /**
204
211
  * Re-exports the type related to subjects from the "subjects" file.
205
212
  *
@@ -210,3 +217,4 @@ __exportStar(require("./events/common/enums/subjects/order-subjects"), exports);
210
217
  __exportStar(require("./events/common/enums/subjects/payment-subjects"), exports);
211
218
  __exportStar(require("./events/common/enums/subjects/main-subjects"), exports);
212
219
  __exportStar(require("./events/common/enums/subjects/customer-subjects"), exports);
220
+ __exportStar(require("./events/common/enums/subjects/customer-system-subjects"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hastehaul/common",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",