using System.Collections.Generic;
using SqlSugar;
using WmsLite.Api.Enums;
namespace WmsLite.Api.Models;
[SugarTable("location")]
public class Location : BaseEntity
{
[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 = "zone_code", Length = 64, IsNullable = false)]
public string ZoneCode { get; set; } = string.Empty;
/// 伸位编码(可选,批量生成时可写入模板中 Aisle 占位符便于筛选)。
[SugarColumn(ColumnName = "aisle_code", Length = 64, IsNullable = true)]
public string? AisleCode { get; set; }
[SugarColumn(ColumnName = "code", Length = 64, IsNullable = false)]
public string Code { get; set; } = string.Empty;
[SugarColumn(ColumnName = "name", Length = 256, IsNullable = true)]
public string? Name { get; set; }
/// 货架/网格行号(可选)。
[SugarColumn(ColumnName = "row_no", IsNullable = true)]
public int? RowNo { get; set; }
/// 货架/网格列号(可选)。
[SugarColumn(ColumnName = "column_no", IsNullable = true)]
public int? ColumnNo { get; set; }
/// 层号(可选)。
[SugarColumn(ColumnName = "layer_no", IsNullable = true)]
public int? LayerNo { get; set; }
/// 储位高度(业务自定单位,如 mm)。
[SugarColumn(ColumnName = "height", IsNullable = true)]
public decimal? Height { get; set; }
[SugarColumn(ColumnName = "location_status", IsNullable = false)]
public LocationStatus LocationStatus { get; set; } = LocationStatus.Empty;
/// 是否外侧仓位(双伸位等场景,外侧先取货)。
[SugarColumn(ColumnName = "is_outer", IsNullable = false)]
public bool IsOuter { get; set; }
/// 绑定的容器编码(可选)。
[SugarColumn(ColumnName = "container_code", Length = 64, IsNullable = true)]
public string? ContainerCode { get; set; }
[SugarColumn(ColumnName = "attrs", IsJson = true, ColumnDataType = "jsonb", IsNullable = true)]
public Dictionary? Attrs { get; set; }
}