//
//  DetailEventFirebaseRepresenter.swift
//  Detail
//
//  Created by Bastián Véliz Vega on 18-07-19.
//  Copyright © 2019 Bastián Véliz Vega. All rights reserved.
//

import Foundation
import Tracker

final class DetailEventFirebaseRepresenter: FirebaseRepresenter {
    func represent(_ event: Event) -> FirebaseModel? {
        guard let detailEvent = event as? DetailEvents else { return nil }

        switch detailEvent {
        case let .viewWillAppear(name):
            return FirebaseModel(eventName: "Detail_Event_View_will_appear", parameters: ["view_name": name])
        case let .switchDidChange(value):
            return FirebaseModel(eventName: "Detail_Event_Switch_change", parameters: ["switch_value": value])
        case let .didSelectSegment(selectedValue):
            return FirebaseModel(eventName: "Detail_Event_Select_segment", parameters: ["segment_value": selectedValue])
        case .didTapGoBack:
            return FirebaseModel(eventName: "Detail_Event_Tap_go_back_button", parameters: nil)
        }
    }
}
