//
//  PlayerPaymentType.swift
//  PadelClub
//
//  Created by Laurent Morvillier on 11/02/2025.
//

import Foundation

enum PlayerPaymentType: Int, CaseIterable, Identifiable, Codable {
    
    init?(rawValue: Int?) {
        guard let value = rawValue else { return nil }
        self.init(rawValue: value)
    }

    var id: Self {
        self
    }
    
    case cash = 0
    case lydia = 1
    case gift = 2
    case check = 3
    case paylib = 4
    case bankTransfer = 5
    case clubHouse = 6
    case creditCard = 7
    case forfeit = 8
    
    func localizedLabel(_ displayStyle: DisplayStyle = .wide) -> String {
        switch self {
        case .check:
            return "Chèque"
        case .cash:
            return "Cash"
        case .lydia:
            return "Lydia"
        case .paylib:
            return "Paylib"
        case .bankTransfer:
            return "Virement"
        case .clubHouse:
            return "Clubhouse"
        case .creditCard:
            return "CB"
        case .forfeit:
            return "Forfait"
        case .gift:
            return "Offert"
        }
    }
}
