azerothcore / azerothcore/acore-cms

Standardise the validators and others simliar implementations.

Open
#169 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
78
Forks
43
Avg merge
13m
Merged PRs (30d)
1

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the SKU validators and the AccountSelector, CharacterSelector, and GuildSelector implementations mentioned in the issue. Compare their repeated validation and document the desired nesting and IsGiftable behavior before proposing a design; done means new implementations no longer require manually duplicated validators.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.