diff --git a/GMERemittance.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist b/GMERemittance.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist index 310b9530..4dd94d1f 100644 --- a/GMERemittance.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/GMERemittance.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ GMERemittance.xcscheme orderHint - 33 + 1 diff --git a/GMERemittance.xcworkspace/xcuserdata/shishir.xcuserdatad/UserInterfaceState.xcuserstate b/GMERemittance.xcworkspace/xcuserdata/shishir.xcuserdatad/UserInterfaceState.xcuserstate index ef6f1069..4f844e22 100644 Binary files a/GMERemittance.xcworkspace/xcuserdata/shishir.xcuserdatad/UserInterfaceState.xcuserstate and b/GMERemittance.xcworkspace/xcuserdata/shishir.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/GMERemittance/Model/User.swift b/GMERemittance/Model/User.swift index c3174d9e..61c41a63 100644 --- a/GMERemittance/Model/User.swift +++ b/GMERemittance/Model/User.swift @@ -86,6 +86,7 @@ class UserContainer: Mappable { } class User: Mappable { + var userId: String? var firstName: String? var middleName: String? @@ -122,6 +123,7 @@ class User: Mappable { } + func mapping(map: Map) { userId <- map["userId"] firstName <- map["firstName"] diff --git a/GMERemittance/Module/Home/Application Logic/Interactor/HomeInteractor.swift b/GMERemittance/Module/Home/Application Logic/Interactor/HomeInteractor.swift index 9294d71d..365b829e 100644 --- a/GMERemittance/Module/Home/Application Logic/Interactor/HomeInteractor.swift +++ b/GMERemittance/Module/Home/Application Logic/Interactor/HomeInteractor.swift @@ -28,7 +28,9 @@ class HomeInteractor { extension HomeInteractor: HomeInteractorInput { func fetchUserInfo() { - self.service.fetchUserInfo(success: { user in + let userId = Utility.getMyUserName() + let param = ["userId" : userId] + self.service.fetchUserInfo(param: param, success: { user in self.output?.show(model: user) }) { error in diff --git a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift index 7c732159..5b05b237 100644 --- a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift +++ b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift @@ -14,14 +14,13 @@ protocol HomeServiceType: class, UserInfoService { protocol UserInfoService: ApiServiceType { - func fetchUserInfo(success: @escaping (User) -> (), failure: @escaping (Error) -> ()) + func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) } extension UserInfoService { - func fetchUserInfo(success: @escaping (User) -> (), failure: @escaping (Error) -> ()) { -// let params = [ "userId": userId, "password": password ] - let url = baseUrl + "" - auth.request(method: .post, url: url, params: nil, success: { (response: UserContainer ) in + func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) { + let url = baseUrl + "mobile/refreshcutomerinformation" + auth.request(method: .post, url: url, params: param, success: { (response: UserContainer ) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) failure(error) diff --git a/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift b/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift index b2117e31..873ce128 100644 --- a/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift +++ b/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift @@ -15,12 +15,18 @@ class HomeRemainingLimitTableViewCell: UITableViewCell { @IBOutlet weak var rewardPointAmountLabel: UILabel! @IBOutlet weak var userNameLabel: UILabel! + var user: User? + override func awakeFromNib() { super.awakeFromNib() // Initialization code } func setup() { + self.amountLabel.text + = self.user?.yearlyLimit + self.userNameLabel.text = user?.firstName + self.rewardPointAmountLabel.text = user?.rewardPoint ?? "0" self.pointBackgroundView.layer.cornerRadius = 5 } diff --git a/GMERemittance/Module/Home/User Interface/View/Home.storyboard b/GMERemittance/Module/Home/User Interface/View/Home.storyboard index 68967152..4e0671db 100644 --- a/GMERemittance/Module/Home/User Interface/View/Home.storyboard +++ b/GMERemittance/Module/Home/User Interface/View/Home.storyboard @@ -1,5 +1,5 @@ - + @@ -338,6 +338,7 @@ + diff --git a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift index ebc68659..280b6c9b 100644 --- a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift +++ b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift @@ -25,6 +25,8 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { @IBOutlet weak var verificationNoticeHeightConstraint: NSLayoutConstraint! @IBOutlet var verificationNoticeView: UIView! @IBOutlet weak var verificationCloseButton: UIButton! + @IBOutlet weak var verificationText: UILabel! + // MARK: Properties var refreshControl = UIRefreshControl() var presenter: HomeModuleInterface? @@ -33,6 +35,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { // update self.save(user: user) self.showUnverifiedNotice() + self.tableView.reloadData() } } var sections: [Sections] = [.balance, .collection] @@ -137,7 +140,6 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { presenter?.refreshData() } - @objc func showNotification(){ performSegue(withIdentifier: "notification", sender: nil) } @@ -214,6 +216,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { } private func showUnverifiedNotice() { + setVerificationText() if shouldShowUnverifiedNotice() { UIView.animate(withDuration: 0.33) { self.verificationNoticeHeightConstraint.constant = Constants.verificationNoticeHeight @@ -227,6 +230,34 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { } } + private func setVerificationText() { + if didNotSubmitKycAndNotVerified() { + self.verificationText.text = "Kindly complete your registration process with us to start using GME services." + }else + if didSubmitKycAndNotVerified() { + self.verificationText.text = "Your registration request is in approval process. You will soon be able to use GME services." + } + + if didSubmitKycAndVerified() { + self.verificationNoticeHeightConstraint.constant = 0 + self.verificationNoticeView.alpha = 0 + } + } + + private func didSubmitKycAndNotVerified() -> Bool { + return Utility.didSubmitKyc() && !Utility.isVerifiedUser() + } + + private func didSubmitKycAndVerified() -> Bool { + return Utility.didSubmitKyc() && Utility.isVerifiedUser() + } + + private func didNotSubmitKycAndNotVerified() -> Bool { + return !Utility.didSubmitKyc() && !Utility.isVerifiedUser() + } + + + @IBAction func showKyc(_ sender: UITapGestureRecognizer) { self.presenter?.showKyc() } @@ -322,7 +353,10 @@ extension HomeViewController: HomeViewInterface { func endRefreshing() { if self.tableView.refreshControl?.isRefreshing == true { self.tableView.refreshControl?.endRefreshing() - self.tableView.contentOffset.y = 0 + UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: { + self.tableView.contentOffset.y = 0 + self.view.layoutIfNeeded() + }) } } } @@ -369,6 +403,7 @@ extension HomeViewController: UITableViewDataSource { func configureRemainingLimitCell(tableView: UITableView, indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "HomeRemainingLimitTableViewCell") as! HomeRemainingLimitTableViewCell + cell.user = self.user cell.setup() return cell } diff --git a/GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift b/GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift index 8aeb4fc2..1d8eb4b1 100644 --- a/GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift +++ b/GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift @@ -178,7 +178,7 @@ class KycInteractor { } private func getCompressedImage(image: UIImage) -> Data? { - return UIImageJPEGRepresentation(image, 0.5) + return UIImageJPEGRepresentation(image, 0.6) } private func getParams(model: KYCRequestModel) -> [String: String] { @@ -219,6 +219,7 @@ extension KycInteractor: KycInteractorInput { let result3 = self._validate(model: model.kycForm3) let shouldSubmit = result1.isValid && result2.isValid && result3.isValid +// let shouldSubmit = result1.isValid && result2.isValid if shouldSubmit { /// call api here. let params = self.getParams(model: model) diff --git a/GMERemittance/RestApiManager.swift b/GMERemittance/RestApiManager.swift index fe36998a..e6f6fddc 100644 --- a/GMERemittance/RestApiManager.swift +++ b/GMERemittance/RestApiManager.swift @@ -2342,7 +2342,7 @@ class RestApiMananger { } else { fileName = "test.jpg" mimeType = "image/jpeg" - data = UIImageJPEGRepresentation(imageData as! UIImage, 0.25)! + data = UIImageJPEGRepresentation(imageData as! UIImage, 0.7)! } diff --git a/GMERemittance/Utility/AppConstants.swift b/GMERemittance/Utility/AppConstants.swift index f89ef31c..2b619bfb 100644 --- a/GMERemittance/Utility/AppConstants.swift +++ b/GMERemittance/Utility/AppConstants.swift @@ -50,12 +50,18 @@ class Utility { } static func isVerifiedUser() -> Bool { - return false let val = (UserDefaults.standard.object(forKey: UserKeys.verified) as? Bool ) ?? false print("value is") print(val) return val } + + static func didSubmitKyc() -> Bool { + let val = (UserDefaults.standard.object(forKey: UserKeys.kyc) as? Bool ) ?? false + print("value is") + print(val) + return val + } static func getMyUserName() -> String { let defaults = UserDefaults.standard diff --git a/Pods/Pods.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist index 950f3911..49b6dc2d 100644 --- a/Pods/Pods.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Pods/Pods.xcodeproj/xcuserdata/shishir.xcuserdatad/xcschemes/xcschememanagement.plist @@ -17,127 +17,127 @@ BRYXBanner.xcscheme orderHint - 3 + 4 Bolts.xcscheme orderHint - 1 + 3 FBSDKCoreKit.xcscheme orderHint - 6 + 7 FBSDKShareKit.xcscheme orderHint - 7 + 8 FLAnimatedImage.xcscheme orderHint - 11 + 12 FacebookCore.xcscheme orderHint - 4 + 5 FacebookShare.xcscheme orderHint - 5 + 6 FirebaseAuth.xcscheme orderHint - 8 + 9 FirebaseCore.xcscheme orderHint - 9 + 10 FirebaseMessaging.xcscheme orderHint - 10 + 11 GTMSessionFetcher.xcscheme orderHint - 13 + 14 GoogleToolboxForMac.xcscheme orderHint - 12 + 13 Hex.xcscheme orderHint - 14 + 15 IQKeyboardManagerSwift.xcscheme orderHint - 15 + 16 LGSideMenuController.xcscheme orderHint - 16 + 17 MBProgressHUD.xcscheme orderHint - 17 + 18 ObjectMapper.xcscheme orderHint - 19 + 20 PMAlertController-PMAlertController.xcscheme orderHint - 21 + 22 PMAlertController.xcscheme orderHint - 20 + 21 Pods-GMERemittance.xcscheme orderHint - 22 + 23 Pods-GMERemittanceTests.xcscheme orderHint - 23 + 24 Pods-GMERemittanceUITests.xcscheme orderHint - 24 + 25 Protobuf.xcscheme orderHint - 25 + 26 RAMAnimatedTabBarController.xcscheme orderHint - 26 + 27 RSKImageCropper.xcscheme orderHint - 27 + 28 ReadMoreTextView.xcscheme @@ -147,32 +147,32 @@ SDWebImage.xcscheme orderHint - 28 + 29 SwiftyJSON.xcscheme orderHint - 29 + 30 XLPagerTabStrip-XLPagerTabStrip.xcscheme orderHint - 32 + 33 XLPagerTabStrip.xcscheme orderHint - 31 + 32 nanopb.xcscheme orderHint - 18 + 19 thenPromise.xcscheme orderHint - 30 + 31