Files
WMSlite/WmsLite.Api/Models/Inventory.cs
T
zhougfandCursor fa1b286463 Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
Implement API security baseline (sys_user, JWT, audit fields, transactions,
unique constraints) and Web real login with 401 handling. Document setup
and development workflows in root, WmsLite.Api, and WmsLite.Web README files.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 14:17:47 +08:00

56 lines
2.3 KiB
C#

using System.Collections.Generic;
using SqlSugar;
using WmsLite.Api.Enums;
namespace WmsLite.Api.Models;
[SugarTable("inventory")]
public class Inventory : BaseEntity
{
/// <summary>1=物料库存,2=空容器库存。</summary>
[SugarColumn(ColumnName = "inventory_kind", IsNullable = false)]
public InventoryKind InventoryKind { get; set; } = InventoryKind.Material;
[SugarColumn(ColumnName = "material_code", Length = 64, IsNullable = true)]
public string? MaterialCode { get; set; }
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
public string? ContainerCode { get; set; }
/// <summary>与 location 表一致,便于按仓库-库区-分区-储位查询。</summary>
[SugarColumn(ColumnName = "warehouse_code", Length = 64, IsNullable = false)]
public string WarehouseCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "area_code", Length = 64, IsNullable = false)]
public string AreaCode { get; set; } = string.Empty;
/// <summary>分区编码。</summary>
[SugarColumn(ColumnName = "zone_code", Length = 64, IsNullable = false)]
public string ZoneCode { get; set; } = string.Empty;
/// <summary>储位编码,对应 location.code。</summary>
[SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = false)]
public string LocationCode { get; set; } = string.Empty;
[SugarColumn(ColumnName = "qty", IsNullable = false)]
public decimal Qty { get; set; }
[SugarColumn(ColumnName = "pending_inbound_qty", IsNullable = false)]
public decimal PendingInboundQty { get; set; }
[SugarColumn(ColumnName = "pending_outbound_qty", IsNullable = false)]
public decimal PendingOutboundQty { get; set; }
[SugarColumn(ColumnName = "frozen_qty", IsNullable = false)]
public decimal FrozenQty { get; set; }
[SugarColumn(ColumnName = "inventory_status", IsNullable = false)]
public InventoryStatus InventoryStatus { get; set; } = InventoryStatus.Available;
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = false)]
public string Unit { get; set; } = string.Empty;
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
public Dictionary<string, object>? Attrs { get; set; }
}