WMSlite/WmsLite.Api/Models/InboundOrderLine.cs
zhougf 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

50 lines
1.9 KiB
C#

using System.Collections.Generic;
using SqlSugar;
using WmsLite.Api.Enums;
namespace WmsLite.Api.Models;
[SugarTable("inbound_order_line")]
public class InboundOrderLine : BaseEntity
{
[SugarColumn(ColumnName = "order_id", IsNullable = false)]
public long OrderId { get; set; }
[SugarColumn(ColumnName = "line_no", IsNullable = false)]
public int LineNo { get; set; }
[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; }
[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;
[SugarColumn(ColumnName = "location_code", Length = 64, IsNullable = true)]
public string? LocationCode { get; set; }
[SugarColumn(ColumnName = "qty", IsNullable = false)]
public decimal Qty { get; set; }
/// <summary>供 CodeFirst 加列时为历史行生成默认值,避免 NOT NULL 无 DEFAULT 失败。</summary>
[SugarColumn(ColumnName = "received_qty", IsNullable = false, DefaultValue = "0")]
public decimal ReceivedQty { get; set; }
[SugarColumn(ColumnName = "line_status", IsNullable = false, DefaultValue = "1")]
public OrderLineStatus LineStatus { get; set; } = OrderLineStatus.Open;
[SugarColumn(ColumnName = "unit", Length = 32, IsNullable = true)]
public string? Unit { get; set; }
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
public Dictionary<string, object>? Attrs { get; set; }
}