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.Collection
{
    public class Invoice : TenantRelation
    {
        public Guid Id { get; set; }
        public string Title { get; set; } = default!;
        public string Description { get; set; } = default!;
        public string InvoiceNumber { get; set; } = default!;
        public string? EInvoiceNumber { get; set; }
        public Guid ProjectId { get; set; }

        [ValidateNever]
        [ForeignKey("ProjectId")]
        public Project? Project { get; set; }
        public DateTime InvoiceDate { get; set; }
        public DateTime ClientSubmitedDate { get; set; }
        public DateTime ExceptedPaymentDate { get; set; }
        public double BasicAmount { get; set; }
        public double TaxAmount { get; set; }
        public bool IsActive { get; set; } = true;
        public bool MarkAsCompleted { get; set; } = true;
        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; }
    }
}
