public UpdateDeliveryCostCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.OrderId).MustAsync(OrderExists) .WithMessage("Заказ не найден."); RuleFor(x => x.DeliveryCost).GreaterThanOrEqualTo(0); }
public EditFoodCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists) .WithMessage("Ресторан не найден."); RuleFor(x => x.Food.Title).NotEmpty(); }
public CreateOrderCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists) .WithMessage("Ресторан не найден."); RuleFor(x => x.OwnerId).MustAsync(UserExists) .WithMessage("Пользователь не найден."); }
public SetUserPaidStatusCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.OrderId).MustAsync(OrderExists) .WithMessage("Заказ не найден."); RuleFor(x => x.UserId).MustAsync(UserExists) .WithMessage("Пользователь не найден."); }
public UpdateRestaurantCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.Title).MaximumLength(100); RuleFor(x => x.Title).NotEmpty(); RuleFor(x => x.Id).MustAsync(RestaurantExists) .WithMessage("Ресторан не найден."); }
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(); }
public DeleteFoodCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.RestaurantId).MustAsync(RestaurantExists) .WithMessage("Ресторан не найден."); RuleFor(x => x.Food).MustAsync(FoodExists) .WithMessage("Еда не найдена"); }
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; }
public IsPhoneNumberTakenQueryHandler(IZakazakumContext context) { _context = context; }
public AddFoodCommandHandler(IZakazakumContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public GetRestaurantsListQueryHandler(IZakazakumContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public SetUserPaidStatusCommandHandler(IZakazakumContext context) { _context = context; }
public UpdateDeliveryCostCommandHandler(IZakazakumContext context) { _context = context; }
public CreateRestaurantCommandValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.Title).MaximumLength(100); RuleFor(x => x.Title).NotEmpty(); }
public CreateUserCommandHandler(IZakazakumContext context) { _context = context; }
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("Ресторан не найден."); }
public GetOrderValidator(IZakazakumContext context) { _context = context; RuleFor(x => x.OrderId).MustAsync(OrderExists) .WithMessage("Заказ не найден."); }
public GetFoodsListQueryQueryHandler(IZakazakumContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public SetOrderStatusCommandHandler(IZakazakumContext context) { _context = context; }
public CreateRestaurantCommandHandler(IZakazakumContext context) { _context = context; }