Skip to content

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

Open
david-rocca wants to merge 1 commit into
devfrom
dr_1729
Open

Resolves issue #1729, Ensures Secretariat organization audit entries store authority in the same array format as BaseOrg documents.#1826
david-rocca wants to merge 1 commit into
devfrom
dr_1729

Conversation

@david-rocca
Copy link
Copy Markdown
Collaborator

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

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
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.

1 participant