This commit is contained in:
2025-02-13 09:05:34 +04:00
parent bca5c116a0
commit 5a5fc38cb6
5 changed files with 2 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ public class RequestDataModel(string id, string workerId, string email, double s
throw new ValidationException("The value in the field WorkerId is not a unique identifier");
if (Email.IsEmpty())
throw new ValidationException("Worker Email is empty");
if (!Regex.IsMatch(Email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$"))
if (!Regex.IsMatch(Email, @"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"))
throw new ValidationException("Field Email is not a email");
if (Sum <= 0)
throw new ValidationException("Field Sum is less than or equal to 0");