Skip to content

Commit

Permalink
ignore the case of email addresses when checking for discrepancies
Browse files Browse the repository at this point in the history
  • Loading branch information
johnduffell committed Sep 18, 2018
1 parent 66d19e0 commit de9a2b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -16,7 +16,10 @@ object AssertSame {
_.value.toLowerCase // some seem to be entered entirely lower case, but this isn't a significant difference, so ignore
)

val emailAddress: AssertSame[Option[EmailAddress]] = AssertSame[Option[EmailAddress]]("emails")
val emailAddress: AssertSame[Option[EmailAddress]] = AssertSame[Option[EmailAddress]](
"emails",
_.map(_.value.toLowerCase) // although emails are technically case sensitive on the first part, it's usually just a typing in difference
)

}

Expand Down
Expand Up @@ -34,12 +34,12 @@ object RunBatch {

val result = for {
args <- GetArgs(rawArgs)
postString = HttpOp(Http.response).setupRequest(post(args.apiKey))
postString = HttpOp(Http.response).setupRequest(post(args.apiKey)).flatMap(RestRequestMaker.toClientFailableOp)
jsons <- ReadFile(args.fileName)
postJsonString = postString.setupRequest[JsonString](jsonString => BodyAsString(jsonString.value))
requestWithResultAsTry = (jsonString: JsonString) =>
postJsonString.runRequest(jsonString) match {
case ClientSuccess(unit) => \/-(())
case ClientSuccess(_) => \/-(())
case f: ClientFailure => -\/(s"failed to call sf contact merge: $f")
}
err <- jsons.traverseU(requestWithResultAsTry)
Expand Down

0 comments on commit de9a2b1

Please sign in to comment.