using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WarehouseAppSHIPS.Models
{
    public class MaterialRequest
    {
        [Key]
        public int Id { get; set; }
        public DateTime RequestDate { get; set; } = DateTime.Now;

        [ForeignKey("Requester")]
        public int RequesterId { get; set; }
        public virtual AppUser? Requester { get; set; }

        [ForeignKey("Material")]
        public int MaterialId { get; set; }
        public virtual Material? Material { get; set; }

        public int Qty { get; set; }

        [Required, MaxLength(255)]
        public string Purpose { get; set; } = string.Empty;

        public RequestStatus Status { get; set; } = RequestStatus.Pending;

        [ForeignKey("Approver")]
        public int? ApproverId { get; set; }
        public virtual AppUser? Approver { get; set; }

        [MaxLength(255)]
        public string? ApprovalNote { get; set; }
        public string? DocumentPath { get; set; }
    }
}