Properly set transaction type via the transaction import api

This commit is contained in:
Everett Sochowski 2015-02-24 10:17:00 +01:00
parent e9a9045f39
commit 9cb66d5d62
2 changed files with 6 additions and 3 deletions

View File

@ -38,7 +38,7 @@ object ImporterAPI extends RestHelper with Loggable {
*/
case class ImporterBank(IBAN : String, national_identifier : String, name : String)
case class ImporterDetails(type_en : String, type_de : String, posted : ImporterDate,
case class ImporterDetails(kind : String, posted : ImporterDate,
completed : ImporterDate, new_balance : ImporterAmount, value : ImporterAmount,
label : String)
case class ImporterDate(`$dt` : Date) //format : "2012-01-04T18:06:22.000Z" (see tests)

View File

@ -26,6 +26,8 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe
val secretKeyHttpParamName = "secret"
val secretKeyValue = Props.get("importer_secret").get
val dummyKind = "Transfer"
def fixture() = new {
lazy val bank = createBank("a-bank")
lazy val accountCurrency = "EUR"
@ -79,8 +81,7 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe
| }
| },
| "details": {
| "type_en": "Transfer",
| "type_de": "Überweisung",
| "kind": "$dummyKind",
| "label": "$dummyLabel"
| "posted": {
| "$$dt": "$startDateString"
@ -134,6 +135,8 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe
f
}
t.transactionType should equal(dummyKind)
t.startDate should equal(importJsonDateFormat.parse(startDate))
t.finishDate should equal(importJsonDateFormat.parse(endDate))
}