using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;

namespace Marco.Pms.Model.Expenses
{
    public class AdvancePaymentTransaction : TenantRelation
    {
        public Guid Id { get; set; }
        public string FinanceUIdPrefix { get; set; } = default!;
        public int FinanceUIdPostfix { get; set; }
        public string Title { get; set; } = default!;
        public Guid? ProjectId { get; set; }

        [ValidateNever]
        [ForeignKey("ProjectId")]
        public Project? Project { get; set; }
        public Guid EmployeeId { get; set; }

        [ValidateNever]
        [ForeignKey("EmployeeId")]
        public Employee? Employee { get; set; }
        public double Amount { get; set; }
        public double CurrentBalance { get; set; }
        public DateTime PaidAt { get; set; }
        public DateTime CreatedAt { get; set; }
        public Guid CreatedById { get; set; }

        [ValidateNever]
        [ForeignKey("CreatedById")]
        public Employee? CreatedBy { get; set; }
        public bool IsActive { get; set; }
    }
}
