wedance-shared 1.0.7 → 1.0.9
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/event.d.ts +8 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/other.d.ts +24 -0
- package/dist/other.js +2 -0
- package/dist/other.js.map +1 -0
- package/dist/ticket.d.ts +34 -1
- package/package.json +1 -1
- package/src/event.ts +68 -68
- package/src/index.ts +1 -0
- package/src/other.ts +27 -0
- package/src/ticket.ts +59 -25
package/dist/event.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { City } from
|
|
2
|
-
import { OrganizerName } from
|
|
3
|
-
import { EventTicket } from
|
|
4
|
-
import { UserBadge } from
|
|
5
|
-
export type DanceTag =
|
|
1
|
+
import { City } from "./city";
|
|
2
|
+
import { OrganizerName } from "./organizer";
|
|
3
|
+
import { EventTicket } from "./ticket";
|
|
4
|
+
import { UserBadge } from "./user";
|
|
5
|
+
export type DanceTag = "salsa" | "kizomba" | "bachata" | "zouk";
|
|
6
6
|
export type Organizer = {
|
|
7
7
|
name: OrganizerName;
|
|
8
8
|
email?: string;
|
|
@@ -12,11 +12,11 @@ export type Links = {
|
|
|
12
12
|
facebook?: string;
|
|
13
13
|
website?: string;
|
|
14
14
|
};
|
|
15
|
-
type Location = {
|
|
15
|
+
export type Location = {
|
|
16
16
|
name: string;
|
|
17
17
|
address?: string;
|
|
18
18
|
};
|
|
19
|
-
export type EventStatus =
|
|
19
|
+
export type EventStatus = "draft" | "published" | "cancelled";
|
|
20
20
|
export type ImageData = {
|
|
21
21
|
url: string;
|
|
22
22
|
alt?: string;
|
|
@@ -63,7 +63,7 @@ export type EventData = {
|
|
|
63
63
|
eventTickets?: EventTicket[] | null;
|
|
64
64
|
lineup?: LineUpArtist[] | null;
|
|
65
65
|
};
|
|
66
|
-
type EventCellType =
|
|
66
|
+
export type EventCellType = "workshop" | "social" | "break" | "other";
|
|
67
67
|
export type ScheduleItem = {
|
|
68
68
|
id: string;
|
|
69
69
|
headline: string;
|
|
@@ -81,4 +81,3 @@ export type LineUpArtist = {
|
|
|
81
81
|
image: string;
|
|
82
82
|
imageUrl: string;
|
|
83
83
|
};
|
|
84
|
-
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/dist/other.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type Language = {
|
|
2
|
+
code: LanguageCode;
|
|
3
|
+
};
|
|
4
|
+
export type LanguageCode = "en-gb" | "fi";
|
|
5
|
+
export type DayPoll = {
|
|
6
|
+
[eventId: string]: string[];
|
|
7
|
+
other: string[];
|
|
8
|
+
};
|
|
9
|
+
export type WeekendPoll = {
|
|
10
|
+
pollId: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
friday: DayPoll;
|
|
13
|
+
saturday: DayPoll;
|
|
14
|
+
};
|
|
15
|
+
export type FeatureFlags = {
|
|
16
|
+
multicity: boolean;
|
|
17
|
+
copenhagen: boolean;
|
|
18
|
+
oslo: boolean;
|
|
19
|
+
stockholm: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type RemoteConfigMessageType = {
|
|
22
|
+
severity: "info" | "warning";
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
package/dist/other.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"other.js","sourceRoot":"","sources":["../src/other.ts"],"names":[],"mappings":""}
|
package/dist/ticket.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export type TicketStatus =
|
|
1
|
+
export type TicketStatus = "Confirmed" | "Cancelled" | "Refunded" | "Expired" | "Used" | "Transferred";
|
|
2
2
|
export type Ticket = {
|
|
3
3
|
id: string;
|
|
4
|
+
ticketId: string;
|
|
4
5
|
eventId: string;
|
|
5
6
|
eventName: string;
|
|
6
7
|
eventDate: string;
|
|
@@ -14,9 +15,41 @@ export type Ticket = {
|
|
|
14
15
|
isRefundable: boolean;
|
|
15
16
|
isTransferable: boolean;
|
|
16
17
|
paymentId: string;
|
|
18
|
+
appliedCoupon?: {
|
|
19
|
+
code: string;
|
|
20
|
+
discountAmount: number;
|
|
21
|
+
discountType: "fixed" | "percentage";
|
|
22
|
+
};
|
|
23
|
+
originalPrice: number;
|
|
24
|
+
orderNumber: string;
|
|
25
|
+
checkedInAt?: string;
|
|
26
|
+
notes?: string;
|
|
27
|
+
transferredAt?: string;
|
|
28
|
+
refundedAt?: string;
|
|
29
|
+
};
|
|
30
|
+
export type CouponCode = {
|
|
31
|
+
code: string;
|
|
32
|
+
discountAmount: number;
|
|
33
|
+
discountType: "fixed" | "percentage";
|
|
34
|
+
minPurchaseQuantity?: number;
|
|
35
|
+
maxUsage?: number;
|
|
36
|
+
expiryDate?: string;
|
|
17
37
|
};
|
|
18
38
|
export type EventTicket = {
|
|
19
39
|
id: string;
|
|
20
40
|
price: number;
|
|
21
41
|
ticketType: string;
|
|
42
|
+
eventId: string;
|
|
43
|
+
quantity: number;
|
|
44
|
+
soldQuantity: number;
|
|
45
|
+
coupons?: CouponCode[];
|
|
46
|
+
name: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
maxQuantityPerPurchase?: number;
|
|
49
|
+
minQuantityPerPurchase?: number;
|
|
50
|
+
saleStartDate?: string;
|
|
51
|
+
saleEndDate?: string;
|
|
52
|
+
isEarlyBird?: boolean;
|
|
53
|
+
isTransferable: boolean;
|
|
54
|
+
isRefundable: boolean;
|
|
22
55
|
};
|
package/package.json
CHANGED
package/src/event.ts
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { City } from
|
|
2
|
-
import { OrganizerName } from
|
|
3
|
-
import { EventTicket } from
|
|
4
|
-
import { UserBadge } from
|
|
1
|
+
import { City } from "./city";
|
|
2
|
+
import { OrganizerName } from "./organizer";
|
|
3
|
+
import { EventTicket } from "./ticket";
|
|
4
|
+
import { UserBadge } from "./user";
|
|
5
5
|
|
|
6
|
-
export type DanceTag =
|
|
6
|
+
export type DanceTag = "salsa" | "kizomba" | "bachata" | "zouk";
|
|
7
7
|
|
|
8
8
|
export type Organizer = {
|
|
9
|
-
name: OrganizerName
|
|
10
|
-
email?: string
|
|
11
|
-
}
|
|
9
|
+
name: OrganizerName;
|
|
10
|
+
email?: string;
|
|
11
|
+
};
|
|
12
12
|
|
|
13
13
|
export type Links = {
|
|
14
|
-
instagram?: string
|
|
15
|
-
facebook?: string
|
|
16
|
-
website?: string
|
|
17
|
-
}
|
|
14
|
+
instagram?: string;
|
|
15
|
+
facebook?: string;
|
|
16
|
+
website?: string;
|
|
17
|
+
};
|
|
18
18
|
|
|
19
|
-
type Location = {
|
|
20
|
-
name: string
|
|
21
|
-
address?: string
|
|
22
|
-
}
|
|
19
|
+
export type Location = {
|
|
20
|
+
name: string;
|
|
21
|
+
address?: string;
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
export type EventStatus =
|
|
24
|
+
export type EventStatus = "draft" | "published" | "cancelled";
|
|
25
25
|
|
|
26
26
|
export type ImageData = {
|
|
27
|
-
url: string
|
|
28
|
-
alt?: string
|
|
29
|
-
blurhash?: string
|
|
30
|
-
}
|
|
27
|
+
url: string;
|
|
28
|
+
alt?: string;
|
|
29
|
+
blurhash?: string;
|
|
30
|
+
};
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* This is the type of the data we get from the server
|
|
34
34
|
* */
|
|
35
35
|
export type EventData = {
|
|
36
|
-
id: string
|
|
37
|
-
title: string
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
38
|
// Date in iso format
|
|
39
|
-
from: string
|
|
39
|
+
from: string;
|
|
40
40
|
// Date in iso format
|
|
41
|
-
until: string
|
|
42
|
-
price: number
|
|
43
|
-
priceProvided: boolean
|
|
44
|
-
organizer: Organizer
|
|
45
|
-
description: string
|
|
46
|
-
location: Location
|
|
41
|
+
until: string;
|
|
42
|
+
price: number;
|
|
43
|
+
priceProvided: boolean;
|
|
44
|
+
organizer: Organizer;
|
|
45
|
+
description: string;
|
|
46
|
+
location: Location;
|
|
47
47
|
// In hours
|
|
48
|
-
duration?: number
|
|
49
|
-
tags: DanceTag[]
|
|
50
|
-
links: Links
|
|
48
|
+
duration?: number;
|
|
49
|
+
tags: DanceTag[];
|
|
50
|
+
links: Links;
|
|
51
51
|
/**
|
|
52
52
|
* Events have international artists
|
|
53
53
|
*/
|
|
54
|
-
isInternational: boolean
|
|
54
|
+
isInternational: boolean;
|
|
55
55
|
/**
|
|
56
56
|
* Is event private? @deprecated
|
|
57
57
|
*/
|
|
58
|
-
isPrivate?: boolean
|
|
59
|
-
hasSeveralPrices?: boolean
|
|
60
|
-
createdAt: string
|
|
61
|
-
lastUpdated?: string
|
|
62
|
-
publishedSchedule?: boolean
|
|
63
|
-
schedule: EventSchedule | null
|
|
58
|
+
isPrivate?: boolean;
|
|
59
|
+
hasSeveralPrices?: boolean;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
lastUpdated?: string;
|
|
62
|
+
publishedSchedule?: boolean;
|
|
63
|
+
schedule: EventSchedule | null;
|
|
64
64
|
// Email of the user who added the event
|
|
65
|
-
addedBy: string
|
|
66
|
-
updatedBy: string
|
|
67
|
-
paymentLink: string | null
|
|
68
|
-
status: EventStatus | null
|
|
69
|
-
city: City
|
|
70
|
-
isFestival: boolean | null
|
|
71
|
-
going: UserBadge[] | null
|
|
72
|
-
interested: UserBadge[] | null
|
|
73
|
-
imageData: ImageData
|
|
74
|
-
eventTickets?: EventTicket[] | null
|
|
75
|
-
lineup?: LineUpArtist[] | null
|
|
76
|
-
}
|
|
65
|
+
addedBy: string;
|
|
66
|
+
updatedBy: string;
|
|
67
|
+
paymentLink: string | null;
|
|
68
|
+
status: EventStatus | null;
|
|
69
|
+
city: City;
|
|
70
|
+
isFestival: boolean | null;
|
|
71
|
+
going: UserBadge[] | null;
|
|
72
|
+
interested: UserBadge[] | null;
|
|
73
|
+
imageData: ImageData;
|
|
74
|
+
eventTickets?: EventTicket[] | null;
|
|
75
|
+
lineup?: LineUpArtist[] | null;
|
|
76
|
+
};
|
|
77
77
|
|
|
78
|
-
type EventCellType =
|
|
78
|
+
export type EventCellType = "workshop" | "social" | "break" | "other";
|
|
79
79
|
|
|
80
80
|
export type ScheduleItem = {
|
|
81
|
-
id: string
|
|
82
|
-
headline: string
|
|
83
|
-
subheader: string | null
|
|
84
|
-
from: string
|
|
85
|
-
until: string
|
|
86
|
-
type: EventCellType
|
|
87
|
-
level: string | null
|
|
88
|
-
}
|
|
81
|
+
id: string;
|
|
82
|
+
headline: string;
|
|
83
|
+
subheader: string | null;
|
|
84
|
+
from: string;
|
|
85
|
+
until: string;
|
|
86
|
+
type: EventCellType;
|
|
87
|
+
level: string | null;
|
|
88
|
+
};
|
|
89
89
|
|
|
90
|
-
export type EventSchedule = Record<string, ScheduleItem[]
|
|
90
|
+
export type EventSchedule = Record<string, ScheduleItem[]>;
|
|
91
91
|
|
|
92
92
|
export type LineUpArtist = {
|
|
93
|
-
id: string
|
|
94
|
-
name: string
|
|
95
|
-
description: string
|
|
96
|
-
image: string
|
|
97
|
-
imageUrl: string
|
|
98
|
-
}
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
image: string;
|
|
97
|
+
imageUrl: string;
|
|
98
|
+
};
|
package/src/index.ts
CHANGED
package/src/other.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type Language = { code: LanguageCode };
|
|
2
|
+
|
|
3
|
+
export type LanguageCode = "en-gb" | "fi";
|
|
4
|
+
|
|
5
|
+
export type DayPoll = {
|
|
6
|
+
[eventId: string]: string[];
|
|
7
|
+
other: string[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type WeekendPoll = {
|
|
11
|
+
pollId: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
friday: DayPoll;
|
|
14
|
+
saturday: DayPoll;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type FeatureFlags = {
|
|
18
|
+
multicity: boolean;
|
|
19
|
+
copenhagen: boolean;
|
|
20
|
+
oslo: boolean;
|
|
21
|
+
stockholm: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type RemoteConfigMessageType = {
|
|
25
|
+
severity: "info" | "warning";
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
package/src/ticket.ts
CHANGED
|
@@ -1,30 +1,64 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
id: string;
|
|
11
|
+
ticketId: string;
|
|
12
|
+
eventId: string;
|
|
13
|
+
eventName: string;
|
|
14
|
+
eventDate: string;
|
|
15
|
+
purchaseDate: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
ticketPrice: number;
|
|
18
|
+
ticketType: string;
|
|
19
|
+
previousOwner: string[];
|
|
20
|
+
owner: string;
|
|
21
|
+
status: TicketStatus;
|
|
22
|
+
isRefundable: boolean;
|
|
23
|
+
isTransferable: boolean;
|
|
24
|
+
paymentId: string;
|
|
25
|
+
appliedCoupon?: {
|
|
26
|
+
code: string;
|
|
27
|
+
discountAmount: number;
|
|
28
|
+
discountType: "fixed" | "percentage";
|
|
29
|
+
};
|
|
30
|
+
originalPrice: number;
|
|
31
|
+
orderNumber: string;
|
|
32
|
+
checkedInAt?: string;
|
|
33
|
+
notes?: string;
|
|
34
|
+
transferredAt?: string;
|
|
35
|
+
refundedAt?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type CouponCode = {
|
|
39
|
+
code: string;
|
|
40
|
+
discountAmount: number; // Amount to subtract from original price
|
|
41
|
+
discountType: "fixed" | "percentage"; // Whether it's a fixed amount or percentage
|
|
42
|
+
minPurchaseQuantity?: number; // Minimum tickets required for this specific code
|
|
43
|
+
maxUsage?: number; // Maximum number of times this code can be used
|
|
44
|
+
expiryDate?: string; // Optional expiry date for the coupon
|
|
45
|
+
};
|
|
25
46
|
|
|
26
47
|
export type EventTicket = {
|
|
27
|
-
id: string
|
|
28
|
-
price: number
|
|
29
|
-
ticketType: string
|
|
30
|
-
|
|
48
|
+
id: string;
|
|
49
|
+
price: number;
|
|
50
|
+
ticketType: string;
|
|
51
|
+
eventId: string;
|
|
52
|
+
quantity: number; // Total tickets allocated
|
|
53
|
+
soldQuantity: number; // Number of tickets sold
|
|
54
|
+
coupons?: CouponCode[];
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
maxQuantityPerPurchase?: number;
|
|
58
|
+
minQuantityPerPurchase?: number;
|
|
59
|
+
saleStartDate?: string;
|
|
60
|
+
saleEndDate?: string;
|
|
61
|
+
isEarlyBird?: boolean;
|
|
62
|
+
isTransferable: boolean;
|
|
63
|
+
isRefundable: boolean;
|
|
64
|
+
};
|