Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Code Notes

Chris Thompson edited this page Jul 5, 2018 · 2 revisions

Endpoints

Dashboards are used to store the state of the application. There are three types of dashboards, state, county and audit board. The dashboards are stored in the database.

Abstract State Machines(ASM) are used during the dashboards' transitions through the application workflow. There is one ASM for the State, and two for each county; "County" and "AuditBoard". They are retrieved from the db upon each request.

Events are emitted on some endpoints. Events are used to transition (update) the ASMs. This happens in a "after hook" (see: afterAfter) on each request.

operations/commands:

acvr-download

Render CastVoteRecords to json (AUDITOR_ENTERED and PHANTOM_BALLOT) (all and per county)

acvr-upload

Save CastVoteRecord to database (AUDITOR_ENTERED) county,cvr-number,scanner-id,batch-id,record-id,imprinted-id,ballot-type,contest-info

audit-board-dashboard-asm-state

render the state for Audit Board (per county) as json

audit-board-signin/signout

add audit board members to the CountyDashboard

audit-investigation-report

add report to the CountyDashboard name, report(string,data?), time

ballot-manifest-download

render all BallotManifests to json (all and per county)

ballot-manifest-import

save csv file to db (rows as BallotManifestInfo) county,scanner-id,batche-number,num-ballots,batch-location (delete matching uploads for county????)

ballot-not-found

submit CastVoteRecord as PHANTOM_BALLOT maybe emit ROUND_COMPLETE_EVENT

cvr-download

render UPLOADED CastVoteRecords as json (and by county) (and by id)

cvr-export-import (what?)

one-at-a-time (per county) import of CVRs start CVRImporter from UploadedFile in a thread request body is json, file is an attribute as a blob

cvr-to-audit-download

download a csv with a random list of CVRs to fetch from storage(by person) (also as json)

contest-download

render contests to json (and by county) (and by id)

county-dashboard-asm-state

render the current CountyDashboardASM as json

county-dashboard-refresh

render the full CountyDashboard as json

county-report-download

render pdf or csv of a county report

dos-dashboard-asm-state

render the the current dos state as json

dos-dashboard-refresh

render the full dos dashboard as json

file-download

unsure how file is found - download a file from file_info query param

file-upload

creates a temp file "upload.csv" and archives it to /opt/corla/file_archive/ (see: unix_upload_file_location)

indicate-hand-count

add ContestToAudit to hand_count_counties on State Dashboard

intermediate-audit-report

submit intermediate report and sign out audit board

pulish-audit-report

not yet implemented

report-ballots-to-audit

not yet implemented

reset-database

delete everything ("delete from ...") and save new dashboards and reset county ASMs

risk-limit-for-comparison-audits

update AuditInfo(risk_limit, etc.) on State Dashboard

Root

nothing

select-contests-for-audit

add contest to State Dashboard's list of contests to audit

set-random-seed

set seed on State Dashboard

sign-off-audit-round

  • emit events
    • RISK_LIMIT_ACHIEVED_EVENT
    • BALLOTS_EXHAUSTED_EVENT
    • ROUND_SIGN_OFF_EVENT

start-audit-round

update County and Audit Board Dashboards and ASM

state-report-download

render pdf or csv of State Report

unauthenticate

remove 'admin' from session hash

update audit info

update State Dashboard emit audit info event