import Foundation
import ComplyCubeMobileSDK

public final class CustomerInfoStageParser: StageParser {
    private let parser: CustomerInfoParser

    public init(parser: CustomerInfoParser = CustomerInfoParser()) {
        self.parser = parser
    }

    public func canParse(_ input: Any) -> Bool {
        guard let map = input as? [String: Any] else { return false }
        return (map["name"] as? String) == "customerInfo"
    }

    public func parse(_ input: Any) throws -> ComplyCubeMobileSDKStage? {
        return try parser.parse(input as! [String: Any])
    }
}
