This commit is contained in:
2024-09-22 17:19:58 +03:00
parent 958c69df4c
commit 1625764e0a
10 changed files with 584 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ namespace ApplicationLayer
{
public readonly static Regex EnglishWordRegex = new("^[a-zA-Z]*$");
public readonly static Regex EnglishPhraseRegex = new(@"^[a-zA-Z№0-9?><;,{}[\]\-_+=!@#$%\^&*|']*$");
public readonly static Regex EnglishPhraseRegex = new(@"^[a-zA-Z №0-9;,\-_+=#*']*$");
public readonly static Regex PhoneNumRegex = new(@"^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$");
}

View File

@@ -60,7 +60,7 @@ public class PlaceOfWorkModelValidator : AbstractValidator<PlaceOfWorkModel>
.WithMessage("Building of place of work can not be empty")
.Matches(Constants.EnglishPhraseRegex)
.WithMessage("Place of work building field can contain only english letters, digits and special symbols")
.MaximumLength(ConfigurationConstraints.CountryNameLength)
.MaximumLength(ConfigurationConstraints.BuildingNumberLength)
.WithMessage($"Building of place of work length must be less than {ConfigurationConstraints.BuildingNumberLength}");
}
}