namespace OpenWarehouse.warehouse.api.Data;

public class ItemInWarehouse()
{
    public ItemInWarehouse(List<ItemInWarehouseClaims>? itemInWarehouses = null) : this()
    {
        if (itemInWarehouses != null)
            ItemInWarehouseClaims = itemInWarehouses;
        else
            ItemInWarehouseClaims = new List<ItemInWarehouseClaims>();
    }

    public ItemInWarehouse(Item item, string positions, List<ItemInWarehouseClaims> itemInWarehouses) : this(itemInWarehouses)
    {
        Item = item;
        Positions = positions;
        ItemInWarehouseClaims = itemInWarehouses;
    }
    
    [Key]
    public Guid? Id { get; set; }
    
    [Required]
    public Item? Item { get; set; }
    
    [Required, MaxLength(30)]
    public string? Positions { get; set; }
    
    [DeleteBehavior(DeleteBehavior.Cascade)]
    public List<ItemInWarehouseClaims>? ItemInWarehouseClaims { get; set; }
}