DFE-Digital / register-early-career-teachers

This application will replace the Manage training for early career teachers service in 2025.
5 stars 0 forks source link

Finalise a claimed teacher by an appropriate body #364

Closed edujackedu closed 1 month ago

edujackedu commented 1 month ago

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.

  1. 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.
  2. persist the data to the actual database:
    1. write a Teacher record if there isn't one already
    2. write an InductionPeriod linked to the teacher and the AB with the supplied started_on and induction_programme
  3. 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.