wedance-shared 1.0.7 → 1.0.8
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/dist/ticket.d.ts +33 -1
- package/package.json +1 -1
- package/src/ticket.ts +58 -25
package/dist/ticket.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TicketStatus =
|
|
1
|
+
export type TicketStatus = "Confirmed" | "Cancelled" | "Refunded" | "Expired" | "Used" | "Transferred";
|
|
2
2
|
export type Ticket = {
|
|
3
3
|
id: string;
|
|
4
4
|
eventId: string;
|
|
@@ -14,9 +14,41 @@ export type Ticket = {
|
|
|
14
14
|
isRefundable: boolean;
|
|
15
15
|
isTransferable: boolean;
|
|
16
16
|
paymentId: string;
|
|
17
|
+
appliedCoupon?: {
|
|
18
|
+
code: string;
|
|
19
|
+
discountAmount: number;
|
|
20
|
+
discountType: "fixed" | "percentage";
|
|
21
|
+
};
|
|
22
|
+
originalPrice: number;
|
|
23
|
+
orderNumber: string;
|
|
24
|
+
checkedInAt?: string;
|
|
25
|
+
notes?: string;
|
|
26
|
+
transferredAt?: string;
|
|
27
|
+
refundedAt?: string;
|
|
28
|
+
};
|
|
29
|
+
export type CouponCode = {
|
|
30
|
+
code: string;
|
|
31
|
+
discountAmount: number;
|
|
32
|
+
discountType: "fixed" | "percentage";
|
|
33
|
+
minPurchaseQuantity?: number;
|
|
34
|
+
maxUsage?: number;
|
|
35
|
+
expiryDate?: string;
|
|
17
36
|
};
|
|
18
37
|
export type EventTicket = {
|
|
19
38
|
id: string;
|
|
20
39
|
price: number;
|
|
21
40
|
ticketType: string;
|
|
41
|
+
eventId: string;
|
|
42
|
+
quantity: number;
|
|
43
|
+
soldQuantity: number;
|
|
44
|
+
coupons?: CouponCode[];
|
|
45
|
+
name: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
maxQuantityPerPurchase?: number;
|
|
48
|
+
minQuantityPerPurchase?: number;
|
|
49
|
+
saleStartDate?: string;
|
|
50
|
+
saleEndDate?: string;
|
|
51
|
+
isEarlyBird?: boolean;
|
|
52
|
+
isTransferable: boolean;
|
|
53
|
+
isRefundable: boolean;
|
|
22
54
|
};
|
package/package.json
CHANGED
package/src/ticket.ts
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
1
|
export type TicketStatus =
|
|
2
|
-
|
|
|
3
|
-
|
|
|
4
|
-
|
|
|
5
|
-
|
|
|
6
|
-
|
|
|
7
|
-
|
|
|
2
|
+
| "Confirmed"
|
|
3
|
+
| "Cancelled"
|
|
4
|
+
| "Refunded"
|
|
5
|
+
| "Expired"
|
|
6
|
+
| "Used"
|
|
7
|
+
| "Transferred";
|
|
8
8
|
|
|
9
9
|
export type Ticket = {
|
|
10
|
-
id: string
|
|
11
|
-
eventId: string
|
|
12
|
-
eventName: string
|
|
13
|
-
eventDate: string
|
|
14
|
-
purchaseDate: string
|
|
15
|
-
quantity: number
|
|
16
|
-
ticketPrice: number
|
|
17
|
-
ticketType: string
|
|
18
|
-
previousOwner: string[]
|
|
19
|
-
owner: string
|
|
20
|
-
status: TicketStatus
|
|
21
|
-
isRefundable: boolean
|
|
22
|
-
isTransferable: boolean
|
|
23
|
-
paymentId: string
|
|
24
|
-
|
|
10
|
+
id: string;
|
|
11
|
+
eventId: string;
|
|
12
|
+
eventName: string;
|
|
13
|
+
eventDate: string;
|
|
14
|
+
purchaseDate: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
ticketPrice: number;
|
|
17
|
+
ticketType: string;
|
|
18
|
+
previousOwner: string[];
|
|
19
|
+
owner: string;
|
|
20
|
+
status: TicketStatus;
|
|
21
|
+
isRefundable: boolean;
|
|
22
|
+
isTransferable: boolean;
|
|
23
|
+
paymentId: string;
|
|
24
|
+
appliedCoupon?: {
|
|
25
|
+
code: string;
|
|
26
|
+
discountAmount: number;
|
|
27
|
+
discountType: "fixed" | "percentage";
|
|
28
|
+
};
|
|
29
|
+
originalPrice: number;
|
|
30
|
+
orderNumber: string;
|
|
31
|
+
checkedInAt?: string;
|
|
32
|
+
notes?: string;
|
|
33
|
+
transferredAt?: string;
|
|
34
|
+
refundedAt?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type CouponCode = {
|
|
38
|
+
code: string;
|
|
39
|
+
discountAmount: number; // Amount to subtract from original price
|
|
40
|
+
discountType: "fixed" | "percentage"; // Whether it's a fixed amount or percentage
|
|
41
|
+
minPurchaseQuantity?: number; // Minimum tickets required for this specific code
|
|
42
|
+
maxUsage?: number; // Maximum number of times this code can be used
|
|
43
|
+
expiryDate?: string; // Optional expiry date for the coupon
|
|
44
|
+
};
|
|
25
45
|
|
|
26
46
|
export type EventTicket = {
|
|
27
|
-
id: string
|
|
28
|
-
price: number
|
|
29
|
-
ticketType: string
|
|
30
|
-
|
|
47
|
+
id: string;
|
|
48
|
+
price: number;
|
|
49
|
+
ticketType: string;
|
|
50
|
+
eventId: string;
|
|
51
|
+
quantity: number; // Total tickets allocated
|
|
52
|
+
soldQuantity: number; // Number of tickets sold
|
|
53
|
+
coupons?: CouponCode[];
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
maxQuantityPerPurchase?: number;
|
|
57
|
+
minQuantityPerPurchase?: number;
|
|
58
|
+
saleStartDate?: string;
|
|
59
|
+
saleEndDate?: string;
|
|
60
|
+
isEarlyBird?: boolean;
|
|
61
|
+
isTransferable: boolean;
|
|
62
|
+
isRefundable: boolean;
|
|
63
|
+
};
|