Skip to content

Conversation

@ThomasKalverda
Copy link
Contributor

This PR refactors the Direct Award audit trail to use proper model relationships and simplifies the related API endpoint.

  • Replaced entity ID fields in DirectAwardAuditTrail with ForeignKey relations to DirectAward and BadgeClass
  • Included a backwards compatible data migration
  • Updated the audit trail signal receiver to populate the new relations
  • Refactored the audit trail API to use a ListAPIView and improved the serializer to leverage model relations

Note: this change should not change the response of the API endpoint, it should only improve the performance and maintainabilty.

Refactor DirectAwardAuditTrail to use proper ForeignKey relations instead of CharField entity IDs. Includes a data migration to populate historical records and removes the legacy fields. The migration is also backwards compatible.
Refactor the audit trail API endpoint to a ListAPIView and improve the serializer using the new model relations.
Copy link
Contributor

@Iso5786 Iso5786 left a comment

Choose a reason for hiding this comment

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

LGTM

@Iso5786 Iso5786 merged commit 489d893 into develop Jan 20, 2026
6 checks passed
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.

3 participants