@open-tender/types 0.3.12 → 0.3.14

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.
@@ -1,36 +1,9 @@
1
- import { Money, OrderType } from '../../global';
2
- export interface LoyaltyCredit {
3
- current: string;
4
- total: string;
5
- }
1
+ import { DiscountType, Money } from '../../global';
6
2
  export declare type LoyaltyType = 'DOLLARS' | 'ORDERS' | 'POINTS';
7
- export interface LoyaltyPoints {
8
- expiration_days: number;
9
- name: string;
10
- points: number;
11
- points_per_dollar: number;
12
- remaining?: number;
13
- balance?: number;
14
- index?: number;
15
- available?: number;
16
- applied?: number;
17
- }
18
- export interface LoyaltyRedemption {
19
- order_type: OrderType;
20
- reward: string;
21
- threshold: string;
22
- type: string;
23
- }
24
- export interface LoyaltySpend {
25
- current: string | null;
26
- order_type: OrderType;
27
- total: string;
28
- type: string;
29
- }
30
3
  export interface LoyaltyThreshold {
4
+ description: string;
31
5
  name: string;
32
6
  points: number;
33
- description: string;
34
7
  }
35
8
  export declare type LoyaltyThresholds = LoyaltyThreshold[];
36
9
  export interface LoyaltyThresholdAugmented extends LoyaltyThreshold {
@@ -38,41 +11,47 @@ export interface LoyaltyThresholdAugmented extends LoyaltyThreshold {
38
11
  isFilled: boolean;
39
12
  }
40
13
  export declare type LoyaltyThresholdsAugmented = LoyaltyThresholdAugmented[];
41
- export interface LoyaltyDiscount {
14
+ export interface LoyaltyReward {
42
15
  amount: string;
16
+ created_at?: string;
43
17
  description: string;
44
18
  discount_id: number;
45
- discount_type: string;
19
+ discount_type: DiscountType;
20
+ expires_at?: string;
46
21
  name: string;
47
22
  title: string;
48
23
  }
24
+ export declare type LoyaltyRewards = LoyaltyReward[];
49
25
  export interface LoyaltyTier {
50
26
  description: string;
51
- discount: LoyaltyDiscount | null;
52
27
  hex_code: string;
53
- is_current_tier: true;
28
+ is_current_tier: boolean;
54
29
  name: string;
55
- threshold: string;
30
+ reward: LoyaltyReward | null;
31
+ threshold: Money;
56
32
  tier_no: number;
57
33
  }
34
+ export declare type LoyaltyTier2 = LoyaltyTier[];
58
35
  export interface LoyaltyStatus {
59
- days: number | null;
60
36
  progress: Money;
61
- tier: LoyaltyTier | null;
37
+ tiers: LoyaltyTier2;
38
+ }
39
+ export declare type LoyaltyPerkType = 'BANKABLE_POINTS' | 'DISCRETE_REWARD' | 'DOLLARS_CREDIT';
40
+ export interface LoyaltyPerk {
41
+ credit: Money | null;
42
+ loyalty_perk: LoyaltyPerkType;
43
+ progress: Money | null;
44
+ rewards?: LoyaltyRewards;
45
+ threshold: Money | null;
46
+ thresholds?: LoyaltyThresholds;
62
47
  }
63
- export declare type LoyaltyTiers = LoyaltyTier[];
64
48
  export interface LoyaltyProgram {
65
- credit: LoyaltyCredit | null;
66
49
  description: string;
50
+ loyalty_program_id: number;
67
51
  loyalty_type: LoyaltyType;
68
52
  name: string;
69
- points: LoyaltyPoints | null;
70
- redemption: LoyaltyRedemption | null;
71
- remaining: string | null;
72
- spend: LoyaltySpend;
73
- status: LoyaltyStatus;
74
- thresholds: LoyaltyThresholds;
75
- tiers: LoyaltyTiers;
76
- towards: string | null;
53
+ perk: LoyaltyPerk | null;
54
+ spend_name: string | null;
55
+ status: LoyaltyStatus | null;
77
56
  }
78
57
  export declare type LoyaltyPrograms = LoyaltyProgram[];
@@ -1,36 +1,9 @@
1
- import { Money, OrderType } from '../../global';
2
- export interface LoyaltyCredit {
3
- current: string;
4
- total: string;
5
- }
1
+ import { DiscountType, Money } from '../../global';
6
2
  export declare type LoyaltyType = 'DOLLARS' | 'ORDERS' | 'POINTS';
7
- export interface LoyaltyPoints {
8
- expiration_days: number;
9
- name: string;
10
- points: number;
11
- points_per_dollar: number;
12
- remaining?: number;
13
- balance?: number;
14
- index?: number;
15
- available?: number;
16
- applied?: number;
17
- }
18
- export interface LoyaltyRedemption {
19
- order_type: OrderType;
20
- reward: string;
21
- threshold: string;
22
- type: string;
23
- }
24
- export interface LoyaltySpend {
25
- current: string | null;
26
- order_type: OrderType;
27
- total: string;
28
- type: string;
29
- }
30
3
  export interface LoyaltyThreshold {
4
+ description: string;
31
5
  name: string;
32
6
  points: number;
33
- description: string;
34
7
  }
35
8
  export declare type LoyaltyThresholds = LoyaltyThreshold[];
36
9
  export interface LoyaltyThresholdAugmented extends LoyaltyThreshold {
@@ -38,41 +11,47 @@ export interface LoyaltyThresholdAugmented extends LoyaltyThreshold {
38
11
  isFilled: boolean;
39
12
  }
40
13
  export declare type LoyaltyThresholdsAugmented = LoyaltyThresholdAugmented[];
41
- export interface LoyaltyDiscount {
14
+ export interface LoyaltyReward {
42
15
  amount: string;
16
+ created_at?: string;
43
17
  description: string;
44
18
  discount_id: number;
45
- discount_type: string;
19
+ discount_type: DiscountType;
20
+ expires_at?: string;
46
21
  name: string;
47
22
  title: string;
48
23
  }
24
+ export declare type LoyaltyRewards = LoyaltyReward[];
49
25
  export interface LoyaltyTier {
50
26
  description: string;
51
- discount: LoyaltyDiscount | null;
52
27
  hex_code: string;
53
- is_current_tier: true;
28
+ is_current_tier: boolean;
54
29
  name: string;
55
- threshold: string;
30
+ reward: LoyaltyReward | null;
31
+ threshold: Money;
56
32
  tier_no: number;
57
33
  }
34
+ export declare type LoyaltyTier2 = LoyaltyTier[];
58
35
  export interface LoyaltyStatus {
59
- days: number | null;
60
36
  progress: Money;
61
- tier: LoyaltyTier | null;
37
+ tiers: LoyaltyTier2;
38
+ }
39
+ export declare type LoyaltyPerkType = 'BANKABLE_POINTS' | 'DISCRETE_REWARD' | 'DOLLARS_CREDIT';
40
+ export interface LoyaltyPerk {
41
+ credit: Money | null;
42
+ loyalty_perk: LoyaltyPerkType;
43
+ progress: Money | null;
44
+ rewards?: LoyaltyRewards;
45
+ threshold: Money | null;
46
+ thresholds?: LoyaltyThresholds;
62
47
  }
63
- export declare type LoyaltyTiers = LoyaltyTier[];
64
48
  export interface LoyaltyProgram {
65
- credit: LoyaltyCredit | null;
66
49
  description: string;
50
+ loyalty_program_id: number;
67
51
  loyalty_type: LoyaltyType;
68
52
  name: string;
69
- points: LoyaltyPoints | null;
70
- redemption: LoyaltyRedemption | null;
71
- remaining: string | null;
72
- spend: LoyaltySpend;
73
- status: LoyaltyStatus;
74
- thresholds: LoyaltyThresholds;
75
- tiers: LoyaltyTiers;
76
- towards: string | null;
53
+ perk: LoyaltyPerk | null;
54
+ spend_name: string | null;
55
+ status: LoyaltyStatus | null;
77
56
  }
78
57
  export declare type LoyaltyPrograms = LoyaltyProgram[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/types",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "A library of types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",