Skip to content

Resolves issue #1729, Ensures Secretariat organization audit entries store authority in the same array format as BaseOrg documents.#1826

Merged
afoote-mitre merged 3 commits into
devfrom
dr_1729
Jun 3, 2026
Merged

Resolves issue #1729, Ensures Secretariat organization audit entries store authority in the same array format as BaseOrg documents.#1826
afoote-mitre merged 3 commits into
devfrom
dr_1729

Conversation

@david-rocca

@david-rocca david-rocca commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Closes Issue #1729

Summary

This PR fixes an audit data inconsistency when creating Secretariat organizations. The create path no longer mutates authority from ['SECRETARIAT'] to 'SECRETARIAT' before writing audit history, so Audit records remain consistent with the stored BaseOrg schema.

Important Changes

src/repositories/baseOrgRepository.js

  • Removed the Secretariat-only mutation that converted authority from an array to a string.
  • Keeps the explicit SecretariatOrgModel save path intact.

test/integration-tests/audit/registryOrgCreatesAuditTest.js

  • Added an integration regression test that creates a Secretariat org through /api/registry/org.
  • Verifies the audit entry stores audit_object.authority as ['SECRETARIAT'].

Testing

Steps to manually test updated functionality, if possible

  • 1) Create a Secretariat org with POST /api/registry/org.
  • 2) Fetch the audit record with GET /api/audit/org/:uuid.
  • 3) Confirm history[0].audit_object.authority is ['SECRETARIAT'].

Automated testing performed:

  • bash -i -c "npm run test:integration"
  • Result: 407 passing

@david-rocca david-rocca changed the title resolving 1729 Resolves issue #1729, Ensures Secretariat organization audit entries store authority in the same array format as BaseOrg documents. May 27, 2026
@afoote-mitre afoote-mitre merged commit a640c34 into dev Jun 3, 2026
9 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.

2 participants