Ejemplo n.º 1
0
 public UpdateDeliveryCostCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.OrderId).MustAsync(OrderExists)
     .WithMessage("Заказ не найден.");
     RuleFor(x => x.DeliveryCost).GreaterThanOrEqualTo(0);
 }
Ejemplo n.º 2
0
 public EditFoodCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
     RuleFor(x => x.Food.Title).NotEmpty();
 }
Ejemplo n.º 3
0
 public CreateOrderCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
     RuleFor(x => x.OwnerId).MustAsync(UserExists)
     .WithMessage("Пользователь не найден.");
 }
Ejemplo n.º 4
0
 public SetUserPaidStatusCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.OrderId).MustAsync(OrderExists)
     .WithMessage("Заказ не найден.");
     RuleFor(x => x.UserId).MustAsync(UserExists)
     .WithMessage("Пользователь не найден.");
 }
Ejemplo n.º 5
0
 public UpdateRestaurantCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.Title).MaximumLength(100);
     RuleFor(x => x.Title).NotEmpty();
     RuleFor(x => x.Id).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
 }
Ejemplo n.º 6
0
 public AddFoodCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
     RuleFor(x => x.Food.Cost).GreaterThanOrEqualTo(0);
     RuleFor(x => x.Food.Title).NotEmpty();
 }
Ejemplo n.º 7
0
 public DeleteFoodCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
     RuleFor(x => x.Food).MustAsync(FoodExists)
     .WithMessage("Еда не найдена");
 }
Ejemplo n.º 8
0
 public AddFoodOrderCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.OrderId).MustAsync(OrderExists)
     .WithMessage("Заказ не найден.");
     RuleFor(x => x.FoodOrder.FoodId).MustAsync(FoodExist)
     .WithMessage("Блюдо не найдено.");
     RuleFor(x => x.FoodOrder.UserId).MustAsync(UserExists)
     .WithMessage("Пользователь не найден.");
 }
 public CreateUserCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.Name).MaximumLength(100);
     RuleFor(x => x.Name).NotEmpty();
     RuleFor(x => x.PhoneNumber).MustAsync(UniquePhoneNumber)
     .When(x => !string.IsNullOrEmpty(x.PhoneNumber))
     .WithMessage("Номер телефона должен быть уникален.");
     RuleFor(x => x.PhoneNumber).Length(11)
     .When(x => !string.IsNullOrEmpty(x.PhoneNumber));
 }
 public IsFoodTitleTakenQueryHandler(IZakazakumContext context)
 {
     _context = context;
 }
Ejemplo n.º 11
0
 public IsPhoneNumberTakenQueryHandler(IZakazakumContext context)
 {
     _context = context;
 }
Ejemplo n.º 12
0
 public AddFoodCommandHandler(IZakazakumContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public GetRestaurantsListQueryHandler(IZakazakumContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Ejemplo n.º 14
0
 public SetUserPaidStatusCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }
 public UpdateDeliveryCostCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }
Ejemplo n.º 16
0
 public CreateRestaurantCommandValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.Title).MaximumLength(100);
     RuleFor(x => x.Title).NotEmpty();
 }
Ejemplo n.º 17
0
 public CreateUserCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }
Ejemplo n.º 18
0
 public GetOrderQueryHandler(IZakazakumContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public UpdateFoodOrderCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }
 public IsFoodTitleTakenQueryValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists)
     .WithMessage("Ресторан не найден.");
 }
Ejemplo n.º 21
0
 public GetOrderValidator(IZakazakumContext context)
 {
     _context = context;
     RuleFor(x => x.OrderId).MustAsync(OrderExists)
     .WithMessage("Заказ не найден.");
 }
Ejemplo n.º 22
0
 public GetFoodsListQueryQueryHandler(IZakazakumContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public SetOrderStatusCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }
 public CreateRestaurantCommandHandler(IZakazakumContext context)
 {
     _context = context;
 }