fix: Remove RemainingCount property from CreateDiscountProduct and related commands, initializing inventory with zero
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m56s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m56s
This commit is contained in:
-2
@@ -23,8 +23,6 @@ public record CreateNewProductsCommand : IRequest<CreateNewProductsResponseDto>
|
||||
public int SaleCount { get; init; }
|
||||
//
|
||||
public int ViewCount { get; init; }
|
||||
//
|
||||
public int RemainingCount { get; init; }
|
||||
// لیست شناسه دستهبندیهای محصول
|
||||
public ICollection<long>? CategoryIds { get; init; }
|
||||
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ public class CreateNewProductsCommandHandler : IRequestHandler<CreateNewProducts
|
||||
await _context.Products.AddAsync(entity, cancellationToken);
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
|
||||
// ایجاد رکورد موجودی در سیستم انبارداری
|
||||
// ایجاد رکورد موجودی در سیستم انبارداری با موجودی اولیه صفر
|
||||
await _inventoryService.InitializeInventoryAsync(
|
||||
entity.Id,
|
||||
ProductType.RegularProduct,
|
||||
request.RemainingCount,
|
||||
0, // موجودی اولیه صفر - باید از طریق Inventory اضافه شود
|
||||
ct: cancellationToken);
|
||||
|
||||
// ثبت دستهبندیهای محصول (در صورت ارسال)
|
||||
|
||||
-2
@@ -25,8 +25,6 @@ public class CreateNewProductsCommandValidator : AbstractValidator<CreateNewProd
|
||||
.NotNull();
|
||||
RuleFor(model => model.ViewCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.RemainingCount)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
-2
@@ -25,8 +25,6 @@ public record UpdateProductsCommand : IRequest<Unit>
|
||||
public int SaleCount { get; init; }
|
||||
//
|
||||
public int ViewCount { get; init; }
|
||||
//
|
||||
public int RemainingCount { get; init; }
|
||||
// لیست شناسه دستهبندیهای محصول
|
||||
public ICollection<long>? CategoryIds { get; init; }
|
||||
|
||||
|
||||
-2
@@ -27,8 +27,6 @@ public class UpdateProductsCommandValidator : AbstractValidator<UpdateProductsCo
|
||||
.NotNull();
|
||||
RuleFor(model => model.ViewCount)
|
||||
.NotNull();
|
||||
RuleFor(model => model.RemainingCount)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user