Skip to content

[DTOSS-9252] Extract status into an append only table#133

Merged
MatMoore merged 2 commits intomainfrom
dtoss-9252-extract-status
Jun 20, 2025
Merged

[DTOSS-9252] Extract status into an append only table#133
MatMoore merged 2 commits intomainfrom
dtoss-9252-extract-status

Conversation

@MatMoore
Copy link
Copy Markdown
Contributor

@MatMoore MatMoore commented Jun 17, 2025

Description

Clinic currently has a 'state' field.

The times this changes is a useful metric. To avoid relying on audit data that will be archived periodically, extract into a separate table and record the created date.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-9252

Review notes

This is the first part of the ticket. Once merged, I'll follow the same pattern for the appointments.

@malcolmbaig malcolmbaig changed the title [DTOSS-9252] extract status into an append only table [DTOSS-9252] Extract status into an append only table Jun 19, 2025
@MatMoore MatMoore force-pushed the dtoss-9252-extract-status branch 2 times, most recently from acd28b1 to 7b1b9c1 Compare June 20, 2025 11:16
@MatMoore MatMoore marked this pull request as ready for review June 20, 2025 11:19
MatMoore added 2 commits June 20, 2025 12:20
This gives us a history of the changes a clinic has gone through.

It does add a bit of friction with the ORM, because we can technically
create Clinic objects without a state now, but we can encapsulate this
in a service object.
@MatMoore MatMoore force-pushed the dtoss-9252-extract-status branch from 7b1b9c1 to 4ce940b Compare June 20, 2025 11:20
Comment on lines +1 to -4
import uuid
from datetime import datetime
from unittest.mock import MagicMock
import uuid
import pytest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything we can do to fix import ordering automatically?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a tool called isort. Looks like we haven't enabled it yet but I can raise another PR...

@MatMoore MatMoore merged commit a47f64f into main Jun 20, 2025
7 checks passed
@MatMoore MatMoore deleted the dtoss-9252-extract-status branch June 20, 2025 14:05
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