Files
raceplanner/backend/Models/Payment.cs
T

39 lines
818 B
C#
Raw Normal View History

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RacePlannerApi.Models;
public class Payment
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public Guid RegistrationId { get; set; }
[ForeignKey("RegistrationId")]
public Registration Registration { get; set; } = null!;
[Required]
public decimal Amount { get; set; }
[Required]
public PaymentMethod Method { get; set; }
[MaxLength(100)]
public string? TransactionId { get; set; }
[MaxLength(500)]
public string? Notes { get; set; }
public DateTime PaymentDate { get; set; } = DateTime.UtcNow;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public enum PaymentMethod
{
Cash,
Online,
Transfer
}