@open-tender/types 0.2.54 → 0.2.56

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,7 +1,7 @@
1
1
  import { RequestedAt } from '../datetimes';
2
2
  import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, PrepType, ServiceType, TenderType } from '../global';
3
3
  import { CheckoutErrorParams } from '../request';
4
- import { Cart } from './cart';
4
+ import { Cart, CartItemWithPoints } from './cart';
5
5
  import { Address, Customer } from './customer';
6
6
  import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
7
7
  export interface SimpleCartOption {
@@ -286,3 +286,9 @@ export interface CustomerCheckout {
286
286
  points: any;
287
287
  discount: any;
288
288
  }
289
+ export interface CheckoutPoints {
290
+ points: CheckoutConfigLoyalty;
291
+ applied: OrderCreatePoints;
292
+ apply: (item: CartItemWithPoints) => void;
293
+ remove: (item: CartItemWithPoints) => void;
294
+ }
@@ -1,5 +1,5 @@
1
1
  import { DateString, ISOString, ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
2
- import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
2
+ import { CardType, CardTypeName, ChannelType, DiscountAuthType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
3
3
  import { CreditCard, CreditCards } from './creditCards';
4
4
  import { Address, Customer, GiftCard, HouseAccounts } from './customer';
5
5
  import { PrepStatus } from './kds';
@@ -88,15 +88,17 @@ export interface OrderDetails {
88
88
  serving_utensils: boolean;
89
89
  tax_exempt_id: string | null;
90
90
  }
91
+ export declare type OrderDiscountType = 'DEAL' | 'DISCOUNT' | 'LOYALTY' | 'PROMO_CODE' | 'REWARD';
91
92
  export interface OrderDiscount {
92
93
  amount: NegativeMoney;
93
94
  auth_type: DiscountAuthType;
94
- discount_type: DiscountType;
95
+ description?: string | null;
96
+ discount_type: OrderDiscountType;
95
97
  ext_id?: string | null;
96
98
  id: number;
97
99
  is_deal: boolean;
98
100
  is_loyalty: boolean;
99
- is_optional: boolean;
101
+ is_optional?: boolean;
100
102
  is_promo_code: boolean;
101
103
  is_reward: boolean;
102
104
  name: string;
@@ -1,7 +1,7 @@
1
1
  import { RequestedAt } from '../datetimes';
2
2
  import { CardType, CardTypeName, DeviceType, DiscountType, Money, OrderType, PrepType, ServiceType, TenderType } from '../global';
3
3
  import { CheckoutErrorParams } from '../request';
4
- import { Cart } from './cart';
4
+ import { Cart, CartItemWithPoints } from './cart';
5
5
  import { Address, Customer } from './customer';
6
6
  import { Order, OrderCustomer, OrderDiscounts, OrderFulfillment, OrderSurcharge } from './order';
7
7
  export interface SimpleCartOption {
@@ -286,3 +286,9 @@ export interface CustomerCheckout {
286
286
  points: any;
287
287
  discount: any;
288
288
  }
289
+ export interface CheckoutPoints {
290
+ points: CheckoutConfigLoyalty;
291
+ applied: OrderCreatePoints;
292
+ apply: (item: CartItemWithPoints) => void;
293
+ remove: (item: CartItemWithPoints) => void;
294
+ }
@@ -1,5 +1,5 @@
1
1
  import { DateString, ISOString, ISOStringOffset, RequestedAt, TimeHuman, TimezonePython } from '../datetimes';
2
- import { CardType, CardTypeName, ChannelType, DiscountAuthType, DiscountType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
2
+ import { CardType, CardTypeName, ChannelType, DiscountAuthType, Gender, Images, Money, NegativeMoney, OrderStatus, OrderType, ServiceType, TenderType } from '../global';
3
3
  import { CreditCard, CreditCards } from './creditCards';
4
4
  import { Address, Customer, GiftCard, HouseAccounts } from './customer';
5
5
  import { PrepStatus } from './kds';
@@ -88,15 +88,17 @@ export interface OrderDetails {
88
88
  serving_utensils: boolean;
89
89
  tax_exempt_id: string | null;
90
90
  }
91
+ export declare type OrderDiscountType = 'DEAL' | 'DISCOUNT' | 'LOYALTY' | 'PROMO_CODE' | 'REWARD';
91
92
  export interface OrderDiscount {
92
93
  amount: NegativeMoney;
93
94
  auth_type: DiscountAuthType;
94
- discount_type: DiscountType;
95
+ description?: string | null;
96
+ discount_type: OrderDiscountType;
95
97
  ext_id?: string | null;
96
98
  id: number;
97
99
  is_deal: boolean;
98
100
  is_loyalty: boolean;
99
- is_optional: boolean;
101
+ is_optional?: boolean;
100
102
  is_promo_code: boolean;
101
103
  is_reward: boolean;
102
104
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/types",
3
- "version": "0.2.54",
3
+ "version": "0.2.56",
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",
package/dist/.DS_Store DELETED
Binary file