Skip to content

Commit

Permalink
Merge pull request #54 from uphold/feature/remove-phone-national-inte…
Browse files Browse the repository at this point in the history
…rnational-masked

Remove phone's `nationalMasked` and `internationalMasked`
  • Loading branch information
ruipenso authored May 29, 2017
2 parents ea88cad + 61dd927 commit 28678ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
14 changes: 1 addition & 13 deletions Source/Model/User/Phone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ public class Phone: Mappable {
/// The E.164 phone mask.
public private(set) final var e164Masked: String?

/// The international phone mask.
public private(set) final var internationalMasked: String?

/// The national phone mask.
public private(set) final var nationalMasked: String?

/// A boolean indicating if the phone is the primary user phone.
public private(set) final var primary: Bool?

Expand All @@ -27,16 +21,12 @@ public class Phone: Mappable {

- parameter id: The contact id.
- parameter e164Masked: The E.164 phone mask.
- parameter internationalMasked: The international phone mask.
- parameter nationalMasked: The national phone mask.
- parameter primary: A boolean indicating if the phone is the primary user phone.
- parameter verified: A boolean indicating if the phone is verified.
*/
public init(id: String, e164Masked: String, internationalMasked: String, nationalMasked: String, primary: Bool, verified: Bool) {
public init(id: String, e164Masked: String, primary: Bool, verified: Bool) {
self.id = id
self.e164Masked = e164Masked
self.internationalMasked = internationalMasked
self.nationalMasked = nationalMasked
self.primary = primary
self.verified = verified
}
Expand All @@ -59,8 +49,6 @@ public class Phone: Mappable {
public func mapping(map: Map) {
self.id <- map["id"]
self.e164Masked <- map["e164Masked"]
self.internationalMasked <- map["internationalMasked"]
self.nationalMasked <- map["nationalMasked"]
self.primary <- map["primary"]
self.verified <- map["verified"]
}
Expand Down
6 changes: 1 addition & 5 deletions Tests/Integration/Model/UserTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,7 @@ class UserTest: UpholdTestCase {
"\"id\": \"foobar\"," +
"\"verified\": true," +
"\"primary\": true," +
"\"e164Masked\": \"+XXXXXXXXX04\"," +
"\"nationalMasked\": \"(XXX) XXX-XX04\"," +
"\"internationalMasked\": \"+X XXX-XXX-XX04\"" +
"\"e164Masked\": \"+XXXXXXXXX04\"" +
"}]"
let user: User = Fixtures.loadUser()
user.adapter = MockRestAdapter(body: json)
Expand All @@ -464,8 +462,6 @@ class UserTest: UpholdTestCase {
XCTAssertEqual(phones.count, 1, "Failed: Wrong number of phone objects.")
XCTAssertEqual(phones[0].e164Masked, "+XXXXXXXXX04", "Failed: Wrong phone e164Masked field.")
XCTAssertEqual(phones[0].id, "foobar", "Failed: Wrong phone id.")
XCTAssertEqual(phones[0].internationalMasked, "+X XXX-XXX-XX04", "Failed: Wrong phone internationalMasked field.")
XCTAssertEqual(phones[0].nationalMasked, "(XXX) XXX-XX04", "Failed: Wrong phone nationalMasked field.")
XCTAssertTrue(phones[0].primary!, "Failed: Wrong phone primary field.")
XCTAssertTrue(phones[0].verified!, "Failed: Wrong phone verified field.")

Expand Down

0 comments on commit 28678ec

Please sign in to comment.