@epilot/pricing-client 2.0.1 → 2.1.0

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.json CHANGED
@@ -38,9 +38,9 @@
38
38
  "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-simple-prices\" />\n"
39
39
  },
40
40
  {
41
- "name": "order_with_bundles",
42
- "x-displayName": "Order (with Price Bundles)",
43
- "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-price-bundles\" />\n"
41
+ "name": "order_composite_prices",
42
+ "x-displayName": "Order (with Composite Prices)",
43
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-composite-prices\" />\n"
44
44
  },
45
45
  {
46
46
  "name": "opportunity_schema",
@@ -59,8 +59,8 @@
59
59
  },
60
60
  {
61
61
  "name": "dynamic_price_schema",
62
- "x-displayName": "Price Bundle",
63
- "description": "<SchemaDefinition schemaRef=\"#/components/schemas/PriceBundle\" exampleRef=\"#/components/examples/price-bundle\" />\n"
62
+ "x-displayName": "Composite Price",
63
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/CompositePrice\" exampleRef=\"#/components/examples/composite-price\" />\n"
64
64
  }
65
65
  ],
66
66
  "x-tagGroups": [
@@ -82,7 +82,7 @@
82
82
  {
83
83
  "name": "Examples",
84
84
  "tags": [
85
- "order_with_bundles"
85
+ "order_composite_prices"
86
86
  ]
87
87
  },
88
88
  {
@@ -646,7 +646,7 @@
646
646
  },
647
647
  "price_options": {
648
648
  "type": "object",
649
- "description": "A set of [prices](/api/pricing#tag/simple_price_schema) or [price bundles](/api/pricing#tag/dynamic_price_schema) for the current product.",
649
+ "description": "A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.",
650
650
  "properties": {
651
651
  "$relation": {
652
652
  "type": "array",
@@ -1259,11 +1259,11 @@
1259
1259
  }
1260
1260
  }
1261
1261
  },
1262
- "PriceBundle": {
1262
+ "CompositePrice": {
1263
1263
  "type": "object",
1264
1264
  "description": "The price entity schema for dynamic pricing",
1265
1265
  "example": {
1266
- "$ref": "#/components/examples/price-bundle"
1266
+ "$ref": "#/components/examples/composite-price"
1267
1267
  },
1268
1268
  "additionalProperties": true,
1269
1269
  "readOnly": true,
@@ -1278,7 +1278,7 @@
1278
1278
  },
1279
1279
  "price_components": {
1280
1280
  "type": "object",
1281
- "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the price bundle.",
1281
+ "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
1282
1282
  "properties": {
1283
1283
  "$relation": {
1284
1284
  "type": "array",
@@ -1288,6 +1288,14 @@
1288
1288
  }
1289
1289
  }
1290
1290
  },
1291
+ "unit_amount_currency": {
1292
+ "description": "Three-letter ISO currency code, in lowercase.",
1293
+ "oneOf": [
1294
+ {
1295
+ "$ref": "#/components/schemas/Currency"
1296
+ }
1297
+ ]
1298
+ },
1291
1299
  "_created_at": {
1292
1300
  "description": "The price creation date",
1293
1301
  "type": "string"
@@ -1310,7 +1318,7 @@
1310
1318
  },
1311
1319
  "_tags": {
1312
1320
  "type": "array",
1313
- "description": "An arbitrary set of tags attached to the price bundle",
1321
+ "description": "An arbitrary set of tags attached to the composite price",
1314
1322
  "items": {
1315
1323
  "type": "string"
1316
1324
  }
@@ -1328,9 +1336,12 @@
1328
1336
  "description": "By default, the quantity is set to 1, when greater than 1 this value is used as a multiplicative factor.\nE.g: 16 x Solar Modules - Premium price.\n",
1329
1337
  "type": "number"
1330
1338
  },
1339
+ "item": {
1340
+ "$ref": "#/components/schemas/Price"
1341
+ },
1331
1342
  "_tags": {
1332
1343
  "type": "array",
1333
- "description": "An arbitrary set of tags attached to the bundle - component relation",
1344
+ "description": "An arbitrary set of tags attached to the composite price - component relation",
1334
1345
  "items": {
1335
1346
  "type": "string"
1336
1347
  }
@@ -1672,6 +1683,26 @@
1672
1683
  "type": "string",
1673
1684
  "description": "The id of the price."
1674
1685
  },
1686
+ "unit_amount": {
1687
+ "type": "integer",
1688
+ "description": "The unit amount value"
1689
+ },
1690
+ "unit_amount_currency": {
1691
+ "description": "Three-letter ISO currency code, in lowercase.",
1692
+ "oneOf": [
1693
+ {
1694
+ "$ref": "#/components/schemas/Currency"
1695
+ }
1696
+ ]
1697
+ },
1698
+ "unit_amount_decimal": {
1699
+ "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
1700
+ "type": "string"
1701
+ },
1702
+ "is_composite_price": {
1703
+ "description": "The flag for prices that contain price components.",
1704
+ "type": "boolean"
1705
+ },
1675
1706
  "taxes": {
1676
1707
  "type": "array",
1677
1708
  "description": "The taxes applied to the price item.",
@@ -1697,7 +1728,14 @@
1697
1728
  }
1698
1729
  },
1699
1730
  "_price": {
1700
- "$ref": "#/components/schemas/Price"
1731
+ "anyOf": [
1732
+ {
1733
+ "$ref": "#/components/schemas/Price"
1734
+ },
1735
+ {
1736
+ "$ref": "#/components/schemas/CompositePrice"
1737
+ }
1738
+ ]
1701
1739
  },
1702
1740
  "_product": {
1703
1741
  "description": "The product linked to the price item.",
@@ -1705,6 +1743,24 @@
1705
1743
  }
1706
1744
  }
1707
1745
  },
1746
+ "CompositePriceItemDto": {
1747
+ "allOf": [
1748
+ {
1749
+ "$ref": "#/components/schemas/PriceItemDto"
1750
+ }
1751
+ ],
1752
+ "description": "Represents a composite price input to the pricing library.",
1753
+ "type": "object",
1754
+ "properties": {
1755
+ "item_components": {
1756
+ "type": "array",
1757
+ "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
1758
+ "items": {
1759
+ "$ref": "#/components/schemas/PriceItemDto"
1760
+ }
1761
+ }
1762
+ }
1763
+ },
1708
1764
  "TaxAmountDto": {
1709
1765
  "type": "object",
1710
1766
  "description": "A valid tax rate from a client.",
@@ -1944,15 +2000,36 @@
1944
2000
  "oneOf": [
1945
2001
  {
1946
2002
  "$ref": "#/components/schemas/PriceItem"
2003
+ },
2004
+ {
2005
+ "$ref": "#/components/schemas/CompositePriceItem"
1947
2006
  }
1948
2007
  ]
1949
2008
  }
1950
2009
  },
2010
+ "CompositePriceItem": {
2011
+ "allOf": [
2012
+ {
2013
+ "$ref": "#/components/schemas/PriceItem"
2014
+ }
2015
+ ],
2016
+ "description": "Represents a composite price input to the pricing library.",
2017
+ "type": "object",
2018
+ "properties": {
2019
+ "item_components": {
2020
+ "type": "array",
2021
+ "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
2022
+ "items": {
2023
+ "$ref": "#/components/schemas/PriceItem"
2024
+ }
2025
+ }
2026
+ }
2027
+ },
1951
2028
  "PriceItem": {
1952
2029
  "description": "Represents a price item",
1953
2030
  "type": "object",
1954
2031
  "example": {
1955
- "$ref": "#/components/examples/order-with-simple-prices"
2032
+ "$ref": "#/components/examples/price-item"
1956
2033
  },
1957
2034
  "properties": {
1958
2035
  "id": {
@@ -1963,13 +2040,6 @@
1963
2040
  "metadata": {
1964
2041
  "$ref": "#/components/schemas/MetaData"
1965
2042
  },
1966
- "item_components": {
1967
- "type": "array",
1968
- "description": "Contains price item configurations, per price component, when the main price item is a [price bundle](/api/pricing#tag/dynamic_price_schema).",
1969
- "items": {
1970
- "$ref": "#/components/schemas/PriceItemComponent"
1971
- }
1972
- },
1973
2043
  "unit_amount": {
1974
2044
  "type": "integer",
1975
2045
  "description": "The unit amount value",
@@ -2009,11 +2079,18 @@
2009
2079
  "type": "string",
2010
2080
  "description": "The id of the price."
2011
2081
  },
2082
+ "is_composite_price": {
2083
+ "description": "The flag for prices that contain price components.",
2084
+ "type": "boolean"
2085
+ },
2012
2086
  "_price": {
2013
2087
  "description": "The price snapshot data.",
2014
2088
  "anyOf": [
2015
2089
  {
2016
2090
  "$ref": "#/components/schemas/Price"
2091
+ },
2092
+ {
2093
+ "$ref": "#/components/schemas/CompositePrice"
2017
2094
  }
2018
2095
  ]
2019
2096
  },
@@ -2051,13 +2128,6 @@
2051
2128
  }
2052
2129
  }
2053
2130
  },
2054
- "PriceItemComponent": {
2055
- "oneOf": [
2056
- {
2057
- "$ref": "#/components/schemas/PriceItem"
2058
- }
2059
- ]
2060
- },
2061
2131
  "TaxAmount": {
2062
2132
  "type": "object",
2063
2133
  "description": "A tax amount associated with a specific tax rate.",
@@ -2277,47 +2347,58 @@
2277
2347
  },
2278
2348
  "street": {
2279
2349
  "type": "string",
2280
- "description": "The first line of the address. Typically the street address or PO Box number."
2350
+ "description": "The first line of the address. Typically the street address or PO Box number.",
2351
+ "nullable": true
2281
2352
  },
2282
2353
  "street_number": {
2283
2354
  "type": "string",
2284
- "description": "The second line of the address. Typically the number of the apartment, suite, or unit."
2355
+ "description": "The second line of the address. Typically the number of the apartment, suite, or unit.",
2356
+ "nullable": true
2285
2357
  },
2286
2358
  "postal_code": {
2287
2359
  "type": "string",
2288
- "description": "The postal code for the address."
2360
+ "description": "The postal code for the address.",
2361
+ "nullable": true
2289
2362
  },
2290
2363
  "city": {
2291
2364
  "type": "string",
2292
- "description": "The name of the city, district, village, or town."
2365
+ "description": "The name of the city, district, village, or town.",
2366
+ "nullable": true
2293
2367
  },
2294
2368
  "country": {
2295
2369
  "type": "string",
2296
- "description": "The two-letter code for the country of the address."
2370
+ "description": "The two-letter code for the country of the address.",
2371
+ "nullable": true
2297
2372
  },
2298
2373
  "additional_info": {
2299
2374
  "type": "string",
2300
- "description": "An additional description for the address"
2375
+ "description": "An additional description for the address",
2376
+ "nullable": true
2301
2377
  },
2302
2378
  "company_name": {
2303
2379
  "type": "string",
2304
- "description": "the company name, usually used as extra delivery instructions"
2380
+ "description": "the company name, usually used as extra delivery instructions",
2381
+ "nullable": true
2305
2382
  },
2306
2383
  "first_name": {
2307
2384
  "type": "string",
2308
- "description": "the first name of the recipient, usually used as extra delivery instructions"
2385
+ "description": "the first name of the recipient, usually used as extra delivery instructions",
2386
+ "nullable": true
2309
2387
  },
2310
2388
  "last_name": {
2311
2389
  "type": "string",
2312
- "description": "the last name of the recipient, usually used as extra delivery instructions"
2390
+ "description": "the last name of the recipient, usually used as extra delivery instructions",
2391
+ "nullable": true
2313
2392
  },
2314
2393
  "salutation": {
2315
2394
  "type": "string",
2316
- "description": "the salutation of the recipient, usually used as extra delivery instructions"
2395
+ "description": "the salutation of the recipient, usually used as extra delivery instructions",
2396
+ "nullable": true
2317
2397
  },
2318
2398
  "title": {
2319
2399
  "type": "string",
2320
- "description": "the title of the recipient, usually used as extra delivery instructions"
2400
+ "description": "the title of the recipient, usually used as extra delivery instructions",
2401
+ "nullable": true
2321
2402
  }
2322
2403
  }
2323
2404
  },
@@ -3207,7 +3288,7 @@
3207
3288
  "_updated_at": "2022-06-03T16:29:46.303Z"
3208
3289
  }
3209
3290
  },
3210
- "order-with-price-bundles": {
3291
+ "order-with-composite-prices": {
3211
3292
  "value": {
3212
3293
  "metadata": [
3213
3294
  {
@@ -3409,7 +3490,7 @@
3409
3490
  "name": "Cool box",
3410
3491
  "_title": "Cool box"
3411
3492
  },
3412
- "description": "Price Bundle - Test 1",
3493
+ "description": "Price Component",
3413
3494
  "unit_amount": 90000,
3414
3495
  "amount_subtotal": 270000,
3415
3496
  "amount_total": 286200
@@ -3785,12 +3866,12 @@
3785
3866
  "_updated_at": "2022-06-03T16:04:10.369Z"
3786
3867
  }
3787
3868
  },
3788
- "price-bundle": {
3869
+ "composite-price": {
3789
3870
  "value": {
3790
3871
  "_id": "c2a95ca9-7a50-41a4-a73c-b5fb1a57d40f",
3791
3872
  "_schema": "price",
3792
- "_title": "My Price Bundle",
3793
- "description": "My Price Bundle",
3873
+ "_title": "My Composite Price",
3874
+ "description": "My Composite Price",
3794
3875
  "_org": "739224",
3795
3876
  "_created_at": "2022-02-18T10:10:26.439Z",
3796
3877
  "_updated_at": "2022-02-18T11:53:04.191Z",
@@ -3870,6 +3951,72 @@
3870
3951
  ]
3871
3952
  }
3872
3953
  }
3954
+ },
3955
+ "price-item": {
3956
+ "value": {
3957
+ "amount_subtotal": 10000,
3958
+ "amount_total": 10600,
3959
+ "currency": "EUR",
3960
+ "description": "Annual internet service",
3961
+ "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
3962
+ "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
3963
+ "taxes": [
3964
+ {
3965
+ "amount": "600",
3966
+ "tax": {
3967
+ "active": true,
3968
+ "behavior": "Exclusive",
3969
+ "description": "Without Behaviour",
3970
+ "rate": "6",
3971
+ "region": "DE",
3972
+ "type": "VAT",
3973
+ "_created_at": "2022-02-07T14:49:08.831Z",
3974
+ "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
3975
+ "_org": "739224",
3976
+ "_schema": "tax",
3977
+ "_title": "Tax Without Behaviour",
3978
+ "_updated_at": "2022-02-07T14:49:08.831Z"
3979
+ }
3980
+ }
3981
+ ],
3982
+ "unit_amount": 10000,
3983
+ "unit_amount_net": 10000,
3984
+ "_price": {
3985
+ "unit_amount": 10000,
3986
+ "unit_amount_currency": "EUR",
3987
+ "unit_amount_decimal": "100.00",
3988
+ "sales_tax": "standard",
3989
+ "tax_behavior": "exclusive",
3990
+ "price_display_in_journeys": "show_price",
3991
+ "type": "one_time",
3992
+ "billing_period": "weekly",
3993
+ "billing_duration_unit": "months",
3994
+ "notice_time_unit": "months",
3995
+ "termination_time_unit": "months",
3996
+ "renewal_duration_unit": "months",
3997
+ "_schema": "price",
3998
+ "_title": "Solar Panel Module",
3999
+ "description": "Solar Panel Module",
4000
+ "active": true,
4001
+ "tax": {
4002
+ "$relation": [
4003
+ {
4004
+ "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
4005
+ }
4006
+ ]
4007
+ },
4008
+ "_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
4009
+ "_org": "728",
4010
+ "_created_at": "2022-06-03T16:04:10.369Z",
4011
+ "_updated_at": "2022-06-03T16:04:10.369Z"
4012
+ },
4013
+ "_product": {
4014
+ "name": "Cool box",
4015
+ "type": "product",
4016
+ "_id": "73f857a4-0fbc-4aa6-983f-87c0d6d410a6",
4017
+ "_title": "Cool box"
4018
+ }
4019
+ }
3873
4020
  }
3874
4021
  }
3875
4022
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -69,5 +69,5 @@
69
69
  "webpack": "~5.18.0",
70
70
  "webpack-cli": "^4.4.0"
71
71
  },
72
- "gitHead": "3c752b53105f0bf26dc37a682af3b592b993d264"
72
+ "gitHead": "9315949cdfd9ea01834da0df76e95eb1d85de170"
73
73
  }