fix: StockMovement CHECK constraint violation — store Quantity as negative for reduce operations, pass correct MovementType from RecordLoss
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled

This commit is contained in:
masoodafar-web
2026-02-22 21:38:20 +03:30
parent 305b8d3fd8
commit 0fe4db5e77
3 changed files with 14 additions and 6 deletions
@@ -1,7 +1,7 @@
namespace CMSMicroservice.Application.InventoryItemCQ.Commands.ReduceInventory;
/// <summary>
/// Command برای کم کردن موجودی (فروش)
/// Command برای کم کردن موجودی (فروش، خسارت، مفقودی و ...)
/// </summary>
public record ReduceInventoryCommand : IRequest<ReduceInventoryResponseDto>
{
@@ -19,4 +19,8 @@ public record ReduceInventoryCommand : IRequest<ReduceInventoryResponseDto>
public long? PerformedByUserId { get; init; }
/// <summary>آیا از موجودی رزرو شده کم شود؟</summary>
public bool FromReserved { get; init; } = true;
/// <summary>نوع حرکت انبار (پیش‌فرض: فروش)</summary>
public Domain.Enums.StockMovementType MovementType { get; init; } = Domain.Enums.StockMovementType.Sale;
/// <summary>توضیحات</summary>
public string? Note { get; init; }
}