Skip to content

WIP: add record tags#214

Open
itsyaasir wants to merge 14 commits intofeat/audit-trails-devfrom
feat/record-tags
Open

WIP: add record tags#214
itsyaasir wants to merge 14 commits intofeat/audit-trails-devfrom
feat/record-tags

Conversation

@itsyaasir
Copy link
Contributor

Description of change

Links to any relevant issues

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes
  • I have updated the CHANGELOG.md, if my changes are significant enough

- Consolidate record tag management functions into a dedicated `tags` module.
- Introduce `AddRecordTag`, `RemoveRecordTag`, and `SetRecordTags` transactions for better encapsulation.
- Update permissions to include `AddRecordTags` and `DeleteRecordTags`.
- Modify existing functions and tests to utilize the new structure for managing record tags.
- Remove deprecated functions and ensure all references are updated accordingly.
- Enhance tests to validate the new tag management functionality and permissions.
@itsyaasir itsyaasir linked an issue Mar 17, 2026 that may be closed by this pull request
@itsyaasir itsyaasir marked this pull request as draft March 18, 2026 08:23
@itsyaasir
Copy link
Contributor Author

There are some important question remaining for this to be implemented fully.

If a tag is removed from the trail registry, there are two places that may still reference that tag:

  • Role rows / role-data : roles may still include that tag in their allowed tags
  • Existing record rows : records may already store that tag as their historical tag

So the first question is:

  • What should happen when a tag is deleted from the trail registry, but it is still referenced by roles and/or already used by records?
    The second question is about correction:
  • If a record was created with the wrong tag, should correct_record be allowed to change the tag as part of the correction, or should the original tag remain immutable even in correction flows?

@itsyaasir itsyaasir marked this pull request as ready for review March 18, 2026 15:08
b"The requested tag is already defined for this audit trail";
#[error]
const ERecordTagInUse: vector<u8> =
b"The requested tag cannot be removed because it is already used by an existing record";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b"The requested tag cannot be removed because it is already used by an existing record";
b"The requested tag cannot be removed because it is already used by an existing record or role";

chrisgitiota and others added 2 commits March 19, 2026 17:46
Several renamings and slightly changes in the record_tag related interfaces.

Co-authored-by: Yasir <yasir@shariff.dev>
# Conflicts:
#	audit-trail-move/sources/audit_trail.move
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.

[AT]: Implement Record Tags

2 participants