Skip to content

Resolves issue #1717 , Replace old CNA fields with new generic partner fields across organization APIs.#1718

Merged
david-rocca merged 4 commits intodevfrom
dr_1717
Apr 7, 2026
Merged

Resolves issue #1717 , Replace old CNA fields with new generic partner fields across organization APIs.#1718
david-rocca merged 4 commits intodevfrom
dr_1717

Conversation

@david-rocca
Copy link
Copy Markdown
Collaborator

Closes Issue #1717

Summary

This PR replaces the legacy cna_country and cna_role_type identifier fields with partner_country, partner_role, and partner_type strings. These modifications propagate through the core organization Mongoose models, constant validation configurations, request/response JSON schemas, controller parameter parsing filters, and the OpenAPI documentation.

Important Changes

src/model/baseorg.js & src/repositories/baseOrgRepository.js:

  • Swapped cna_role_type and cna_country inside the Mongoose schema for partner_role, partner_type, and partner_country.
  • Added the new partner properties to the directRegistryKeys whitelist.

src/constants/index.js:

  • Updated JOINT_APPROVAL_FIELDS to require Secretariat approval for changes on the new partner fields.

src/middleware/schemas/BaseOrg.json & schemas/registry-org/*:

  • Standardized the API definitions by mapping partner_role, partner_type, and partner_country properties as Strings.
  • Synchronized definitions in list-registry-orgs-response.json and get-registry-org-response.json.

src/controller/org.controller/org.middleware.js & src/controller/registry-org.controller/registry-org.middleware.js:

  • Updated parsePostParams and the request body checks to accurately process and allow the new partner fields.

src/controller/org.controller/index.js & api-docs/openapi.json:

  • Reflected partner schema updates into the live @swagger decorators and detailed payload descriptions.

test/integration-tests/registry-org/registryOrgCRUDTest.js:

  • Expanded existing registry org unit tests to validate the correct reading, writing, and parsing of partner_role, partner_type, and partner_country.

Testing

Steps to manually test updated functionality:

  • 1) Authenticate as a Secretariat user.
  • 2) Submit a POST /api/registry/org payload to create an org ensuring you provide values in partner_role, partner_type, and partner_country.
  • 3) Query GET /api/registry/org/:shortname and assert that those partner values properly map into the response.
  • 4) Submit a PUT /api/registry/org/:shortname payload modifying these partner fields, observing a successful update response.

@jdalphond-mitre
Copy link
Copy Markdown
Collaborator

Tested, looks good

Copy link
Copy Markdown
Collaborator

@jdalphond-mitre jdalphond-mitre left a comment

Choose a reason for hiding this comment

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

Tested, working

@jdalphond-mitre jdalphond-mitre self-requested a review April 7, 2026 19:35
jdalphond-mitre
jdalphond-mitre previously approved these changes Apr 7, 2026
@david-rocca david-rocca merged commit d69ed1d into dev Apr 7, 2026
9 checks passed
@david-rocca david-rocca deleted the dr_1717 branch April 7, 2026 19:47
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