From 1dbe81faaa71e7d2fb901dba0fdccf1fa7d97ff8 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Sun, 4 Jan 2026 23:51:47 +0330 Subject: [PATCH] refactor: Remove InitialCount and RemainingCount properties from discount product commands --- .../CreateDiscountProduct/CreateDiscountProductCommand.cs | 3 --- .../CreateDiscountProductCommandHandler.cs | 1 - .../CreateDiscountProductCommandValidator.cs | 3 --- .../Commands/CreateNewProducts/CreateNewProductsCommand.cs | 1 - .../Commands/UpdateProducts/UpdateProductsCommand.cs | 1 - 5 files changed, 9 deletions(-) diff --git a/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommand.cs b/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommand.cs index 1c30b06..6425a3b 100644 --- a/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommand.cs +++ b/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommand.cs @@ -17,9 +17,6 @@ public record CreateDiscountProductCommand : IRequestحداکثر درصد تخفیف (0-100) public int MaxDiscountPercent { get; init; } - /// تعداد اولیه موجودی - public int InitialCount { get; init; } - /// ترتیب نمایش public int SortOrder { get; init; } diff --git a/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommandHandler.cs b/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommandHandler.cs index d505af7..486a3e8 100644 --- a/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommandHandler.cs +++ b/src/BackOffice.BFF.Application/DiscountProductCQ/Commands/CreateDiscountProduct/CreateDiscountProductCommandHandler.cs @@ -21,7 +21,6 @@ public class CreateDiscountProductCommandHandler : IRequestHandler x.MaxDiscountPercent) .InclusiveBetween(0, 100).WithMessage("درصد تخفیف باید بین 0 تا 100 باشد"); - RuleFor(x => x.InitialCount) - .GreaterThanOrEqualTo(0).WithMessage("تعداد اولیه نمی‌تواند منفی باشد"); - RuleFor(x => x.CategoryIds) .NotEmpty().WithMessage("حداقل یک دسته‌بندی باید انتخاب شود"); } diff --git a/src/BackOffice.BFF.Application/ProductsCQ/Commands/CreateNewProducts/CreateNewProductsCommand.cs b/src/BackOffice.BFF.Application/ProductsCQ/Commands/CreateNewProducts/CreateNewProductsCommand.cs index 4e024ea..93d4db0 100644 --- a/src/BackOffice.BFF.Application/ProductsCQ/Commands/CreateNewProducts/CreateNewProductsCommand.cs +++ b/src/BackOffice.BFF.Application/ProductsCQ/Commands/CreateNewProducts/CreateNewProductsCommand.cs @@ -8,7 +8,6 @@ public record CreateNewProductsCommand : IRequest public long Price { get; init; } public int Discount { get; init; } public int Rate { get; init; } - public int RemainingCount { get; init; } public ImageFileModel ImageFile { get; init; } public ImageFileModel ThumbnailFile { get; init; } // لیست شناسه دسته‌بندی‌های محصول diff --git a/src/BackOffice.BFF.Application/ProductsCQ/Commands/UpdateProducts/UpdateProductsCommand.cs b/src/BackOffice.BFF.Application/ProductsCQ/Commands/UpdateProducts/UpdateProductsCommand.cs index b9cad3f..420bf4e 100644 --- a/src/BackOffice.BFF.Application/ProductsCQ/Commands/UpdateProducts/UpdateProductsCommand.cs +++ b/src/BackOffice.BFF.Application/ProductsCQ/Commands/UpdateProducts/UpdateProductsCommand.cs @@ -9,7 +9,6 @@ public record UpdateProductsCommand : IRequest public long Price { get; init; } public int Discount { get; init; } public int Rate { get; init; } - public int RemainingCount { get; init; } public string ImagePath { get; init; } public string ThumbnailPath { get; init; } public ImageFileModel ImageFile { get; init; }