Skip to content
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

Discount: Conditional min/max range for percent and amount #152

Open
mbirman opened this issue Mar 9, 2018 · 0 comments
Open

Discount: Conditional min/max range for percent and amount #152

mbirman opened this issue Mar 9, 2018 · 0 comments

Comments

@mbirman
Copy link
Contributor

mbirman commented Mar 9, 2018

From @d-Pixie:

As for the AMOUNT/PERCENT problem above I think we should front a custom property here and take a tuple of the type and value of the discount. That is, as far as I can get from the docs, the only way to do this. Bad data modeling on Fortnox's part unfortunately ...
So we have played with the idea before of fronting certain attributes an keeping the Fortnox values in private attributes, prefixed with underscores or some such, and use the custom property's constructor to set the internal attributes. In this case we would case the validation based on the type and verify that the provided value for a type of discount holds before updating the internal variables.

For amount it must be [-9_999_999_999.9, 9_999_999_999.9]
For percent [-100.0, 100.0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant