using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace PSTW_CentralSystem.Areas.IT.Models { [Table("it_requests")] public class ItRequest { [Key] public int ItRequestId { get; set; } public int UserId { get; set; } // FK -> aspnetusers.Id // snapshot fields (taken at submission time) [Required] [MaxLength(200)] public string StaffName { get; set; } = string.Empty; [MaxLength(200)] public string? CompanyName { get; set; } [MaxLength(200)] public string? DepartmentName { get; set; } [MaxLength(200)] public string? Designation { get; set; } [MaxLength(200)] public string? Location { get; set; } [MaxLength(50)] public string? EmploymentStatus { get; set; } // Permanent / Contract / Temp / New Staff public DateTime? ContractEndDate { get; set; } public DateTime RequiredDate { get; set; } [MaxLength(20)] public string? PhoneExt { get; set; } public DateTime SubmitDate { get; set; } // navigation public ICollection Hardware { get; set; } = new List(); public ICollection Emails { get; set; } = new List(); public ICollection OsRequirements { get; set; } = new List(); public ICollection Software { get; set; } = new List(); public ICollection SharedPermissions { get; set; } = new List(); public DateTime? FirstSubmittedAt { get; set; } // when the request was first created public DateTime? EditableUntil { get; set; } // FirstSubmittedAt + window public bool IsLockedForEdit { get; set; } } }