survey library and orgPolicies routes added#347
Conversation
WalkthroughAdds new survey library and organizationExtension route mappings in elevate-survey and dev routes JSON, including categories, surveys, observations (list/import), and organization extension create/update endpoints. All map to the survey service. Version bumped to 1.0.18. The JS routes file contains a duplicated block of the new routes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant GW as Interface Router
participant SV as Survey Service
Note over C,GW: New library & organizationExtension routes
C->>GW: HTTP request (/survey/v1/library/... or /organizationExtension/...)
GW->>SV: Forward to survey (inSequence=false, not orchestrated)
SV-->>GW: Response
GW-->>C: Response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
elevate-survey/constants/routes.js (1)
3013-3052: Routes added correctly; consider addingorchestrated: falsefor consistency.Most survey routes in this file explicitly set
orchestrated: false. These new entries omit it. It’s optional, but adding it keeps style uniform.Example (apply similarly to all new entries in this block):
{ sourceRoute: "/survey/v1/library/categories/create", type: "POST", inSequence: false, + orchestrated: false, targetRoute: { path: "/survey/v1/library/categories/create", type: "POST" }, service: "survey" },interface-routes/elevate-dev-routes.json (3)
12107-12119: Add basic rate limiting for public GET list endpoints.library/categories/list and library/surveys/list can be scraped; align with existing "public-low" limits used elsewhere.
Apply:
"service": "survey" }, { "sourceRoute": "/survey/v1/library/surveys/list", "type": "GET", "priority": "MUST_HAVE", "inSequence": false, "orchestrated": false, + "rateLimit": { "type": "public-low" }, "targetPackages": [And similarly for /survey/v1/library/categories/list.
"orchestrated": false, + "rateLimit": { "type": "public-low" }, "targetPackages": [Also applies to: 12121-12133
12149-12161: Gate heavy import endpoints.observations/import (with and without :id) likely trigger server-side writes and file I/O. Add "internal" rate limit (and, if applicable, requiresCustomHandling).
"inSequence": false, "orchestrated": false, + "rateLimit": { "type": "internal" }, + "requiresCustomHandling": true, "targetPackages": [Apply to both import routes.
Also applies to: 12163-12175
12177-12189: Harden organizationExtension admin endpoints.These modify org-level state; add internal rate limits.
"inSequence": false, "orchestrated": false, + "rateLimit": { "type": "internal" }, "targetPackages": [Apply to create, update, update/:id, and updateRelatedOrgs.
Confirm these endpoints require authentication/authorization in the survey service.
Also applies to: 12191-12203, 12205-12217, 12219-12231
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
elevate-survey/constants/routes.js(1 hunks)elevate-survey/package.json(1 hunks)interface-routes/elevate-dev-routes.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-05T09:46:50.071Z
Learnt from: MallanagoudaB
PR: ELEVATE-Project/utils#329
File: elevate-project/constants/routes.js:0-0
Timestamp: 2025-08-05T09:46:50.071Z
Learning: In the elevate-project/constants/routes.js file, the `orchestrated` property is not compulsory for all route configurations. Out of 293 total routes, 33 routes (about 11%) exist without this property, making it optional rather than required.
Applied to files:
interface-routes/elevate-dev-routes.jsonelevate-survey/constants/routes.js
📚 Learning: 2025-08-05T09:46:50.071Z
Learnt from: MallanagoudaB
PR: ELEVATE-Project/utils#329
File: elevate-project/constants/routes.js:0-0
Timestamp: 2025-08-05T09:46:50.071Z
Learning: In the elevate-project/constants/routes.js file, the `orchestrated` property is not compulsory for all route configurations. Many routes exist without this property, making it optional rather than required.
Applied to files:
elevate-survey/constants/routes.js
🔇 Additional comments (4)
elevate-survey/package.json (1)
3-3: Version bump looks fine.Please ensure the package is published/tagged alongside the interface route changes so downstream deployments pick up 1.0.18.
elevate-survey/constants/routes.js (3)
3053-3072: Confirm downstream expects GET for these list endpoints.
/survey/v1/library/surveys/listand/survey/v1/library/observations/listare configured as GET. Verify the survey service exposes these as GET to avoid 405s.
3073-3092: Import endpoints look good.POST mapping for
/survey/v1/library/observations/import(with and without:id) aligns with typical semantics.
3093-3132: Validate service ownership for organizationExtension routes.These routes are mapped to the "survey" service — confirm this is intentional (organizationExtension logic may belong to a different domain such as user/entity) to avoid cross-domain coupling.
Duplicate check: only one block found in elevate-survey/constants/routes.js (lines 3094–3129).
| { | ||
| "sourceRoute": "/survey/v1/library/categories/create", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/categories/update", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/categories/update/:id", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/categories/list", | ||
| "type": "GET", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/surveys/list", | ||
| "type": "GET", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/observations/list", | ||
| "type": "GET", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/observations/import", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/library/observations/import/:id", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/organizationExtension/create", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/organizationExtension/update", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/organizationExtension/update/:id", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, | ||
| { | ||
| "sourceRoute": "/survey/v1/organizationExtension/updateRelatedOrgs", | ||
| "type": "POST", | ||
| "priority": "MUST_HAVE", | ||
| "inSequence": false, | ||
| "orchestrated": false, | ||
| "targetPackages": [ | ||
| { | ||
| "basePackageName": "survey", | ||
| "packageName": "elevate-survey-observation" | ||
| } | ||
| ], | ||
| "service": "survey" | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
New survey library + organizationExtension routes look consistent.
All map to service "survey", with inSequence/orchestrated false and correct HTTP verbs. Placement within the survey section is coherent.
Run to ensure no duplicate (sourceRoute, type) entries slipped in:
🏁 Script executed:
#!/bin/bash
# Duplicates of route+method within this JSON
jq -r '.routes[] | "\(.sourceRoute)|\(.type)"' interface-routes/elevate-dev-routes.json \
| sort | uniq -dLength of output: 5273
Survey routes look consistent — duplicate (sourceRoute,type) entries found in interface-routes/elevate-dev-routes.json; dedupe required
Survey additions map to service "survey" with correct verbs/flags. Verification (your jq run) shows multiple duplicate (sourceRoute|type) pairs in this file — remove or consolidate the duplicate route objects so each (sourceRoute,type) is unique and re-run the jq command to confirm.
🤖 Prompt for AI Agents
In interface-routes/elevate-dev-routes.json around lines 12064 to 12231 there
are duplicate route objects sharing the same (sourceRoute,type) pairs; remove or
consolidate those duplicates so each (sourceRoute,type) appears exactly once,
preserving the correct fields (priority, inSequence, orchestrated,
targetPackages, service) for the intended entry; after deduping, run your jq
uniqueness check again to verify no duplicate (sourceRoute|type) pairs remain.
Summary by CodeRabbit