diff --git a/CHANGELOG.md b/CHANGELOG.md index f90cacf..116cc6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.20.0] - 2022-04-18 + +### Added + +- Adds optional `vintage_year` field to `order` creation + ## [1.19.0] - 2022-04-11 ### Added diff --git a/package-lock.json b/package-lock.json index 1c21899..636e885 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@patch-technology/patch", - "version": "1.19.0", + "version": "1.20.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@patch-technology/patch", - "version": "1.19.0", + "version": "1.20.0", "license": "MIT", "dependencies": { "query-string": "^7.0.1", diff --git a/package.json b/package.json index f4202ae..30f3b4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@patch-technology/patch", - "version": "1.19.0", + "version": "1.20.0", "description": "Node.js wrapper for the Patch API", "license": "MIT", "repository": { diff --git a/src/ApiClient.js b/src/ApiClient.js index 7e2655c..ec9759f 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -16,7 +16,7 @@ class ApiClient { }; this.defaultHeaders = { - 'User-Agent': 'patch-node/1.19.0' + 'User-Agent': 'patch-node/1.20.0' }; /** diff --git a/src/model/CreateOrderRequest.js b/src/model/CreateOrderRequest.js index a83a7e4..4f57f80 100644 --- a/src/model/CreateOrderRequest.js +++ b/src/model/CreateOrderRequest.js @@ -43,6 +43,13 @@ class CreateOrderRequest { if (data.hasOwnProperty('state')) { obj['state'] = ApiClient.convertToType(data['state'], 'String'); } + + if (data.hasOwnProperty('vintage_year')) { + obj['vintage_year'] = ApiClient.convertToType( + data['vintage_year'], + 'Number' + ); + } } return obj; } @@ -58,4 +65,6 @@ CreateOrderRequest.prototype['metadata'] = undefined; CreateOrderRequest.prototype['state'] = undefined; +CreateOrderRequest.prototype['vintage_year'] = undefined; + export default CreateOrderRequest; diff --git a/test/integration/orders.test.js b/test/integration/orders.test.js index e52b083..481211a 100644 --- a/test/integration/orders.test.js +++ b/test/integration/orders.test.js @@ -83,4 +83,13 @@ describe('Orders Integration', function () { expect(order.metadata).to.have.all.keys('external_id'); }); }); + + it('supports create orders with a vintage year', async function () { + const createOrderResponse = await patch.orders.createOrder({ + mass_g: 100, + vintage_year: 2022 + }); + + expect(createOrderResponse.success).to.equal(true); + }); });