Browse Source

notification update completed

v0.17
yajan 2 years ago
parent
commit
fb9554a102
  1. 5
      GME Remit/APIs/Router/APIRouter.swift
  2. 12
      GME Remit/Modules/InviteUser/User Interface/View/InviteUser.storyboard
  3. 9
      GME Remit/Modules/NotificationList/Application Logic/Interactor/NotificationListInteractor.swift
  4. 2
      GME Remit/Modules/NotificationList/Application Logic/Interactor/NotificationListInteractorIO.swift
  5. 4
      GME Remit/Modules/NotificationList/Application Logic/Service/NotificationListService.swift
  6. 3
      GME Remit/Modules/NotificationList/Application Logic/Service/NotificationListServiceType.swift
  7. 1
      GME Remit/Modules/NotificationList/Module Interface/NotificationListModuleInterface.swift
  8. 12
      GME Remit/Modules/NotificationList/User Interface/Presenter/NotificationListPresenter.swift
  9. 5
      GME Remit/Modules/NotificationList/User Interface/View/NotificationListViewController.swift
  10. 1
      GME Remit/Modules/NotificationList/User Interface/View/NotificationListViewInterface.swift
  11. 2
      GME Remit/Modules/RenewID/User Interface/View/RenewIDViewController.swift

5
GME Remit/APIs/Router/APIRouter.swift

@ -108,6 +108,7 @@ enum APIRouter {
// MARK: NotificationList
case getNotificationList
case updateNotification(rowId: String)
// MARK: ReferralList
case getReferralList
@ -591,6 +592,8 @@ extension APIRouter {
case .getNotificationList:
let userID = GMEDB.shared.user.string(.senderId) ?? ""
return "\(baseUrl)/mobile/GetNotificationList?customerId=\(userID)"
case .updateNotification(rowId: let rowId):
return "mobile/UpdateNotification?rowId=\(rowId)"
case .getReferralList:
let userID = GMEDB.shared.user.string(.senderId) ?? ""
return "\(baseUrlWithoutVersion)/v3/mobile/\(userID)/GetFieldsByProduct?type=4"
@ -718,6 +721,8 @@ extension APIRouter {
return .get
case .getRewardPoint:
return .get
case .updateNotification(rowId: let rowId):
return .post
}
}
}

12
GME Remit/Modules/InviteUser/User Interface/View/InviteUser.storyboard

@ -24,7 +24,7 @@
<rect key="frame" x="10" y="8" width="355" height="250"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="eu9-HM-scH">
<rect key="frame" x="91.5" y="90" width="172" height="70"/>
<rect key="frame" x="61" y="90" width="233" height="70"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_reward" translatesAutoresizingMaskIntoConstraints="NO" id="Ilh-q9-hBr">
<rect key="frame" x="0.0" y="0.0" width="70" height="70"/>
@ -34,22 +34,22 @@
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ugh-d9-EZv">
<rect key="frame" x="80" y="0.0" width="92" height="70"/>
<rect key="frame" x="80" y="0.0" width="153" height="70"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Reward Points" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZ9-bC-qoP">
<rect key="frame" x="0.0" y="0.0" width="92" height="36"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Reward Points Available" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZ9-bC-qoP">
<rect key="frame" x="0.0" y="0.0" width="153" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" name="ThemeSubBackground"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5100" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eVX-cq-6O9">
<rect key="frame" x="0.0" y="36" width="92" height="24"/>
<rect key="frame" x="0.0" y="36" width="153" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" name="ThemeWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VxT-bh-SOK">
<rect key="frame" x="0.0" y="60" width="92" height="10"/>
<rect key="frame" x="0.0" y="60" width="153" height="10"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="cJK-iL-WjM"/>
</constraints>

9
GME Remit/Modules/NotificationList/Application Logic/Interactor/NotificationListInteractor.swift

@ -62,4 +62,13 @@ extension NotificationListInteractor: NotificationListInteractorInput {
}
}
func updateNotification(rowId: String) {
service.updateNotification(rowId: rowId) {
self.output?.notificationUpdated()
} failure: {
self.output?.setError(with: $0)
}
}
}

2
GME Remit/Modules/NotificationList/Application Logic/Interactor/NotificationListInteractorIO.swift

@ -8,9 +8,11 @@
protocol NotificationListInteractorInput: class {
func fetchNotificationList(isRefresh: Bool)
func updateNotification(rowId: String)
}
protocol NotificationListInteractorOutput: class {
func setNotificationList(using model: [NotificationList])
func setError(with error: Error)
func notificationUpdated()
}

4
GME Remit/Modules/NotificationList/Application Logic/Service/NotificationListService.swift

@ -40,4 +40,8 @@ class NotificationListService: NotificationListServiceType {
APIRouter.getNotificationList.json(success: success, failure: failure)
}
func updateNotification(rowId: String, success: @escaping () -> Void, failure: @escaping (Error) -> Void) {
APIRouter.updateNotification(rowId: rowId).json(success: success, failure: failure)
}
}

3
GME Remit/Modules/NotificationList/Application Logic/Service/NotificationListServiceType.swift

@ -11,5 +11,6 @@ import Foundation
protocol NotificationListServiceType: class {
func fetchNotificationList(success: @escaping ([NotificationList]) -> Void,
failure: @escaping (Error) -> Void
)
)
func updateNotification(rowId: String, success: @escaping () -> Void, failure: @escaping (Error) -> Void)
}

1
GME Remit/Modules/NotificationList/Module Interface/NotificationListModuleInterface.swift

@ -8,4 +8,5 @@
protocol NotificationListModuleInterface: class {
func fetchNotification(isRefresh: Bool)
func updateNotification(rowId: String)
}

12
GME Remit/Modules/NotificationList/User Interface/Presenter/NotificationListPresenter.swift

@ -23,9 +23,14 @@ class NotificationListPresenter {
extension NotificationListPresenter: NotificationListModuleInterface {
func fetchNotification(isRefresh: Bool) {
view?.progress(isShow: false)
view?.progress(isShow: true)
self.interactor?.fetchNotificationList(isRefresh: isRefresh)
}
func updateNotification(rowId: String) {
view?.progress(isShow: true)
interactor?.updateNotification(rowId: rowId)
}
}
// MARK: NotificationList interactor output interface
@ -40,4 +45,9 @@ extension NotificationListPresenter: NotificationListInteractorOutput {
func setError(with error: Error) {
view?.setError(with: error)
}
func notificationUpdated() {
view?.progress(isShow: false)
view?.notificationUpdated()
}
}

5
GME Remit/Modules/NotificationList/User Interface/View/NotificationListViewController.swift

@ -55,6 +55,10 @@ extension NotificationListViewController: NotificationListViewInterface {
self.hideProgressHud()
}
}
func notificationUpdated() {
presenter?.fetchNotification(isRefresh: false)
}
}
extension NotificationListViewController: UITableViewDelegate, UITableViewDataSource {
@ -77,6 +81,7 @@ extension NotificationListViewController: UITableViewDelegate, UITableViewDataSo
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let item = tableData[indexPath.row]
presenter?.updateNotification(rowId: item.rowID)
if item.isClickable == "Y" {
guard let webController = UIStoryboard(name: "Storyboard", bundle: nil)
.instantiateViewController(withIdentifier: "WebLinksViewController") as? WebLinksViewController

1
GME Remit/Modules/NotificationList/User Interface/View/NotificationListViewInterface.swift

@ -11,4 +11,5 @@ protocol NotificationListViewInterface: class {
func setError(with error: Error)
func progress(isShow: Bool)
func notificationUpdated()
}

2
GME Remit/Modules/RenewID/User Interface/View/RenewIDViewController.swift

@ -90,7 +90,7 @@ class RenewIDViewController: UIViewController {
let idStatusTitle = NSAttributedString(string: "\(idStatusCheck ?? "")", attributes: colorOption)
let statusText = NSAttributedString(string: "Status: ")
let statusText = NSAttributedString(string: "Id Status Expiry: ")
let combination = NSMutableAttributedString()
combination.append(statusText)
combination.append(idStatusTitle)

Loading…
Cancel
Save