-
Notifications
You must be signed in to change notification settings - Fork 1
Open Election Data Models
Required fields are the minimum number of fields required to create the record in the database.
required fields:
id* - UID - secure unique identifier - created in postgres. Do not use integer types. - Indexed
createdAt - datetime stamp in UTC for record created
updatedAt - datetime stamp in UTC for last update. - Indexed
Governments are entities that match donations, administer donation programs and possibly run elections. All records are located against the government entity
Table Name: Governments
Required fields:
slug - varchar(24) - the subdomain and huma-nreadable name for the government (i.e. portland, seattle). - Indexed
must be alphanumeric. will be used for folders & naming items in the system
Not Required
name - varchar(255) - the display name of the government program
website - varchar(255) - the government's main website for the matching program
domain - varchar(255) - the fully qualified domain name for the program (https://www.portlandopenelections.org)
Users have access to the system, are linked to permissions and can add/edit/read data.
Required Fields:
email - varchar(255) - required - the email of the user - Indexed
salt - varchar(255) - required - the application generated salt for the password
passwordHash - varchar(255) - required - the salted md5 hash of the password (salt + password)
Not Required Fields:
phone - uinteger(64) - the phone number of the user
firstName - varchar(255) - the user's first name
lastName - varchar(255) - the user's last name
address1 - varchar(255) - the mailing address
address2 - varchar(255) - the additional mailing address
city - varchar(255) - the city
state - varchar(255) - the two letter abbreviation
postcalCode - varchar(255) - the postal code - 5 to 8 numbers. dashes allowed
Permissions enable a user to conduct CRUD operations in the system. All permissions affect a resource which is a plain language name. These are enforced at the application level. All permission dictionaries should be maintained in the application code.
Required fields
userId - the user record - Indexed permissionLevel - enum[create|update|read|delete] resource - enum[User|Donation|] - a human readable service or action identifier. Can correspond to the table name, a service, capability, etc. The dictionary is kept in the application. governmentId - the government id - if set, applies to all campaigns under the government campaignId - the campaign id - if set, applies to only the campaign
Settings are undefined, added as needed, to customize the application and code for the government entity. Settings might include things like logos, colors, customized text, etc.
Required Fields
governmentId - record linkage to the government
key - varchar(255) - the setting key
value - blob - the binary or text blob. Can be json, binary (image), text, etc.