Skip to content

Refactor and Centralize Validation Logic into a Validation Service #138

@szymonpoterejkoinfe2

Description

@szymonpoterejkoinfe2

Description

Currently, the validation logic resides within the RegisterPage.cs and PersonalInfoPage.cs files. To improve maintainability, testability, and separation of concerns, this logic should be moved into a dedicated Validation Service.

Requirements

  1. Create a new Validation Service (e.g., IValidationService and ValidationService).
  2. Move all existing validation methods from RegisterPage.cs and PersonalInfoPage.cs into the new service.
  3. Each validation method:
    • Should be asynchronous (Task<bool> return type).
    • Should return a boolean indicating whether the validation was successful.
  4. Inject the validation service using the application's Dependency Injection (DI) system.
  5. Update all existing references in RegisterPage.cs and PersonalInfoPage.cs to use the new service instead of inline logic.

Acceptance Criteria

  • All validation logic is centralized in the ValidationService.
  • Methods are async and return Task<bool>.
  • RegisterPage.cs and PersonalInfoPage.cs no longer contain direct validation logic.
  • ValidationService is correctly registered in DI and used where needed.

Metadata

Metadata

Labels

BackendBackend oriented areajust betterOptimalization or just prettier code. Not a bug. Just better

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions