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 PaymentRequest : TenantRelation
    {
        public Guid Id { get; set; }
        public string Title { get; set; } = default!;
        public string Description { get; set; } = default!;
        public string UIDPrefix { get; set; } = default!;
        public int UIDPostfix { get; set; }
        public string Payee { get; set; } = default!;
        public bool IsAdvancePayment { get; set; }
        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 DateTime DueDate { get; set; }
        public Guid? ProjectId { get; set; }

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

        [ValidateNever]
        [ForeignKey("RecurringPaymentId")]
        public RecurringPayment? RecurringPayment { get; set; }
        public Guid? ExpenseCategoryId { get; set; }

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

        [ValidateNever]
        [ForeignKey("ExpenseStatusId")]
        public ExpensesStatusMaster? ExpenseStatus { get; set; }
        public string? PaidTransactionId { get; set; }
        public DateTime? PaidAt { get; set; }
        public Guid? PaidById { get; set; }

        [ValidateNever]
        [ForeignKey("PaidById")]
        public Employee? PaidBy { get; set; }
        public bool IsExpenseCreated { get; set; } = false;
        public bool IsActive { get; set; }
        public DateTime CreatedAt { get; set; }
        public Guid CreatedById { get; set; }

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

        [ValidateNever]
        [ForeignKey("UpdatedById")]
        public Employee? UpdatedBy { get; set; }
    }
}
