using System.ComponentModel.DataAnnotations;

namespace FlatRender.IdentitySvc.Models.Requests;

public record CreateTenantRequest(
    [Required] string Slug,
    [Required] string Name,
    string? Kind,
    string? ContactName,
    [Required, EmailAddress] string ContactEmail,
    string? ContactPhone
);

public record UpdateTenantRequest(
    string? Name,
    string? ContactName,
    string? ContactEmail,
    string? ContactPhone,
    string? BillingEmail,
    string[]? AllowedOrigins
);

public record TenantBrandingRequest(
    string? DisplayName,
    string? LogoUrl,
    string? LogoDarkUrl,
    string? FaviconUrl,
    string? OgImageUrl,
    string? PrimaryColor,
    string? SecondaryColor,
    string? AccentColor,
    string? BackgroundColor,
    string? FontFamily,
    string? EmailFromName,
    string? EmailFromAddress,
    string? EmailReplyTo,
    string? EmailFooterHtml,
    string? SupportUrl,
    string? TermsUrl,
    string? PrivacyUrl,
    bool? EmbedEnabled,
    string[]? EmbedAllowedHosts,
    string? WatermarkText,
    string? WatermarkImageUrl,
    bool? WatermarkEnabled
);

public record StartDomainVerificationRequest([Required] string Domain, string Method = "DNS_TXT");

public record CreateApiKeyRequest(
    [Required] string Name,
    string Environment = "Live",
    [Required] string[] Scopes = default!,
    string[]? AllowedIps = null,
    int RateLimitRpm = 60,
    DateTime? ExpiresAt = null
);

public record RevokeApiKeyRequest(string? Reason);

public record ValidateApiKeyRequest(
    [Required] string KeyPrefix,
    [Required] string KeyHash,
    string? IpAddress
);

public record CreateWebhookRequest(
    [Required] string Name,
    [Required] string Url,
    [Required] string[] Events
);
