Browse Source

register buh fixed

pull/1/head
gme_2 6 years ago
parent
commit
1a7ff45462
  1. 2
      GMERemittance/AppDelegate.swift
  2. 9
      GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift
  3. 5
      GMERemittance/Module/Main/User Interface/View/MainViewController.swift
  4. 12
      GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift
  5. 4
      GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1.storyboard
  6. 36
      GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift
  7. 24
      GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift
  8. 3
      GMERemittance/Module/New Group/kycForm3/User Interface/View/kycForm3ViewController.swift
  9. 22
      GMERemittance/Module/Register/Application Logic/Interactor/RegisterInteractor.swift
  10. 9
      GMERemittance/UrlManager.swift
  11. 2
      GMERemittance/Utility/AppConstants.swift
  12. 8
      GMERemittance/_Home/_Home.storyboard

2
GMERemittance/AppDelegate.swift

@ -18,6 +18,8 @@ import Crashlytics
import AlamofireNetworkActivityLogger
import IQKeyboardManagerSwift
import LGSideMenuController
let development = true
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate {

9
GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift

@ -39,8 +39,13 @@ class LoginInteractor {
var error = ""
var isValid = true
if userName.isEmpty {
error = error + "Username field is required."; isValid = false}
if password.isEmpty {error = error + "\n Password filed is required."; isValid = false}
error = error + "Username field is required.";
isValid = false
}
if password.isEmpty {error = error + "\n Password filed is required.";
isValid = false
}
let _error = NSError.init(domain: "LoginInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : error])
return (isValid, _error)
}

5
GMERemittance/Module/Main/User Interface/View/MainViewController.swift

@ -147,6 +147,7 @@ struct Fonts {
static let regular = "SanFranciscoDisplay-regular"
static let light = "SanFranciscoDisplay-light"
static let bold = "SanFranciscoDisplay-Bold"
static let semiBold = "SanFranciscoDisplay-Semibold"
}
struct TabBar {
@ -160,6 +161,10 @@ struct Fonts {
struct XLTabBar {
static let itemFont = UIFont(name: Family.light, size: 12)!
}
struct Error {
static let font = UIFont(name: Family.semiBold, size: 11)!
}
}

12
GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift

@ -46,11 +46,11 @@ class KycInteractor {
formDick.forEach({
if ($0.value ?? "").isEmpty {
sucks = false // isValid = false
errorsDick[$0.key] = "required"
errorsDick[$0.key] = "\($0.key) filed is required"
}
})
if let email = model?.email {
if let email = model?.email, email != "" {
if !Utility.isValidEmail(email: email){
sucks = false
errorsDick[KycForm1FieldKeys.email] = "invalid email"
@ -89,16 +89,16 @@ class KycInteractor {
if $0.key == KycForm2FieldKeys.issueDate {
if shoulValidateIssueDate {
sucks = false // isValid = false
errorsDick[$0.key] = "required"
errorsDick[$0.key] = "\($0.key) filed is required"
}
}else if $0.key == KycForm2FieldKeys.expiryDate {
if shoulValidateExpiryDate {
sucks = false // isValid = false
errorsDick[$0.key] = "required"
errorsDick[$0.key] = "\($0.key) filed is required"
}
}else {
sucks = false // isValid = false
errorsDick[$0.key] = "required"
errorsDick[$0.key] = "\($0.key) filed is required"
}
}
@ -126,7 +126,7 @@ class KycInteractor {
formDick.forEach({
if $0.value == nil {
sucks = false // isValid = false
errorsDick[$0.key] = "required"
errorsDick[$0.key] = "\($0.key) filed is required"
}
})
let result = (sucks, errorsDick) // (isValid, errorsDick)

4
GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1.storyboard

@ -49,7 +49,7 @@
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tell us a few things about yourself" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5gp-EN-amE">
<rect key="frame" x="0.0" y="0.0" width="345" height="50"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="VW7-6s-ifB"/>
</constraints>
@ -462,7 +462,7 @@
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" red="0.90588235294117647" green="0.92941176470588238" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="ixK-Bl-e32" secondAttribute="trailing" id="OBv-lc-TsN"/>
<constraint firstAttribute="bottom" secondItem="ixK-Bl-e32" secondAttribute="bottom" id="OZk-UQ-8pZ"/>

36
GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift

@ -29,15 +29,15 @@ class Occupation {
}
struct KycForm1FieldKeys {
static let firstName = "firstName"
static let middleName = "middleName"
static let lastName = "lastName"
static let firstName = "firstname"
static let middleName = "middlename"
static let lastName = "lastname"
static let gender = "gender"
static let dob = "dob"
static let mobileNumber = "mobileNumber"
static let dob = "date of birth"
static let mobileNumber = "mobile number"
static let email = "email"
static let nativeCountry = "nativeCountry"
static let country = "country"
static let nativeCountry = "native country"
static let country = "address"
static let province = "province"
static let occupation = "occupation"
}
@ -47,6 +47,8 @@ class KycForm1ViewController: UIViewController {
struct Constants {
static let segmentBackgroundViewColor = UIColor.init(hex: "E7EDF2")
static let stateRedColor = UIColor.init(hex: "#EC1C24")
static let errorBorderWidth = AppConstants.errorBorderWidth
static let errorLabelFont = Fonts.Error.font
static let clearColor = UIColor.clear
static let male = "Male"
static let female = "Female"
@ -141,6 +143,12 @@ class KycForm1ViewController: UIViewController {
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.view.endEditing(true)
removeFocus()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.view.endEditing(true)
@ -161,6 +169,12 @@ class KycForm1ViewController: UIViewController {
// MARK: Other Functions
private func removeFocus() {
self.textfields.forEach({
$0.resignFirstResponder()
})
}
private func createModel() {
self.kycForm1Model.firstName = self.firstNameTextField.text!
self.kycForm1Model.middleName = self.middleNmaeTextField.text!
@ -222,7 +236,11 @@ class KycForm1ViewController: UIViewController {
}
private func setupErrorLabels() {
self.errorLabels = [firstNameErrorLabel, middleNameErrorLabel, lastNameErrorLabel, genderErrorLabel, dobErrorLabel, mobileNumberErrorLabel, emailErrorLabel, nativeCountryErrorLabel, nativeCountryErrorLabel, provinceErrorLabel, occupationErrorLabel]
self.errorLabels = [firstNameErrorLabel, middleNameErrorLabel, lastNameErrorLabel, genderErrorLabel, dobErrorLabel, mobileNumberErrorLabel, emailErrorLabel, nativeCountryErrorLabel, nativeCountryErrorLabel, provinceErrorLabel, occupationErrorLabel, countryErrorLabel]
self.errorLabels.forEach({
$0.font = Constants.errorLabelFont
})
self.errorLabelsDict =
[
@ -275,7 +293,7 @@ class KycForm1ViewController: UIViewController {
private func showBorder(textfield :UITextField?) {
guard let textfield = textfield else {return}
textfield.layer.borderColor = Constants.stateRedColor.cgColor
textfield.layer.borderWidth = 0.3
textfield.layer.borderWidth = Constants.errorBorderWidth
textfield.layer.addShadow(with: Constants.stateRedColor)
}

24
GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift

@ -24,14 +24,14 @@ class KycForm2Model {
struct KycForm2FieldKeys {
static let bank = "bank"
static let accountNumber = "accountNumber"
static let verificationId = "verificationId"
static let verificationIdNumber = "verificationIdNumber"
static let expiryDate = "expiryDate"
static let sourceOfFund = "sourceOfFund"
static let issueDate = "issueDate"
static let shouldValidateIssueDate = "issueDateValidation"
static let shouldValidateExpiryDate = "expiryDateValidation"
static let accountNumber = "account number"
static let verificationId = "verification id"
static let verificationIdNumber = "verification id number"
static let expiryDate = "expiry date"
static let sourceOfFund = "source of fund"
static let issueDate = "issue date"
static let shouldValidateIssueDate = "issue date validation"
static let shouldValidateExpiryDate = "expiry date validation"
}
class KycForm2ViewController: UIViewController {
@ -46,6 +46,8 @@ class KycForm2ViewController: UIViewController {
static let expiryDateText = "docExpiryDate"
static let issueDateTag = 30001
static let expiryDateTag = 30002
static let errorFont = Fonts.Error.font
static let errorBorderSize = AppConstants.errorBorderWidth
}
// MARK: IBOutlets
@ -260,6 +262,10 @@ class KycForm2ViewController: UIViewController {
private func setupErrorLabels() {
self.errorLabels = [bankErrorLabel, accountNumberErrorLabel, verificationIdErrorLabel, verificationIdNumberErrorLabel, expiryDateErrorLabel,issueDateErrorLabel, sourceOfFundErrorLabel]
self.errorLabels.forEach({
$0.font = Constants.errorFont
})
self.errorLabelsDict =
[
KycForm2FieldKeys.bank: self.bankErrorLabel,
@ -298,7 +304,7 @@ class KycForm2ViewController: UIViewController {
private func showBorder(textfield :UITextField?) {
guard let textfield = textfield else {return}
textfield.layer.borderColor = Constants.stateRedColor.cgColor
textfield.layer.borderWidth = 0.3
textfield.layer.borderWidth = Constants.errorBorderSize
textfield.layer.addShadow(with: Constants.stateRedColor)
}

3
GMERemittance/Module/New Group/kycForm3/User Interface/View/kycForm3ViewController.swift

@ -39,6 +39,7 @@ class KycForm3ViewController: UIViewController {
struct Constants {
static let stateRedColor = UIColor.init(hex: "#EC1C24")
static let clearColor = UIColor.clear
static let errorBorderSize = AppConstants.errorBorderWidth
}
// MARK: IBOutlets
@ -273,7 +274,7 @@ extension KycForm3ViewController {
private func showBorder(view : UIView?) {
guard let _view = view else {return}
_view.layer.borderColor = Constants.stateRedColor.cgColor
_view.layer.borderWidth = 0.3
_view.layer.borderWidth = Constants.errorBorderSize
_view.layer.addShadow(with: Constants.stateRedColor)
}

22
GMERemittance/Module/Register/Application Logic/Interactor/RegisterInteractor.swift

@ -119,6 +119,7 @@ class RegisterInteractor {
if password != confirmPassword {
error = error + "\n Password do not match."
isValid = false
}
}
@ -131,17 +132,21 @@ class RegisterInteractor {
var isValid = true
// user name
if userName.contains("@") {
if !Utility.isValidEmail(email: userName) {error = error + "email must be valid"}
isValid = false
if !Utility.isValidEmail(email: userName) {error = error + "email must be valid"
isValid = false
}
}else {
if ( userName.rangeOfCharacter(from: NSCharacterSet.decimalDigits.inverted) == nil) {
isValid = true
if ( userName.rangeOfCharacter(from: NSCharacterSet.letters) != nil) {
error = error + "username must be either mobile number or email."
isValid = false
}
}
}
if userName.isEmpty { error = error + "Username field is required."; isValid = false }
if userName.isEmpty {
error = error + "Username field is required.";
isValid = false
}
let result = self.isValidPasword(password: password, confirmPassword: confirmPassword)
@ -150,7 +155,10 @@ class RegisterInteractor {
isValid = false
}
if dob.isEmpty { error = error + "\n Date Of Birth field is required."; isValid = false }
if dob.isEmpty {
error = error + "\n Date Of Birth field is required."
isValid = false
}
let _error = NSError.init(domain: "LoginInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : error])
return (isValid, _error)

9
GMERemittance/UrlManager.swift

@ -8,12 +8,19 @@
import Foundation
class UrlManager {
static let sharedInstance = UrlManager()
// 121.156.120.71:5001
let baseURL: String = "http://gmeuat.gmeremit.com:5011/api/v1/"
let baseURL = development ? "http://gmeuat.gmeremit.com:5012/api/v1/" :
"http://gmeuat.gmeremit.com:5011/api/v1/"
// let statingURL: String = "http://gmeuat.gmeremit.com:5011/api/v1/"
// let uatBaseUrl = "http://gmeuat.gmeremit.com:5012/api/v1/"
// let baseURL: String = "http://121.156.120.71:9091/api/v1/"
// let baseURL: String = "http://10.15.18.101:9091/api/v1/"

2
GMERemittance/Utility/AppConstants.swift

@ -12,7 +12,7 @@ import Foundation
class AppConstants {
static let uuid = "uuid"
static let dateFormat = "yyyy-MM-dd"
static let errorBorderWidth: CGFloat = 0.1
}

8
GMERemittance/_Home/_Home.storyboard

@ -1152,7 +1152,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8WZ-lQ-Im6" userLabel="LoadMoreView">
<rect key="frame" x="0.0" y="0.0" width="375" height="44.5"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7wo-T4-XhL">
<rect key="frame" x="155.5" y="8" width="63" height="29"/>
@ -1556,7 +1556,7 @@
<rect key="frame" x="0.0" y="50" width="375" height="617"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ccr" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JsQ-yR-2jU">
<rect key="frame" x="53" y="18" width="121" height="21.5"/>
<rect key="frame" x="53" y="18" width="121" height="21"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Regular" family="San Francisco Text" pointSize="18"/>
<color key="textColor" red="0.92549019610000005" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -1569,13 +1569,13 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="9849192759" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0uy-Jf-gcM">
<rect key="frame" x="53" y="53.5" width="121" height="17"/>
<rect key="frame" x="53" y="53" width="121" height="17"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Regular" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="sis.ccr@gmail.com" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KaU-d1-nW6">
<rect key="frame" x="53" y="76.5" width="121" height="17"/>
<rect key="frame" x="53" y="76" width="121" height="17"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Regular" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>

Loading…
Cancel
Save