heartraite 1.0.219 → 1.0.221
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/enum/app-route.enum.d.ts +1 -0
- package/dist/enum/app-route.enum.js +1 -0
- package/dist/enum/cloudfunction.enum.d.ts +4 -0
- package/dist/enum/cloudfunction.enum.js +4 -0
- package/dist/types/cloud-function-types.d.ts +18 -2
- package/dist/types/event.types.d.ts +48 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/request.types.d.ts +10 -0
- package/dist/types/response.types.d.ts +10 -1
- package/dist/types/ticket.types.d.ts +45 -0
- package/dist/types/ticket.types.js +2 -0
- package/package.json +1 -1
- package/src/enum/app-route.enum.ts +1 -0
- package/src/enum/cloudfunction.enum.ts +4 -0
- package/src/types/cloud-function-types.ts +24 -0
- package/src/types/event.types.ts +86 -2
- package/src/types/index.ts +1 -0
- package/src/types/request.types.ts +10 -0
- package/src/types/response.types.ts +15 -1
- package/src/types/ticket.types.ts +83 -0
|
@@ -26,6 +26,7 @@ var AppRoute;
|
|
|
26
26
|
AppRoute["TERMS_PRIVACY"] = "terms_privacy";
|
|
27
27
|
AppRoute["EVENTS"] = "events";
|
|
28
28
|
AppRoute["EVENT_DETAILS"] = "event_details";
|
|
29
|
+
AppRoute["EVENT_OFFER"] = "event_offer";
|
|
29
30
|
AppRoute["EVENT_FEEDBACK"] = "event_feedback";
|
|
30
31
|
AppRoute["JOIN_EVENT"] = "join_event";
|
|
31
32
|
AppRoute["CHAT"] = "chat";
|
|
@@ -16,6 +16,10 @@ export declare enum CloudFunction {
|
|
|
16
16
|
GET_USER_EVENTS = "event/get-user-events",
|
|
17
17
|
JOIN_EVENT = "event/join-event",
|
|
18
18
|
GET_EVENT = "event/get-event",
|
|
19
|
+
GET_PUBLIC_EVENTS = "event/get-public-events",
|
|
20
|
+
CREATE_CHECKOUT = "ticket/create-checkout",
|
|
21
|
+
CONFIRM_ORDER = "ticket/confirm",
|
|
22
|
+
ABANDON_ORDER = "ticket/abandon",
|
|
19
23
|
SUBMIT_CATEGORY_FEEDBACK = "ca/submit-category-feedback",
|
|
20
24
|
CREATE_LIKE = "like/create-like",
|
|
21
25
|
HANDLE_LIKE_SEEN = "like/handle-like-seen",
|
|
@@ -20,6 +20,10 @@ var CloudFunction;
|
|
|
20
20
|
CloudFunction["GET_USER_EVENTS"] = "event/get-user-events";
|
|
21
21
|
CloudFunction["JOIN_EVENT"] = "event/join-event";
|
|
22
22
|
CloudFunction["GET_EVENT"] = "event/get-event";
|
|
23
|
+
CloudFunction["GET_PUBLIC_EVENTS"] = "event/get-public-events";
|
|
24
|
+
CloudFunction["CREATE_CHECKOUT"] = "ticket/create-checkout";
|
|
25
|
+
CloudFunction["CONFIRM_ORDER"] = "ticket/confirm";
|
|
26
|
+
CloudFunction["ABANDON_ORDER"] = "ticket/abandon";
|
|
23
27
|
CloudFunction["SUBMIT_CATEGORY_FEEDBACK"] = "ca/submit-category-feedback";
|
|
24
28
|
CloudFunction["CREATE_LIKE"] = "like/create-like";
|
|
25
29
|
CloudFunction["HANDLE_LIKE_SEEN"] = "like/handle-like-seen";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudFunction } from "../enum";
|
|
2
|
-
import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, DeleteUserRequest, GetCARequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetAdvancedMatchRequest, GetMessagesRequest, GetPLSSubmissionRequest, GetSelfAwarenessRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest, SubmitFeedbackRequest, ExpressConsultationInterestRequest, GetMyConsultationInterestRequest, GetConsultationInterestsRequest, UpdateConsultationInterestRequest, SyncAffiliateRequest, JoinEventRequest, GetEventRequest, GetEventMatchRequest, SendEventFeedbackRequest, GetEventParticipantsRequest } from "./request.types";
|
|
3
|
-
import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, DeleteUserResponse, GetCAResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetAdvancedMatchResponse, GetMessagesResponse, GetPLSSubmissionResponse, GetSelfAwarenessReponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse, SubmitFeedbackResponse, ExpressConsultationInterestResponse, GetMyConsultationInterestResponse, GetConsultationInterestsResponse, UpdateConsultationInterestResponse, SyncAffiliateResponse, GetUserEventsResponse, JoinEventResponse, GetEventResponse, GetEventMatchResponse, SendEventFeedbackResponse, GetEventParticipantsResponse } from "./response.types";
|
|
2
|
+
import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, DeleteUserRequest, GetCARequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetAdvancedMatchRequest, GetMessagesRequest, GetPLSSubmissionRequest, GetSelfAwarenessRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest, SubmitFeedbackRequest, ExpressConsultationInterestRequest, GetMyConsultationInterestRequest, GetConsultationInterestsRequest, UpdateConsultationInterestRequest, SyncAffiliateRequest, JoinEventRequest, GetEventRequest, GetEventMatchRequest, SendEventFeedbackRequest, GetEventParticipantsRequest, GetPublicEventsRequest, CreateCheckoutRequest, ConfirmOrderRequest, AbandonOrderRequest } from "./request.types";
|
|
3
|
+
import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, DeleteUserResponse, GetCAResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetAdvancedMatchResponse, GetMessagesResponse, GetPLSSubmissionResponse, GetSelfAwarenessReponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse, SubmitFeedbackResponse, ExpressConsultationInterestResponse, GetMyConsultationInterestResponse, GetConsultationInterestsResponse, UpdateConsultationInterestResponse, SyncAffiliateResponse, GetUserEventsResponse, JoinEventResponse, GetEventResponse, GetEventMatchResponse, SendEventFeedbackResponse, GetEventParticipantsResponse, GetPublicEventsResponse, CreateCheckoutResponse, ConfirmOrderResponse, AbandonOrderResponse } from "./response.types";
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This function is deprecated.
|
|
6
6
|
* Use `CloudFunctionTypes` inside application code instead.
|
|
@@ -59,6 +59,22 @@ export type CloudFunctionTypes = {
|
|
|
59
59
|
payload: GetEventRequest;
|
|
60
60
|
response: GetEventResponse;
|
|
61
61
|
};
|
|
62
|
+
[CloudFunction.GET_PUBLIC_EVENTS]: {
|
|
63
|
+
payload: GetPublicEventsRequest;
|
|
64
|
+
response: GetPublicEventsResponse;
|
|
65
|
+
};
|
|
66
|
+
[CloudFunction.CREATE_CHECKOUT]: {
|
|
67
|
+
payload: CreateCheckoutRequest;
|
|
68
|
+
response: CreateCheckoutResponse;
|
|
69
|
+
};
|
|
70
|
+
[CloudFunction.CONFIRM_ORDER]: {
|
|
71
|
+
payload: ConfirmOrderRequest;
|
|
72
|
+
response: ConfirmOrderResponse;
|
|
73
|
+
};
|
|
74
|
+
[CloudFunction.ABANDON_ORDER]: {
|
|
75
|
+
payload: AbandonOrderRequest;
|
|
76
|
+
response: AbandonOrderResponse;
|
|
77
|
+
};
|
|
62
78
|
[CloudFunction.SUBMIT_FEEDBACK]: {
|
|
63
79
|
payload: SubmitFeedbackRequest;
|
|
64
80
|
response: SubmitFeedbackResponse;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CAStatus, Gender, MatchmakingMode } from "../enum";
|
|
1
|
+
import { CAStatus, Gender, Market, MatchmakingMode } from "../enum";
|
|
2
2
|
import { CompatibilitySummary } from "./matchmaking.types";
|
|
3
3
|
type UserId = string;
|
|
4
4
|
export declare enum EventAccess {
|
|
@@ -8,7 +8,7 @@ export declare enum EventAccess {
|
|
|
8
8
|
export type Event = {
|
|
9
9
|
id: string;
|
|
10
10
|
title: string;
|
|
11
|
-
inviteCode
|
|
11
|
+
inviteCode?: string;
|
|
12
12
|
description?: string;
|
|
13
13
|
createdBy: string;
|
|
14
14
|
hostBrand: string;
|
|
@@ -26,7 +26,52 @@ export type Event = {
|
|
|
26
26
|
lastUpdated: string;
|
|
27
27
|
access: EventAccess;
|
|
28
28
|
lastCAReminderAt?: string;
|
|
29
|
+
homeMarket?: Market;
|
|
30
|
+
city?: string;
|
|
31
|
+
eligibility?: EventEligibility;
|
|
32
|
+
priceOre?: number;
|
|
33
|
+
currency?: EventCurrency;
|
|
34
|
+
capacity?: EventCapacity;
|
|
35
|
+
seats?: EventSeats;
|
|
36
|
+
published?: boolean;
|
|
37
|
+
salesOpenAt?: string;
|
|
38
|
+
salesCloseAt?: string;
|
|
39
|
+
decisionAt?: string;
|
|
29
40
|
};
|
|
41
|
+
export type EventEligibilityInterest = "opposite_gender";
|
|
42
|
+
export type EventEligibility = {
|
|
43
|
+
markets?: Market[];
|
|
44
|
+
states?: string[];
|
|
45
|
+
minAge?: number;
|
|
46
|
+
maxAge?: number;
|
|
47
|
+
interest?: EventEligibilityInterest;
|
|
48
|
+
};
|
|
49
|
+
export type EventCurrency = "SEK";
|
|
50
|
+
export type EventCapacity = {
|
|
51
|
+
male: number;
|
|
52
|
+
female: number;
|
|
53
|
+
};
|
|
54
|
+
export type EventSeatCount = {
|
|
55
|
+
held: number;
|
|
56
|
+
sold: number;
|
|
57
|
+
};
|
|
58
|
+
export type EventSeats = {
|
|
59
|
+
male: EventSeatCount;
|
|
60
|
+
female: EventSeatCount;
|
|
61
|
+
};
|
|
62
|
+
export type EventAvailability = "scheduled" | "on_sale" | "sold_out_for_you" | "sales_closed" | "not_eligible";
|
|
63
|
+
export type EventIneligibleReason = "outside_area" | "out_of_age_range" | "assessment_required";
|
|
64
|
+
export type EventUserOrderStatus = "none" | "pending" | "paid";
|
|
65
|
+
type EventOfferDetails = Pick<Event, "id" | "title" | "description" | "hostBrand" | "eventDateTime" | "matchRevealTime" | "location" | "city" | "access"> & Required<Pick<Event, "priceOre" | "currency" | "salesOpenAt" | "salesCloseAt">> & Pick<EventEligibility, "minAge" | "maxAge"> & {
|
|
66
|
+
userOrderStatus?: EventUserOrderStatus;
|
|
67
|
+
};
|
|
68
|
+
export type EventOffer = EventOfferDetails & ({
|
|
69
|
+
availability: Exclude<EventAvailability, "not_eligible">;
|
|
70
|
+
ineligibleReason?: never;
|
|
71
|
+
} | {
|
|
72
|
+
availability: "not_eligible";
|
|
73
|
+
ineligibleReason: EventIneligibleReason;
|
|
74
|
+
});
|
|
30
75
|
export type EventParticipation = {
|
|
31
76
|
eventId: string;
|
|
32
77
|
userId: string;
|
|
@@ -37,6 +82,7 @@ export type EventParticipation = {
|
|
|
37
82
|
role: "attendee" | "host" | "admin";
|
|
38
83
|
status: "confirmed" | "pending" | "cancelled";
|
|
39
84
|
mode: MatchmakingMode;
|
|
85
|
+
checkedInAt?: string;
|
|
40
86
|
};
|
|
41
87
|
export type FullParticipant = EventParticipation & {
|
|
42
88
|
firstName: string;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -57,6 +57,16 @@ export type GetEventRequest = {
|
|
|
57
57
|
export type GetEventParticipantsRequest = {
|
|
58
58
|
eventId: string;
|
|
59
59
|
};
|
|
60
|
+
export type GetPublicEventsRequest = undefined;
|
|
61
|
+
export type CreateCheckoutRequest = {
|
|
62
|
+
eventId: string;
|
|
63
|
+
};
|
|
64
|
+
export type ConfirmOrderRequest = {
|
|
65
|
+
sessionId: string;
|
|
66
|
+
};
|
|
67
|
+
export type AbandonOrderRequest = {
|
|
68
|
+
eventId: string;
|
|
69
|
+
};
|
|
60
70
|
export type SubmitFeedbackRequest = {
|
|
61
71
|
message: string;
|
|
62
72
|
type: FeedbackType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConsultationInterest, ConsultationInterestSummary } from "./consultation.types";
|
|
2
2
|
import { Submission, CategoryEvaluation } from "./submission.types";
|
|
3
|
-
import { Event, FullParticipant, FullParticipantWithCS } from "./event.types";
|
|
3
|
+
import { Event, EventOffer, FullParticipant, FullParticipantWithCS } from "./event.types";
|
|
4
|
+
import { EventOrderView } from "./ticket.types";
|
|
4
5
|
import { UserMatch } from "./match.types";
|
|
5
6
|
import { MatchableUser, MatchCheck } from "./matchmaking.types";
|
|
6
7
|
import { Message } from "./message.types";
|
|
@@ -46,6 +47,14 @@ export type GetEventParticipantsResponse = {
|
|
|
46
47
|
eventMatchId: string | null;
|
|
47
48
|
eventMatchIds: string[];
|
|
48
49
|
};
|
|
50
|
+
export type GetPublicEventsResponse = EventOffer[];
|
|
51
|
+
export type CreateCheckoutResponse = {
|
|
52
|
+
orderId: string;
|
|
53
|
+
checkoutUrl: string;
|
|
54
|
+
expiresAt: string;
|
|
55
|
+
};
|
|
56
|
+
export type ConfirmOrderResponse = EventOrderView;
|
|
57
|
+
export type AbandonOrderResponse = void;
|
|
49
58
|
export type SubmitFeedbackResponse = undefined;
|
|
50
59
|
export type ExpressConsultationInterestResponse = ConsultationInterestSummary;
|
|
51
60
|
export type GetMyConsultationInterestResponse = ConsultationInterestSummary;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Gender } from "../enum";
|
|
2
|
+
import { EventCurrency } from "./event.types";
|
|
3
|
+
export type EventOrderStatus = "pending" | "paid" | "expired" | "abandoned" | "cancelled" | "refund_pending" | "refunded" | "refund_failed";
|
|
4
|
+
export type EventOrderKind = "paid" | "comp";
|
|
5
|
+
export type EventOrderRefundReason = "user_cancel" | "event_cancelled" | "admin" | "deletion" | "oversold";
|
|
6
|
+
export type EventOrderRefundStatus = "pending" | "succeeded" | "failed";
|
|
7
|
+
export type EventOrderRefund = {
|
|
8
|
+
stripeRefundId?: string;
|
|
9
|
+
amountOre: number;
|
|
10
|
+
reason: EventOrderRefundReason;
|
|
11
|
+
requestedAt: string;
|
|
12
|
+
status: EventOrderRefundStatus;
|
|
13
|
+
failedAt?: string;
|
|
14
|
+
};
|
|
15
|
+
export type EventOrderMessageChannel = "push" | "email" | "iam";
|
|
16
|
+
export type EventOrderBuyerSnapshot = {
|
|
17
|
+
firstName: string;
|
|
18
|
+
email: string;
|
|
19
|
+
};
|
|
20
|
+
export type EventOrder = {
|
|
21
|
+
id: string;
|
|
22
|
+
eventId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
kind: EventOrderKind;
|
|
25
|
+
status: EventOrderStatus;
|
|
26
|
+
gender: Gender;
|
|
27
|
+
amountOre: number;
|
|
28
|
+
currency: EventCurrency;
|
|
29
|
+
priceSnapshotOre: number;
|
|
30
|
+
stripeProductId?: string;
|
|
31
|
+
stripeCheckoutSessionId?: string;
|
|
32
|
+
stripePaymentIntentId?: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
expiresAt: string;
|
|
35
|
+
paidAt?: string;
|
|
36
|
+
cancelledAt?: string;
|
|
37
|
+
refund?: EventOrderRefund;
|
|
38
|
+
messages?: Record<string, Partial<Record<EventOrderMessageChannel, string>>>;
|
|
39
|
+
buyerSnapshot: EventOrderBuyerSnapshot;
|
|
40
|
+
deletedUser?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type EventOrderRefundView = Pick<EventOrderRefund, "amountOre" | "status" | "requestedAt">;
|
|
43
|
+
export type EventOrderView = Pick<EventOrder, "id" | "eventId" | "kind" | "status" | "amountOre" | "currency" | "createdAt" | "expiresAt" | "paidAt" | "cancelledAt"> & {
|
|
44
|
+
refund?: EventOrderRefundView;
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -16,6 +16,10 @@ export enum CloudFunction {
|
|
|
16
16
|
GET_USER_EVENTS = "event/get-user-events",
|
|
17
17
|
JOIN_EVENT = "event/join-event",
|
|
18
18
|
GET_EVENT = "event/get-event",
|
|
19
|
+
GET_PUBLIC_EVENTS = "event/get-public-events",
|
|
20
|
+
CREATE_CHECKOUT = "ticket/create-checkout",
|
|
21
|
+
CONFIRM_ORDER = "ticket/confirm",
|
|
22
|
+
ABANDON_ORDER = "ticket/abandon",
|
|
19
23
|
SUBMIT_CATEGORY_FEEDBACK = "ca/submit-category-feedback",
|
|
20
24
|
CREATE_LIKE = "like/create-like",
|
|
21
25
|
HANDLE_LIKE_SEEN = "like/handle-like-seen",
|
|
@@ -42,6 +42,10 @@ import {
|
|
|
42
42
|
GetEventMatchRequest,
|
|
43
43
|
SendEventFeedbackRequest,
|
|
44
44
|
GetEventParticipantsRequest,
|
|
45
|
+
GetPublicEventsRequest,
|
|
46
|
+
CreateCheckoutRequest,
|
|
47
|
+
ConfirmOrderRequest,
|
|
48
|
+
AbandonOrderRequest,
|
|
45
49
|
} from "./request.types";
|
|
46
50
|
import {
|
|
47
51
|
AddImagesResponse,
|
|
@@ -88,6 +92,10 @@ import {
|
|
|
88
92
|
GetEventMatchResponse,
|
|
89
93
|
SendEventFeedbackResponse,
|
|
90
94
|
GetEventParticipantsResponse,
|
|
95
|
+
GetPublicEventsResponse,
|
|
96
|
+
CreateCheckoutResponse,
|
|
97
|
+
ConfirmOrderResponse,
|
|
98
|
+
AbandonOrderResponse,
|
|
91
99
|
} from "./response.types";
|
|
92
100
|
|
|
93
101
|
/**
|
|
@@ -156,6 +164,22 @@ export type CloudFunctionTypes = {
|
|
|
156
164
|
payload: GetEventRequest;
|
|
157
165
|
response: GetEventResponse;
|
|
158
166
|
};
|
|
167
|
+
[CloudFunction.GET_PUBLIC_EVENTS]: {
|
|
168
|
+
payload: GetPublicEventsRequest;
|
|
169
|
+
response: GetPublicEventsResponse;
|
|
170
|
+
};
|
|
171
|
+
[CloudFunction.CREATE_CHECKOUT]: {
|
|
172
|
+
payload: CreateCheckoutRequest;
|
|
173
|
+
response: CreateCheckoutResponse;
|
|
174
|
+
};
|
|
175
|
+
[CloudFunction.CONFIRM_ORDER]: {
|
|
176
|
+
payload: ConfirmOrderRequest;
|
|
177
|
+
response: ConfirmOrderResponse;
|
|
178
|
+
};
|
|
179
|
+
[CloudFunction.ABANDON_ORDER]: {
|
|
180
|
+
payload: AbandonOrderRequest;
|
|
181
|
+
response: AbandonOrderResponse;
|
|
182
|
+
};
|
|
159
183
|
|
|
160
184
|
// feedback
|
|
161
185
|
[CloudFunction.SUBMIT_FEEDBACK]: {
|
package/src/types/event.types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CAStatus, Gender, MatchmakingMode } from "../enum";
|
|
1
|
+
import { CAStatus, Gender, Market, MatchmakingMode } from "../enum";
|
|
2
2
|
import { CompatibilitySummary } from "./matchmaking.types";
|
|
3
3
|
|
|
4
4
|
type UserId = string;
|
|
@@ -11,7 +11,7 @@ export enum EventAccess {
|
|
|
11
11
|
export type Event = {
|
|
12
12
|
id: string;
|
|
13
13
|
title: string;
|
|
14
|
-
inviteCode
|
|
14
|
+
inviteCode?: string;
|
|
15
15
|
description?: string;
|
|
16
16
|
createdBy: string;
|
|
17
17
|
hostBrand: string;
|
|
@@ -29,8 +29,91 @@ export type Event = {
|
|
|
29
29
|
lastUpdated: string;
|
|
30
30
|
access: EventAccess;
|
|
31
31
|
lastCAReminderAt?: string;
|
|
32
|
+
homeMarket?: Market;
|
|
33
|
+
city?: string;
|
|
34
|
+
eligibility?: EventEligibility;
|
|
35
|
+
priceOre?: number;
|
|
36
|
+
currency?: EventCurrency;
|
|
37
|
+
capacity?: EventCapacity;
|
|
38
|
+
seats?: EventSeats;
|
|
39
|
+
published?: boolean;
|
|
40
|
+
salesOpenAt?: string;
|
|
41
|
+
salesCloseAt?: string;
|
|
42
|
+
decisionAt?: string;
|
|
32
43
|
};
|
|
33
44
|
|
|
45
|
+
export type EventEligibilityInterest = "opposite_gender";
|
|
46
|
+
|
|
47
|
+
export type EventEligibility = {
|
|
48
|
+
markets?: Market[];
|
|
49
|
+
states?: string[];
|
|
50
|
+
minAge?: number;
|
|
51
|
+
maxAge?: number;
|
|
52
|
+
interest?: EventEligibilityInterest;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type EventCurrency = "SEK";
|
|
56
|
+
|
|
57
|
+
export type EventCapacity = {
|
|
58
|
+
male: number;
|
|
59
|
+
female: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type EventSeatCount = {
|
|
63
|
+
held: number;
|
|
64
|
+
sold: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type EventSeats = {
|
|
68
|
+
male: EventSeatCount;
|
|
69
|
+
female: EventSeatCount;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type EventAvailability =
|
|
73
|
+
| "scheduled"
|
|
74
|
+
| "on_sale"
|
|
75
|
+
| "sold_out_for_you"
|
|
76
|
+
| "sales_closed"
|
|
77
|
+
| "not_eligible";
|
|
78
|
+
|
|
79
|
+
export type EventIneligibleReason =
|
|
80
|
+
| "outside_area"
|
|
81
|
+
| "out_of_age_range"
|
|
82
|
+
| "assessment_required";
|
|
83
|
+
|
|
84
|
+
export type EventUserOrderStatus = "none" | "pending" | "paid";
|
|
85
|
+
|
|
86
|
+
type EventOfferDetails = Pick<
|
|
87
|
+
Event,
|
|
88
|
+
| "id"
|
|
89
|
+
| "title"
|
|
90
|
+
| "description"
|
|
91
|
+
| "hostBrand"
|
|
92
|
+
| "eventDateTime"
|
|
93
|
+
| "matchRevealTime"
|
|
94
|
+
| "location"
|
|
95
|
+
| "city"
|
|
96
|
+
| "access"
|
|
97
|
+
> &
|
|
98
|
+
Required<
|
|
99
|
+
Pick<Event, "priceOre" | "currency" | "salesOpenAt" | "salesCloseAt">
|
|
100
|
+
> &
|
|
101
|
+
Pick<EventEligibility, "minAge" | "maxAge"> & {
|
|
102
|
+
userOrderStatus?: EventUserOrderStatus;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type EventOffer = EventOfferDetails &
|
|
106
|
+
(
|
|
107
|
+
| {
|
|
108
|
+
availability: Exclude<EventAvailability, "not_eligible">;
|
|
109
|
+
ineligibleReason?: never;
|
|
110
|
+
}
|
|
111
|
+
| {
|
|
112
|
+
availability: "not_eligible";
|
|
113
|
+
ineligibleReason: EventIneligibleReason;
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
|
|
34
117
|
export type EventParticipation = {
|
|
35
118
|
eventId: string;
|
|
36
119
|
userId: string;
|
|
@@ -41,6 +124,7 @@ export type EventParticipation = {
|
|
|
41
124
|
role: "attendee" | "host" | "admin";
|
|
42
125
|
status: "confirmed" | "pending" | "cancelled";
|
|
43
126
|
mode: MatchmakingMode;
|
|
127
|
+
checkedInAt?: string;
|
|
44
128
|
};
|
|
45
129
|
|
|
46
130
|
export type FullParticipant = EventParticipation & {
|
package/src/types/index.ts
CHANGED
|
@@ -83,6 +83,16 @@ export type GetEventRequest = {
|
|
|
83
83
|
export type GetEventParticipantsRequest = {
|
|
84
84
|
eventId: string;
|
|
85
85
|
};
|
|
86
|
+
export type GetPublicEventsRequest = undefined;
|
|
87
|
+
export type CreateCheckoutRequest = {
|
|
88
|
+
eventId: string;
|
|
89
|
+
};
|
|
90
|
+
export type ConfirmOrderRequest = {
|
|
91
|
+
sessionId: string;
|
|
92
|
+
};
|
|
93
|
+
export type AbandonOrderRequest = {
|
|
94
|
+
eventId: string;
|
|
95
|
+
};
|
|
86
96
|
|
|
87
97
|
// feedback
|
|
88
98
|
export type SubmitFeedbackRequest = {
|
|
@@ -3,7 +3,13 @@ import {
|
|
|
3
3
|
ConsultationInterestSummary,
|
|
4
4
|
} from "./consultation.types";
|
|
5
5
|
import { Submission, CategoryEvaluation } from "./submission.types";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Event,
|
|
8
|
+
EventOffer,
|
|
9
|
+
FullParticipant,
|
|
10
|
+
FullParticipantWithCS,
|
|
11
|
+
} from "./event.types";
|
|
12
|
+
import { EventOrderView } from "./ticket.types";
|
|
7
13
|
import { UserMatch } from "./match.types";
|
|
8
14
|
import { MatchableUser, MatchCheck } from "./matchmaking.types";
|
|
9
15
|
import { Message } from "./message.types";
|
|
@@ -60,6 +66,14 @@ export type GetEventParticipantsResponse = {
|
|
|
60
66
|
eventMatchId: string | null;
|
|
61
67
|
eventMatchIds: string[];
|
|
62
68
|
};
|
|
69
|
+
export type GetPublicEventsResponse = EventOffer[];
|
|
70
|
+
export type CreateCheckoutResponse = {
|
|
71
|
+
orderId: string;
|
|
72
|
+
checkoutUrl: string;
|
|
73
|
+
expiresAt: string;
|
|
74
|
+
};
|
|
75
|
+
export type ConfirmOrderResponse = EventOrderView;
|
|
76
|
+
export type AbandonOrderResponse = void;
|
|
63
77
|
|
|
64
78
|
// feedback
|
|
65
79
|
export type SubmitFeedbackResponse = undefined;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Gender } from "../enum";
|
|
2
|
+
import { EventCurrency } from "./event.types";
|
|
3
|
+
|
|
4
|
+
export type EventOrderStatus =
|
|
5
|
+
| "pending"
|
|
6
|
+
| "paid"
|
|
7
|
+
| "expired"
|
|
8
|
+
| "abandoned"
|
|
9
|
+
| "cancelled"
|
|
10
|
+
| "refund_pending"
|
|
11
|
+
| "refunded"
|
|
12
|
+
| "refund_failed";
|
|
13
|
+
|
|
14
|
+
export type EventOrderKind = "paid" | "comp";
|
|
15
|
+
|
|
16
|
+
export type EventOrderRefundReason =
|
|
17
|
+
| "user_cancel"
|
|
18
|
+
| "event_cancelled"
|
|
19
|
+
| "admin"
|
|
20
|
+
| "deletion"
|
|
21
|
+
| "oversold";
|
|
22
|
+
|
|
23
|
+
export type EventOrderRefundStatus = "pending" | "succeeded" | "failed";
|
|
24
|
+
|
|
25
|
+
export type EventOrderRefund = {
|
|
26
|
+
stripeRefundId?: string;
|
|
27
|
+
amountOre: number;
|
|
28
|
+
reason: EventOrderRefundReason;
|
|
29
|
+
requestedAt: string;
|
|
30
|
+
status: EventOrderRefundStatus;
|
|
31
|
+
failedAt?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type EventOrderMessageChannel = "push" | "email" | "iam";
|
|
35
|
+
|
|
36
|
+
export type EventOrderBuyerSnapshot = {
|
|
37
|
+
firstName: string;
|
|
38
|
+
email: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type EventOrder = {
|
|
42
|
+
id: string;
|
|
43
|
+
eventId: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
kind: EventOrderKind;
|
|
46
|
+
status: EventOrderStatus;
|
|
47
|
+
gender: Gender;
|
|
48
|
+
amountOre: number;
|
|
49
|
+
currency: EventCurrency;
|
|
50
|
+
priceSnapshotOre: number;
|
|
51
|
+
stripeProductId?: string;
|
|
52
|
+
stripeCheckoutSessionId?: string;
|
|
53
|
+
stripePaymentIntentId?: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
expiresAt: string;
|
|
56
|
+
paidAt?: string;
|
|
57
|
+
cancelledAt?: string;
|
|
58
|
+
refund?: EventOrderRefund;
|
|
59
|
+
messages?: Record<string, Partial<Record<EventOrderMessageChannel, string>>>;
|
|
60
|
+
buyerSnapshot: EventOrderBuyerSnapshot;
|
|
61
|
+
deletedUser?: boolean;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type EventOrderRefundView = Pick<
|
|
65
|
+
EventOrderRefund,
|
|
66
|
+
"amountOre" | "status" | "requestedAt"
|
|
67
|
+
>;
|
|
68
|
+
|
|
69
|
+
export type EventOrderView = Pick<
|
|
70
|
+
EventOrder,
|
|
71
|
+
| "id"
|
|
72
|
+
| "eventId"
|
|
73
|
+
| "kind"
|
|
74
|
+
| "status"
|
|
75
|
+
| "amountOre"
|
|
76
|
+
| "currency"
|
|
77
|
+
| "createdAt"
|
|
78
|
+
| "expiresAt"
|
|
79
|
+
| "paidAt"
|
|
80
|
+
| "cancelledAt"
|
|
81
|
+
> & {
|
|
82
|
+
refund?: EventOrderRefundView;
|
|
83
|
+
};
|