Initial commit
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using PowderCoating.Core.Enums;
|
||||
|
||||
namespace PowderCoating.Application.DTOs.GiftCertificate;
|
||||
|
||||
public class GiftCertificateListDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string CertificateCode { get; set; } = string.Empty;
|
||||
public decimal OriginalAmount { get; set; }
|
||||
public decimal RedeemedAmount { get; set; }
|
||||
public decimal RemainingBalance { get; set; }
|
||||
public string? RecipientName { get; set; }
|
||||
public string? RecipientEmail { get; set; }
|
||||
public GiftCertificateIssuedReason IssuedReason { get; set; }
|
||||
public GiftCertificateStatus Status { get; set; }
|
||||
public DateTime IssueDate { get; set; }
|
||||
public DateTime? ExpiryDate { get; set; }
|
||||
}
|
||||
|
||||
public class GiftCertificateDto : GiftCertificateListDto
|
||||
{
|
||||
public int? RecipientCustomerId { get; set; }
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
public int? PurchasingCustomerId { get; set; }
|
||||
public string? PurchasingCustomerName { get; set; }
|
||||
public string? Notes { get; set; }
|
||||
public string? IssuedByName { get; set; }
|
||||
public List<GiftCertificateRedemptionDto> Redemptions { get; set; } = new();
|
||||
}
|
||||
|
||||
public class GiftCertificateRedemptionDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int GiftCertificateId { get; set; }
|
||||
public int InvoiceId { get; set; }
|
||||
public string InvoiceNumber { get; set; } = string.Empty;
|
||||
public decimal AmountRedeemed { get; set; }
|
||||
public DateTime RedeemedDate { get; set; }
|
||||
public string? RedeemedByName { get; set; }
|
||||
}
|
||||
|
||||
public class CreateGiftCertificateDto
|
||||
{
|
||||
[Required]
|
||||
[Range(1.00, 9999.99, ErrorMessage = "Amount must be between $1.00 and $9,999.99")]
|
||||
[Display(Name = "Certificate Amount")]
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Issued Reason")]
|
||||
public GiftCertificateIssuedReason IssuedReason { get; set; } = GiftCertificateIssuedReason.Sold;
|
||||
|
||||
[Range(0, 9999.99)]
|
||||
[Display(Name = "Purchase Price (if sold)")]
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
|
||||
[Display(Name = "Purchasing Customer")]
|
||||
public int? PurchasingCustomerId { get; set; }
|
||||
|
||||
[Display(Name = "Recipient Customer")]
|
||||
public int? RecipientCustomerId { get; set; }
|
||||
|
||||
[StringLength(200)]
|
||||
[Display(Name = "Recipient Name")]
|
||||
public string? RecipientName { get; set; }
|
||||
|
||||
[EmailAddress]
|
||||
[StringLength(200)]
|
||||
[Display(Name = "Recipient Email")]
|
||||
public string? RecipientEmail { get; set; }
|
||||
|
||||
[Display(Name = "Expiry Date (optional)")]
|
||||
public DateTime? ExpiryDate { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
[Display(Name = "Notes")]
|
||||
public string? Notes { get; set; }
|
||||
}
|
||||
|
||||
public class RedeemGiftCertificateDto
|
||||
{
|
||||
[Required]
|
||||
public string CertificateCode { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[Range(0.01, 9999.99)]
|
||||
public decimal Amount { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user