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.
58 lines
1.5 KiB
58 lines
1.5 KiB
//
|
|
// NotificationListPresenter.swift
|
|
// GME Remit
|
|
//
|
|
// Created by yare on 8/15/22.
|
|
//Copyright © 2022 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class NotificationListPresenter {
|
|
|
|
// MARK: Properties
|
|
|
|
weak var view: NotificationListViewInterface?
|
|
var interactor: NotificationListInteractorInput?
|
|
var wireframe: NotificationListWireframeInput?
|
|
|
|
// MARK: Converting entities
|
|
}
|
|
|
|
// MARK: NotificationList module interface
|
|
|
|
extension NotificationListPresenter: NotificationListModuleInterface {
|
|
func fetchNotification(isRefresh: Bool) {
|
|
view?.progress(isShow: true)
|
|
self.interactor?.fetchNotificationList(isRefresh: isRefresh)
|
|
}
|
|
|
|
func updateNotification(rowId: String) {
|
|
view?.progress(isShow: true)
|
|
interactor?.updateNotification(rowId: rowId)
|
|
}
|
|
|
|
func openNotificationDetails(item: NotificationList) {
|
|
wireframe?.openNotificationDetails()
|
|
interactor?.pushNotifcationDetail(item: item)
|
|
}
|
|
}
|
|
|
|
// MARK: NotificationList interactor output interface
|
|
|
|
extension NotificationListPresenter: NotificationListInteractorOutput {
|
|
func setNotificationList(using model: [NotificationList]) {
|
|
view?.progress(isShow: false)
|
|
view?.setNotificationList(using: model)
|
|
}
|
|
|
|
func setError(with error: Error) {
|
|
view?.progress(isShow: false)
|
|
view?.setError(with: error)
|
|
}
|
|
|
|
func notificationUpdated() {
|
|
view?.progress(isShow: false)
|
|
view?.notificationUpdated()
|
|
}
|
|
}
|