WebApi + ClientApp, GraphQL, Reflection

This commit is contained in:
Boris Milašinović
2026-05-06 20:55:05 +02:00
parent 8f7c704a90
commit 4fb3de19f6
196 changed files with 10395 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using Events.WebAPI.Contract.Validation;
namespace Events.WebAPI.Util.Validation;
public class ValidationMessageProvider : IValidationMessageProvider
{
public ValidationMessage UniqueSportName(string sportName)
=> new(ValidationErrorCodes.SportNameNotUnique, $"A sport named '{sportName}' already exists.");
public ValidationMessage UniquePersonDocumentAndCountry()
=> new(ValidationErrorCodes.PersonDocumentCountryNotUnique, "A person with the same document number already exists for the selected country.");
public ValidationMessage PersonEmailOrContactPhoneRequired()
=> new(ValidationErrorCodes.PersonEmailOrContactPhoneRequired, "Either e-mail address or contact phone is required.");
public ValidationMessage UniqueRegistration()
=> new(ValidationErrorCodes.RegistrationNotUnique, "The person is already registered for the selected sport at this event.");
public ValidationMessage EventNotFound()
=> new(ValidationErrorCodes.EventNotFound, "The selected event does not exist.");
public ValidationMessage PersonNotFound()
=> new(ValidationErrorCodes.PersonNotFound, "The selected person does not exist.");
public ValidationMessage SportNotFound()
=> new(ValidationErrorCodes.SportNotFound, "The selected sport does not exist.");
public ValidationMessage ForeignKeyNotFound(string propertyName)
=> new(ValidationErrorCodes.ForeignKeyNotFound, $"The selected value for {propertyName} does not exist.");
}