-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from uphold/feature/add-verifications
Add verifications to User model
- Loading branch information
Showing
7 changed files
with
273 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Foundation | ||
import ObjectMapper | ||
|
||
/// Verification parameter model. | ||
open class VerificationParameter: Mappable { | ||
|
||
/// The reason of the verification. | ||
public private(set) final var reason: String? | ||
|
||
/// The status of the verification. | ||
public private(set) final var status: String? | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter reason: The reason for the verification. | ||
- parameter status: The status of the verification. | ||
*/ | ||
public init(reason: String, status: String) { | ||
self.reason = reason | ||
self.status = status | ||
} | ||
|
||
// MARK: Required by the ObjectMapper. | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter map: Mapping data object. | ||
*/ | ||
required public init?(map: Map) { | ||
} | ||
|
||
/** | ||
Maps the JSON to the Object. | ||
|
||
- parameter map: The object to map. | ||
*/ | ||
open func mapping(map: Map) { | ||
reason <- map["reason"] | ||
status <- map["status"] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import Foundation | ||
import ObjectMapper | ||
|
||
/// Verifications model. | ||
open class Verifications: Mappable { | ||
|
||
/// The address verification. | ||
public private(set) final var address: VerificationParameter? | ||
|
||
/// The birthdate verification. | ||
public private(set) final var birthdate: VerificationParameter? | ||
|
||
/// The documents verification. | ||
public private(set) final var documents: VerificationParameter? | ||
|
||
/// The email verification. | ||
public private(set) final var email: VerificationParameter? | ||
|
||
/// The identity verification. | ||
public private(set) final var identity: VerificationParameter? | ||
|
||
/// The location verification. | ||
public private(set) final var location: VerificationParameter? | ||
|
||
/// The phone verification. | ||
public private(set) final var phone: VerificationParameter? | ||
|
||
/// The terms verification. | ||
public private(set) final var terms: VerificationParameter? | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter address: The address verification. | ||
- parameter birthdate: The birthdate verification. | ||
- parameter documents: The documents verification. | ||
- parameter email: The email verification. | ||
- parameter identity: The identity verification. | ||
- parameter location: The location verification. | ||
- parameter phone: The phone verification. | ||
- parameter terms: The terms verification. | ||
*/ | ||
public init(address: VerificationParameter?, birthdate: VerificationParameter?, documents: VerificationParameter?, email: VerificationParameter?, identity: VerificationParameter?, location: VerificationParameter?, phone: VerificationParameter?, terms: VerificationParameter?) { | ||
self.address = address | ||
self.birthdate = birthdate | ||
self.documents = documents | ||
self.email = email | ||
self.identity = identity | ||
self.location = location | ||
self.phone = phone | ||
self.terms = terms | ||
} | ||
|
||
// MARK: Required by the ObjectMapper. | ||
|
||
/** | ||
Constructor. | ||
|
||
- parameter map: Mapping data object. | ||
*/ | ||
required public init?(map: Map) { | ||
} | ||
|
||
/** | ||
Maps the JSON to the Object. | ||
|
||
- parameter map: The object to map. | ||
*/ | ||
open func mapping(map: Map) { | ||
address <- map["address"] | ||
birthdate <- map["birthdate"] | ||
documents <- map["documents"] | ||
email <- map["email"] | ||
identity <- map["identity"] | ||
location <- map["location"] | ||
phone <- map["phone"] | ||
terms <- map["terms"] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.