Browse Source

added kyc model

pull/1/head
gme_2 6 years ago
parent
commit
d8f8ce8ca9
  1. 4
      GMERemittance.xcodeproj/project.pbxproj
  2. 64
      GMERemittance/Model/KycModel.swift
  3. 6
      GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift
  4. 2
      GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift

4
GMERemittance.xcodeproj/project.pbxproj

@ -366,6 +366,7 @@
D937038421490C3800D93077 /* KycForm1ViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D937036E21490C3800D93077 /* KycForm1ViewInterface.swift */; };
D937038521490C3800D93077 /* KycForm1.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D937036F21490C3800D93077 /* KycForm1.storyboard */; };
D937038621490C3800D93077 /* KycForm1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D937037021490C3800D93077 /* KycForm1ViewController.swift */; };
D94173B3214B40ED00D04BE5 /* KycModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D94173B2214B40ED00D04BE5 /* KycModel.swift */; };
D945F11D213E1D5100A24824 /* SendMoneyReceiptModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D945F10A213E1D5100A24824 /* SendMoneyReceiptModuleInterface.swift */; };
D945F11E213E1D5100A24824 /* SendMoneyReceiptService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D945F10D213E1D5100A24824 /* SendMoneyReceiptService.swift */; };
D945F11F213E1D5100A24824 /* SendMoneyReceiptServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D945F10E213E1D5100A24824 /* SendMoneyReceiptServiceType.swift */; };
@ -871,6 +872,7 @@
D937036E21490C3800D93077 /* KycForm1ViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KycForm1ViewInterface.swift; sourceTree = "<group>"; };
D937036F21490C3800D93077 /* KycForm1.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = KycForm1.storyboard; sourceTree = "<group>"; };
D937037021490C3800D93077 /* KycForm1ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KycForm1ViewController.swift; sourceTree = "<group>"; };
D94173B2214B40ED00D04BE5 /* KycModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KycModel.swift; sourceTree = "<group>"; };
D945F10A213E1D5100A24824 /* SendMoneyReceiptModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendMoneyReceiptModuleInterface.swift; sourceTree = "<group>"; };
D945F10D213E1D5100A24824 /* SendMoneyReceiptService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendMoneyReceiptService.swift; sourceTree = "<group>"; };
D945F10E213E1D5100A24824 /* SendMoneyReceiptServiceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendMoneyReceiptServiceType.swift; sourceTree = "<group>"; };
@ -2974,6 +2976,7 @@
D945F128213E4A9D00A24824 /* SendMoneyReciept.swift */,
D96A5001214668A000CFD507 /* RegisterRequestModel.swift */,
D92C24A621477EA600F6876F /* ResponseMessage.swift */,
D94173B2214B40ED00D04BE5 /* KycModel.swift */,
);
path = Model;
sourceTree = "<group>";
@ -4146,6 +4149,7 @@
D95B5E4B21315C57000C0B33 /* EmptyTableViewCell.swift in Sources */,
04CAEC2D1FEBAEB400C819D4 /* KYCViewModel.swift in Sources */,
9F03D22E1FECFC52002E132E /* RecipientTranscationViewController.swift in Sources */,
D94173B3214B40ED00D04BE5 /* KycModel.swift in Sources */,
D95B7047213FB5F10053CC3D /* WebLinksViewController.swift in Sources */,
A270F08D2075C74300B78D00 /* AgentCountryList.swift in Sources */,
9FA09740200E129500F3B5EC /* CommentsViewController.swift in Sources */,

64
GMERemittance/Model/KycModel.swift

@ -0,0 +1,64 @@
//
// KycModel.swift
// GMERemittance
//
// Created by gme_2 on 14/09/2018.
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
import ObjectMapper
class KycModelContainer: Mappable {
var errorCode: String?
var message: String?
var id: String?
var data: KycModel?
required init?(map: Map) {
}
func mapping(map: Map) {
errorCode <- map["ErrorCode"]
message <- map["Msg"]
id <- map["Id"]
data <- map["Data"]
}
}
class KycModel: Mappable {
var nativeCountry: [KeyValueModel]?
var city: [KeyValueModel]?
var occupation: [KeyValueModel]?
var bank: [KeyValueModel]?
var idType: [KeyValueModel]?
required init?(map: Map) {
}
func mapping(map: Map) {
nativeCountry <- map["NativeCountry"]
city <- map["City"]
occupation <- map["Occupation"]
bank <- map["Bank"]
idType <- map["IdType"]
}
}
class KeyValueModel: Mappable {
var id: String?
var text: String?
required init?(map: Map) {
}
func mapping(map: Map) {
id <- map["id"]
text <- map["text"]
}
}

6
GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift

@ -15,13 +15,13 @@ protocol KycForm1ServiceType: class {
protocol FetchKycInformation: ApiServiceType {
func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () )
func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () )
}
extension FetchKycInformation {
func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () ) {
func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () ) {
let url = baseUrl + "mobile/loadform/receiver"
auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyInformationContainer) in
auth.request(method: .get, url: url, params: nil, success: { (response: KycModelContainer) in
if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
failure(error)

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

@ -271,7 +271,7 @@ extension KycForm1ViewController: KycForm1ViewInterface {
if let topMostTextField = self.textfields.filter({
$0.tag == tag
}).first {
// Todo
// scroll to view here
}

Loading…
Cancel
Save