//
//  Season.swift
//  iPOS
//
//  Created by bbc on 16/06/17.
//  Copyright © 2017 BBC. All rights reserved.
//

import Foundation
import ObjectMapper

class Season: Mappable, INameable{
    var seasonId: Int!
    var code: Int!
    var name: String?
    var startDate: Date?
    var endDate: Date?
    var isEnabled: Bool!
    var customName: String { return self.name! }
    var customSubtitle: String? { return nil }
    
    func mapping(map: Map) {
        seasonId <- map["SeasonId"]
        code <- map["Code"]
        name <- map["Name"]
        startDate <- (map["StartDate"],Util.CustomDateTransform())
        endDate <- (map["EndDate"],Util.CustomDateTransform())
        isEnabled <- map["IsEnabled"]
    }
    
    required init?(map: Map) {
    }
    
    init() {
    }
}
