using Claim = System.Security.Claims.Claim;

namespace OpenWarehouse.warehouse.api.Data;

public class WarehouseClaims() : ClaimBase
{
    public WarehouseClaims(Warehouse warehouse, Claim claim) : this()
    {
        Warehouse = warehouse;
        ClaimType = claim.Type;
        ClaimValue = claim.Value;
        ClaimIssuer = claim.Issuer;

    }

    public Claim GetClaim()
    {
        return new Claim(ClaimType ?? "Uknow", ClaimValue ?? "Uknow");
    }
    
    [Key, MaxLength(100)]
    public Guid? Id { get; set; }
    [Required, MaxLength(100)]
    public Guid? WarehouseId { get; set; }
    public Warehouse? Warehouse { get; set; }
}