Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Trello
When we create placements as part of creating a trainee, we don't quite follow the same logic as when creating a placement on its own. When creating a placement on its own, we don't seem to use the hesa mapping logic that we use when creating them with a trainee. I'm not sure if this is what we expect, but on looking at the hesa mapping logic, it seemed that was an issue with it.
This logic seems to return
nil
for the URN if the URN is not within the arrayNOT_APPLICABLE_SCHOOL_URNS
. This will be most URNs since the array is only small:Changes proposed in this pull request
I've added a test to the
post_hesa_trainees_spec
which reproduces the issue. I've then updated the logic in the hesa_mapper so that the test now passes.Guidance to review
Should we actually be using the hesa mappers when creating a single placement, as we do for nested placements?
Important business
NB: Please notify the #twd_data_insights team and ask for a review if new fields are being added to analytics.yml