//
//  FederalTournamentHolder.swift
//  Padel Tournament
//
//  Created by Razmig Sarkissian on 13/11/2023.
//

import Foundation

protocol FederalTournamentHolder {
    var holderId: String { get }
    var startDate: Date { get }
    var endDate: Date? { get }
    var tournaments: [any TournamentBuildHolder] { get }
    func clubLabel() -> String
    func subtitleLabel() -> String
    var dayDuration: Int { get }
}

extension FederalTournamentHolder {
    
    func durationLabel() -> String {
        switch dayDuration {
        case 1:
            return (startDate.timeOfDay == .evening ? "Soir" : "Journée")
        default:
            return dayDuration.formatted() + " jours"
        }
    }
}
