getmovement / deprecated-movement-rails-api

DEPRECATED Rails API for getmovement.org
1 stars 1 forks source link

As a volunteer, I want to record someone’s contact information so that the campaign can get in touch with them. #20

Open joshsmith opened 8 years ago

begedin commented 8 years ago

From #3, my guess is, this would be a combination of recording Voter and CampaignVoter information, with the addition of any metadata the CampaignVoter record links to.

I believe the important part here is to figure out how to store campaign metadata. I'm thinking something like


# we store our data definition here
create_table :campaign_metadata do |t|
  t.integer campaign_id
  t.string property    # the thing we display in the UI 
  t.string type          # the type of the thing we display (yes/no question, multiple choice, free input)
end

create_table :campaign_voter_metadata do |t|
  t.integer campaign_voter_id, null: false

  # first option
  t.string property_name, null: false # the name from the campaign_metadata table
  t.text property_value, null: false    # value we've put in (will need conversion)

  # alternatively, we just store the meta into a single string, ex. json
  t.text data, null: false
end

First option would mean a record for each piece of information, for a CampaignVoter, while the alternative would mean a single record containing all the information for a CampaignVoter

joshsmith commented 8 years ago

Can you clarify the metadata you mean here? Some examples?

I was thinking something simpler to start, a base kind of data that we will accept.

begedin commented 8 years ago

Nothing specific, but my assumption was that some if not all campaigns will have custom information they will require from voters, so this is an attempt to figure out how to define that information.

begedin commented 8 years ago

An additional concern. My guess is, we will want a protection system against tampering here? Otherwise, a volunteer would be able to provide incorrect voter information. How complex should this be?

joshsmith commented 8 years ago

That's correct, we will want that. I think there are various things we can do to mitigate, but for now let's operate under the idea that tracking information longitudinally by tracking all changes (voter file, user input, campaign manipulation, etc). Then we can implement QA steps, systems for highlighting discrepancies, etc. But without that basic infrastructure to make step changes to data, then we cannot do much quality control around it.