Implement Inventory Management Service with CRUD operations for warehouses and inventory items, stock operations, and bulk processing capabilities.
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m48s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m48s
This commit is contained in:
+93
@@ -0,0 +1,93 @@
|
||||
using MediatR;
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
|
||||
namespace CMSMicroservice.Application.Features.InventoryItems.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم موجودی به ID
|
||||
/// </summary>
|
||||
public record GetInventoryItemByIdQuery(long Id) : IRequest<InventoryItem?>;
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم موجودی به Product ID
|
||||
/// </summary>
|
||||
public record GetInventoryItemByProductIdQuery(long ProductId, long? WarehouseId = null) : IRequest<InventoryItem?>;
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم موجودی به DiscountProduct ID
|
||||
/// </summary>
|
||||
public record GetInventoryItemByDiscountProductIdQuery(long DiscountProductId, long? WarehouseId = null) : IRequest<InventoryItem?>;
|
||||
|
||||
/// <summary>
|
||||
/// Query برای جستجوی آیتم های موجودی
|
||||
/// </summary>
|
||||
public record SearchInventoryItemsQuery : IRequest<List<InventoryItem>>
|
||||
{
|
||||
public long? WarehouseId { get; init; }
|
||||
public long? ProductId { get; init; }
|
||||
public long? DiscountProductId { get; init; }
|
||||
public string? ProductName { get; init; }
|
||||
public bool? IsActive { get; init; }
|
||||
public bool? IsLowStock { get; init; }
|
||||
public bool? IsOutOfStock { get; init; }
|
||||
public int Skip { get; init; } = 0;
|
||||
public int Take { get; init; } = 100;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت تعداد آیتم های موجودی
|
||||
/// </summary>
|
||||
public record GetInventoryItemsCountQuery : IRequest<int>
|
||||
{
|
||||
public long? WarehouseId { get; init; }
|
||||
public long? ProductId { get; init; }
|
||||
public long? DiscountProductId { get; init; }
|
||||
public string? ProductName { get; init; }
|
||||
public bool? IsActive { get; init; }
|
||||
public bool? IsLowStock { get; init; }
|
||||
public bool? IsOutOfStock { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم های کم موجود
|
||||
/// </summary>
|
||||
public record GetLowStockItemsQuery : IRequest<List<InventoryItem>>
|
||||
{
|
||||
public long? WarehouseId { get; init; }
|
||||
public int Count { get; init; } = 50;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم های ناموجود
|
||||
/// </summary>
|
||||
public record GetOutOfStockItemsQuery : IRequest<List<InventoryItem>>
|
||||
{
|
||||
public long? WarehouseId { get; init; }
|
||||
public int Count { get; init; } = 50;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query برای چک کردن دسترسی موجودی
|
||||
/// </summary>
|
||||
public record CheckInventoryAvailabilityQuery : IRequest<bool>
|
||||
{
|
||||
public long InventoryItemId { get; init; }
|
||||
public int RequiredQuantity { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت موجودی قابل دسترس
|
||||
/// </summary>
|
||||
public record GetAvailableQuantityQuery(long InventoryItemId) : IRequest<int>;
|
||||
|
||||
/// <summary>
|
||||
/// Query برای دریافت آیتم های موجودی در انبار
|
||||
/// </summary>
|
||||
public record GetWarehouseInventoryItemsQuery : IRequest<List<InventoryItem>>
|
||||
{
|
||||
public long WarehouseId { get; init; }
|
||||
public bool? IsActive { get; init; }
|
||||
public bool? IsLowStock { get; init; }
|
||||
public int Skip { get; init; } = 0;
|
||||
public int Take { get; init; } = 100;
|
||||
}
|
||||
Reference in New Issue
Block a user