shoc-backend/Api.SeaHavenIndustries/DTOs/Workorder_DTO.cs
Adam Moussa 05b36ef7dd Add configurable dropdowns, new WO fields, and seed data
- Create DropdownOption model with Category, Value, ParentValue for Trade/SubTrade/Problem
- Add DropdownOptionsController with CRUD + ByCategory endpoint with parent filtering
- Add Problem, Trade, SubTrade, VendorNTE, ScheduledDate, CompletedDate, Source to WorkOrder
- Update EditWorkorder_DTO and GetWorkorderById with new fields
- Audit log tracks changes to all new fields
- Seed default Trades (10), SubTrades (20), and Problems (11) on startup
2026-04-17 10:40:38 -04:00

80 lines
No EOL
3.2 KiB
C#

using Data.SeaHavenIndustries;
namespace Api.SeaHavenIndustries.DTOs
{
public class Workorder_DTO
{
public string? WorkerOrderNumber { get; set; }
public string? WorkerOrderTitle { get; set; }
public string? Description { get; set; }
public string? PO { get; set; }
public string? TT { get; set; }
//public int? ContactId { get; set; }
public string? AssignTo { get; set; }
public DateTime? DueDate { get; set; }
public string? Priority { get; set; }
public int? LocationId { get; set; }
public bool? istemplate { get; set; }
//public int? CategoryId { get; set; }
public List<IFormFile>? Attachments { get; set; }
public string? BeforPhotoIssue { get; set; }
public IFormFile? BeforPhotoAttachment { get; set; }
public string? AfterPhotoIssue { get; set; }
public IFormFile? AfterPhotoAttachment { get; set; }
public string? SignOffName { get; set; }
public IFormFile? SignOffAttachment { get; set; }
public string? SignOffSignature { get; set; }
public string? WorkOrderContacts { get; set; }
public string? WorkOrderCategories { get; set; }
public List<int> GetContactIds()
{
return WorkOrderContacts?.Split(',').Select(int.Parse).ToList() ?? new List<int>();
}
public List<int> GetCategoryIds()
{
return WorkOrderCategories?.Split(',').Select(int.Parse).ToList() ?? new List<int>();
}
}
public class EditWorkorder_DTO
{
public int? Id { get; set; }
public string? WorkerOrderNumber { get; set; }
public string? WorkerOrderTitle { get; set; }
public string? Description { get; set; }
public string? PO { get; set; }
public string? TT { get; set; }
public string? AssignTo { get; set; }
public DateTime? DueDate { get; set; }
public string? Priority { get; set; }
public string? Status { get; set; }
public int? LocationId { get; set; }
public string? Problem { get; set; }
public string? Trade { get; set; }
public string? SubTrade { get; set; }
public decimal? VendorNTE { get; set; }
public DateTime? ScheduledDate { get; set; }
public DateTime? CompletedDate { get; set; }
public string? Source { get; set; }
public List<IFormFile>? Attachments { get; set; }
public string? BeforPhotoIssue { get; set; }
public IFormFile? BeforPhotoAttachment { get; set; }
public string? AfterPhotoIssue { get; set; }
public IFormFile? AfterPhotoAttachment { get; set; }
public string? SignOffName { get; set; }
public IFormFile? SignOffAttachment { get; set; }
public string? SignOffSignature { get; set; }
public string? WorkOrderContacts { get; set; }
public string? WorkOrderCategories { get; set; }
public List<int> GetContactIds()
{
return WorkOrderContacts?.Split(',').Select(int.Parse).ToList() ?? new List<int>();
}
public List<int> GetCategoryIds()
{
return WorkOrderCategories?.Split(',').Select(int.Parse).ToList() ?? new List<int>();
}
}
}