Skip to content

Commit 1851540

Browse files
author
Rahul Mody
authored
1.20.0 - create order by vintage year (#63)
* 1.20.0 enable vintage year order creation * 1.20.0 changelog
1 parent 4c1bfe2 commit 1851540

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
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.20.0] - 2022-04-18
9+
10+
### Added
11+
12+
- Adds optional `vintage_year` field to `order` creation
13+
814
## [1.19.0] - 2022-04-11
915

1016
### Added

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "1.19.0",
3+
"version": "1.20.0",
44
"description": "Node.js wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {

src/ApiClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ApiClient {
1616
};
1717

1818
this.defaultHeaders = {
19-
'User-Agent': 'patch-node/1.19.0'
19+
'User-Agent': 'patch-node/1.20.0'
2020
};
2121

2222
/**

src/model/CreateOrderRequest.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ class CreateOrderRequest {
4343
if (data.hasOwnProperty('state')) {
4444
obj['state'] = ApiClient.convertToType(data['state'], 'String');
4545
}
46+
47+
if (data.hasOwnProperty('vintage_year')) {
48+
obj['vintage_year'] = ApiClient.convertToType(
49+
data['vintage_year'],
50+
'Number'
51+
);
52+
}
4653
}
4754
return obj;
4855
}
@@ -58,4 +65,6 @@ CreateOrderRequest.prototype['metadata'] = undefined;
5865

5966
CreateOrderRequest.prototype['state'] = undefined;
6067

68+
CreateOrderRequest.prototype['vintage_year'] = undefined;
69+
6170
export default CreateOrderRequest;

test/integration/orders.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,13 @@ describe('Orders Integration', function () {
8383
expect(order.metadata).to.have.all.keys('external_id');
8484
});
8585
});
86+
87+
it('supports create orders with a vintage year', async function () {
88+
const createOrderResponse = await patch.orders.createOrder({
89+
mass_g: 100,
90+
vintage_year: 2022
91+
});
92+
93+
expect(createOrderResponse.success).to.equal(true);
94+
});
8695
});

0 commit comments

Comments
 (0)