taarifa / taarifa_backend

Prototype of a Taarifa backend (DEPRECATED, use TaarifaAPI)
Other
0 stars 1 forks source link

Store different report types in different collections #15

Open kynan opened 10 years ago

dgorissen commented 10 years ago

in particular: currently waterpoints are stored as reports, this does not make sense as they are not reports, belong in separate db, outside of core taarifa

nicowe commented 10 years ago

What exactly are we trying to achieve? @Dirk: do you mean a seperate database or a seperate mongo collection?

Currently Waterpoints are a subclass of the generic baseclass report in the ODM. Do you want to change this?

dgorissen commented 10 years ago

Its just subtle semantics. See my (crappy) picture I emailed a couple days ago about the high level picture.

Right now submitting a new report is equivalent to submitting a new waterpoint (you enter location, ward name, technology, village, etc). While actually a report about about a waterpoint should contain, for example, waterpoint id, who reported by, date, problem recorded, comments, ...

So ideally a Taarifa report just refers to a particular waterpoint (by id) as stored in openstreetmap (where the waterpoint data should ideally end up) and does not duplicate waterpoint attributes in the reports collection. Of course for now we have to store the waterpoint CSV data somewhere. We can keep it in the same db but I would store it in a separate collection to keep the semantic distinction.

dgorissen commented 10 years ago

Just to detail, given an empty, raw, database the upload script should: