using TwoFromTheCaseContracts.Exceptions; using TwoFromTheCaseContracts.Extensions; using TwoFromTheCaseContracts.Infrastructure; namespace TwoFromTheCaseContracts.DataModels; public class WorkerWorkDataModel(string workerId, string workId) : IValidation { public string WorkerId { get; private set; } = workerId; public string WorkId { get; private set; } = workId; public void Validate() { if (WorkerId.IsEmpty()) throw new ValidationException("Field WorkerId is empty"); if (!WorkerId.IsGuid()) throw new ValidationException("The value in the field WorkerId is not a unique identifier"); if (WorkId.IsEmpty()) throw new ValidationException("Field WorkId is empty"); if (!WorkId.IsGuid()) throw new ValidationException("The value in the field WorkId is not a unique identifier"); } }