// // InboundAccountsInteractor.swift // GME Remit // // Created by InKwon James Kim on 2019/11/12. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation class InboundAccountsInteractor { // MARK: Properties weak var output: InboundAccountsInteractorOutput? private let service: InboundAccountsServiceType // MARK: Initialization init(service: InboundAccountsServiceType) { self.service = service } } // MARK: InboundAccounts interactor input interface extension InboundAccountsInteractor: InboundAccountsInteractorInput { func fetchAccounts() { service.fetchAccounts( success: {[weak self] in self?.output?.setAccounts($0) }, failure: {[weak self] in self?.output?.setError(with: $0) } ) } func delete(with account: InboundAccount) { service.delete( with: account, success: {[weak self] in self?.output?.deleteSuccess(message: $0.message ?? "") }, failure: {[weak self] in self?.output?.setError(with: $0) } ) } }