From 72cbd82026e3c5bbcac96663ab7842c7bb66bf4f Mon Sep 17 00:00:00 2001 From: Robert Jefe Lindstaedt Date: Tue, 14 May 2019 15:53:47 +0200 Subject: [PATCH] fix(accounting): force location and number, allow location null --- lib/v0/locations/accounts.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/v0/locations/accounts.js b/lib/v0/locations/accounts.js index c2b425c21..2b70fe58b 100644 --- a/lib/v0/locations/accounts.js +++ b/lib/v0/locations/accounts.js @@ -2,6 +2,10 @@ module.exports = { type: 'array', items: { type: 'object', + required: [ + 'location', + 'custom_id' + ], properties: { name: { anyOf: [ @@ -17,10 +21,17 @@ module.exports = { ] }, location: { - description: 'The specific Tillhub resource this account applies to (e.g. branch).', - type: 'string', - format: 'uuid', - example: '936835f7-2d75-41d2-9001-38ed6e458328' + anyOf: [ + { + description: 'The specific Tillhub resource this account applies to (e.g. branch).', + type: 'string', + format: 'uuid', + example: '936835f7-2d75-41d2-9001-38ed6e458328' + }, + { + type: 'null' + } + ] }, custom_id: { description: 'The custom financial account identifier e.g. an account number.',