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

import Foundation

protocol ClubHolder {
    var clubName: String? { get }
}

extension ClubHolder {
    var shortSmartClubName: String? {
        var clubName = clubName
        clubName = clubName?.replacingOccurrences(of: "TENNIS SPORTING CLUB", with: "TSC")
        clubName = clubName?.replacingOccurrences(of: "SPORTING CLUB TENNIS", with: "SCT")
        clubName = clubName?.replacingOccurrences(of: "TENNIS CLUB SPORTING", with: "TCS")
        clubName = clubName?.replacingOccurrences(of: "SPORTING CLUB", with: "SC")
        clubName = clubName?.replacingOccurrences(of: "SPORTING ", with: "")
        clubName = clubName?.replacingOccurrences(of: "TENNIS CLUB", with: "TC")
        clubName = clubName?.replaceCharactersFromSet(characterSet: .punctuationCharacters)
        return clubName
    }

}

