Skip to content
This repository was archived by the owner on Feb 23, 2022. It is now read-only.

Data Structures

JaymeP edited this page Feb 10, 2022 · 11 revisions

Campaigns table

Describes all campaigns and the number of letters sent for each campaign.

API reference

API reference Retrieving information for all campaigns in the table or just one.

Data description

Column Name Data Type Description
id integer Auto-increments with each new campaign added. (Not editable.)
organization string The name of the organization responsible for this campaign.
name string The name of this particular campaign.
cause enum Must be one of: Civic Rights, Education, Climate Justice The cause this campaign is supporting.
type enum Must be one of: Starter, Accelerator, Grant The type of campaign this is.
page_url text The URL for this campaign's call to action.
letters_counter integer The number of letters sent for this campaign.

(something is modding letters_counter, have not yet identified when and how often)

Example

CampaignTable


letter_versions table

This data is sent to Lob, primarily template_id which is specific to each campaign by office division. This data structure triages the letter object that's being displayed and sent, specific to the template_id of the region that's being picked by the office.

​​LetterVersions

  • keyID: use to create join or belong relationships for Users, Campaigns, and Letters sent
  • template_id: lob html template
  • office_division: each campaign has a different letter dependent on filter. Federal is the default.
  • state: Custom versions per state
  • county: Custom versions per county
  • CampaignID: maps to campaigns table

letter_sent table

Way to understand volumes of letters being sent. This table will be used to measure conversion for letter_upload, user_volunteer and user_campaign. letter_sent


Constituent Table

constituent

*This information is collected from review letter screen

  • Letters sent holds id of letter that was successfully posted with Lob (payment and address verification went through)
  • User agreement is a boolean that they abide by the platforms best practices
  • Updates is sending campaign_id so that we can send to advocacy groups so they can follow up and by our user education team
  • Street address, City, and State are strings
  • Zipcode is a string

Stripe Payments Table

stripe

Volunteer user table

Consisting of

  • name (string)
  • address (string)
  • letters sent (array of string template_ids)
Clone this wiki locally