Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(products): add customizations
- Loading branch information
1 parent
28fdeb7
commit 2e81dc0
Showing
7 changed files
with
500 additions
and
195 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
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,87 @@ | ||
module.exports = { | ||
amount: { | ||
description: 'Either net or gross should be set (not null). Tax will be calculated accordingly automatically. We do not validate for either to be set, for data flexibility reasons.', | ||
type: 'object', | ||
properties: { | ||
net: { | ||
oneOf: [ | ||
{ | ||
example: '27633.02', | ||
type: 'number', | ||
minimum: 0, | ||
maximum: 1000000, | ||
multipleOf: 0.01 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
gross: { | ||
oneOf: [ | ||
{ | ||
example: '27633.02', | ||
type: 'number', | ||
minimum: 0, | ||
maximum: 1000000, | ||
multipleOf: 0.01 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
currency: { | ||
type: 'string', | ||
minLength: 3, | ||
maxLength: 3 | ||
}, | ||
percentage: { | ||
description: 'DEPRECATED', | ||
type: 'number' | ||
}, | ||
purchase_price: { | ||
description: 'Define the opportunity cost or calculatory base price of this product and currency.', | ||
oneOf: [ | ||
{ | ||
example: '27633.02', | ||
type: 'number', | ||
minimum: 0, | ||
maximum: 1000000, | ||
multipleOf: 0.01 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
cost: { | ||
description: 'Define additional cost.', | ||
oneOf: [ | ||
{ | ||
example: '27633.02', | ||
type: 'number', | ||
minimum: 0, | ||
maximum: 1000000, | ||
multipleOf: 0.01 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
}, | ||
margin: { | ||
description: 'Add a margin to pruchase_price and cost to result in net.', | ||
oneOf: [ | ||
{ | ||
type: 'number', | ||
multipleOf: 0.0001 | ||
}, | ||
{ | ||
type: 'null' | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.