Skip to content

Commit

Permalink
fix: fix existing type definitions and add new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
pheekus committed May 8, 2024
1 parent 6ad5ffc commit 8763e5c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 9 additions & 0 deletions src/backend/Graph/coupon.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Attributes } from './attributes';
import type { CouponCodes } from './coupon_codes';
import type { CouponItemCategories } from './coupon_item_categories';
import type { GenerateCodes } from './generate_codes';
Expand All @@ -12,6 +13,8 @@ export interface Coupon extends Graph {
'self': Coupon;
/** Store this coupon belongs to. */
'fx:store': Store;
/** Attributes linked to this coupon. */
'fx:attributes': Attributes;
/** Codes linked to this coupon. */
'fx:coupon_codes': CouponCodes;
/** POST here to generate random coupon codes. */
Expand Down Expand Up @@ -57,6 +60,12 @@ export interface Coupon extends Graph {
customer_attribute_restrictions: string;
/** 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`. */
customer_subscription_restrictions: string;
/** 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. */
item_option_restrictions: null | Record<string, string[]>;
/** Enables sharing coupon codes between coupons. */
shared_codes_allowed: boolean;
/** This param is using for coupon calculation amount for tax inclusive mode. Optional. [0..1]. */
inclusive_tax_rate: number;
/** The date this resource was created. */
date_created: string | null;
/** The date this resource was last modified. */
Expand Down
15 changes: 5 additions & 10 deletions src/backend/Graph/customer_portal_settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,9 @@ export interface CustomerPortalSettings extends Graph {
date_created: string | null;
/** The date this resource was last modified. */
date_modified: string | null;
} & (
| {
/** Shared secret key. */
jwtSharedSecret: string;
}
| {
/** Private key for JWT signing. */
jwtPrivateKey: string;
}
);
/** Shared secret key. */
jwtSharedSecret: string;
/** Private key for JWT signing, read-only. */
jwtPrivateKey?: string;
};
}
3 changes: 3 additions & 0 deletions src/backend/Graph/gift_card.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Attributes } from './attributes';
import type { GenerateCodes } from './generate_codes';
import type { GiftCardCodes } from './gift_card_codes';
import type { GiftCardItemCategories } from './gift_card_item_categories';
Expand All @@ -12,6 +13,8 @@ export interface GiftCard extends Graph {
'self': GiftCard;
/** Store this gift card is assigned to. */
'fx:store': Store;
/** Attributes linked to this gift card. */
'fx:attributes': Attributes;
/** POST here to generate random gift card codes. */
'fx:generate_codes': GenerateCodes;
/** Collection of codes for this gift card. */
Expand Down
2 changes: 2 additions & 0 deletions src/backend/Graph/gift_card_code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface GiftCardCode extends Graph {
end_date: string | null;
/** Current balance on the gift card. Decimal. Required. */
current_balance: number;
/** PATCH-only: use this field to link this gift card code to a customer. */
customer_id?: number | string;
/** The date this resource was created. Readonly. */
date_created: string | null;
/** The date this resource was last modified. Readonly. */
Expand Down

0 comments on commit 8763e5c

Please sign in to comment.