using System.ComponentModel.DataAnnotations;

namespace LibraryAPI.Models
{
    public enum BorrowStatus
    {
        Active,
        Returned,
        Overdue
    }

    public class BorrowRecord
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(150)]
        public string BorrowerName { get; set; } = string.Empty;

        [Required]
        [MaxLength(150)]
        public string BorrowerEmail { get; set; } = string.Empty;

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

        public DateTime DueDate { get; set; }

        public DateTime? ReturnDate { get; set; }

        public BorrowStatus Status { get; set; } = BorrowStatus.Active;

        [MaxLength(500)]
        public string? Notes { get; set; }

        // Foreign key
        [Required]
        public int BookId { get; set; }

        // Navigation property
        public Book Book { get; set; } = null!;
    }
}
