@epilot/pricing-client 2.1.2 → 2.1.3

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
@@ -562,6 +562,14 @@
562
562
  "message": {
563
563
  "type": "string",
564
564
  "description": "Error message"
565
+ },
566
+ "status": {
567
+ "type": "number",
568
+ "description": "The HTTP status code"
569
+ },
570
+ "cause": {
571
+ "type": "string",
572
+ "description": "The cause of the error (visible for bad requests - http 400)"
565
573
  }
566
574
  }
567
575
  },
@@ -1111,16 +1119,26 @@
1111
1119
  ]
1112
1120
  },
1113
1121
  "tax": {
1114
- "type": "object",
1115
1122
  "description": "The default tax rate applied to the price",
1116
- "properties": {
1117
- "$relation": {
1123
+ "oneOf": [
1124
+ {
1125
+ "type": "object",
1126
+ "properties": {
1127
+ "$relation": {
1128
+ "type": "array",
1129
+ "items": {
1130
+ "$ref": "#/components/schemas/EntityRelation"
1131
+ }
1132
+ }
1133
+ }
1134
+ },
1135
+ {
1118
1136
  "type": "array",
1119
1137
  "items": {
1120
- "$ref": "#/components/schemas/EntityRelation"
1138
+ "$ref": "#/components/schemas/Tax"
1121
1139
  }
1122
1140
  }
1123
- }
1141
+ ]
1124
1142
  },
1125
1143
  "tax_behavior": {
1126
1144
  "type": "string",
@@ -1277,16 +1295,26 @@
1277
1295
  "description": "A brief description of the price."
1278
1296
  },
1279
1297
  "price_components": {
1280
- "type": "object",
1281
1298
  "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
1282
- "properties": {
1283
- "$relation": {
1299
+ "oneOf": [
1300
+ {
1284
1301
  "type": "array",
1285
1302
  "items": {
1286
- "$ref": "#/components/schemas/PriceComponentRelation"
1303
+ "$ref": "#/components/schemas/Price"
1304
+ }
1305
+ },
1306
+ {
1307
+ "type": "object",
1308
+ "properties": {
1309
+ "$relation": {
1310
+ "type": "array",
1311
+ "items": {
1312
+ "$ref": "#/components/schemas/PriceComponentRelation"
1313
+ }
1314
+ }
1287
1315
  }
1288
1316
  }
1289
- }
1317
+ ]
1290
1318
  },
1291
1319
  "unit_amount_currency": {
1292
1320
  "description": "Three-letter ISO currency code, in lowercase.",
@@ -1336,9 +1364,6 @@
1336
1364
  "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",
1337
1365
  "type": "number"
1338
1366
  },
1339
- "item": {
1340
- "$ref": "#/components/schemas/Price"
1341
- },
1342
1367
  "_tags": {
1343
1368
  "type": "array",
1344
1369
  "description": "An arbitrary set of tags attached to the composite price - component relation",
@@ -1660,11 +1685,12 @@
1660
1685
  ]
1661
1686
  }
1662
1687
  },
1663
- "PriceItemDto": {
1664
- "description": "Represents a valid price item from a client.",
1688
+ "BasePriceItemDto": {
1689
+ "description": "Represents a valid base price item from a client.",
1665
1690
  "type": "object",
1666
1691
  "properties": {
1667
1692
  "metadata": {
1693
+ "description": "An additional structure to keep metadata related with the price item.",
1668
1694
  "$ref": "#/components/schemas/MetaData"
1669
1695
  },
1670
1696
  "quantity": {
@@ -1683,14 +1709,6 @@
1683
1709
  "type": "string",
1684
1710
  "description": "The id of the price."
1685
1711
  },
1686
- "unit_amount": {
1687
- "type": "integer",
1688
- "description": "The unit amount value"
1689
- },
1690
- "unit_amount_decimal": {
1691
- "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
1692
- "type": "string"
1693
- },
1694
1712
  "taxes": {
1695
1713
  "type": "array",
1696
1714
  "description": "The taxes applied to the price item.",
@@ -1715,23 +1733,39 @@
1715
1733
  ]
1716
1734
  }
1717
1735
  },
1718
- "_price": {
1719
- "anyOf": [
1720
- {
1721
- "$ref": "#/components/schemas/Price"
1722
- }
1723
- ]
1724
- },
1725
1736
  "_product": {
1726
- "description": "The product linked to the price item.",
1737
+ "description": "The snapshot of the product linked to the price item.",
1727
1738
  "$ref": "#/components/schemas/Product"
1728
1739
  }
1729
1740
  }
1730
1741
  },
1742
+ "PriceItemDto": {
1743
+ "allOf": [
1744
+ {
1745
+ "$ref": "#/components/schemas/BasePriceItemDto"
1746
+ }
1747
+ ],
1748
+ "description": "Represents a price input to the pricing library.",
1749
+ "type": "object",
1750
+ "properties": {
1751
+ "unit_amount": {
1752
+ "type": "integer",
1753
+ "description": "The unit amount value"
1754
+ },
1755
+ "unit_amount_decimal": {
1756
+ "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
1757
+ "type": "string"
1758
+ },
1759
+ "_price": {
1760
+ "description": "The snapshot of the price linked to the price item.",
1761
+ "$ref": "#/components/schemas/Price"
1762
+ }
1763
+ }
1764
+ },
1731
1765
  "CompositePriceItemDto": {
1732
1766
  "allOf": [
1733
1767
  {
1734
- "$ref": "#/components/schemas/PriceItemDto"
1768
+ "$ref": "#/components/schemas/BasePriceItemDto"
1735
1769
  }
1736
1770
  ],
1737
1771
  "description": "Represents a composite price input to the pricing library.",
@@ -1745,11 +1779,8 @@
1745
1779
  }
1746
1780
  },
1747
1781
  "_price": {
1748
- "anyOf": [
1749
- {
1750
- "$ref": "#/components/schemas/CompositePrice"
1751
- }
1752
- ]
1782
+ "description": "The snapshot of the price linked to the price item.",
1783
+ "$ref": "#/components/schemas/CompositePrice"
1753
1784
  }
1754
1785
  }
1755
1786
  },
@@ -1759,7 +1790,8 @@
1759
1790
  "properties": {
1760
1791
  "rate": {
1761
1792
  "type": "string",
1762
- "description": "The tax rate applied."
1793
+ "deprecated": true,
1794
+ "description": "The deprecated tax rate applied.\nThis field has been deprecated in favor of the new Tax Management. You should use the new tax fields pointing to a proper tax entity.\n"
1763
1795
  },
1764
1796
  "tax": {
1765
1797
  "description": "The tax applied.",
@@ -1829,7 +1861,6 @@
1829
1861
  }
1830
1862
  },
1831
1863
  "required": [
1832
- "type",
1833
1864
  "amount_subtotal",
1834
1865
  "amount_total"
1835
1866
  ]
@@ -1989,7 +2020,7 @@
1989
2020
  "description": "Tracks a set of product prices, quantities, (discounts) and taxes.",
1990
2021
  "type": "array",
1991
2022
  "items": {
1992
- "oneOf": [
2023
+ "anyOf": [
1993
2024
  {
1994
2025
  "$ref": "#/components/schemas/PriceItem"
1995
2026
  },
@@ -2135,7 +2166,14 @@
2135
2166
  },
2136
2167
  "rate": {
2137
2168
  "type": "string",
2138
- "description": "The tax rate applied."
2169
+ "description": "The tax rate applied. With the release of the tax management feature this field is being deprecated in favor of the tax field.",
2170
+ "deprecated": true
2171
+ },
2172
+ "rateValue": {
2173
+ "type": "number",
2174
+ "description": "The tax rate value applied (represented as an integer percentage, e.g, 19 or 7).\nWith the release of the tax management feature this field is being deprecated in favor of the tax field.\n",
2175
+ "example": 19,
2176
+ "deprecated": true
2139
2177
  },
2140
2178
  "tax": {
2141
2179
  "description": "The tax applied.",
@@ -2147,6 +2185,35 @@
2147
2185
  }
2148
2186
  }
2149
2187
  },
2188
+ "TaxAmountBreakdown": {
2189
+ "type": "object",
2190
+ "description": "A tax amount associated with a specific tax rate.",
2191
+ "readOnly": true,
2192
+ "properties": {
2193
+ "amount": {
2194
+ "type": "integer",
2195
+ "description": "The tax amount."
2196
+ },
2197
+ "rate": {
2198
+ "type": "string",
2199
+ "description": "The tax rate applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.",
2200
+ "deprecated": true
2201
+ },
2202
+ "rateValue": {
2203
+ "type": "number",
2204
+ "description": "The tax rate value applied. With the release of the tax manager feature this field is being deprecated in favor of the tax field.",
2205
+ "deprecated": true
2206
+ },
2207
+ "tax": {
2208
+ "description": "The tax applied.",
2209
+ "oneOf": [
2210
+ {
2211
+ "$ref": "#/components/schemas/TaxBreakdownInfo"
2212
+ }
2213
+ ]
2214
+ }
2215
+ }
2216
+ },
2150
2217
  "RecurrenceAmount": {
2151
2218
  "type": "object",
2152
2219
  "description": "An amount associated with a specific recurrence.",
@@ -2174,7 +2241,6 @@
2174
2241
  }
2175
2242
  },
2176
2243
  "required": [
2177
- "type",
2178
2244
  "amount_subtotal",
2179
2245
  "amount_total"
2180
2246
  ]
@@ -2202,7 +2268,7 @@
2202
2268
  "items": {
2203
2269
  "oneOf": [
2204
2270
  {
2205
- "$ref": "#/components/schemas/TaxAmount"
2271
+ "$ref": "#/components/schemas/TaxAmountBreakdown"
2206
2272
  }
2207
2273
  ]
2208
2274
  }
@@ -2509,6 +2575,62 @@
2509
2575
  "filename"
2510
2576
  ]
2511
2577
  },
2578
+ "EntityId": {
2579
+ "type": "string",
2580
+ "format": "uuid"
2581
+ },
2582
+ "EntityItem": {
2583
+ "type": "object",
2584
+ "properties": {
2585
+ "_id": {
2586
+ "$ref": "#/components/schemas/EntityId"
2587
+ },
2588
+ "_title": {
2589
+ "type": "string",
2590
+ "description": "Title of entity"
2591
+ },
2592
+ "_org": {
2593
+ "type": "string",
2594
+ "description": "Organization Id the entity belongs to"
2595
+ },
2596
+ "_schema": {
2597
+ "type": "string"
2598
+ },
2599
+ "_tags": {
2600
+ "type": "array",
2601
+ "items": {
2602
+ "type": "string"
2603
+ }
2604
+ },
2605
+ "_created_at": {
2606
+ "type": "string",
2607
+ "format": "date-time"
2608
+ },
2609
+ "_updated_at": {
2610
+ "type": "string",
2611
+ "format": "date-time"
2612
+ }
2613
+ },
2614
+ "required": [
2615
+ "_id",
2616
+ "_title",
2617
+ "_org",
2618
+ "_schema",
2619
+ "_created_at",
2620
+ "_updated_at"
2621
+ ],
2622
+ "example": {
2623
+ "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
2624
+ "_org": "123",
2625
+ "_schema": "contact",
2626
+ "_tags": [
2627
+ "example",
2628
+ "mock"
2629
+ ],
2630
+ "_created_at": "2021-02-09T12:41:43.662Z",
2631
+ "_updated_at": "2021-02-09T12:41:43.662Z"
2632
+ }
2633
+ },
2512
2634
  "EntityRelation": {
2513
2635
  "type": "object",
2514
2636
  "additionalProperties": true,
@@ -2531,9 +2653,43 @@
2531
2653
  "required": [
2532
2654
  "type",
2533
2655
  "rate",
2534
- "behavior"
2656
+ "behavior",
2657
+ "_id",
2658
+ "_title",
2659
+ "_org",
2660
+ "_schema",
2661
+ "_created_at",
2662
+ "_updated_at"
2535
2663
  ],
2536
2664
  "properties": {
2665
+ "_id": {
2666
+ "$ref": "#/components/schemas/EntityId"
2667
+ },
2668
+ "_title": {
2669
+ "type": "string",
2670
+ "description": "Title of entity"
2671
+ },
2672
+ "_org": {
2673
+ "type": "string",
2674
+ "description": "Organization Id the entity belongs to"
2675
+ },
2676
+ "_schema": {
2677
+ "type": "string"
2678
+ },
2679
+ "_tags": {
2680
+ "type": "array",
2681
+ "items": {
2682
+ "type": "string"
2683
+ }
2684
+ },
2685
+ "_created_at": {
2686
+ "type": "string",
2687
+ "format": "date-time"
2688
+ },
2689
+ "_updated_at": {
2690
+ "type": "string",
2691
+ "format": "date-time"
2692
+ },
2537
2693
  "type": {
2538
2694
  "type": "string",
2539
2695
  "enum": [
@@ -2552,7 +2708,9 @@
2552
2708
  "type": "string",
2553
2709
  "enum": [
2554
2710
  "Exclusive",
2555
- "Inclusive"
2711
+ "Inclusive",
2712
+ "exclusive",
2713
+ "inclusive"
2556
2714
  ]
2557
2715
  },
2558
2716
  "active": {
@@ -2564,6 +2722,42 @@
2564
2722
  "region_label": {
2565
2723
  "type": "string"
2566
2724
  }
2725
+ },
2726
+ "example": {
2727
+ "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
2728
+ "type": "VAT",
2729
+ "description": "Tax description",
2730
+ "behavior": "Exclusive",
2731
+ "active": "true",
2732
+ "region": "DE",
2733
+ "region_label": "Germany",
2734
+ "_org": "123",
2735
+ "_schema": "tax",
2736
+ "_tags": [
2737
+ "example",
2738
+ "mock"
2739
+ ],
2740
+ "_created_at": "2021-02-09T12:41:43.662Z",
2741
+ "_updated_at": "2021-02-09T12:41:43.662Z"
2742
+ }
2743
+ },
2744
+ "TaxBreakdownInfo": {
2745
+ "type": "object",
2746
+ "properties": {
2747
+ "rate": {
2748
+ "type": "number"
2749
+ },
2750
+ "type": {
2751
+ "type": "string",
2752
+ "enum": [
2753
+ "VAT",
2754
+ "GST",
2755
+ "Custom"
2756
+ ]
2757
+ },
2758
+ "_id": {
2759
+ "type": "string"
2760
+ }
2567
2761
  }
2568
2762
  }
2569
2763
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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": "f6176e92cb46cd8a48aa0f010adf17682b8d22b5"
72
+ "gitHead": "ea98397937045b2bb16cb4db4905bcef1eede417"
73
73
  }