In reference to issue #327, moves bulk of logic from routers/case_manager addStudent procedure over to lib/db_helpers/case_manager createAndAssignStudent function. Also creates specific errors, which are thrown by the new function to allow better information for the client to display. There is no client aspect to this PR, though making that final connection could easily be added to this PR. Also adds several additional tests on the routers/case_manager.test.ts to ensure that the correct errors are being thrown in the correct circumstances.
In reference to issue #327, moves bulk of logic from routers/case_manager
addStudent
procedure over to lib/db_helpers/case_managercreateAndAssignStudent
function. Also creates specific errors, which are thrown by the new function to allow better information for the client to display. There is no client aspect to this PR, though making that final connection could easily be added to this PR. Also adds several additional tests on the routers/case_manager.test.ts to ensure that the correct errors are being thrown in the correct circumstances.