You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
//
|
|
// PlayerPaymentType.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Laurent Morvillier on 11/02/2025.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public enum PlayerPaymentType: Int, CaseIterable, Identifiable, Codable {
|
|
|
|
init?(rawValue: Int?) {
|
|
guard let value = rawValue else { return nil }
|
|
self.init(rawValue: value)
|
|
}
|
|
|
|
public 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
|
|
|
|
public func localizedLabel(_ displayStyle: DisplayStyle = .wide) -> String {
|
|
switch self {
|
|
case .check:
|
|
return "Chèque"
|
|
case .cash:
|
|
return "Cash"
|
|
case .lydia:
|
|
return "SumUp"
|
|
case .paylib:
|
|
return "Wero"
|
|
case .bankTransfer:
|
|
return "Virement"
|
|
case .clubHouse:
|
|
return "Clubhouse"
|
|
case .creditCard:
|
|
return "CB"
|
|
case .forfeit:
|
|
return "Forfait"
|
|
case .gift:
|
|
return "Offert"
|
|
}
|
|
}
|
|
}
|
|
|