Skip to content

Commit 36c9bb4

Browse files
authoredJul 14, 2021
Update type of cents_usd response fields (#33)
* Update type of cents_usd * Update test * Update changelog
1 parent c999209 commit 36c9bb4

11 files changed

+42
-53
lines changed
 

‎.mocharc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
require: '@babel/register'
2-
recursive: true
2+
recursive: true

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.7.0] - 2021-07-14
9+
10+
### Changed
11+
12+
- [BREAKING] Changed `order.price_cents_usd` and `order.patch_fee_cents_usd` from string to integer.
13+
814
## [1.6.0] - 2021-07-14
915

1016
### Added

‎package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"description": "JavaScript wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {

‎src/api/EstimatesApi.js

+14-21
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,26 @@ export default class EstimatesApi {
1919
constructor(apiClient) {
2020
this.apiClient = apiClient || ApiClient.instance;
2121
this.createBitcoinEstimate = this.createBitcoinEstimate.bind(this);
22-
this.createBitcoinEstimateWithHttpInfo = this.createBitcoinEstimateWithHttpInfo.bind(
23-
this
24-
);
22+
this.createBitcoinEstimateWithHttpInfo =
23+
this.createBitcoinEstimateWithHttpInfo.bind(this);
2524
this.createFlightEstimate = this.createFlightEstimate.bind(this);
26-
this.createFlightEstimateWithHttpInfo = this.createFlightEstimateWithHttpInfo.bind(
27-
this
28-
);
25+
this.createFlightEstimateWithHttpInfo =
26+
this.createFlightEstimateWithHttpInfo.bind(this);
2927
this.createMassEstimate = this.createMassEstimate.bind(this);
30-
this.createMassEstimateWithHttpInfo = this.createMassEstimateWithHttpInfo.bind(
31-
this
32-
);
28+
this.createMassEstimateWithHttpInfo =
29+
this.createMassEstimateWithHttpInfo.bind(this);
3330
this.createShippingEstimate = this.createShippingEstimate.bind(this);
34-
this.createShippingEstimateWithHttpInfo = this.createShippingEstimateWithHttpInfo.bind(
35-
this
36-
);
31+
this.createShippingEstimateWithHttpInfo =
32+
this.createShippingEstimateWithHttpInfo.bind(this);
3733
this.createVehicleEstimate = this.createVehicleEstimate.bind(this);
38-
this.createVehicleEstimateWithHttpInfo = this.createVehicleEstimateWithHttpInfo.bind(
39-
this
40-
);
34+
this.createVehicleEstimateWithHttpInfo =
35+
this.createVehicleEstimateWithHttpInfo.bind(this);
4136
this.retrieveEstimate = this.retrieveEstimate.bind(this);
42-
this.retrieveEstimateWithHttpInfo = this.retrieveEstimateWithHttpInfo.bind(
43-
this
44-
);
37+
this.retrieveEstimateWithHttpInfo =
38+
this.retrieveEstimateWithHttpInfo.bind(this);
4539
this.retrieveEstimates = this.retrieveEstimates.bind(this);
46-
this.retrieveEstimatesWithHttpInfo = this.retrieveEstimatesWithHttpInfo.bind(
47-
this
48-
);
40+
this.retrieveEstimatesWithHttpInfo =
41+
this.retrieveEstimatesWithHttpInfo.bind(this);
4942
}
5043

5144
createBitcoinEstimateWithHttpInfo(createBitcoinEstimateRequest) {

‎src/api/OrdersApi.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ export default class OrdersApi {
2323
this.retrieveOrder = this.retrieveOrder.bind(this);
2424
this.retrieveOrderWithHttpInfo = this.retrieveOrderWithHttpInfo.bind(this);
2525
this.retrieveOrders = this.retrieveOrders.bind(this);
26-
this.retrieveOrdersWithHttpInfo = this.retrieveOrdersWithHttpInfo.bind(
27-
this
28-
);
26+
this.retrieveOrdersWithHttpInfo =
27+
this.retrieveOrdersWithHttpInfo.bind(this);
2928
}
3029

3130
cancelOrderWithHttpInfo(id) {

‎src/api/PreferencesApi.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,17 @@ export default class PreferencesApi {
1515
constructor(apiClient) {
1616
this.apiClient = apiClient || ApiClient.instance;
1717
this.createPreference = this.createPreference.bind(this);
18-
this.createPreferenceWithHttpInfo = this.createPreferenceWithHttpInfo.bind(
19-
this
20-
);
18+
this.createPreferenceWithHttpInfo =
19+
this.createPreferenceWithHttpInfo.bind(this);
2120
this.deletePreference = this.deletePreference.bind(this);
22-
this.deletePreferenceWithHttpInfo = this.deletePreferenceWithHttpInfo.bind(
23-
this
24-
);
21+
this.deletePreferenceWithHttpInfo =
22+
this.deletePreferenceWithHttpInfo.bind(this);
2523
this.retrievePreference = this.retrievePreference.bind(this);
26-
this.retrievePreferenceWithHttpInfo = this.retrievePreferenceWithHttpInfo.bind(
27-
this
28-
);
24+
this.retrievePreferenceWithHttpInfo =
25+
this.retrievePreferenceWithHttpInfo.bind(this);
2926
this.retrievePreferences = this.retrievePreferences.bind(this);
30-
this.retrievePreferencesWithHttpInfo = this.retrievePreferencesWithHttpInfo.bind(
31-
this
32-
);
27+
this.retrievePreferencesWithHttpInfo =
28+
this.retrievePreferencesWithHttpInfo.bind(this);
3329
}
3430

3531
createPreferenceWithHttpInfo(createPreferenceRequest) {

‎src/api/ProjectsApi.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ export default class ProjectsApi {
1414
constructor(apiClient) {
1515
this.apiClient = apiClient || ApiClient.instance;
1616
this.retrieveProject = this.retrieveProject.bind(this);
17-
this.retrieveProjectWithHttpInfo = this.retrieveProjectWithHttpInfo.bind(
18-
this
19-
);
17+
this.retrieveProjectWithHttpInfo =
18+
this.retrieveProjectWithHttpInfo.bind(this);
2019
this.retrieveProjects = this.retrieveProjects.bind(this);
21-
this.retrieveProjectsWithHttpInfo = this.retrieveProjectsWithHttpInfo.bind(
22-
this
23-
);
20+
this.retrieveProjectsWithHttpInfo =
21+
this.retrieveProjectsWithHttpInfo.bind(this);
2422
}
2523

2624
retrieveProjectWithHttpInfo(id) {

‎src/model/CreateBitcoinEstimateRequest.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ class CreateBitcoinEstimateRequest {
4949

5050
CreateBitcoinEstimateRequest.prototype['timestamp'] = undefined;
5151

52-
CreateBitcoinEstimateRequest.prototype[
53-
'transaction_value_btc_sats'
54-
] = undefined;
52+
CreateBitcoinEstimateRequest.prototype['transaction_value_btc_sats'] =
53+
undefined;
5554

5655
CreateBitcoinEstimateRequest.prototype['project_id'] = undefined;
5756

‎src/model/Order.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ class Order {
9090
if (data.hasOwnProperty('price_cents_usd')) {
9191
obj['price_cents_usd'] = ApiClient.convertToType(
9292
data['price_cents_usd'],
93-
'String'
93+
'Number'
9494
);
9595
}
9696

9797
if (data.hasOwnProperty('patch_fee_cents_usd')) {
9898
obj['patch_fee_cents_usd'] = ApiClient.convertToType(
9999
data['patch_fee_cents_usd'],
100-
'String'
100+
'Number'
101101
);
102102
}
103103

‎test/integration/orders.test.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ describe('Orders Integration', function () {
2323
project_id: biomass_test_project_id
2424
});
2525

26-
expect(parseFloat(data.price_cents_usd)).to.be.closeTo(91, 1);
27-
expect(parseFloat(data.patch_fee_cents_usd)).to.be.closeTo(9, 1);
28-
expect(parseFloat(data.mass_g)).to.be.closeTo(91000, 2000);
26+
expect(data.price_cents_usd + data.patch_fee_cents_usd).to.eq(100);
2927
});
3028

3129
it('supports placing orders in a `draft` state', async function () {

0 commit comments

Comments
 (0)
Please sign in to comment.