using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Fitness_core_BE.Models
{
/// A snapshot receipt generated the moment a Booking's payment is recorded (either
/// via MarkGuestBookingPaid or the Complete checkout flow) -- deliberately NOT a live join to
/// Booking/Facility, so it stays stable and printable even if the booking is later reassigned,
/// rescheduled, or the facility renamed. Purpose-built for bookings and kept entirely separate
/// from CustomerInvoice, which is hardwired to the membership/subscription domain
/// (FKCustomerSubscriptionId is required there) and has no concept of a one-off booking
/// charge.
public class BookingInvoice
{
[Key]
public Guid BookingInvoiceId { get; set; }
public Guid FKBookingId { get; set; }
[ForeignKey(nameof(FKBookingId))]
public Booking? Booking { get; set; }
public Guid FKClientId { get; set; }
[ForeignKey(nameof(FKClientId))]
public Client Client { get; set; }
public decimal Amount { get; set; }
/// "Cash" | "Bank".
[MaxLength(20)]
public string PaymentMethod { get; set; } = "Cash";
[MaxLength(200)]
public string GuestName { get; set; } = string.Empty;
[MaxLength(32)]
public string? GuestPhone { get; set; }
[MaxLength(128)]
public string FacilityName { get; set; } = string.Empty;
public DateTime BookingStartTime { get; set; }
public DateTime BookingEndTime { get; set; }
public DateTime IssuedAt { get; set; } = DateTime.UtcNow;
}
}