Currently an AB can claim an ECT using the flow laid out in #265.
That flow finishes in RegisterECT where there is a TODO that outlines what should happen.
if the ECT is brand new (they're being claimed for the first time) send a message to the TRS API letting them know the ECT has started their induction. This should be done as an job so it retries when there's a problem. When the job succeeds we should write to a timestamp field on the Teacher called something like induction_start_date_submitted_to_trs_at.
persist the data to the actual database:
write a Teacher record if there isn't one already
write an InductionPeriod linked to the teacher and the AB with the supplied started_on and induction_programme
when the above is done, delete the pending record
The above are done in a transaction. As we're using SolidQueue, the submission job will only be picked up by the worker when the teacher/induction period are written, avoiding the condition where the job finishes before the teacher record is created.
Currently an AB can claim an ECT using the flow laid out in #265.
That flow finishes in RegisterECT where there is a
TODO
that outlines what should happen.Teacher
called something likeinduction_start_date_submitted_to_trs_at
.Teacher
record if there isn't one alreadyInductionPeriod
linked to the teacher and the AB with the suppliedstarted_on
andinduction_programme
The above are done in a transaction. As we're using SolidQueue, the submission job will only be picked up by the worker when the teacher/induction period are written, avoiding the condition where the job finishes before the teacher record is created.