@simonarcher/fika-types 1.0.80 → 1.0.82

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/loyalty.d.ts CHANGED
@@ -17,6 +17,20 @@ export interface QRTokenPayload {
17
17
  /** 6-digit backup verification code */
18
18
  securityCode: string;
19
19
  }
20
+ /**
21
+ * JWT payload structure for open voucher claim tokens
22
+ * Contains voucher identifier for claiming open vouchers
23
+ */
24
+ export interface ClaimTokenPayload {
25
+ /** Unique voucher identifier */
26
+ voucherId: string;
27
+ /** Token expiry timestamp (Unix time) */
28
+ exp: number;
29
+ /** Token issued at timestamp (Unix time) */
30
+ iat: number;
31
+ /** Token type identifier */
32
+ type: 'claim';
33
+ }
20
34
  /**
21
35
  * Enhanced stamp data for voucher storage
22
36
  * Contains detailed information about each stamp used in a voucher
@@ -44,8 +58,8 @@ export interface VoucherStampData {
44
58
  export interface LoyaltyVoucher {
45
59
  /** Unique voucher identifier */
46
60
  id: string;
47
- /** User who earned the voucher */
48
- userId: string;
61
+ /** User who earned the voucher (null for unclaimed open vouchers) */
62
+ userId: string | null;
49
63
  /** Type of voucher - 'shop_specific' or 'fika_universal' */
50
64
  voucherType: 'shop_specific' | 'fika_universal';
51
65
  /** Shop where voucher can be redeemed */
@@ -85,6 +99,16 @@ export interface LoyaltyVoucher {
85
99
  rewardDescription: string;
86
100
  /** Expiration date for the voucher (optional) */
87
101
  expiresAt?: AdminTimestamp;
102
+ /** Claim token for open vouchers (JWT token for claiming) */
103
+ claimToken?: string;
104
+ /** When claim token expires (90 days from creation) */
105
+ claimTokenExpiresAt?: AdminTimestamp;
106
+ /** When voucher was claimed (for open vouchers) */
107
+ claimedAt?: AdminTimestamp;
108
+ /** User ID who claimed the voucher (for open vouchers) */
109
+ claimedBy?: string;
110
+ /** Flag to identify open vouchers */
111
+ isOpenVoucher?: boolean;
88
112
  }
89
113
  /**
90
114
  * Request to generate a new QR token for a voucher
@@ -401,8 +425,8 @@ export interface ShopLoyaltyConfig {
401
425
  };
402
426
  }
403
427
  export interface VoucherSource {
404
- /** Type of source - 'stamp_collection', 'campaign', 'gift', 'admin_grant', 'quest_reward' */
405
- sourceType: 'stamp_collection' | 'campaign' | 'gift' | 'admin_grant' | 'quest_reward' | 'platform_reward';
428
+ /** Type of source - 'stamp_collection', 'campaign', 'gift', 'admin_grant', 'quest_reward', 'open_voucher' */
429
+ sourceType: 'stamp_collection' | 'campaign' | 'gift' | 'admin_grant' | 'quest_reward' | 'platform_reward' | 'open_voucher';
406
430
  /** ID of the source (campaign ID, quest ID, gift ID, etc.) */
407
431
  sourceId?: string;
408
432
  /** Name/description of the source */
@@ -21,6 +21,34 @@ export interface CoffeeCorrection {
21
21
  name: string;
22
22
  }>;
23
23
  }
24
+ /**
25
+ * Interface for brew methods corrections
26
+ */
27
+ export interface BrewMethodsCorrection {
28
+ methodsToAdd: string[];
29
+ methodsToRemove: string[];
30
+ existingMethods: string[];
31
+ }
32
+ /**
33
+ * Interface for features corrections
34
+ * Maps feature keys to their corrected values: true (yes), false (no), or null (unknown)
35
+ */
36
+ export interface FeaturesCorrection {
37
+ featureChanges: Record<string, boolean | null>;
38
+ existingFeatures: Record<string, boolean | null>;
39
+ }
40
+ /**
41
+ * Interface for menu corrections (free-form text)
42
+ */
43
+ export interface MenuCorrection {
44
+ text: string;
45
+ }
46
+ /**
47
+ * Interface for other corrections (free-form text)
48
+ */
49
+ export interface OtherCorrection {
50
+ text: string;
51
+ }
24
52
  /**
25
53
  * Interface for shop correction submission data
26
54
  */
@@ -29,6 +57,10 @@ export interface ShopCorrectionData {
29
57
  shopName: string;
30
58
  correctionType: CorrectionType;
31
59
  coffeeCorrection?: CoffeeCorrection;
60
+ brewMethodsCorrection?: BrewMethodsCorrection;
61
+ featuresCorrection?: FeaturesCorrection;
62
+ menuCorrection?: MenuCorrection;
63
+ otherCorrection?: OtherCorrection;
32
64
  userId: string;
33
65
  userName?: string;
34
66
  timestamp: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonarcher/fika-types",
3
- "version": "1.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "Shared TypeScript types for Fika projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",