marco.pms.api/Marco.Pms.Model/PurchaseInvoice/PurchaseInvoiceDetails.cs

206 lines
6.9 KiB
C#

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
{
/// <summary>
/// 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.
/// </summary>
public class PurchaseInvoiceDetails : TenantRelation
{
/// <summary>
/// Gets or sets the unique identifier of the detail.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the prefix of the unique identifier for the detail.
/// </summary>
public string UIDPrefix { get; set; } = default!; // PUR/MMYY/
/// <summary>
/// Gets or sets the postfix of the unique identifier for the detail.
/// </summary>
public int UIDPostfix { get; set; } // 00001
/// <summary>
/// Gets or sets the title of the detail.
/// </summary>
public string Title { get; set; } = default!;
/// <summary>
/// Gets or sets the description of the detail.
/// </summary>
public string Description { get; set; } = default!;
/// <summary>
/// Gets or sets the unique identifier of the related project.
/// </summary>
public Guid ProjectId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the organization related to the detail.
/// </summary>
public Guid OrganizationId { get; set; }
/// <summary>
/// Gets or sets the related organization.
/// </summary>
[ValidateNever]
[ForeignKey("OrganizationId")]
public Organization? Organization { get; set; }
/// <summary>
/// Gets or sets the billing address of the detail.
/// </summary>
public string BillingAddress { get; set; } = default!;
/// <summary>
/// Gets or sets the shipping address of the detail.
/// </summary>
public string ShippingAddress { get; set; } = default!;
/// <summary>
/// Gets or sets the purchase order number of the detail.
/// </summary>
public string? PurchaseOrderNumber { get; set; }
/// <summary>
/// Gets or sets the purchase order date of the detail.
/// </summary>
public DateTime? PurchaseOrderDate { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the supplier related to the detail.
/// </summary>
public Guid SupplierId { get; set; }
/// <summary>
/// Gets or sets the related supplier.
/// </summary>
[ValidateNever]
[ForeignKey("SupplierId")]
public Organization? Supplier { get; set; }
/// <summary>
/// Gets or sets the proforma invoice number of the detail.
/// </summary>
public string? ProformaInvoiceNumber { get; set; }
/// <summary>
/// Gets or sets the proforma invoice date of the detail.
/// </summary>
public DateTime? ProformaInvoiceDate { get; set; }
/// <summary>
/// Gets or sets the proforma invoice amount of the detail.
/// </summary>
public double? ProformaInvoiceAmount { get; set; }
/// <summary>
/// Gets or sets the invoice number of the detail.
/// </summary>
public string? InvoiceNumber { get; set; }
/// <summary>
/// Gets or sets the invoice date of the detail.
/// </summary>
public DateTime? InvoiceDate { get; set; }
/// <summary>
/// Gets or sets the e-way bill number of the detail.
/// </summary>
public string? EWayBillNumber { get; set; }
/// <summary>
/// Gets or sets the e-way bill date of the detail.
/// </summary>
public DateTime? EWayBillDate { get; set; }
/// <summary>
/// Gets or sets the invoice reference number of the detail.
/// </summary>
public string? InvoiceReferenceNumber { get; set; }
/// <summary>
/// Gets or sets the acknowledgment number of the detail.
/// </summary>
public string? AcknowledgmentNumber { get; set; }
/// <summary>
/// Gets or sets the acknowledgment date of the detail.
/// </summary>
public DateTime? AcknowledgmentDate { get; set; }
/// <summary>
/// Gets or sets the base amount of the detail.
/// </summary>
public double BaseAmount { get; set; }
/// <summary>
/// Gets or sets the tax amount of the detail.
/// </summary>
public double TaxAmount { get; set; }
/// <summary>
/// Gets or sets the transport charges of the detail.
/// </summary>
public double? TransportCharges { get; set; }
/// <summary>
/// Gets or sets the total amount of the detail.
/// </summary>
public double TotalAmount { get; set; }
/// <summary>
/// The payment due date of the detail.
/// </summary>
public DateTime PaymentDueDate { get; set; } // Defaults to 40 days from the invoice date
/// <summary>
/// Gets or sets a value indicating whether the detail is active.
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user who created the detail.
/// </summary>
public Guid CreatedById { get; set; }
/// <summary>
/// Gets or sets the user who created the detail.
/// </summary>
[ValidateNever]
[ForeignKey("CreatedById")]
public Employee? CreatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the detail was created.
/// </summary>
public DateTime CreatedAt { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user who last updated the detail.
/// </summary>
public Guid? UpdatedById { get; set; }
/// <summary>
/// Gets or sets the user who last updated the detail.
/// </summary>
[ValidateNever]
[ForeignKey("UpdatedById")]
public Employee? UpdatedBy { get; set; }
/// <summary>
/// Gets or sets the date and time when the detail was last updated.
/// </summary>
public DateTime? UpdatedAt { get; set; }
}
}