DoSomething/mb-logging-api — pull request #18 by DeeZone (2014-10-16 00:24:37+00:00)
Title: Issue17 summery details logging

** NOTE**: In development, not ready for merge. For discussion only.

Adds endpoint: `/api/v1/imports/summaries/existing` to support logging of existing stats as addition to entries in `db['import-summaries']`, indexed on `target_CSV_file`.

**To test**:
- start`mongod` and $node mb-logging-api-server`.
- Test http POST to `http://localhost:4733/api/v1/imports/summaries/existing?type=user_import&source=niche.com&target_CSV_file=2014-09-10.csv`
```
with parameters:
- `mailchimp`
- `drupal`
- `mobile_commons` -> `undeliverable`
- `mobile_commons` -> `existing`
- `mobile_commons` -> `no_subscription`
- `mobile_commons` -> `other`
- `mobile_commons` -> `total`
- `total`

to populate fields in `import-summary` document:
```
existing : {
mailchimp : { type : Number },
drupal : { type : Number },
mobile_commons : {
undeliverable : { type : Number },
existing : { type : Number },
no_subscription : { type : Number },
other : { type : Number },
total : { type : Number }
},
total : { type : Number }
},
```
- update of entry based on `target_CSV_file` value.