Files
BackOffice.BFF/src/BackOffice.BFF.Application/DiscountShoppingCartCQ/Commands/UpdateCartItemCount/UpdateCartItemCountCommandValidator.cs
T
masoodafar-web 4f400eabc5 feat: Implement Discount Product and Shopping Cart functionalities
- Added UpdateDiscountProductCommandValidator for validating discount product updates.
- Created GetDiscountProductByIdQuery and its handler for retrieving discount product details by ID.
- Implemented GetDiscountProductsQuery and handler for fetching a list of discount products with filtering options.
- Developed AddToCartCommand and handler for adding products to the shopping cart.
- Implemented ClearCartCommand and handler for clearing the shopping cart.
- Created RemoveFromCartCommand and handler for removing items from the cart.
- Added UpdateCartItemCountCommand and handler for updating the quantity of items in the cart.
- Developed GetUserCartQuery and handler for retrieving the user's shopping cart details.
- Implemented Product Tag functionalities including assigning tags to products, creating, updating, and deleting tags.
- Added queries for fetching all tags and products by tag.
2025-12-04 02:41:19 +03:30

17 lines
649 B
C#

namespace BackOffice.BFF.Application.DiscountShoppingCartCQ.Commands.UpdateCartItemCount;
public class UpdateCartItemCountCommandValidator : AbstractValidator<UpdateCartItemCountCommand>
{
public UpdateCartItemCountCommandValidator()
{
RuleFor(x => x.UserId)
.GreaterThan(0).WithMessage("شناسه کاربر نامعتبر است");
RuleFor(x => x.CartItemId)
.GreaterThan(0).WithMessage("شناسه آیتم سبد خرید نامعتبر است");
RuleFor(x => x.NewCount)
.GreaterThan(0).WithMessage("تعداد جدید باید بیشتر از صفر باشد");
}
}