//
//  UsersInterfaces.swift
//  Secure Door
//
//  Created by UHP Mac 5 on 05/02/2019.
//  Copyright (c) 2019 Jakov. All rights reserved.
//
//  This file was generated by the 🐍 VIPER generator
//

import UIKit

enum UsersNavigationOption {
    case userDetails
}

protocol UsersWireframeInterface: WireframeInterface {
    func navigate(to option: UsersNavigationOption)
}

protocol UsersViewInterface: ViewInterface {
    func reloadData()
}

protocol UsersPresenterInterface: PresenterInterface {
    func numberOfSections() -> Int
    func numberOrItems(in section: Int) -> Int
    func item(at indexPath: IndexPath) -> UserDoorViewItem
    func titleForHeader(in section: Int) -> String
}

protocol UsersInteractorInterface: InteractorInterface {
    func getUsers() -> Result<[User]>
    func getDoors() -> Result<[Door]>
    func updateUserDoor(userId: UUID, doorId: UUID, allowed: Bool) -> Result<Void>
}

struct UserDoorViewItem {
    let isAllowed: Bool
    let doorName: String
    let switchAction: (Bool) -> ()?
}
