using Marco.Pms.Model.Collection;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.PurchaseInvoice
{
///
/// Represents a payment made against a purchase invoice.
/// It is a subclass of TenantRelation, indicating that it is a relation between a tenant and the Marco PMS system.
///
public class PurchaseInvoicePayment : TenantRelation
{
///
/// Gets or sets the unique identifier of the payment.
///
public Guid Id { get; set; }
///
/// Gets or sets the unique identifier of the associated purchase invoice.
///
public Guid InvoiceId { get; set; }
///
/// Gets or sets the associated purchase invoice.
/// This is a navigation property that allows access to the associated PurchaseInvoiceDetails object.
///
[ValidateNever]
[ForeignKey("InvoiceId")]
public PurchaseInvoiceDetails? Invoice { get; set; }
///
/// Gets or sets the date the payment was received.
///
public DateTime PaymentReceivedDate { get; set; }
///
/// Gets or sets the transaction ID of the payment.
///
public string TransactionId { get; set; } = default!;
///
/// Gets or sets the amount of the payment.
///
public double Amount { get; set; }
///
/// Gets or sets a comment about the payment.
///
public string Comment { get; set; } = default!;
///
/// Gets or sets a value indicating whether the payment is active.
///
public bool IsActive { get; set; } = true;
///
/// Gets or sets the unique identifier of the payment adjustment head.
///
public Guid PaymentAdjustmentHeadId { get; set; }
///
/// Gets or sets the associated payment adjustment head.
/// This is a navigation property that allows access to the associated PaymentAdjustmentHead object.
///
[ValidateNever]
[ForeignKey("PaymentAdjustmentHeadId")]
public PaymentAdjustmentHead? PaymentAdjustmentHead { get; set; }
///
/// Gets or sets the date and time the record was created.
///
public DateTime CreatedAt { get; set; }
///
/// Gets or sets the unique identifier of the user who created the record.
///
public Guid CreatedById { get; set; }
///
/// Gets or sets the user who created the record.
/// This is a navigation property that allows access to the associated Employee object.
///
[ValidateNever]
[ForeignKey("CreatedById")]
public Employee? CreatedBy { get; set; }
}
}