EnCiv / undebate-ssp

Undebate Self Service Portal- Web portal where election administrators of democratically run organizations create undebates for their candidates and voters
Other
6 stars 9 forks source link

API Create Moderator Recorder in Undebate #106

Closed ddfridley closed 2 years ago

ddfridley commented 2 years ago

Create the API l that will cause the moderator undebate recorder to be created.

client side:

emit('create-moderator-recorder', electionObjId, cb) 

the call back should return undefined if there is an error, or { moderator: {viewerPath: "/path/to/viewer", recorderPath: "/path/to/recorder"} }

The API call should result in a side effect where all browsers subscribing to the electionObj should get an update.

Note: references to undebate that follow are to the civ-serv branch of the undebate repo, not the main branch.

When the API is called, a viewer-recorder object needs to be created from the information in the electionObj.

Use undebate: app/tools/2021-nac-viewer-recorder.js as a template for creating the moderator recorder for the election.

Need to add parentId of electionObjId to the viewer.

After the election Object is created, the undebate api undebateFromTemplateAndRows shall be called with the viewer-recorder-object from above, and the moderator info manipulated into a rowObjs array with one row.

see the test file for an example /app/lib/tests/undebates-from-template-and-rows.js

Here is the main code but hopefully it won't be needed: /app/lib/undebates-from-template-and-rows.js and

server side: app/socket_apis/create-moderator-recorder.js

import undebatesFromTemplateAndRows from "civil-server"

createModeratorRecorder(electionObjId,callback){

}

create an interactive/visual dev test for the api

You will need to go through the steps here to create a mongo database on mongodb.com (free) and get a MONGODB_URI and put it into your environment. I hear that the steps in the slides are out of date so ask if there are problems.

After you have a MONGODB_URI in your environment, you can npm run dev and then browse to localhost:3011/qa/create-moderator-record

you can also brows to localhost:3011/home , localhost:3011/qa/ccwrapper and localhost:3011/qa/ccwrapper-recorder

ddfridley commented 2 years ago

closed in #124