You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
//
|
|
// SendMoneyExchangeRateInteractor.swift
|
|
// GMERemittance
|
|
//
|
|
// Created by gme_2 on 28/08/2018.
|
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class SendMoneyExchangeRateInteractor {
|
|
|
|
// MARK: Properties
|
|
|
|
weak var output: SendMoneyExchangeRateInteractorOutput?
|
|
private let service: SendMoneyExchangeRateServiceType
|
|
|
|
// MARK: Initialization
|
|
|
|
init(service: SendMoneyExchangeRateServiceType) {
|
|
self.service = service
|
|
}
|
|
|
|
// MARK: Converting entities
|
|
}
|
|
|
|
// MARK: SendMoneyExchangeRate interactor input interface
|
|
|
|
extension SendMoneyExchangeRateInteractor: SendMoneyExchangeRateInteractorInput {
|
|
func calculate(params: [String : String]) {
|
|
self.service.calculate(params: params, success: { (model) in
|
|
if let model = model {
|
|
self.output?.show(model: model)
|
|
}else {
|
|
let error = NSError.init(domain: "SendMoneyExchangeRateInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : "Failed to map exchange rate from server"])
|
|
self.output?.show(error: error)
|
|
}
|
|
}) { (error) in
|
|
self.output?.show(error: error)
|
|
}
|
|
}
|
|
}
|