using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Expenses.Masters;
using Marco.Pms.Model.Master;
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 Expenses : TenantRelation
    {
        public Guid Id { get; set; }
        public string UIDPrefix { get; set; } = default!;
        public int UIDPostfix { get; set; }
        public Guid ProjectId { get; set; }

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

        //[ValidateNever]
        //[ForeignKey("ExpensesTypeId")]
        //public ExpensesTypeMaster? ExpensesType { get; set; }

        public Guid ExpenseCategoryId { get; set; }

        [ValidateNever]
        [ForeignKey("ExpenseCategoryId")]
        public ExpenseCategoryMaster? ExpenseCategory { get; set; }
        public Guid PaymentModeId { get; set; }

        [ValidateNever]
        [ForeignKey("PaymentModeId")]
        public PaymentModeMatser? PaymentMode { get; set; }
        public Guid PaidById { get; set; }

        [ValidateNever]
        [ForeignKey("PaidById")]
        public Employee? PaidBy { get; set; }
        public Guid CreatedById { get; set; }

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

        [ValidateNever]
        [ForeignKey("ReviewedById")]
        public Employee? ReviewedBy { get; set; }
        public Guid? ApprovedById { get; set; }

        [ValidateNever]
        [ForeignKey("ApprovedById")]
        public Employee? ApprovedBy { get; set; }
        public Guid? ProcessedById { get; set; }

        [ValidateNever]
        [ForeignKey("ProcessedById")]
        public Employee? ProcessedBy { get; set; }
        public DateTime TransactionDate { get; set; }
        public DateTime CreatedAt { get; set; }
        public string? TransactionId { get; set; }
        public string Description { get; set; } = string.Empty;
        public string? ExpenseUId { get; set; }
        public string? Location { get; set; }
        public string? GSTNumber { get; set; }
        public string SupplerName { get; set; } = string.Empty;
        public Guid CurrencyId { get; set; }

        [ValidateNever]
        [ForeignKey("CurrencyId")]
        public CurrencyMaster? Currency { get; set; }
        public double Amount { get; set; }
        public double? BaseAmount { get; set; }
        public double? TaxAmount { get; set; }
        public double? TDSPercentage { get; set; }
        public int? NoOfPersons { get; set; }
        public Guid? PaymentRequestId { get; set; }

        [ValidateNever]
        [ForeignKey("PaymentRequestId")]
        public PaymentRequest? PaymentRequest { get; set; }
        public Guid StatusId { get; set; }

        [ValidateNever]
        [ForeignKey("StatusId")]
        public ExpensesStatusMaster? Status { get; set; }
        public bool PreApproved { get; set; } = false;
        public bool IsActive { get; set; } = true;
    }
}
