using System.ComponentModel.DataAnnotations;

public class CreateBatchForm
{
    [Required]
    public IFormFile File { get; set; } = null!;

    /// <summary>
    /// Required unless <see cref="CoverSheetCode"/> is provided; cover sheet values override when both are sent.
    /// </summary>
    public string? BatchType { get; set; }

    public string? Track { get; set; }

    public Guid? PatientId { get; set; }

    public Guid? SupersedesBatchId { get; set; }

    public CreateBatchRequest ToMetadata() =>
        new(BatchType ?? throw new InvalidOperationException("BatchType is required."),
            Track, PatientId, SupersedesBatchId);

    public string? CoverSheetCode { get; set; }
}