Implement Validate Decorator for Model Validation #23
Labels
enhancement
New feature or request
from_willyovale
An issue described in original project, but never implemented
good first issue
Good for newcomers
Description
Fireorm supports validation by leveraging class-validator. The current implementation requires validation to be manually checked in each repository function. To improve code maintainability and readability, a
Validate
decorator should be created to handle this validation automatically.Steps to Reproduce
Expected Behavior
A
Validate
decorator should handle model validation, reducing code repetition and improving maintainability.Actual Behavior
Validation checks are manually implemented in repository functions, leading to repeated code and potential for errors.
Acceptance Criteria
Validate
decorator that checks if validation should be performed and returns aValidationError
.Validate
decorator.Additional Context
Validate
decorator.validatorOptions
of class-validator.Proposed API Changes
Create Validate Decorator:
Validate
decorator to handle model validation.Unit Tests:
Validate
decorator.Replace Existing Validation Code:
Validate
decorator instead of manual validation checks.Ensure Usage of Validate Decorator:
@Validate
.Example Implementation
Original Issue
The text was updated successfully, but these errors were encountered: