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.
 
 
 
 

45 lines
1.3 KiB

//
// SendMoneyReceiptInteractor.swift
// GMERemittance
//
// Created by gme_2 on 04/09/2018.
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
class SendMoneyReceiptInteractor {
// MARK: Properties
weak var output: SendMoneyReceiptInteractorOutput?
private let service: SendMoneyReceiptServiceType
var transactionId: String!
// MARK: Initialization
init(service: SendMoneyReceiptServiceType, transactionId: String) {
self.service = service
self.transactionId = transactionId
}
// MARK: Converting entities
}
// MARK: SendMoneyReceipt interactor input interface
extension SendMoneyReceiptInteractor: SendMoneyReceiptInteractorInput {
func viewIsReady() {
self.service.fetch(transactionId: self.transactionId, success: { (model) in
if let _model = model {
_model.transactionId = self.transactionId
self.output?.show(model: _model)
}else {
let error = NSError.init(domain: "SendMoneyReceiptInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : "INVALID API FROM SERVER"])
self.output?.show(error: error)
}
}) { (error) in
self.output?.show(error: error)
}
}
}