using Microsoft.AspNetCore.Http;
using System.ComponentModel;

namespace Application.Features.Config.Get;

public sealed class Response
{
    public int ID { get; init; }

    public BasicConfigDto Basic { get; init; } = new();
    public ImagesConfigDto Images { get; init; } = new();
    public MetaConfigDto Meta { get; init; } = new();
    public CompanyConfigDto Company { get; init; } = new();
    public AccountConfigDto Account { get; init; } = new();
    public EmailTemplateConfigDto EmailTemplate { get; init; } = new();
    public ExternalApiConfigDto External { get; init; } = new();
    public PaymentConfigDto Payment { get; init; } = new();

    public sealed class BasicConfigDto
    {
        [DisplayName("사이트 이름")]
        public string? SiteName { get; init; }

        [DisplayName("사이트 주소")]
        public string? SiteURL { get; init; }

        [DisplayName("최고 관리자 ID")]
        public string? RootID { get; init; }

        [DisplayName("송수신 이메일")]
        public string? FromEmail { get; init; }

        [DisplayName("송수신자 이름")]
        public string? FromName { get; init; }

        [DisplayName("SMTP Server")]
        public string? SmtpServer { get; init; }

        [DisplayName("SMTP Port")]
        public int? SmtpPort { get; set; }

        [DisplayName("SMTP Enable SSL")]
        public bool SmtpEnableSSL { get; init; } = false;

        [DisplayName("SMTP Username")]
        public string? SmtpUsername { get; init; }

        [DisplayName("SMTP Password")]
        public string? SmtpPassword { get; init; }

        [DisplayName("관리자단 접근 가능 IP")]
        public string? AdminWhiteIPList { get; init; }

        [DisplayName("사용자단 접근 가능 IP")]
        public string? FrontWhiteIPList { get; init; }

        [DisplayName("차단 시 안내문 제목")]
        public string? BlockAlertTitle { get; init; }

        [DisplayName("차단 시 안내문 내용")]
        public string? BlockAlertContent { get; init; }

        [DisplayName("점검 여부")]
        public bool IsMaintenance { get; init; } = false;

        [DisplayName("점검 내용")]
        public string? MaintenanceContent { get; init; }
    }

    public sealed class ImagesConfigDto
    {
        // ====== DB에 저장/표시할 경로(문자열) ======
        [DisplayName("Favicon")]
        public string? FaviconPath { get; init; }

        [DisplayName("Logo-square")]
        public string? LogoSquarePath { get; init; }

        [DisplayName("Logo-horizontal")]
        public string? LogoHorizontalPath { get; init; }

        [DisplayName("og-default")]
        public string? OgDefaultPath { get; init; }

        [DisplayName("Twitter-image")]
        public string? TwitterImagePath { get; init; }

        [DisplayName("Apple-touch-icon")]
        public string? AppleTouchIconPath { get; init; }

        [DisplayName("App-icon-192")]
        public string? AppIcon192Path { get; init; }

        [DisplayName("App-icon-512")]
        public string? AppIcon512Path { get; init; }

        // ====== 업로드 입력(폼 바인딩용) ======
        [DisplayName("Favicon 업로드")]
        public IFormFile? FaviconFile { get; init; }

        [DisplayName("Logo-square 업로드")]
        public IFormFile? LogoSquareFile { get; init; }

        [DisplayName("Logo-horizontal 업로드")]
        public IFormFile? LogoHorizontalFile { get; init; }

        [DisplayName("og-default 업로드")]
        public IFormFile? OgDefaultFile { get; init; }

        [DisplayName("Twitter-image 업로드")]
        public IFormFile? TwitterImageFile { get; init; }

        [DisplayName("Apple-touch-icon 업로드")]
        public IFormFile? AppleTouchIconFile { get; init; }

        [DisplayName("App-icon-192 업로드")]
        public IFormFile? AppIcon192File { get; init; }

        [DisplayName("App-icon-512 업로드")]
        public IFormFile? AppIcon512File { get; init; }
    }

    public sealed class MetaConfigDto
    {
        [DisplayName("Meta Keywords")]
        public string? Keywords { get; init; }

        [DisplayName("Meta Description")]
        public string? Description { get; init; }

        [DisplayName("Meta Author")]
        public string? Author { get; init; }

        [DisplayName("Meta Viewport")]
        public string? Viewport { get; init; }

        [DisplayName("Meta ApplicationName")]
        public string? ApplicationName { get; init; }

        [DisplayName("Meta Generator")]
        public string? Generator { get; init; }

        [DisplayName("Meta Robots")]
        public string? Robots { get; init; }

        [DisplayName("Meta Adds")]
        public string? Adds { get; init; }
    }

    public sealed class CompanyConfigDto
    {
        [DisplayName("상호 명")]
        public string? Name { get; init; }

        [DisplayName("사업자 등록 번호")]
        public string? RegNo { get; init; }

        [DisplayName("사업자 소재지")]
        public string? Address { get; init; }

        [DisplayName("우편번호")]
        public string? ZipCode { get; init; }

        [DisplayName("대표자 명")]
        public string? Owner { get; init; }

        [DisplayName("대표 전화번호")]
        public string? Tel { get; init; }

        [DisplayName("FAX")]
        public string? Fax { get; init; }

        [DisplayName("통신판매업 신고번호")]
        public string? RetailSaleNo { get; init; }

        [DisplayName("부가통신 사업자번호")]
        public string? AddedSaleNo { get; init; }

        [DisplayName("호스팅 서비스")]
        public string? Hosting { get; init; }

        [DisplayName("정보관리책임자")]
        public string? AdminName { get; init; }

        [DisplayName("정보관리책임자 이메일")]
        public string? AdminEmail { get; init; }

        [DisplayName("사이트 주소")]
        public string? SiteUrl { get; init; }

        [DisplayName("입금계좌 - 은행")]
        public string? BankCode { get; init; }

        [DisplayName("입금계좌 - 예금주")]
        public string? BankOwner { get; init; }

        [DisplayName("입금계좌 - 계좌번호")]
        public string? BankNumber { get; init; }
    }

    public sealed class AccountConfigDto
    {
        public bool IsRegisterBlock { get; init; }
        public bool IsRegisterEmailAuth { get; init; }
        public ushort? PasswordMinLength { get; init; }
        public ushort? PasswordUppercaseLength { get; init; }
        public ushort? PasswordNumbersLength { get; init; }
        public ushort? PasswordSpecialcharsLength { get; init; }
        public string? DeniedEmailList { get; init; }
        public string? DeniedNameList { get; init; }
        public ushort? ChangeEmailDay { get; init; }
        public ushort? ChangeNameDay { get; init; }
        public ushort? ChangeSummaryDay { get; init; }
        public ushort? ChangeIntroDay { get; init; }
        public ushort? ChangePasswordDay { get; init; }
        public ushort? MaxLoginTryCount { get; init; }
        public ushort? MaxLoginTryLimitSecond { get; init; }
    }

    public sealed class EmailTemplateConfigDto
    {
        public string? RegisterEmailFormTitle { get; init; }
        public string? RegisterEmailFormContent { get; init; }
        public string? RegistrationEmailFormTitle { get; init; }
        public string? RegistrationEmailFormContent { get; init; }
        public string? ResetPasswordEmailFormTitle { get; init; }
        public string? ResetPasswordEmailFormContent { get; init; }
        public string? ChangedPasswordEmailFormTitle { get; init; }
        public string? ChangedPasswordEmailFormContent { get; init; }
        public string? WithdrawEmailFormTitle { get; init; }
        public string? WithdrawEmailFormContent { get; init; }
        public string? EmailVerifyFormTitle { get; init; }
        public string? EmailVerifyFormContent { get; init; }
        public string? ChangedEmailFormTitle { get; init; }
        public string? ChangedEmailFormContent { get; init; }
    }

    public sealed class ExternalApiConfigDto
    {
        public string? YouTubeApiKeyEnc { get; init; }
        public string? YouTubeApiName { get; init; }
        public string? GoogleClientId { get; init; }
        public string? GoogleClientSecretEnc { get; init; }
        public string? GoogleAppId { get; init; }
    }

    public sealed class PaymentConfigDto
    {
    }
}
