@qrush/types 2.0.6 → 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 -22
  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,7 +100,7 @@ export interface LocationPermission {
95
100
  canEditLocationDetails: boolean;
96
101
  canViewAnalytics: boolean;
97
102
  canManagePromotions: boolean;
98
- canUserLocationPromotions: boolean;
103
+ canUseLocationPromotions: boolean;
99
104
  grantedAt: Timestamp;
100
105
  grantedBy: string;
101
106
  expiresAt?: Timestamp;
@@ -107,7 +112,6 @@ export interface ActivePromotion {
107
112
  instanceId: string;
108
113
  timeSlots?: TimeSlot[];
109
114
  displayOrder?: number;
110
- promotionType: PromotionType;
111
115
  titleSnapshot: string;
112
116
  savingSnapshot: number;
113
117
  descriptionSnapshot: string;
@@ -119,15 +123,6 @@ export interface TimeSlot {
119
123
  from: Timestamp;
120
124
  to: Timestamp;
121
125
  }
122
- export interface PromotionAnalytics {
123
- instanceId: string;
124
- period: "day" | "week" | "month";
125
- redemptions: number;
126
- uniqueUsers: number;
127
- byEvent: Record<string, number>;
128
- byDayOfWeek: Record<number, number>;
129
- byHour: Record<number, number>;
130
- }
131
126
  export interface AvailablePromotion {
132
127
  instance: PromotionInstance;
133
128
  permission: PromotionInstancePermission;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrush/types",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Shared TypeScript types for the QRush ecosystem",
5
5
  "type": "module",
6
6
  "scripts": {