wedance-shared 1.0.6 → 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/city.d.ts +32 -0
- package/dist/city.js +39 -0
- package/dist/city.js.map +1 -0
- package/dist/event.d.ts +84 -0
- package/dist/event.js +2 -0
- package/dist/event.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js.map +1 -0
- package/dist/organizer.d.ts +16 -0
- package/dist/organizer.js +2 -0
- package/dist/organizer.js.map +1 -0
- package/dist/ticket.d.ts +54 -0
- package/dist/ticket.js +2 -0
- package/dist/ticket.js.map +1 -0
- package/dist/user.d.ts +40 -0
- package/dist/user.js +2 -0
- package/dist/user.js.map +1 -0
- package/package.json +1 -1
- package/src/ticket.ts +58 -25
package/dist/city.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type CityData = {
|
|
2
|
+
city: "helsinki";
|
|
3
|
+
country: "fi";
|
|
4
|
+
coordinates: [60.1695, 24.9354];
|
|
5
|
+
} | {
|
|
6
|
+
city: "tampere";
|
|
7
|
+
country: "fi";
|
|
8
|
+
coordinates: [61.4978, 23.761];
|
|
9
|
+
} | {
|
|
10
|
+
city: "oslo";
|
|
11
|
+
country: "no";
|
|
12
|
+
coordinates: [59.9139, 10.7522];
|
|
13
|
+
} | {
|
|
14
|
+
city: "tallinn";
|
|
15
|
+
country: "ee";
|
|
16
|
+
coordinates: [59.437, 24.7536];
|
|
17
|
+
} | {
|
|
18
|
+
city: "copenhagen";
|
|
19
|
+
country: "dk";
|
|
20
|
+
coordinates: [55.6761, 12.5683];
|
|
21
|
+
};
|
|
22
|
+
export declare const LIST_CITIES: CityData[];
|
|
23
|
+
export type City = CityData;
|
|
24
|
+
export type CityName = CityData["city"];
|
|
25
|
+
export type CountryCode = CityData["country"];
|
|
26
|
+
export declare enum Timezone {
|
|
27
|
+
FINLAND = "Europe/Helsinki",
|
|
28
|
+
DENMARK = "Europe/Copenhagen",
|
|
29
|
+
SWEDEN = "Europe/Stockholm",
|
|
30
|
+
NORWAY = "Europe/Oslo"
|
|
31
|
+
}
|
|
32
|
+
export {};
|
package/dist/city.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const LIST_CITIES = [
|
|
2
|
+
{
|
|
3
|
+
city: "helsinki",
|
|
4
|
+
country: "fi",
|
|
5
|
+
coordinates: [60.1695, 24.9354],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
city: "tampere",
|
|
9
|
+
country: "fi",
|
|
10
|
+
coordinates: [61.4978, 23.761],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
city: "oslo",
|
|
14
|
+
country: "no",
|
|
15
|
+
coordinates: [59.9139, 10.7522],
|
|
16
|
+
},
|
|
17
|
+
// {
|
|
18
|
+
// city: 'stockholm',
|
|
19
|
+
// country: 'se',
|
|
20
|
+
// },
|
|
21
|
+
{
|
|
22
|
+
city: "tallinn",
|
|
23
|
+
country: "ee",
|
|
24
|
+
coordinates: [59.437, 24.7536],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
city: "copenhagen",
|
|
28
|
+
country: "dk",
|
|
29
|
+
coordinates: [55.6761, 12.5683],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
export var Timezone;
|
|
33
|
+
(function (Timezone) {
|
|
34
|
+
Timezone["FINLAND"] = "Europe/Helsinki";
|
|
35
|
+
Timezone["DENMARK"] = "Europe/Copenhagen";
|
|
36
|
+
Timezone["SWEDEN"] = "Europe/Stockholm";
|
|
37
|
+
Timezone["NORWAY"] = "Europe/Oslo";
|
|
38
|
+
})(Timezone || (Timezone = {}));
|
|
39
|
+
//# sourceMappingURL=city.js.map
|
package/dist/city.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"city.js","sourceRoot":"","sources":["../src/city.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;IACD,IAAI;IACJ,uBAAuB;IACvB,mBAAmB;IACnB,KAAK;IACL;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;KAChC;CACF,CAAC;AAMF,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,uCAA2B,CAAA;IAC3B,yCAA6B,CAAA;IAC7B,uCAA2B,CAAA;IAC3B,kCAAsB,CAAA;AACxB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB"}
|
package/dist/event.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
export type Organizer = {
|
|
7
|
+
name: OrganizerName;
|
|
8
|
+
email?: string;
|
|
9
|
+
};
|
|
10
|
+
export type Links = {
|
|
11
|
+
instagram?: string;
|
|
12
|
+
facebook?: string;
|
|
13
|
+
website?: string;
|
|
14
|
+
};
|
|
15
|
+
type Location = {
|
|
16
|
+
name: string;
|
|
17
|
+
address?: string;
|
|
18
|
+
};
|
|
19
|
+
export type EventStatus = 'draft' | 'published' | 'cancelled';
|
|
20
|
+
export type ImageData = {
|
|
21
|
+
url: string;
|
|
22
|
+
alt?: string;
|
|
23
|
+
blurhash?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* This is the type of the data we get from the server
|
|
27
|
+
* */
|
|
28
|
+
export type EventData = {
|
|
29
|
+
id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
from: string;
|
|
32
|
+
until: string;
|
|
33
|
+
price: number;
|
|
34
|
+
priceProvided: boolean;
|
|
35
|
+
organizer: Organizer;
|
|
36
|
+
description: string;
|
|
37
|
+
location: Location;
|
|
38
|
+
duration?: number;
|
|
39
|
+
tags: DanceTag[];
|
|
40
|
+
links: Links;
|
|
41
|
+
/**
|
|
42
|
+
* Events have international artists
|
|
43
|
+
*/
|
|
44
|
+
isInternational: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Is event private? @deprecated
|
|
47
|
+
*/
|
|
48
|
+
isPrivate?: boolean;
|
|
49
|
+
hasSeveralPrices?: boolean;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
lastUpdated?: string;
|
|
52
|
+
publishedSchedule?: boolean;
|
|
53
|
+
schedule: EventSchedule | null;
|
|
54
|
+
addedBy: string;
|
|
55
|
+
updatedBy: string;
|
|
56
|
+
paymentLink: string | null;
|
|
57
|
+
status: EventStatus | null;
|
|
58
|
+
city: City;
|
|
59
|
+
isFestival: boolean | null;
|
|
60
|
+
going: UserBadge[] | null;
|
|
61
|
+
interested: UserBadge[] | null;
|
|
62
|
+
imageData: ImageData;
|
|
63
|
+
eventTickets?: EventTicket[] | null;
|
|
64
|
+
lineup?: LineUpArtist[] | null;
|
|
65
|
+
};
|
|
66
|
+
type EventCellType = 'workshop' | 'social' | 'break' | 'other';
|
|
67
|
+
export type ScheduleItem = {
|
|
68
|
+
id: string;
|
|
69
|
+
headline: string;
|
|
70
|
+
subheader: string | null;
|
|
71
|
+
from: string;
|
|
72
|
+
until: string;
|
|
73
|
+
type: EventCellType;
|
|
74
|
+
level: string | null;
|
|
75
|
+
};
|
|
76
|
+
export type EventSchedule = Record<string, ScheduleItem[]>;
|
|
77
|
+
export type LineUpArtist = {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
image: string;
|
|
82
|
+
imageUrl: string;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
package/dist/event.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { City } from "./city";
|
|
2
|
+
export type OrganizerName = "SOB Productions" | "Helsinki SBK" | "Avec Dance Club" | "Still Dancing" | "Tanssikoulu SalsaLatina" | "Helsinki Salsa Academy" | "BabaGen" | "Bachata Studio" | "Tanssikoulu BailaBaila" | "Petra & Otso" | "Bachata Helsinki" | "Anton Kargaltsev" | "Salsa Borealis" | "Helsinki Dance Central" | "Ted's Kizomba" | "Urbankiz Helsinki" | "Azembora" | "S-Dance" | "Helsinki Kizomba Studio" | "idance Helsinki" | "Tampere Social Dance" | "Azúcar" | "DJ Pies Locos" | "Kizomba Social Tampere" | "Fever Dance Oslo" | "Pure Dance Official" | "Dancecity" | "Bachata Monthly" | "Salsakompaniet" | "Bachata Studio Tallinn" | "Casa De Baile" | "Havana Moderna" | "Other";
|
|
3
|
+
export type OrganizerData = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: OrganizerName;
|
|
6
|
+
email?: string;
|
|
7
|
+
website?: string;
|
|
8
|
+
city: City;
|
|
9
|
+
description?: {
|
|
10
|
+
fi: string;
|
|
11
|
+
en: string;
|
|
12
|
+
};
|
|
13
|
+
lastUpdated: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
isFlagged: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizer.js","sourceRoot":"","sources":["../src/organizer.ts"],"names":[],"mappings":""}
|
package/dist/ticket.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type TicketStatus = "Confirmed" | "Cancelled" | "Refunded" | "Expired" | "Used" | "Transferred";
|
|
2
|
+
export type Ticket = {
|
|
3
|
+
id: string;
|
|
4
|
+
eventId: string;
|
|
5
|
+
eventName: string;
|
|
6
|
+
eventDate: string;
|
|
7
|
+
purchaseDate: string;
|
|
8
|
+
quantity: number;
|
|
9
|
+
ticketPrice: number;
|
|
10
|
+
ticketType: string;
|
|
11
|
+
previousOwner: string[];
|
|
12
|
+
owner: string;
|
|
13
|
+
status: TicketStatus;
|
|
14
|
+
isRefundable: boolean;
|
|
15
|
+
isTransferable: boolean;
|
|
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;
|
|
36
|
+
};
|
|
37
|
+
export type EventTicket = {
|
|
38
|
+
id: string;
|
|
39
|
+
price: number;
|
|
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;
|
|
54
|
+
};
|
package/dist/ticket.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket.js","sourceRoot":"","sources":["../src/ticket.ts"],"names":[],"mappings":""}
|
package/dist/user.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { City } from './city';
|
|
2
|
+
import { DanceTag } from './event';
|
|
3
|
+
import { OrganizerName } from './organizer';
|
|
4
|
+
import { Ticket } from './ticket';
|
|
5
|
+
export type Role = 'admin' | 'manager' | 'organiser' | 'user';
|
|
6
|
+
export type User = {
|
|
7
|
+
id: string;
|
|
8
|
+
email: string;
|
|
9
|
+
displayName: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
lastUpdated?: string;
|
|
12
|
+
lastConnected?: string;
|
|
13
|
+
savedEvents: string[];
|
|
14
|
+
goingEvents: string[];
|
|
15
|
+
role: Role;
|
|
16
|
+
managerCity?: City;
|
|
17
|
+
organiser?: OrganizerName;
|
|
18
|
+
city: City | null;
|
|
19
|
+
followingOrganisers: OrganizerName[];
|
|
20
|
+
favoriteDance?: DanceTag;
|
|
21
|
+
fcmTokens?: string[];
|
|
22
|
+
notificationPreferences?: NotificationPreferences;
|
|
23
|
+
appVersion?: string;
|
|
24
|
+
deviceModel?: string;
|
|
25
|
+
platform?: string;
|
|
26
|
+
tickets?: Ticket[];
|
|
27
|
+
emailVerified: boolean;
|
|
28
|
+
stripeId?: string;
|
|
29
|
+
};
|
|
30
|
+
export type NotificationPreferences = {
|
|
31
|
+
all: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* This is used to show who is going to the event
|
|
35
|
+
*/
|
|
36
|
+
export type UserBadge = {
|
|
37
|
+
id: string;
|
|
38
|
+
displayName: string;
|
|
39
|
+
avatar?: string;
|
|
40
|
+
};
|
package/dist/user.js
ADDED
package/dist/user.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/user.ts"],"names":[],"mappings":""}
|
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
|
+
};
|