xebia-functional / nine-cards-v2

An Open Source Android Launcher built with Scala on Android
http://www.9cards.io/
Other
183 stars 20 forks source link

Use EitherT to model known errors #878

Closed franciscodr closed 7 years ago

franciscodr commented 8 years ago

We should model known errors by using cats EitherT in the response of the services.

franciscodr commented 7 years ago

PR's link: https://github.com/47deg/nine-cards-backend/pull/120 Branch: paco-878-using-eithert

QA instructions
  1. Run nine-cards-backend app by typing sbt -Dconfig.file=modules/api/src/main/resources/localhost.conf
  2. Check if rankApps endpoint keeps working as expected
curl -X "POST" "http://localhost:8080/applications/rank" \
     -H "X-Auth-Token: 12345" \
     -H "X-Android-ID: <enter-android-id>" \
     -H "Content-Type: application/json" \
     -H "X-Session-Token: <enter-session-token>" \
     -d $'{
    "location": "ES",
    "items": {
        "BOOKS_AND_REFERENCE": ["com.google.android.apps.books"],
        "BUSINESS": ["com.google.android.apps.giant"],
        "COMMUNICATION": ["com.google.android.talk", "com.google.android.gm", "com.motorola.targetnotif", "com.whatsapp", "com.Slack"],
        "TRAVEL_AND_LOCAL": ["com.google.android.apps.maps"]
    }
}'
fedefernandez commented 7 years ago

Works fine, LGTM!