class BrandSettings {
  final String displayName;
  final String? tagline;
  final String? publicEmail;
  final String? publicPhone;
  final String? publicCity;
  final String? publicCountry;
  final String? websiteUrl;
  final String? whatsappNumber;
  final String? logoUrl;
  final String primaryColor;
  final bool isListedOnMarketplace;
  final String? defaultLocale;
  final String? defaultCurrency;

  const BrandSettings({
    required this.displayName,
    this.tagline,
    this.publicEmail,
    this.publicPhone,
    this.publicCity,
    this.publicCountry,
    this.websiteUrl,
    this.whatsappNumber,
    this.logoUrl,
    required this.primaryColor,
    required this.isListedOnMarketplace,
    this.defaultLocale,
    this.defaultCurrency,
  });

  factory BrandSettings.fromJson(Map<String, dynamic> json) => BrandSettings(
        displayName: json['displayName'] as String? ?? '',
        tagline: json['tagline'] as String?,
        publicEmail: json['publicEmail'] as String?,
        publicPhone: json['publicPhone'] as String?,
        publicCity: json['publicCity'] as String?,
        publicCountry: json['publicCountry'] as String?,
        websiteUrl: json['websiteUrl'] as String?,
        whatsappNumber: json['whatsappNumber'] as String?,
        logoUrl: json['logoUrl'] as String?,
        primaryColor: json['primaryColor'] as String? ?? '#1A56DB',
        isListedOnMarketplace:
            json['isListedOnMarketplace'] as bool? ?? false,
        defaultLocale: json['defaultLocale'] as String?,
        defaultCurrency: json['defaultCurrency'] as String?,
      );

  Map<String, dynamic> toJson() => {
        'displayName': displayName,
        if (tagline != null) 'tagline': tagline,
        if (publicEmail != null) 'publicEmail': publicEmail,
        if (publicPhone != null) 'publicPhone': publicPhone,
        if (publicCity != null) 'publicCity': publicCity,
        if (publicCountry != null) 'publicCountry': publicCountry,
        if (websiteUrl != null) 'websiteUrl': websiteUrl,
        if (whatsappNumber != null) 'whatsappNumber': whatsappNumber,
        'primaryColor': primaryColor,
        'isListedOnMarketplace': isListedOnMarketplace,
        if (defaultLocale != null) 'defaultLocale': defaultLocale,
        if (defaultCurrency != null) 'defaultCurrency': defaultCurrency,
      };
}
