@simonarcher/fika-types 1.0.57 → 1.0.59

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
@@ -46,10 +46,21 @@ export interface LoyaltyVoucher {
46
46
  id: string;
47
47
  /** User who earned the voucher */
48
48
  userId: string;
49
+ /** Type of voucher - 'shop_specific' or 'fika_universal' */
50
+ voucherType: 'shop_specific' | 'fika_universal';
49
51
  /** Shop where voucher can be redeemed */
50
- shopId: string;
52
+ shopId?: string;
51
53
  /** Stamps used to create this voucher */
52
- stamps: VoucherStampData[];
54
+ stamps?: VoucherStampData[];
55
+ /** Platform-level reward configuration */
56
+ platformReward?: {
57
+ rewardType: string;
58
+ rewardDescription: string;
59
+ maxValue?: number;
60
+ currency?: string;
61
+ };
62
+ /** Information about how this voucher was obtained */
63
+ source: VoucherSource;
53
64
  /** When voucher was created */
54
65
  createdAt: AdminTimestamp;
55
66
  /** Whether voucher is still valid */
@@ -72,6 +83,8 @@ export interface LoyaltyVoucher {
72
83
  rewardType: string;
73
84
  /** Human-readable reward description */
74
85
  rewardDescription: string;
86
+ /** Expiration date for the voucher (optional) */
87
+ expiresAt?: AdminTimestamp;
75
88
  }
76
89
  /**
77
90
  * Request to generate a new QR token for a voucher
@@ -361,3 +374,48 @@ export interface UserStampProgressResponse {
361
374
  /** Error message if failed */
362
375
  message?: string;
363
376
  }
377
+ export interface FikaVoucher extends LoyaltyVoucher {
378
+ /** Type of voucher - 'shop_specific' or 'fika_universal' */
379
+ voucherType: 'shop_specific' | 'fika_universal';
380
+ /** For FIKA vouchers, this indicates it can be used at any participating shop */
381
+ isUniversal: boolean;
382
+ /** Platform-level reward configuration */
383
+ platformReward?: {
384
+ rewardType: string;
385
+ rewardDescription: string;
386
+ maxValue?: number;
387
+ };
388
+ }
389
+ export interface ShopLoyaltyConfig {
390
+ hasPlatformLoyaltyRewards: boolean;
391
+ stampsRequired: number;
392
+ rewardType: string;
393
+ rewardValue: string;
394
+ rewardDescription: string;
395
+ status: 'active' | 'inactive' | 'requested' | 'suspended';
396
+ acceptsFikaVouchers: boolean;
397
+ fikaVoucherReward?: {
398
+ rewardType: string;
399
+ rewardDescription: string;
400
+ maxValue?: number;
401
+ };
402
+ }
403
+ 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';
406
+ /** ID of the source (campaign ID, quest ID, gift ID, etc.) */
407
+ sourceId?: string;
408
+ /** Name/description of the source */
409
+ sourceName?: string;
410
+ /** Additional metadata about the source */
411
+ metadata?: {
412
+ campaignType?: string;
413
+ questName?: string;
414
+ giftFromUserId?: string;
415
+ giftMessage?: string;
416
+ adminReason?: string;
417
+ [key: string]: any;
418
+ };
419
+ }
420
+ export declare const isUniversalVoucher: (voucher: LoyaltyVoucher) => boolean;
421
+ export declare const isShopSpecificVoucher: (voucher: LoyaltyVoucher) => boolean;
package/dist/loyalty.js CHANGED
@@ -1,2 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isShopSpecificVoucher = exports.isUniversalVoucher = void 0;
4
+ // Helper functions
5
+ const isUniversalVoucher = (voucher) => {
6
+ return voucher.voucherType === 'fika_universal';
7
+ };
8
+ exports.isUniversalVoucher = isUniversalVoucher;
9
+ const isShopSpecificVoucher = (voucher) => {
10
+ return voucher.voucherType === 'shop_specific';
11
+ };
12
+ exports.isShopSpecificVoucher = isShopSpecificVoucher;
package/dist/quest.d.ts CHANGED
@@ -33,7 +33,7 @@ export interface QuestAction {
33
33
  metadata?: any;
34
34
  }
35
35
  export interface QuestReward {
36
- type: 'points' | 'badge' | 'coupon';
36
+ type: 'points' | 'badge' | 'coupon' | 'shopify_coupon' | 'fika_voucher' | 'third_party_coupon';
37
37
  value: number | string;
38
38
  metadata?: any;
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonarcher/fika-types",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "Shared TypeScript types for Fika projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",