using MediatR;
namespace CMSMicroservice.Application.Features.InventoryItems.Commands;
///
/// Command برای ایجاد آیتم موجودی جدید
///
public record CreateInventoryItemCommand : IRequest
{
public long? ProductId { get; init; }
public long? DiscountProductId { get; init; }
public long WarehouseId { get; init; }
public int Quantity { get; init; }
public int MinQuantity { get; init; }
public int MaxQuantity { get; init; }
public bool IsActive { get; init; } = true;
}
///
/// Command برای آپدیت آیتم موجودی
///
public record UpdateInventoryItemCommand : IRequest
{
public long Id { get; init; }
public int? Quantity { get; init; }
public int? MinQuantity { get; init; }
public int? MaxQuantity { get; init; }
public long? WarehouseId { get; init; }
public bool? IsActive { get; init; }
}
///
/// Command برای آپدیت کردن موجودی یک آیتم
///
public record UpdateInventoryQuantityCommand : IRequest
{
public long Id { get; init; }
public int NewQuantity { get; init; }
public string? ReferenceNumber { get; init; }
public long? PerformedByUserId { get; init; }
public string? Note { get; init; }
}
///
/// Command برای رزرو کردن موجودی
///
public record ReserveInventoryCommand : IRequest
{
public long Id { get; init; }
public int Quantity { get; init; }
public long? OrderId { get; init; }
public long? DiscountOrderId { get; init; }
public string? ReferenceNumber { get; init; }
public long? PerformedByUserId { get; init; }
}
///
/// Command برای آزاد کردن موجودی رزرو شده
///
public record ReleaseReservedInventoryCommand : IRequest
{
public long Id { get; init; }
public int Quantity { get; init; }
public long? OrderId { get; init; }
public long? DiscountOrderId { get; init; }
public string? ReferenceNumber { get; init; }
public long? PerformedByUserId { get; init; }
}
///
/// Command برای کم کردن موجودی (فروش)
///
public record ReduceInventoryCommand : IRequest
{
public long Id { get; init; }
public int Quantity { get; init; }
public long? OrderId { get; init; }
public long? DiscountOrderId { get; init; }
public string? ReferenceNumber { get; init; }
public long? PerformedByUserId { get; init; }
public bool FromReserved { get; init; } = true; // آیا از موجودی رزرو شده کم شود؟
}
///
/// Command برای اضافه کردن موجودی (خرید)
///
public record IncreaseInventoryCommand : IRequest
{
public long Id { get; init; }
public int Quantity { get; init; }
public string? ReferenceNumber { get; init; }
public long? PerformedByUserId { get; init; }
public string? Note { get; init; }
}
///
/// Command برای حذف آیتم موجودی
///
public record DeleteInventoryItemCommand : IRequest
{
public long Id { get; init; }
}