//
//  LNPurchaseResponse.swift
//  Lanu
//
//  Created by OneeChan on 2025/12/22.
//

import Foundation
import AutoCodable



enum LNCurrencyType: Int, Decodable {
    case coin = 0
    case diamond = 1
    case bean = 2
    
    func name(lowcase: Bool = false) -> String {
        switch self {
        case .coin: lowcase ? .init(key: "B00136") : .init(key: "A00216")
        case .diamond: lowcase ? .init(key: "B00135") : .init(key: "A00217")
        case .bean: lowcase ? .init(key: "B00137") : .init(key: "A00277")
        }
    }
    
    var icon: UIImage {
        switch self {
        case .coin: .icCoin42
        case .diamond: .icDiamond42
        case .bean: .icBean
        }
    }
    
    var currentValue: Double {
        switch self {
        case .coin: myWalletInfo.coin
        case .diamond: myWalletInfo.diamond
        case .bean: myWalletInfo.bean
        }
    }
}

enum LNPurchasePlatform: Int, Decodable {
    case official = 0
    case android = 1
    case web = 2
    case iOS = 3
}

enum LNPurchasePayType: Int, Decodable {
    case apple = 1
    case google = 2
}

@AutoCodable
class LNUserWalletInfoResponse: Decodable {
    var diamond: Double = 0
    var goldCoin: Double = 0
    var beanTotal: Double = 0
    var unsettledBean: Double = 0
    var availableBean: Double = 0
}

@AutoCodable
class LNPurchaseGoodsVO: Decodable {
    var id: String = ""
    var coinRechargeAmount: Double = 0
    var amount: Double = 0
    var currency: String = ""
    var code: String = ""
}

@AutoCodable
class LNPurchaseGoodsListResponse: Decodable {
    var items: [LNPurchaseGoodsVO] = []
}

@AutoCodable
class LNPurchaseCreateOrderResponse: Decodable {
    var result: String = ""
}

@AutoCodable
class LNExchangeExpectResponse: Decodable {
    var amount: Double = 0.0
}
