using PSTW_CentralSystem.Models;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
namespace PSTW_CentralSystem.Areas.Inventory.Models
{
    public class ItemMovementModel
    {
        [Key]
        public int Id { get; set; }
        public int? ItemId { get; set; }
        public int? ToStation { get; set; }
        public int? ToStore { get; set; }
        public int? ToUser { get; set; }
        [Comment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery")]
        public string? ToOther { get; set; }
        public DateTime? sendDate { get; set; }
        [Comment("Register, StockIn, Stock Out")]
        public string? Action { get; set; }
        public int? Quantity { get; set; }
        public string? Remark { get; set; }
        public string? ConsignmentNote { get; set; }
        public DateTime Date { get; set; }
        public int? LastUser { get; set; }
        public int? LastStore{ get; set; }
        public int? LastStation{ get; set; }
        [Comment("Repair, Calibration, Faulty, Ready To Deploy, On Delivery")]
        public string? LatestStatus { get; set; }
        public DateTime? receiveDate { get; set; }
        public bool MovementComplete { get; set; } = false;
        //public virtual ItemModel? Item { get; set; }
        //[ForeignKey("ToStore")]
        [ForeignKey("ItemId")]
        public virtual ItemModel? Item { get; set; }
        [ForeignKey("ToStore")]
        public virtual StoreModel? NextStore { get; set; }
        [ForeignKey("ToStation")]
        public virtual StationModel? NextStation { get; set; }
        [ForeignKey("ToUser")]
        public virtual UserModel? NextUser { get; set; }
        [ForeignKey("LastStore")]
        public virtual StoreModel? FromStore { get; set; }
        [ForeignKey("LastStation")]
        public virtual StationModel? FromStation { get; set; }
        [ForeignKey("LastUser")]
        public virtual UserModel? FromUser { get; set; }
    }

    public class ItemStatusUpdateModel
    {
        public int ItemId { get; set; }
        public int Status { get; set; }
    }
}
