using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RacePlannerApi.Models;

public class Registration
{
    [Key]
    public Guid Id { get; set; } = Guid.NewGuid();

    [Required]
    public Guid EventId { get; set; }

    [ForeignKey("EventId")]
    public Event Event { get; set; } = null!;

    [Required]
    public Guid ParticipantId { get; set; }

    [ForeignKey("ParticipantId")]
    public User Participant { get; set; } = null!;

    public RegistrationStatus Status { get; set; } = RegistrationStatus.Pending;

    [MaxLength(100)]
    public string? Category { get; set; }

    [MaxLength(200)]
    public string? EmergencyContact { get; set; }

    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    public DateTime? UpdatedAt { get; set; }

    // Navigation properties
    public ICollection<Payment> Payments { get; set; } = new List<Payment>();
}

public enum RegistrationStatus
{
    Pending,
    Confirmed,
    Cancelled,
    Completed
}