@thantickets/common 1.0.10 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/build/events/order-cancelled-event.d.ts +10 -0
- package/build/events/order-cancelled-event.js +2 -0
- package/build/events/oreder-created-event.d.ts +15 -0
- package/build/events/oreder-created-event.js +2 -0
- package/build/events/subjects.d.ts +3 -1
- package/build/events/subjects.js +2 -0
- package/build/events/types/order-status.d.ts +6 -0
- package/build/events/types/order-status.js +18 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/package.json +1 -1
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Subjects } from "./subjects";
|
2
|
+
import { OrderStatus } from "./types/order-status";
|
3
|
+
export interface OrderCreatedEvent {
|
4
|
+
subject: Subjects.OrderCreated;
|
5
|
+
data: {
|
6
|
+
id: string;
|
7
|
+
status: OrderStatus;
|
8
|
+
userId: string;
|
9
|
+
expiresAt: string;
|
10
|
+
ticket: {
|
11
|
+
id: string;
|
12
|
+
price: number;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
}
|
package/build/events/subjects.js
CHANGED
@@ -5,4 +5,6 @@ var Subjects;
|
|
5
5
|
(function (Subjects) {
|
6
6
|
Subjects["TicketCreated"] = "ticket:created";
|
7
7
|
Subjects["TicketUpdated"] = "ticket:updated";
|
8
|
+
Subjects["OrderCreated"] = "order:created";
|
9
|
+
Subjects["OrderCancelled"] = "order:cancelled";
|
8
10
|
})(Subjects || (exports.Subjects = Subjects = {}));
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OrderStatus = void 0;
|
4
|
+
var OrderStatus;
|
5
|
+
(function (OrderStatus) {
|
6
|
+
//When the order has been created, but the
|
7
|
+
//ticket it is trying to order has not been reserved
|
8
|
+
OrderStatus["Created"] = "created";
|
9
|
+
//The ticket the order is trying to reserve has already
|
10
|
+
//been reserved, or when the user has cancelled the order
|
11
|
+
//The order expires before payment
|
12
|
+
OrderStatus["Cancelled"] = "cancelled";
|
13
|
+
//The order has successfully reserved the ticket
|
14
|
+
OrderStatus["AwaitingPayment"] = "awaiting:payment";
|
15
|
+
//The order has reserved the ticket and the user has
|
16
|
+
//provide payment successfully
|
17
|
+
OrderStatus["Complete"] = "complete";
|
18
|
+
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
package/build/index.d.ts
CHANGED
@@ -13,3 +13,6 @@ export * from './events/base-publisher';
|
|
13
13
|
export * from './events/subjects';
|
14
14
|
export * from './events/ticket-created-event';
|
15
15
|
export * from './events/ticket-updated-events';
|
16
|
+
export * from './events/types/order-status';
|
17
|
+
export * from './events/oreder-created-event';
|
18
|
+
export * from './events/order-cancelled-event';
|
package/build/index.js
CHANGED
@@ -29,3 +29,6 @@ __exportStar(require("./events/base-publisher"), exports);
|
|
29
29
|
__exportStar(require("./events/subjects"), exports);
|
30
30
|
__exportStar(require("./events/ticket-created-event"), exports);
|
31
31
|
__exportStar(require("./events/ticket-updated-events"), exports);
|
32
|
+
__exportStar(require("./events/types/order-status"), exports);
|
33
|
+
__exportStar(require("./events/oreder-created-event"), exports);
|
34
|
+
__exportStar(require("./events/order-cancelled-event"), exports);
|