1 Commits

Author SHA1 Message Date
IlyasValiulov
106bcad01c правка 2025-02-08 13:24:12 +04:00
2 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ public class FurnitureComponentDataModel(string furnitureId, string componentId,
if (ComponentId.IsEmpty())
throw new ValidationException("Field ComponentId is empty");
if (!ComponentId.IsGuid())
throw new ValidationException("The value in the field BlandId is not a unique identifier");
throw new ValidationException("The value in the field ComponentId is not a unique identifier");
if (Count <= 0)
throw new ValidationException("Field Count is less than or equal to 0");
}

View File

@@ -18,10 +18,10 @@ public class FurnitureDataModel(string id, string name, int weight, List<Compone
if (!Id.IsGuid())
throw new ValidationException("The value in the field Id is not a unique identifier");
if (Name.IsEmpty())
throw new ValidationException("Field FurnitureId is empty");
throw new ValidationException("Field Name is empty");
if (Weight <= 0)
throw new ValidationException("Field Count is less than or equal to 0");
throw new ValidationException("Field Weight is less than or equal to 0");
if ((Components?.Count ?? 0) == 0)
throw new ValidationException("The sale must include products");
throw new ValidationException("The furniture must include Components");
}
}