//
//  DWalletMode.swift
//  B24PaymentSdk
//
//  Created by visal ny on 19/12/24.
//

import Foundation

struct DWalletMode: Codable{
    let primaryColor, screenBgColor, primaryLabelColor, secondaryLabelColor: String
    let cardColor, onPrimaryColor, dangerColor, warningColor: String
    let successColor: String?
    let walletCardColor: String?

    enum CodingKeys: String, CodingKey {
            case primaryColor = "primary_color"
            case screenBgColor = "screen_bg_color"
            case primaryLabelColor = "primary_label_color"
            case secondaryLabelColor = "secondary_label_color"
            case cardColor = "card_color"
            case onPrimaryColor = "on_primary_color"
            case dangerColor = "danger_color"
            case warningColor = "warning_color"
            case successColor = "success_color"
            case walletCardColor = "wallet_card_color"
        }


    init(
            primaryColor: String = "#54A6DB",
            screenBgColor: String = "#F2F0ED",
            primaryLabelColor: String = "#212E3B",
            secondaryLabelColor: String = "#214775",
            cardColor: String = "#FFFFFF",
            onPrimaryColor: String = "#FFFFFF",
            dangerColor: String = "#FF5952",
            warningColor: String = "#FFC668",
            successColor: String? = "#17A865",
            walletCardColor: String? = "#214775"
        ) {
            self.primaryColor = primaryColor
            self.screenBgColor = screenBgColor
            self.primaryLabelColor = primaryLabelColor
            self.secondaryLabelColor = secondaryLabelColor
            self.cardColor = cardColor
            self.onPrimaryColor = onPrimaryColor
            self.dangerColor = dangerColor
            self.warningColor = warningColor
            self.successColor = successColor
            self.walletCardColor = walletCardColor
        }

    /// Fallback dark mode values — used when API does not return a dark_mode object.
    static func darkModeDefaults() -> DWalletMode {
        return DWalletMode(
            primaryColor:        "#67B5E0",
            screenBgColor:       "#0F1923",
            primaryLabelColor:   "#F2F0ED",
            secondaryLabelColor: "#7DAFD4",
            cardColor:           "#1A2535",
            onPrimaryColor:      "#FFFFFF",
            dangerColor:         "#FF6B64",
            warningColor:        "#FFD080",
            successColor:        "#17A865",
            walletCardColor:     "#1A2D4A"
        )
    }
}
