forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
предварительно
This commit is contained in:
@@ -9,11 +9,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MagicCarpetContracts.DataModels;
|
||||
|
||||
public class SaleTourDataModel(string saleId, string cocktailId, int count) : IValidation
|
||||
public class SaleTourDataModel(string saleId, string tourId, int count) : IValidation
|
||||
{
|
||||
public string SaleId { get; private set; } = saleId;
|
||||
|
||||
public string TourId { get; private set; } = cocktailId;
|
||||
public string TourId { get; private set; } = tourId;
|
||||
|
||||
public int Count { get; private set; } = count;
|
||||
|
||||
@@ -26,10 +26,10 @@ public class SaleTourDataModel(string saleId, string cocktailId, int count) : IV
|
||||
throw new ValidationException("The value in the field SaleId is not a unique identifier");
|
||||
|
||||
if (TourId.IsEmpty())
|
||||
throw new ValidationException("Field TourId is empty");
|
||||
throw new ValidationException("Field ProductId is empty");
|
||||
|
||||
if (!TourId.IsGuid())
|
||||
throw new ValidationException("The value in the field TourId is not a unique identifier");
|
||||
throw new ValidationException("The value in the field ProductId is not a unique identifier");
|
||||
|
||||
if (Count <= 0)
|
||||
throw new ValidationException("Field Count is less than or equal to 0");
|
||||
|
||||
Reference in New Issue
Block a user