Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schemas): adds full patch schema
- Loading branch information
1 parent
65f8924
commit 09f3ff7
Showing
3 changed files
with
193 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
module.exports = { | ||
code: { | ||
description: 'The chosen or generated voucher code', | ||
example: '1234 1234 1234', | ||
anyOf: [ | ||
{ | ||
type: 'string' | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
format: { | ||
description: 'The format this voucher conforms to', | ||
example: 'xxxx xxxx xxxx', | ||
type: 'string' | ||
}, | ||
format_type: { | ||
description: '', | ||
type: 'string', | ||
'enum': [ | ||
'numeric', | ||
'alphanumeric', | ||
'alphabetic' | ||
] | ||
}, | ||
amount: { | ||
description: 'decimal type', | ||
example: '10.99', | ||
anyOf: [ | ||
{ | ||
type: 'number', | ||
minimum: 0 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
amount_cents: { | ||
description: '', | ||
anyOf: [ | ||
{ | ||
type: 'integer', | ||
minimum: 0 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
amount_max: { | ||
description: '', | ||
anyOf: [ | ||
{ | ||
type: 'number', | ||
minimum: 0 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
currency: { | ||
description: '', | ||
type: 'string' | ||
}, | ||
custom: { | ||
description: '', | ||
type: 'object' | ||
}, | ||
metadata: { | ||
description: '', | ||
type: 'object' | ||
}, | ||
issuable: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
reissuable: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
issuer: { | ||
description: '', | ||
type: 'string' | ||
}, | ||
customer: { | ||
description: '', | ||
anyOf: [ | ||
{ | ||
type: 'object' | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
comment: { | ||
description: '', | ||
type: 'string', | ||
maxLength: 1024 | ||
}, | ||
expires_at: { | ||
description: '', | ||
type: 'string', | ||
format: 'date-time' | ||
}, | ||
barcodes: { | ||
description: '', | ||
type: 'object' | ||
}, | ||
title: { | ||
description: '', | ||
type: 'string' | ||
}, | ||
partial_redemption: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
active: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
bound_to: { | ||
description: '', | ||
type: 'object' | ||
}, | ||
namespace: { | ||
description: '', | ||
type: 'string' | ||
}, | ||
type: { | ||
description: '', | ||
type: 'string', | ||
'enum': [ | ||
'amount', | ||
'discount', | ||
'product' | ||
] | ||
}, | ||
regions: { | ||
description: '', | ||
type: 'array', | ||
minItems: 1, | ||
maxItems: 1, | ||
items: { | ||
oneOf: [ | ||
{ | ||
type: 'string', | ||
minLength: 2, | ||
maxLength: 2, | ||
pattern: '^[A-Z]{2}$' | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
} | ||
}, | ||
limited_to_region: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
refundable: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
mutable: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
exchange_for_cash: { | ||
description: '', | ||
type: 'boolean' | ||
}, | ||
restriction_single_transaction: { | ||
description: '', | ||
type: 'boolean' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.