Skip to content

1.20.0 - create order by vintage year #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiClient {
};

this.defaultHeaders = {
'User-Agent': 'patch-node/1.19.0'
'User-Agent': 'patch-node/1.20.0'
};

/**
Expand Down
9 changes: 9 additions & 0 deletions src/model/CreateOrderRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -58,4 +65,6 @@ CreateOrderRequest.prototype['metadata'] = undefined;

CreateOrderRequest.prototype['state'] = undefined;

CreateOrderRequest.prototype['vintage_year'] = undefined;

export default CreateOrderRequest;
9 changes: 9 additions & 0 deletions test/integration/orders.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});