@epilot/pricing-client 3.47.9-alpha.3 → 3.47.9-alpha.4

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/openapi.d.ts CHANGED
@@ -357,6 +357,70 @@ declare namespace Components {
357
357
  */
358
358
  Price[];
359
359
  }
360
+ /**
361
+ * The coupon configuration
362
+ */
363
+ export interface BaseCouponCommon {
364
+ [name: string]: any;
365
+ _id: EntityId /* uuid */;
366
+ /**
367
+ * The auto-generated title for the title
368
+ */
369
+ _title: string;
370
+ /**
371
+ * Organization Id the entity belongs to
372
+ */
373
+ _org: string;
374
+ /**
375
+ * The schema of the entity, for coupons it is always `coupon`
376
+ */
377
+ _schema: "coupon";
378
+ _tags?: string[];
379
+ /**
380
+ * The creation date for the opportunity
381
+ */
382
+ _created_at: string; // date-time
383
+ /**
384
+ * The date the coupon was last updated
385
+ */
386
+ _updated_at: string; // date-time
387
+ name: string | null;
388
+ description?: string | null;
389
+ type: "fixed" | "percentage";
390
+ category: "discount" | "cashback";
391
+ /**
392
+ * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
393
+ */
394
+ percentage_value?: string | null;
395
+ /**
396
+ * Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
397
+ */
398
+ fixed_value?: number;
399
+ /**
400
+ * Use if type is set to fixed. The unit amount in cents to be discounted, represented as a decimal string with at most 12 decimal places.
401
+ */
402
+ fixed_value_decimal?: string;
403
+ /**
404
+ * Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
405
+ */
406
+ fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
407
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
408
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
409
+ *
410
+ * example:
411
+ * EUR
412
+ */
413
+ Currency;
414
+ /**
415
+ * The cashback period, for now it's limited to either 0 months or 12 months
416
+ */
417
+ cashback_period?: "0" | "12";
418
+ active?: boolean;
419
+ /**
420
+ * Whether the coupon requires a promo code to be applied
421
+ */
422
+ requires_promo_code?: boolean;
423
+ }
360
424
  export interface BaseMarketPriceRecord {
361
425
  /**
362
426
  * Cost in Cents, e.g. 12.3 for 12,3 Cents = 0.123€.
@@ -721,7 +785,7 @@ declare namespace Components {
721
785
  /**
722
786
  * The coupons applicable to the price item
723
787
  */
724
- _coupons?: (CouponItem)[];
788
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
725
789
  /**
726
790
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
727
791
  */
@@ -1059,7 +1123,7 @@ declare namespace Components {
1059
1123
  /**
1060
1124
  * The coupons applicable to the price item
1061
1125
  */
1062
- _coupons?: (CouponItem)[];
1126
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
1063
1127
  }
1064
1128
  export interface BasicAuthCredentials {
1065
1129
  /**
@@ -1817,7 +1881,7 @@ declare namespace Components {
1817
1881
  /**
1818
1882
  * The coupons applicable to the price item
1819
1883
  */
1820
- _coupons?: (CouponItem)[];
1884
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
1821
1885
  /**
1822
1886
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
1823
1887
  */
@@ -2018,7 +2082,7 @@ declare namespace Components {
2018
2082
  /**
2019
2083
  * The coupons applicable to the price item
2020
2084
  */
2021
- _coupons?: (CouponItem)[];
2085
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
2022
2086
  /**
2023
2087
  * The flag for prices that contain price components.
2024
2088
  */
@@ -2392,16 +2456,20 @@ declare namespace Components {
2392
2456
  [name: string]: number;
2393
2457
  };
2394
2458
  }
2459
+ /**
2460
+ * The coupon configuration
2461
+ */
2395
2462
  export interface CouponItem {
2396
- _id?: EntityId /* uuid */;
2463
+ [name: string]: any;
2464
+ _id: EntityId /* uuid */;
2397
2465
  /**
2398
2466
  * The auto-generated title for the title
2399
2467
  */
2400
- _title?: string;
2468
+ _title: string;
2401
2469
  /**
2402
2470
  * Organization Id the entity belongs to
2403
2471
  */
2404
- _org?: string;
2472
+ _org: string;
2405
2473
  /**
2406
2474
  * The schema of the entity, for coupons it is always `coupon`
2407
2475
  */
@@ -2410,12 +2478,12 @@ declare namespace Components {
2410
2478
  /**
2411
2479
  * The creation date for the opportunity
2412
2480
  */
2413
- _created_at?: string; // date-time
2481
+ _created_at: string; // date-time
2414
2482
  /**
2415
2483
  * The date the coupon was last updated
2416
2484
  */
2417
- _updated_at?: string; // date-time
2418
- name?: string | null;
2485
+ _updated_at: string; // date-time
2486
+ name: string | null;
2419
2487
  description?: string | null;
2420
2488
  type: "fixed" | "percentage";
2421
2489
  category: "discount" | "cashback";
@@ -4092,7 +4160,7 @@ declare namespace Components {
4092
4160
  /**
4093
4161
  * The coupons applicable to the price item
4094
4162
  */
4095
- _coupons?: (CouponItem)[];
4163
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
4096
4164
  /**
4097
4165
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
4098
4166
  */
@@ -4303,7 +4371,7 @@ declare namespace Components {
4303
4371
  /**
4304
4372
  * The coupons applicable to the price item
4305
4373
  */
4306
- _coupons?: (CouponItem)[];
4374
+ _coupons?: (/* The coupon configuration */ CouponItem)[];
4307
4375
  /**
4308
4376
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
4309
4377
  */
@@ -6228,6 +6296,7 @@ export type AvailabilityResult = Components.Schemas.AvailabilityResult;
6228
6296
  export type AverageMarketPriceRecord = Components.Schemas.AverageMarketPriceRecord;
6229
6297
  export type AverageMarketPriceResult = Components.Schemas.AverageMarketPriceResult;
6230
6298
  export type BaseCoupon = Components.Schemas.BaseCoupon;
6299
+ export type BaseCouponCommon = Components.Schemas.BaseCouponCommon;
6231
6300
  export type BaseMarketPriceRecord = Components.Schemas.BaseMarketPriceRecord;
6232
6301
  export type BasePriceItem = Components.Schemas.BasePriceItem;
6233
6302
  export type BasePriceItemCommon = Components.Schemas.BasePriceItemCommon;
package/dist/openapi.json CHANGED
@@ -5980,7 +5980,7 @@
5980
5980
  }
5981
5981
  }
5982
5982
  },
5983
- "BaseCoupon": {
5983
+ "BaseCouponCommon": {
5984
5984
  "type": "object",
5985
5985
  "description": "The coupon configuration",
5986
5986
  "additionalProperties": true,
@@ -6094,7 +6094,17 @@
6094
6094
  "requires_promo_code": {
6095
6095
  "type": "boolean",
6096
6096
  "description": "Whether the coupon requires a promo code to be applied"
6097
- },
6097
+ }
6098
+ }
6099
+ },
6100
+ "BaseCoupon": {
6101
+ "type": "object",
6102
+ "allOf": [
6103
+ {
6104
+ "$ref": "#/components/schemas/BaseCouponCommon"
6105
+ }
6106
+ ],
6107
+ "properties": {
6098
6108
  "prices": {
6099
6109
  "description": "The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.",
6100
6110
  "oneOf": [
@@ -6170,112 +6180,11 @@
6170
6180
  },
6171
6181
  "CouponItem": {
6172
6182
  "type": "object",
6173
- "required": [
6174
- "type",
6175
- "category",
6176
- "_schema"
6177
- ],
6178
- "properties": {
6179
- "_id": {
6180
- "$ref": "#/components/schemas/EntityId",
6181
- "readOnly": true
6182
- },
6183
- "_title": {
6184
- "type": "string",
6185
- "description": "The auto-generated title for the title",
6186
- "readOnly": true
6187
- },
6188
- "_org": {
6189
- "type": "string",
6190
- "description": "Organization Id the entity belongs to",
6191
- "readOnly": true
6192
- },
6193
- "_schema": {
6194
- "type": "string",
6195
- "enum": [
6196
- "coupon"
6197
- ],
6198
- "readOnly": true,
6199
- "description": "The schema of the entity, for coupons it is always `coupon`"
6200
- },
6201
- "_tags": {
6202
- "type": "array",
6203
- "items": {
6204
- "type": "string"
6205
- }
6206
- },
6207
- "_created_at": {
6208
- "type": "string",
6209
- "format": "date-time",
6210
- "readOnly": true,
6211
- "description": "The creation date for the opportunity"
6212
- },
6213
- "_updated_at": {
6214
- "type": "string",
6215
- "format": "date-time",
6216
- "readOnly": true,
6217
- "description": "The date the coupon was last updated"
6218
- },
6219
- "name": {
6220
- "type": "string",
6221
- "nullable": true
6222
- },
6223
- "description": {
6224
- "type": "string",
6225
- "nullable": true
6226
- },
6227
- "type": {
6228
- "type": "string",
6229
- "enum": [
6230
- "fixed",
6231
- "percentage"
6232
- ]
6233
- },
6234
- "category": {
6235
- "type": "string",
6236
- "enum": [
6237
- "discount",
6238
- "cashback"
6239
- ]
6240
- },
6241
- "percentage_value": {
6242
- "type": "string",
6243
- "description": "Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.",
6244
- "nullable": true
6245
- },
6246
- "fixed_value": {
6247
- "description": "Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.",
6248
- "type": "number"
6249
- },
6250
- "fixed_value_decimal": {
6251
- "description": "Use if type is set to fixed. The unit amount in cents to be discounted, represented as a decimal string with at most 12 decimal places.",
6252
- "type": "string"
6253
- },
6254
- "fixed_value_currency": {
6255
- "description": "Use if type is set to fixed. Three-letter ISO currency code, in lowercase.",
6256
- "oneOf": [
6257
- {
6258
- "$ref": "#/components/schemas/Currency"
6259
- }
6260
- ]
6261
- },
6262
- "cashback_period": {
6263
- "type": "string",
6264
- "description": "The cashback period, for now it's limited to either 0 months or 12 months",
6265
- "enum": [
6266
- "0",
6267
- "12"
6268
- ],
6269
- "nullable": true
6270
- },
6271
- "active": {
6272
- "type": "boolean"
6273
- },
6274
- "requires_promo_code": {
6275
- "type": "boolean",
6276
- "description": "Whether the coupon requires a promo code to be applied"
6183
+ "allOf": [
6184
+ {
6185
+ "$ref": "#/components/schemas/BaseCouponCommon"
6277
6186
  }
6278
- }
6187
+ ]
6279
6188
  },
6280
6189
  "CouponWithoutPromoCodes": {
6281
6190
  "allOf": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.47.9-alpha.3",
3
+ "version": "3.47.9-alpha.4",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",