using Marco.Pms.Model.Employees; using Marco.Pms.Model.OrganizationModel; using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using System.ComponentModel.DataAnnotations.Schema; namespace Marco.Pms.Model.PurchaseInvoice { /// /// The PurchaseInvoiceDetails class represents a detail in a purchase invoice. /// It contains information about the detail such as its unique identifier, title, description, billing and shipping addresses, /// purchase order number and date, supplier information, proforma invoice details, invoice details, e-way bill details, /// invoice reference number, acknowledgment number and date, base amount, tax amount, transport charges, total amount, and payment due date. /// public class PurchaseInvoiceDetails : TenantRelation { /// /// Gets or sets the unique identifier of the detail. /// public Guid Id { get; set; } /// /// Gets or sets the prefix of the unique identifier for the detail. /// public string UIDPrefix { get; set; } = default!; // PUR/MMYY/ /// /// Gets or sets the postfix of the unique identifier for the detail. /// public int UIDPostfix { get; set; } // 00001 /// /// Gets or sets the title of the detail. /// public string Title { get; set; } = default!; /// /// Gets or sets the description of the detail. /// public string Description { get; set; } = default!; /// /// Gets or sets the unique identifier of the related project. /// public Guid ProjectId { get; set; } /// /// Gets or sets the unique identifier of the organization related to the detail. /// public Guid OrganizationId { get; set; } /// /// Gets or sets the related organization. /// [ValidateNever] [ForeignKey("OrganizationId")] public Organization? Organization { get; set; } /// /// Gets or sets the status of the detail. /// public Guid StatusId { get; set; } /// /// Gets or sets the status of the detail. /// [ValidateNever] [ForeignKey("StatusId")] public PurchaseInvoiceStatus? Status { get; set; } /// /// Gets or sets the billing address of the detail. /// public string BillingAddress { get; set; } = default!; /// /// Gets or sets the shipping address of the detail. /// public string ShippingAddress { get; set; } = default!; /// /// Gets or sets the purchase order number of the detail. /// public string? PurchaseOrderNumber { get; set; } /// /// Gets or sets the purchase order date of the detail. /// public DateTime? PurchaseOrderDate { get; set; } /// /// Gets or sets the unique identifier of the supplier related to the detail. /// public Guid SupplierId { get; set; } /// /// Gets or sets the related supplier. /// [ValidateNever] [ForeignKey("SupplierId")] public Organization? Supplier { get; set; } /// /// Gets or sets the proforma invoice number of the detail. /// public string? ProformaInvoiceNumber { get; set; } /// /// Gets or sets the proforma invoice date of the detail. /// public DateTime? ProformaInvoiceDate { get; set; } /// /// Gets or sets the proforma invoice amount of the detail. /// public double? ProformaInvoiceAmount { get; set; } /// /// Gets or sets the invoice number of the detail. /// public string? InvoiceNumber { get; set; } /// /// Gets or sets the invoice date of the detail. /// public DateTime? InvoiceDate { get; set; } /// /// Gets or sets the e-way bill number of the detail. /// public string? EWayBillNumber { get; set; } /// /// Gets or sets the e-way bill date of the detail. /// public DateTime? EWayBillDate { get; set; } /// /// Gets or sets the invoice reference number of the detail. /// public string? InvoiceReferenceNumber { get; set; } /// /// Gets or sets the acknowledgment number of the detail. /// public string? AcknowledgmentNumber { get; set; } /// /// Gets or sets the acknowledgment date of the detail. /// public DateTime? AcknowledgmentDate { get; set; } /// /// Gets or sets the base amount of the detail. /// public double BaseAmount { get; set; } /// /// Gets or sets the tax amount of the detail. /// public double TaxAmount { get; set; } /// /// Gets or sets the transport charges of the detail. /// public double? TransportCharges { get; set; } /// /// Gets or sets the total amount of the detail. /// public double TotalAmount { get; set; } /// /// The payment due date of the detail. /// public DateTime PaymentDueDate { get; set; } // Defaults to 40 days from the invoice date /// /// Gets or sets a value indicating whether the detail is active. /// public bool IsActive { get; set; } /// /// Gets or sets the unique identifier of the user who created the detail. /// public Guid CreatedById { get; set; } /// /// Gets or sets the user who created the detail. /// [ValidateNever] [ForeignKey("CreatedById")] public Employee? CreatedBy { get; set; } /// /// Gets or sets the date and time when the detail was created. /// public DateTime CreatedAt { get; set; } /// /// Gets or sets the unique identifier of the user who last updated the detail. /// public Guid? UpdatedById { get; set; } /// /// Gets or sets the user who last updated the detail. /// [ValidateNever] [ForeignKey("UpdatedById")] public Employee? UpdatedBy { get; set; } /// /// Gets or sets the date and time when the detail was last updated. /// public DateTime? UpdatedAt { get; set; } } }