Skip to content

Commit 8763e5c

Browse files
committed
fix: fix existing type definitions and add new ones
1 parent 6ad5ffc commit 8763e5c

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/backend/Graph/coupon.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Attributes } from './attributes';
12
import type { CouponCodes } from './coupon_codes';
23
import type { CouponItemCategories } from './coupon_item_categories';
34
import type { GenerateCodes } from './generate_codes';
@@ -12,6 +13,8 @@ export interface Coupon extends Graph {
1213
'self': Coupon;
1314
/** Store this coupon belongs to. */
1415
'fx:store': Store;
16+
/** Attributes linked to this coupon. */
17+
'fx:attributes': Attributes;
1518
/** Codes linked to this coupon. */
1619
'fx:coupon_codes': CouponCodes;
1720
/** POST here to generate random coupon codes. */
@@ -57,6 +60,12 @@ export interface Coupon extends Graph {
5760
customer_attribute_restrictions: string;
5861
/** Auto-apply coupons only. This coupon will be automatically applied when a subscription includes a product with one of the codes in the list. Wildcards are allowed just like in product code restrictions. Example: `code_1,code_2,sku_*,abc`. */
5962
customer_subscription_restrictions: string;
63+
/** This restricts the usage of a coupon code based on an item's `item_option` key and value. Valid input is a json object with the keys matching the `item_option.name`, and the value an array of comma-separated matching or partially matching strings, using `*` as a wild card at the beginning, end, or middle of the string. So `{"author": ["Agatha*", "*brown"]}` will match the item where item option "author" is "Agatha Christie" or "Dan Brown". It would not match an item with no "author" option, or with an "author" of "John Doe". Optional. 6000 characters or less. */
64+
item_option_restrictions: null | Record<string, string[]>;
65+
/** Enables sharing coupon codes between coupons. */
66+
shared_codes_allowed: boolean;
67+
/** This param is using for coupon calculation amount for tax inclusive mode. Optional. [0..1]. */
68+
inclusive_tax_rate: number;
6069
/** The date this resource was created. */
6170
date_created: string | null;
6271
/** The date this resource was last modified. */

src/backend/Graph/customer_portal_settings.d.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,9 @@ export interface CustomerPortalSettings extends Graph {
7676
date_created: string | null;
7777
/** The date this resource was last modified. */
7878
date_modified: string | null;
79-
} & (
80-
| {
81-
/** Shared secret key. */
82-
jwtSharedSecret: string;
83-
}
84-
| {
85-
/** Private key for JWT signing. */
86-
jwtPrivateKey: string;
87-
}
88-
);
79+
/** Shared secret key. */
80+
jwtSharedSecret: string;
81+
/** Private key for JWT signing, read-only. */
82+
jwtPrivateKey?: string;
83+
};
8984
}

src/backend/Graph/gift_card.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Attributes } from './attributes';
12
import type { GenerateCodes } from './generate_codes';
23
import type { GiftCardCodes } from './gift_card_codes';
34
import type { GiftCardItemCategories } from './gift_card_item_categories';
@@ -12,6 +13,8 @@ export interface GiftCard extends Graph {
1213
'self': GiftCard;
1314
/** Store this gift card is assigned to. */
1415
'fx:store': Store;
16+
/** Attributes linked to this gift card. */
17+
'fx:attributes': Attributes;
1518
/** POST here to generate random gift card codes. */
1619
'fx:generate_codes': GenerateCodes;
1720
/** Collection of codes for this gift card. */

src/backend/Graph/gift_card_code.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export interface GiftCardCode extends Graph {
3030
end_date: string | null;
3131
/** Current balance on the gift card. Decimal. Required. */
3232
current_balance: number;
33+
/** PATCH-only: use this field to link this gift card code to a customer. */
34+
customer_id?: number | string;
3335
/** The date this resource was created. Readonly. */
3436
date_created: string | null;
3537
/** The date this resource was last modified. Readonly. */

0 commit comments

Comments
 (0)