@qrush/types 1.1.19 → 2.0.1
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/Events.d.ts +12 -8
- package/dist/Events.js +1 -1
- package/dist/Location.d.ts +11 -3
- package/dist/Promotion.d.ts +103 -38
- package/dist/Promotion.js +0 -2
- package/package.json +1 -1
package/dist/Events.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Timestamp, FieldValue } from
|
|
1
|
+
import type { Timestamp, FieldValue } from "@firebase/firestore";
|
|
2
2
|
import { FireQueryDocSnapshotRef } from "./CustomDocType.js";
|
|
3
3
|
import { IFireMetaPossibleTags } from "./Meta.js";
|
|
4
|
-
import musicGenres from
|
|
5
|
-
import { LocationTypeArray, LocationTypeSlugArray } from
|
|
6
|
-
import { Features, Location, EventCategory, EventCategorySlug } from
|
|
7
|
-
import {
|
|
8
|
-
export { EventCategory, EventCategorySlug, eventCategories, Features, Location } from
|
|
4
|
+
import musicGenres from "./Genres.js";
|
|
5
|
+
import { LocationTypeArray, LocationTypeSlugArray } from "./Location.js";
|
|
6
|
+
import { Features, Location, EventCategory, EventCategorySlug } from "./Common.js";
|
|
7
|
+
import { ActivePromotion } from "./Promotion.js";
|
|
8
|
+
export { EventCategory, EventCategorySlug, eventCategories, Features, Location, } from "./Common.js";
|
|
9
9
|
export interface IFireEvent {
|
|
10
10
|
id: string;
|
|
11
11
|
name: string;
|
|
@@ -26,7 +26,7 @@ export interface IFireEvent {
|
|
|
26
26
|
demoEvent: boolean;
|
|
27
27
|
draftMode: boolean;
|
|
28
28
|
topPickEvent?: boolean | undefined;
|
|
29
|
-
promotedBy?:
|
|
29
|
+
promotedBy?: "LFF" | "DFF" | undefined;
|
|
30
30
|
isPersonalEvent?: boolean | undefined;
|
|
31
31
|
tags: string[] | IFireMetaPossibleTags["tags"];
|
|
32
32
|
properties: EventProperties;
|
|
@@ -42,7 +42,11 @@ export interface IFireEvent {
|
|
|
42
42
|
}[];
|
|
43
43
|
createdAt?: Timestamp;
|
|
44
44
|
modifiedAt?: Timestamp | null;
|
|
45
|
-
|
|
45
|
+
createdBy: string;
|
|
46
|
+
locationId: string;
|
|
47
|
+
activePromotions: ActivePromotion[];
|
|
48
|
+
lastModifiedBy?: string;
|
|
49
|
+
lastModifiedAt?: Timestamp;
|
|
46
50
|
}
|
|
47
51
|
export declare const eventTagsIsNotString: (tags: string[] | IFireMetaPossibleTags["tags"]) => tags is IFireMetaPossibleTags["tags"];
|
|
48
52
|
export interface TicketType {
|
package/dist/Events.js
CHANGED
package/dist/Location.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FireQueryDocSnapshotRef } from "./CustomDocType.js";
|
|
2
2
|
import { Location as BaseLocation, Features } from "./Common.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ActivePromotion } from "./Promotion.js";
|
|
4
4
|
export declare const LOCATION_TYPE_MAPPING: {
|
|
5
5
|
readonly Bar: "bars";
|
|
6
6
|
readonly Outdoor: "outdoor";
|
|
@@ -30,7 +30,7 @@ export interface IFireEventLegacy {
|
|
|
30
30
|
customRadiusM?: number;
|
|
31
31
|
}
|
|
32
32
|
export type IFireLocation = {
|
|
33
|
-
id
|
|
33
|
+
id: string;
|
|
34
34
|
title: string;
|
|
35
35
|
titleSlug: string;
|
|
36
36
|
isPremium: boolean;
|
|
@@ -85,6 +85,14 @@ export type IFireLocation = {
|
|
|
85
85
|
website?: string;
|
|
86
86
|
socialMedia?: Partial<Record<SocialMediaPlatform, string>>;
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
timezone: string;
|
|
89
|
+
defaultPromoterPermissions?: {
|
|
90
|
+
canCreateEvents: boolean;
|
|
91
|
+
canViewAnalytics: boolean;
|
|
92
|
+
};
|
|
93
|
+
activePromoterCount?: number;
|
|
94
|
+
totalEventsCreated?: number;
|
|
95
|
+
activeOwnerCount?: number;
|
|
96
|
+
promotions?: ActivePromotion[];
|
|
89
97
|
};
|
|
90
98
|
export type FireLocationSnapshotRef = FireQueryDocSnapshotRef<IFireLocation>;
|
package/dist/Promotion.d.ts
CHANGED
|
@@ -1,60 +1,125 @@
|
|
|
1
1
|
import { Timestamp } from "@firebase/firestore";
|
|
2
|
-
export type PromotionItemType = "shot" | "drink" | "entry" | "merch" | "vip" | "skipline";
|
|
3
|
-
export type PromotionDealType = "2for1" | "free" | "discount";
|
|
2
|
+
export type PromotionItemType = "shot" | "drink" | "beer" | "cocktail" | "entry" | "food" | "merch" | "vip" | "skipline" | "service";
|
|
3
|
+
export type PromotionDealType = "2for1" | "free" | "discount" | "upgrade" | "combo" | "happyhour";
|
|
4
4
|
export type PromotionType = "event" | "location";
|
|
5
5
|
export type PromotionStatus = "active" | "inactive" | "archived";
|
|
6
6
|
export interface PromotionTemplate {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: Timestamp;
|
|
9
|
+
updatedAt: Timestamp;
|
|
10
|
+
createdBy: string;
|
|
11
|
+
status: "active" | "archived";
|
|
7
12
|
title: string;
|
|
8
13
|
description: string;
|
|
9
|
-
saving: number;
|
|
10
|
-
tags: string[];
|
|
11
14
|
itemType: PromotionItemType;
|
|
12
|
-
dealType
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
dealType: PromotionDealType;
|
|
16
|
+
defaultSaving: number;
|
|
17
|
+
defaultActiveDays?: number[];
|
|
18
|
+
defaultResetMinutes: number;
|
|
19
|
+
customizationRules: {
|
|
20
|
+
allowTitleEdit: boolean;
|
|
21
|
+
allowDescriptionEdit: boolean;
|
|
22
|
+
allowSavingEdit: boolean;
|
|
23
|
+
savingMin?: number;
|
|
24
|
+
savingMax?: number;
|
|
25
|
+
allowActiveDaysEdit: boolean;
|
|
26
|
+
allowResetMinutesEdit: boolean;
|
|
27
|
+
};
|
|
28
|
+
displayOrder?: number;
|
|
29
|
+
tags?: string[];
|
|
22
30
|
}
|
|
23
31
|
export interface PromotionInstance {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
locationId
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
status: PromotionStatus;
|
|
32
|
+
id: string;
|
|
33
|
+
templateId?: string;
|
|
34
|
+
locationId?: string;
|
|
35
|
+
userId?: string;
|
|
36
|
+
origin: "template" | "custom";
|
|
37
|
+
createdAt: Timestamp;
|
|
38
|
+
updatedAt: Timestamp;
|
|
39
|
+
createdBy: string;
|
|
40
|
+
status: "active" | "paused" | "archived";
|
|
34
41
|
title: string;
|
|
35
42
|
description: string;
|
|
36
43
|
saving: number;
|
|
37
44
|
itemType: PromotionItemType;
|
|
38
|
-
dealType
|
|
45
|
+
dealType: PromotionDealType;
|
|
46
|
+
promotionType: PromotionType;
|
|
47
|
+
activeDays: number[];
|
|
48
|
+
resetMinutes: number;
|
|
49
|
+
dailyRedemptionCount: number;
|
|
50
|
+
totalRedemptionCount: number;
|
|
51
|
+
lastRedemptionReset?: Timestamp;
|
|
52
|
+
displayOrder?: number;
|
|
39
53
|
}
|
|
40
54
|
export interface PromotionRedemption {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
promotionType: PromotionType;
|
|
55
|
+
id: string;
|
|
56
|
+
userId: string;
|
|
57
|
+
instanceId: string;
|
|
45
58
|
locationId: string;
|
|
46
59
|
eventId?: string;
|
|
47
|
-
|
|
48
|
-
|
|
60
|
+
promotionTitle: string;
|
|
61
|
+
promotionType: PromotionType;
|
|
49
62
|
itemType: PromotionItemType;
|
|
50
63
|
dealType?: PromotionDealType;
|
|
64
|
+
savingAmount: number;
|
|
65
|
+
redeemedAt: Timestamp;
|
|
66
|
+
}
|
|
67
|
+
export interface PromotionInstancePermission {
|
|
68
|
+
userId: string;
|
|
69
|
+
isOwner: boolean;
|
|
70
|
+
canUse: boolean;
|
|
71
|
+
canModify: boolean;
|
|
72
|
+
canViewAnalytics: boolean;
|
|
73
|
+
canManagePromotions: boolean;
|
|
74
|
+
grantedAt: Timestamp;
|
|
75
|
+
grantedBy: string;
|
|
76
|
+
expiresAt?: Timestamp;
|
|
77
|
+
}
|
|
78
|
+
export interface LocationPermission {
|
|
79
|
+
userId: string;
|
|
80
|
+
locationId: string;
|
|
81
|
+
isOwner: boolean;
|
|
82
|
+
role?: "owner" | "manager" | "promoter" | "staff";
|
|
83
|
+
canCreateEvents: boolean;
|
|
84
|
+
canManageStaff: boolean;
|
|
85
|
+
canEditLocationDetails: boolean;
|
|
86
|
+
canViewAnalytics: boolean;
|
|
87
|
+
canManagePromotions: boolean;
|
|
88
|
+
grantedAt: Timestamp;
|
|
89
|
+
grantedBy: string;
|
|
90
|
+
expiresAt?: Timestamp;
|
|
91
|
+
revokedAt?: Timestamp;
|
|
92
|
+
revokedBy?: string;
|
|
93
|
+
revocationReason?: string;
|
|
51
94
|
}
|
|
52
|
-
export interface
|
|
53
|
-
|
|
54
|
-
|
|
95
|
+
export interface ActivePromotion {
|
|
96
|
+
instanceId: string;
|
|
97
|
+
timeSlots?: TimeSlot[];
|
|
98
|
+
displayOrder?: number;
|
|
55
99
|
promotionType: PromotionType;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
100
|
+
titleSnapshot: string;
|
|
101
|
+
savingSnapshot: number;
|
|
102
|
+
descriptionSnapshot: string;
|
|
103
|
+
itemTypeSnapshot: PromotionItemType;
|
|
104
|
+
dealTypeSnapshot?: PromotionDealType;
|
|
105
|
+
resetMinutesSnapshot: number;
|
|
106
|
+
}
|
|
107
|
+
export interface TimeSlot {
|
|
108
|
+
from: Timestamp;
|
|
109
|
+
to: Timestamp;
|
|
110
|
+
}
|
|
111
|
+
export interface PromotionAnalytics {
|
|
112
|
+
instanceId: string;
|
|
113
|
+
period: "day" | "week" | "month";
|
|
114
|
+
redemptions: number;
|
|
115
|
+
uniqueUsers: number;
|
|
116
|
+
byEvent: Record<string, number>;
|
|
117
|
+
byDayOfWeek: Record<number, number>;
|
|
118
|
+
byHour: Record<number, number>;
|
|
119
|
+
}
|
|
120
|
+
export interface AvailablePromotion {
|
|
121
|
+
instance: PromotionInstance;
|
|
122
|
+
permission: PromotionInstancePermission;
|
|
123
|
+
isActive: boolean;
|
|
124
|
+
nextAvailableAt?: Timestamp;
|
|
60
125
|
}
|
package/dist/Promotion.js
CHANGED