wedance-shared 1.0.38 → 1.0.39

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.
@@ -30,6 +30,7 @@ export type ImageData = {
30
30
  * */
31
31
  export type EventData = {
32
32
  id: string;
33
+ externalId: string | null | undefined;
33
34
  title: string;
34
35
  from: string;
35
36
  until: string;
@@ -12,11 +12,17 @@ export type Ticket = {
12
12
  eventId: string;
13
13
  eventName: string;
14
14
  eventDate: string;
15
+ /**
16
+ * Date of purchase in ISO format
17
+ */
15
18
  purchaseDate: string;
16
19
  quantity: number;
17
- ticketPrice: number;
20
+ paidAmount: MonetaryAmount;
21
+ originalAmount: MonetaryAmount;
18
22
  ticketType: string;
19
- previousOwner: string[];
23
+ /**
24
+ * ID of the user who originally purchased the ticket
25
+ */
20
26
  originalOwnerId: string;
21
27
  /**
22
28
  * ID of the user who owns the ticket
@@ -31,14 +37,24 @@ export type Ticket = {
31
37
  discountAmount: number;
32
38
  discountType: "fixed" | "percentage";
33
39
  };
34
- originalPrice: number;
35
- orderNumber: string;
36
40
  checkedInAt?: string;
37
41
  notes?: string;
38
42
  transferredAt?: string;
39
43
  refundedAt?: string;
40
44
  createdAt: Timestamp;
41
45
  updatedAt: Timestamp;
46
+ /**
47
+ * @deprecated Replaced by originalOwnerId
48
+ */
49
+ previousOwner: string[];
50
+ /**
51
+ * @deprecated Replaced by price.amount
52
+ */
53
+ originalPrice?: number;
54
+ /**
55
+ * @deprecated Replaced by price.amount
56
+ */
57
+ ticketPrice?: number;
42
58
  };
43
59
  export type TicketTransfer = {
44
60
  type: "transfer";
@@ -48,30 +64,54 @@ export type TicketTransfer = {
48
64
  };
49
65
  export type CouponCode = {
50
66
  code: string;
51
- discountAmount: number;
52
67
  discountType: "fixed" | "percentage";
53
- minPurchaseQuantity?: number;
54
- maxUsage?: number;
55
- expiryDate?: string;
68
+ discountAmount: number;
69
+ startDate: string | null;
70
+ expiryDate: string | null;
56
71
  };
57
72
  export type EventTicket = {
58
73
  id: string;
59
74
  price: number;
60
- ticketType: string;
75
+ price_details: MonetaryAmount;
61
76
  eventId: string;
62
77
  quantity: number;
63
78
  amountSold: number;
64
- coupons?: CouponCode[];
79
+ coupons: CouponCode[] | null;
65
80
  name: string;
66
81
  description?: string;
67
82
  maxQuantityPerPurchase?: number;
68
83
  minQuantityPerPurchase?: number;
69
- saleStartDate?: string;
70
- saleEndDate?: string;
71
- isEarlyBird?: boolean;
84
+ startDate: string | null;
85
+ endDate: string | null;
72
86
  isTransferable: boolean;
73
87
  isRefundable: boolean;
74
- status: "published" | "draft";
88
+ status: "published" | "draft" | "sold-out" | "unavailable";
89
+ /**
90
+ * Promotional period for the ticket
91
+ */
92
+ promotionalPeriod: PromotionalPeriod | null;
93
+ /**
94
+ * @deprecated Replaced by name
95
+ */
96
+ ticketType: string;
97
+ };
98
+ export type PromotionalPeriod = {
99
+ /**
100
+ * Discount amount during the promotional period. Can't be more than the price. unit: MAJOR
101
+ */
102
+ discountAmount: number;
103
+ /**
104
+ * Start date of the promotional period (ISO string)
105
+ */
106
+ startDate: string;
107
+ /**
108
+ * End date of the promotional period (ISO string)
109
+ */
110
+ endDate: string;
111
+ /**
112
+ * Optional description of the promotion (e.g., "Early Bird", "Flash Sale")
113
+ */
114
+ description?: string;
75
115
  };
76
116
  export type Payment = {
77
117
  amount: number;
@@ -127,3 +167,8 @@ export type Payment = {
127
167
  transfer_data: string | null;
128
168
  transfer_group: string | null;
129
169
  };
170
+ export type MonetaryAmount = {
171
+ amount: number;
172
+ currency: string;
173
+ unit: "MAJOR" | "MINOR";
174
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "This repository contains shared TypeScript types and interfaces used across multiple WeDance applications:",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,6 +37,8 @@ export type ImageData = {
37
37
  * */
38
38
  export type EventData = {
39
39
  id: string;
40
+ // Id from an event added by a partner.
41
+ externalId: string | null | undefined;
40
42
  title: string;
41
43
  // Date in iso format
42
44
  from: string;
@@ -20,12 +20,17 @@ export type Ticket = {
20
20
  eventId: string;
21
21
  eventName: string;
22
22
  eventDate: string;
23
+ /**
24
+ * Date of purchase in ISO format
25
+ */
23
26
  purchaseDate: string;
24
27
  quantity: number;
25
- ticketPrice: number;
28
+ paidAmount: MonetaryAmount;
29
+ originalAmount: MonetaryAmount;
26
30
  ticketType: string;
27
- // @deprecated Replaced by originalOwnerId
28
- previousOwner: string[];
31
+ /**
32
+ * ID of the user who originally purchased the ticket
33
+ */
29
34
  originalOwnerId: string;
30
35
  /**
31
36
  * ID of the user who owns the ticket
@@ -40,14 +45,24 @@ export type Ticket = {
40
45
  discountAmount: number;
41
46
  discountType: "fixed" | "percentage";
42
47
  };
43
- originalPrice: number;
44
- orderNumber: string;
45
48
  checkedInAt?: string;
46
49
  notes?: string;
47
50
  transferredAt?: string;
48
51
  refundedAt?: string;
49
52
  createdAt: Timestamp;
50
53
  updatedAt: Timestamp;
54
+ /**
55
+ * @deprecated Replaced by originalOwnerId
56
+ */
57
+ previousOwner: string[];
58
+ /**
59
+ * @deprecated Replaced by price.amount
60
+ */
61
+ originalPrice?: number;
62
+ /**
63
+ * @deprecated Replaced by price.amount
64
+ */
65
+ ticketPrice?: number;
51
66
  };
52
67
 
53
68
  export type TicketTransfer = {
@@ -59,32 +74,56 @@ export type TicketTransfer = {
59
74
 
60
75
  export type CouponCode = {
61
76
  code: string;
62
- discountAmount: number; // Amount to subtract from original price
63
- discountType: "fixed" | "percentage"; // Whether it's a fixed amount or percentage
64
- minPurchaseQuantity?: number; // Minimum tickets required for this specific code
65
- maxUsage?: number; // Maximum number of times this code can be used
66
- expiryDate?: string; // Optional expiry date for the coupon
77
+ discountType: "fixed" | "percentage";
78
+ discountAmount: number;
79
+ startDate: string | null;
80
+ expiryDate: string | null;
67
81
  };
68
82
 
69
83
  export type EventTicket = {
70
84
  id: string;
71
85
  price: number;
72
- // ticketType is deprecated, use name instead
73
- ticketType: string;
86
+ price_details: MonetaryAmount;
74
87
  eventId: string;
75
- quantity: number; // Total tickets allocated
76
- amountSold: number; // Number of tickets sold
77
- coupons?: CouponCode[];
88
+ quantity: number;
89
+ amountSold: number;
90
+ coupons: CouponCode[] | null;
78
91
  name: string;
79
92
  description?: string;
80
93
  maxQuantityPerPurchase?: number;
81
94
  minQuantityPerPurchase?: number;
82
- saleStartDate?: string;
83
- saleEndDate?: string;
84
- isEarlyBird?: boolean;
95
+ startDate: string | null;
96
+ endDate: string | null;
85
97
  isTransferable: boolean;
86
98
  isRefundable: boolean;
87
- status: "published" | "draft";
99
+ status: "published" | "draft" | "sold-out" | "unavailable";
100
+ /**
101
+ * Promotional period for the ticket
102
+ */
103
+ promotionalPeriod: PromotionalPeriod | null;
104
+ /**
105
+ * @deprecated Replaced by name
106
+ */
107
+ ticketType: string;
108
+ };
109
+
110
+ export type PromotionalPeriod = {
111
+ /**
112
+ * Discount amount during the promotional period. Can't be more than the price. unit: MAJOR
113
+ */
114
+ discountAmount: number;
115
+ /**
116
+ * Start date of the promotional period (ISO string)
117
+ */
118
+ startDate: string;
119
+ /**
120
+ * End date of the promotional period (ISO string)
121
+ */
122
+ endDate: string;
123
+ /**
124
+ * Optional description of the promotion (e.g., "Early Bird", "Flash Sale")
125
+ */
126
+ description?: string;
88
127
  };
89
128
 
90
129
  export type Payment = {
@@ -141,3 +180,9 @@ export type Payment = {
141
180
  transfer_data: string | null;
142
181
  transfer_group: string | null;
143
182
  };
183
+
184
+ export type MonetaryAmount = {
185
+ amount: number;
186
+ currency: string;
187
+ unit: "MAJOR" | "MINOR";
188
+ };