Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename person_employments, add end date logic #1459

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

hortha
Copy link
Contributor

@hortha hortha commented Aug 12, 2024

Context

Having done analysis on the last 4 months TPS data extracts and got answers from Capita about various quirks, we are now in a position to draw a line on the initial phase of the workforce data import.

Changes proposed in this pull request

Rename the person_employments table in TRS to tps_employments.
Add a withdrawal_confirmed field to the tps_employments table (so this can be passed on to BQ in case it is needed in future).
Where the end date in the extract file is in the future, use the extract date as the last known employed date.
Amend the logic used on the TPS import to include ageing the data
Set the end date to the last known employed date when we get a W indicator
Set the end date to the last known employed date when the last known employed date is greater than 5 months after the extract date
Reset the end date to NULL if the W indicator is removed in a future extract for a given TRN / LA Code / Establishment Number / Start Date (as long as the last known TPS employed date is less than 5 months after the extract date)
Reset the end date to NULL if the last known TPS employed date for a given TRN / LA Code / Establishment Number / Start Date is less than 5 months after the extract date

Checklist

  • Attach to Trello card
  • Rebased master
  • Cleaned commit history
  • Tested by running locally

@hortha hortha requested review from gunndabad and MrKevJoy August 12, 2024 12:06
@hortha
Copy link
Contributor Author

hortha commented Aug 12, 2024

@hortha hortha force-pushed the final-amendments-to-workforce-data-import branch from c888d63 to b36842c Compare August 12, 2024 12:07
@hortha hortha merged commit 3063e7f into main Aug 13, 2024
13 checks passed
@hortha hortha deleted the final-amendments-to-workforce-data-import branch August 13, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants