using System.Text.Json.Serialization;
using e_suite.API.Common.models.@base;
using e_suite.Database.Core.Extensions;
using e_suite.Database.Core.Models;
using e_suite.Database.Core.Tables.Domain;

namespace e_suite.API.Common.models;

public class GetDomain : DomainBase, IGeneralId
{
    public GetDomain() : base()
    {

    }

    public GetDomain(Domain domain)
    {
        Guid = domain.Guid;
        Id = domain.Id;
        Name = domain.Name;
        SsoProviderId = domain.SsoProvider?.ToGeneralIdRef();
        SunriseHostName = domain.SunriseHostname;
        SunriseAppId = domain.SunriseAppId;
        SunriseCategoryId = domain.SunriseCategoryId;
        SigmaId = domain.SigmaId;
    }

    [JsonPropertyName("id")]
    public long Id { get; set; }

    [JsonPropertyName("guid")]
    public Guid Guid { get; set; }
}