namespace Berufsschule_HAM.Models;

using System.Text.Json;
using Berufsschule_HAM.Exceptions;
public class LocationModel
{
    public required string Location { get; set; }
    public LocationsDescription? Description { get; set; }
    public LocationModel(Dictionary<string, string> ldapData)
    {
        Location = ldapData.GetValueOrDefault("l") ?? throw new LocationModelConfigurationException();
        string? descriptionValue = ldapData.GetValueOrDefault("description");
        if (descriptionValue is null)
        {
            Description = new();
        }
        else
        {
            Description = JsonSerializer.Deserialize<LocationsDescription>(descriptionValue);
        }
    }
}
public class LocationsDescription
{
    public string? Location { get; set; }
    public string? RoomNumber { get; set; }
    public string? Seat { get; set; }
}