diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6785041..b3f9d31 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,3 +10,6 @@ - [ ] Have you added an integration test for the changes? - [ ] Have you built the gem locally and made queries against it successfully? +- [ ] Did you update the changelog? +- [ ] Did you bump the package version? +- [ ] For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production? diff --git a/CHANGELOG.md b/CHANGELOG.md index f40e1c2..04b45f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.3] - 2020-09-28 + +### Added + +- `patch_fee_cents_usd` field to `orders` + ## [1.2.2] - 2020-09-18 ### Added diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2cffeec --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +SHELL = /bin/bash + +build: + npx prettier --write . && \ + npm run build + +test: + npm run test + +.PHONY: build test \ No newline at end of file diff --git a/package.json b/package.json index 3149fd9..20308f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@patch-technology/patch", - "version": "1.2.2", + "version": "1.2.3", "description": "Javascript wrapper for the Patch API", "license": "MIT", "repository": { diff --git a/src/model/Order.js b/src/model/Order.js index 59e502e..af1ac53 100644 --- a/src/model/Order.js +++ b/src/model/Order.js @@ -16,6 +16,7 @@ class Order { state, allocationState, priceCentsUsd, + patchFeeCentsUsd, allocations, metadata ) { @@ -27,6 +28,7 @@ class Order { state, allocationState, priceCentsUsd, + patchFeeCentsUsd, allocations, metadata ); @@ -40,6 +42,7 @@ class Order { state, allocationState, priceCentsUsd, + patchFeeCentsUsd, allocations, metadata ) { @@ -49,6 +52,7 @@ class Order { obj['state'] = state; obj['allocation_state'] = allocationState; obj['price_cents_usd'] = priceCentsUsd; + obj['patch_fee_cents_usd'] = patchFeeCentsUsd; obj['allocations'] = allocations; obj['metadata'] = metadata; } @@ -90,6 +94,13 @@ class Order { ); } + if (data.hasOwnProperty('patch_fee_cents_usd')) { + obj['patch_fee_cents_usd'] = ApiClient.convertToType( + data['patch_fee_cents_usd'], + 'String' + ); + } + if (data.hasOwnProperty('allocations')) { obj['allocations'] = ApiClient.convertToType(data['allocations'], [ Allocation @@ -116,6 +127,8 @@ Order.prototype['allocation_state'] = undefined; Order.prototype['price_cents_usd'] = undefined; +Order.prototype['patch_fee_cents_usd'] = undefined; + Order.prototype['allocations'] = undefined; Order.prototype['metadata'] = undefined; diff --git a/src/model/Photo.js b/src/model/Photo.js index ae329aa..3ad7d3f 100644 --- a/src/model/Photo.js +++ b/src/model/Photo.js @@ -8,11 +8,13 @@ import ApiClient from '../ApiClient'; class Photo { - constructor() { - Photo.initialize(this); + constructor(url) { + Photo.initialize(this, url); } - static initialize(obj) {} + static initialize(obj, url) { + obj['url'] = url; + } static constructFromObject(data, obj) { if (data) { diff --git a/test/integration/orders.test.js b/test/integration/orders.test.js index d2c7c30..df38bf6 100644 --- a/test/integration/orders.test.js +++ b/test/integration/orders.test.js @@ -25,6 +25,8 @@ describe('Orders Integration', function () { const placeOrderResponse = await patch.orders.placeOrder(orderId); expect(placeOrderResponse.data.state).to.equal('placed'); + expect(placeOrderResponse.data.price_cents_usd).to.equal('1.0'); + expect(placeOrderResponse.data.patch_fee_cents_usd).to.equal('0.0'); }); it('supports cancelling orders in a `draft` state', async function () {