@qrush/types 2.0.6 → 2.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.
Files changed (2) hide show
  1. package/dist/Promotion.d.ts +14 -24
  2. package/package.json +1 -1
@@ -1,8 +1,16 @@
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
- export type PromotionType = "event" | "location";
5
4
  export type PromotionStatus = "active" | "inactive" | "archived";
5
+ export interface CustomizationRules {
6
+ allowTitleEdit: boolean;
7
+ allowDescriptionEdit: boolean;
8
+ allowSavingEdit: boolean;
9
+ savingMin?: number;
10
+ savingMax?: number;
11
+ allowActiveDaysEdit: boolean;
12
+ allowResetMinutesEdit: boolean;
13
+ }
6
14
  export interface PromotionTemplate {
7
15
  id: string;
8
16
  createdAt: Timestamp;
@@ -16,23 +24,15 @@ export interface PromotionTemplate {
16
24
  defaultSaving: number;
17
25
  defaultActiveDays?: number[];
18
26
  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
- };
27
+ customizationRules: CustomizationRules;
28
28
  displayOrder?: number;
29
29
  tags?: string[];
30
30
  }
31
31
  export interface PromotionInstance {
32
32
  id: string;
33
- templateId?: string;
34
33
  locationId?: string;
35
34
  userId?: string;
35
+ templateId?: string;
36
36
  origin: "template" | "custom";
37
37
  createdAt: Timestamp;
38
38
  updatedAt: Timestamp;
@@ -43,9 +43,10 @@ export interface PromotionInstance {
43
43
  saving: number;
44
44
  itemType: PromotionItemType;
45
45
  dealType: PromotionDealType;
46
- promotionType: PromotionType;
47
46
  activeDays: number[];
48
47
  resetMinutes: number;
48
+ resetTime: number;
49
+ customizationRules: CustomizationRules;
49
50
  dailyRedemptionCount: number;
50
51
  totalRedemptionCount: number;
51
52
  lastRedemptionReset?: Timestamp;
@@ -58,7 +59,6 @@ export interface PromotionRedemption {
58
59
  locationId: string;
59
60
  eventId?: string;
60
61
  promotionTitle: string;
61
- promotionType: PromotionType;
62
62
  itemType: PromotionItemType;
63
63
  dealType?: PromotionDealType;
64
64
  savingAmount: number;
@@ -95,7 +95,7 @@ export interface LocationPermission {
95
95
  canEditLocationDetails: boolean;
96
96
  canViewAnalytics: boolean;
97
97
  canManagePromotions: boolean;
98
- canUserLocationPromotions: boolean;
98
+ canUseLocationPromotions: boolean;
99
99
  grantedAt: Timestamp;
100
100
  grantedBy: string;
101
101
  expiresAt?: Timestamp;
@@ -107,7 +107,6 @@ export interface ActivePromotion {
107
107
  instanceId: string;
108
108
  timeSlots?: TimeSlot[];
109
109
  displayOrder?: number;
110
- promotionType: PromotionType;
111
110
  titleSnapshot: string;
112
111
  savingSnapshot: number;
113
112
  descriptionSnapshot: string;
@@ -119,15 +118,6 @@ export interface TimeSlot {
119
118
  from: Timestamp;
120
119
  to: Timestamp;
121
120
  }
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
121
  export interface AvailablePromotion {
132
122
  instance: PromotionInstance;
133
123
  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.8",
4
4
  "description": "Shared TypeScript types for the QRush ecosystem",
5
5
  "type": "module",
6
6
  "scripts": {