-
Notifications
You must be signed in to change notification settings - Fork 37
Description
I only can talk for Validators for SKUs, currently any new implementation requires (manually) to add a piece of code as validador, which is a bad pratice. We should have a function or class for that purpose.
What does this mainaly fixes?
-
New implementations may (my case) forget to manually create a validator for that implementation.
Example: SKU requires the character selection to be added to the cart, should be mandatory, currently each implementation has that validation either copy pasted or new validator to achieve the same. -
Reduces code size and code repetition.
Having the same code or similiar code in each implementation to do the same, could be their own function or class. -
Allows a easier choice of validators for developers or new implementation.
Example: -
AccountSelector | You required to be logged in
-
CharacterSelector | You required to be logged in and too choose a character prior to add to a cart.
-
GuildSelector | You required to be logged in, choose a character and choose a guild.
and other validators.
Having each Validator having the required Validators to it could be good or bad (for nesting).
GuildSelector requires CharacterSelector which requires AccountSelector as example
| AccountSelector
| - CharacterSelector
| - - GuildSelector
Edit: IsGiftable or smth also.