using System.ComponentModel.DataAnnotations;

namespace API.Models.Internal.Altersgruppen
{
    public class AltersGruppe
    {
        public string Id { get; set; } = Ulid.NewUlid().ToString();
        public required string Name { get; set; }
        public int StartingAge { get; set; }
        public int EndingAge { get; set; }
    }

    public class AltersGruppeIngoing
    {
        [Required]
        public string Name { get; set; }
        [Required]
        public int StartingAge { get; set; }
        [Required]
        public int EndingAge { get; set; }
    }

    public static class AltersgruppeMapper
    {
        public static AltersGruppe ToInternalFromIngoing(this AltersGruppeIngoing group)
        {
            return new AltersGruppe
            {
                Name = group.Name,
                StartingAge = group.StartingAge,
                EndingAge = group.EndingAge,
            };
        }
    }
}
