StorageArea.cs 1.5 KB
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Rcs.Domain.Entities;

/// <summary>
/// 库区实体
/// @author zzy
/// </summary>
[Table("storage_areas")]
public class StorageArea : Entity
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.None)]
    [Column("area_id")]
    public Guid AreaId { get; set; }

    /// <summary>
    /// 库区编码
    /// </summary>
    [Required]
    [Column("area_code")]
    [MaxLength(50)]
    public string AreaCode { get; set; }

    /// <summary>
    /// 库区名称
    /// </summary>
    [Column("area_name")]
    [MaxLength(100)]
    public string? AreaName { get; set; }

    /// <summary>
    /// 库区描述
    /// </summary>
    [Column("description")]
    [MaxLength(500)]
    public string? Description { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [Column("is_active")]
    public bool IsActive { get; set; } = true;

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("created_at", TypeName = "timestamp")]
    public DateTime CreatedAt { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("updated_at", TypeName = "timestamp")]
    public DateTime? UpdatedAt { get; set; }

    #region 导航属性

    /// <summary>
    /// 库位集合
    /// </summary>
    public virtual ICollection<StorageLocation> StorageLocations { get; set; } = new List<StorageLocation>();

    #endregion
}