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.

132 lines
3.8 KiB

  1. //
  2. // RecipientModel.swift
  3. // GME Remit
  4. //
  5. // Created by InKwon James Kim on 16/08/2019.
  6. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import ObjectMapper
  9. struct Recipient: Mappable {
  10. var firstName: String?
  11. var middleName: String?
  12. var lastName1: String?
  13. var lastName2: String?
  14. var localFirstName: String?
  15. var localMiddleName: String?
  16. var localLastName1: String?
  17. var localLastName2: String?
  18. var id: String?
  19. var name: String?
  20. var localizedName: String?
  21. var paymentMethod: PaymentMethodModel?
  22. var agent: AgentModel?
  23. var receiverID: String?
  24. var membershipID: String?
  25. var country: String?
  26. var countryCode: String?
  27. var countryID: String?
  28. var address: String?
  29. var state: String?
  30. var stateID: String?
  31. var zipCode: String?
  32. var city: String?
  33. var email: String?
  34. var homePhone: String?
  35. var workPhone: String?
  36. var mobile: String?
  37. var relationship: String?
  38. var relationshipID: String?
  39. var district: String?
  40. var districtID: String?
  41. var purposeOfRemit: String?
  42. var purposeOfRemitID: String?
  43. var fullName: String?
  44. var idType: String?
  45. var idNumber: String?
  46. init?(map: Map) {}
  47. init() {}
  48. mutating func mapping(map: Map) {
  49. firstName <- map["firstName"]
  50. middleName <- map["middleName"]
  51. lastName1 <- map["lastName1"]
  52. lastName2 <- map["lastName2"]
  53. localFirstName <- map["localFirstName"]
  54. localMiddleName <- map["localMiddleName"]
  55. localLastName1 <- map["localLastName1"]
  56. localLastName2 <- map["localLastName2"]
  57. id <- map["id"]
  58. name <- map["name"]
  59. localizedName <- map["localizedName"]
  60. paymentMethod <- map["paymentMethod"]
  61. agent <- map["agent"]
  62. receiverID <- map["receiverId"]
  63. membershipID <- map["membershipId"]
  64. country <- map["country"]
  65. address <- map["address"]
  66. state <- map["state"]
  67. zipCode <- map["zipCode"]
  68. city <- map["city"]
  69. email <- map["email"]
  70. homePhone <- map["homePhone"]
  71. workPhone <- map["workPhone"]
  72. mobile <- map["mobile"]
  73. relationship <- map["relationship"]
  74. district <- map["district"]
  75. purposeOfRemit <- map["purposeOfRemit"]
  76. fullName <- map["fullName"]
  77. idType <- map["idType"]
  78. idNumber <- map["idNumber"]
  79. stateID <- map["stateId"]
  80. countryCode <- map["countryCode"]
  81. countryID <- map["countryId"]
  82. relationshipID <- map["relationshipId"]
  83. districtID <- map["districtId"]
  84. purposeOfRemitID <- map["purposeOfRemitId"]
  85. }
  86. func serialize() -> [String : String] {
  87. return [
  88. "firstName": firstName ?? "",
  89. "middleName": middleName ?? "",
  90. "lastName1": lastName1 ?? "",
  91. "lastName2": lastName2 ?? "",
  92. "localFirstName": localFirstName ?? "",
  93. "localMiddleName": localMiddleName ?? "",
  94. "localLastName1": localLastName1 ?? "",
  95. "localLastName2": localLastName2 ?? "",
  96. "id": id ?? "",
  97. "name": name ?? "",
  98. "localizedName": localizedName ?? "",
  99. // "paymentMethod": paymentMethod ?? "",
  100. // "agent": agent ?? "",
  101. "receiverId": receiverID ?? "",
  102. "membershipId": membershipID ?? "",
  103. "country": country ?? "",
  104. "address": address ?? "",
  105. "state": state ?? "",
  106. "zipCode": zipCode ?? "",
  107. "city": city ?? "",
  108. "email": email ?? "",
  109. "homePhone": homePhone ?? "",
  110. "workPhone": workPhone ?? "",
  111. "mobile": mobile ?? "",
  112. "relationship": relationship ?? "",
  113. "district": district ?? "",
  114. "purposeOfRemit": purposeOfRemit ?? "",
  115. "fullName": fullName ?? "",
  116. "idType": idType ?? "",
  117. "idNumber": idNumber ?? "",
  118. "stateId": stateID ?? "",
  119. "countryCode": countryCode ?? "",
  120. "countryId": countryID ?? "",
  121. "relationshipId": relationshipID ?? "",
  122. "districtId": districtID ?? "",
  123. "purposeOfRemitId": purposeOfRemitID ?? "",
  124. ]
  125. }
  126. }