@qrush/types 2.0.5 → 2.0.7

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.
Files changed (2) hide show
  1. package/dist/Promotion.d.ts +17 -21
  2. package/package.json +1 -1
@@ -1,8 +1,20 @@
1
1
  import { Timestamp } from "@firebase/firestore";
2
2
  export type PromotionItemType = "shot" | "drink" | "beer" | "cocktail" | "entry" | "food" | "merch" | "vip" | "skipline" | "service";
3
3
  export type PromotionDealType = "2for1" | "free" | "discount" | "upgrade" | "combo" | "happyhour";
4
+ /**
5
+ * @deprecated
6
+ */
4
7
  export type PromotionType = "event" | "location";
5
8
  export type PromotionStatus = "active" | "inactive" | "archived";
9
+ export interface CustomizationRules {
10
+ allowTitleEdit: boolean;
11
+ allowDescriptionEdit: boolean;
12
+ allowSavingEdit: boolean;
13
+ savingMin?: number;
14
+ savingMax?: number;
15
+ allowActiveDaysEdit: boolean;
16
+ allowResetMinutesEdit: boolean;
17
+ }
6
18
  export interface PromotionTemplate {
7
19
  id: string;
8
20
  createdAt: Timestamp;
@@ -16,23 +28,15 @@ export interface PromotionTemplate {
16
28
  defaultSaving: number;
17
29
  defaultActiveDays?: number[];
18
30
  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
- };
31
+ customizationRules: CustomizationRules;
28
32
  displayOrder?: number;
29
33
  tags?: string[];
30
34
  }
31
35
  export interface PromotionInstance {
32
36
  id: string;
33
- templateId?: string;
34
37
  locationId?: string;
35
38
  userId?: string;
39
+ templateId?: string;
36
40
  origin: "template" | "custom";
37
41
  createdAt: Timestamp;
38
42
  updatedAt: Timestamp;
@@ -46,6 +50,8 @@ export interface PromotionInstance {
46
50
  promotionType: PromotionType;
47
51
  activeDays: number[];
48
52
  resetMinutes: number;
53
+ resetTime: number;
54
+ customizationRules: CustomizationRules;
49
55
  dailyRedemptionCount: number;
50
56
  totalRedemptionCount: number;
51
57
  lastRedemptionReset?: Timestamp;
@@ -58,7 +64,6 @@ export interface PromotionRedemption {
58
64
  locationId: string;
59
65
  eventId?: string;
60
66
  promotionTitle: string;
61
- promotionType: PromotionType;
62
67
  itemType: PromotionItemType;
63
68
  dealType?: PromotionDealType;
64
69
  savingAmount: number;
@@ -95,6 +100,7 @@ export interface LocationPermission {
95
100
  canEditLocationDetails: boolean;
96
101
  canViewAnalytics: boolean;
97
102
  canManagePromotions: boolean;
103
+ canUseLocationPromotions: boolean;
98
104
  grantedAt: Timestamp;
99
105
  grantedBy: string;
100
106
  expiresAt?: Timestamp;
@@ -106,7 +112,6 @@ export interface ActivePromotion {
106
112
  instanceId: string;
107
113
  timeSlots?: TimeSlot[];
108
114
  displayOrder?: number;
109
- promotionType: PromotionType;
110
115
  titleSnapshot: string;
111
116
  savingSnapshot: number;
112
117
  descriptionSnapshot: string;
@@ -118,15 +123,6 @@ export interface TimeSlot {
118
123
  from: Timestamp;
119
124
  to: Timestamp;
120
125
  }
121
- export interface PromotionAnalytics {
122
- instanceId: string;
123
- period: "day" | "week" | "month";
124
- redemptions: number;
125
- uniqueUsers: number;
126
- byEvent: Record<string, number>;
127
- byDayOfWeek: Record<number, number>;
128
- byHour: Record<number, number>;
129
- }
130
126
  export interface AvailablePromotion {
131
127
  instance: PromotionInstance;
132
128
  permission: PromotionInstancePermission;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrush/types",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Shared TypeScript types for the QRush ecosystem",
5
5
  "type": "module",
6
6
  "scripts": {