using SolutionErp.Domain.Common;

namespace SolutionErp.Domain.Office;

// Phase 10.3 G-O4 (Mig 39 — S38) — Đơn đăng ký đi công tác.
// Reuse workflow ApplicableType=ProposalGeneral=4 (KHÔNG có enum riêng — share Proposal pool).
public class TravelRequest : AuditableEntity
{
    public string? MaDonTu { get; set; }                  // "DT/TR/2026/001"
    public Guid RequesterUserId { get; set; }
    public string RequesterFullName { get; set; } = string.Empty;
    public string Destination { get; set; } = string.Empty;  // "Hà Nội", "TP.HCM", ...
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public int NumDays { get; set; }                      // computed
    public string Purpose { get; set; } = string.Empty;
    public decimal? EstimatedCost { get; set; }           // dự toán chi phí
    public WorkflowAppStatus Status { get; set; } = WorkflowAppStatus.Nhap;
    public Guid? ApprovalWorkflowId { get; set; }
    public int? CurrentApprovalLevelOrder { get; set; }

    public WorkflowAppStatus? RejectedFromStatus { get; set; }   // smart return tracking (mirror Proposal)
    public List<TravelRequestLevelOpinion> LevelOpinions { get; set; } = new();
}
