Skip to content

survey library and orgPolicies routes added#347

Merged
praveenKDass merged 1 commit intomasterfrom
survey_libraryOrg_routes
Sep 19, 2025
Merged

survey library and orgPolicies routes added#347
praveenKDass merged 1 commit intomasterfrom
survey_libraryOrg_routes

Conversation

@praveenKDass
Copy link
Copy Markdown
Collaborator

@praveenKDass praveenKDass commented Sep 18, 2025

Summary by CodeRabbit

  • New Features
    • Introduced survey library endpoints: categories create/update/update by ID/list; surveys list; observations list/import (with optional ID); and organization extension create/update/update by ID/update related orgs.
    • Enabled these endpoints in development routing to ensure consistent access and behavior.
  • Chores
    • Bumped package version to 1.0.18.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 18, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Survey route config (JS)
elevate-survey/constants/routes.js
Added multiple survey library and organizationExtension routes using sourceRoute/targetRoute (inSequence: false); no orchestrated flag. The new block appears twice (duplicate insertion).
Dev interface routes (JSON)
interface-routes/elevate-dev-routes.json
Appended corresponding survey routes with MUST_HAVE priority, inSequence: false, orchestrated: false, targeting basePackage "survey" and package "elevate-survey-observation".
Package version bump
elevate-survey/package.json
Version updated from 1.0.17 to 1.0.18.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • VISHNUDAS-tunerlabs

Poem

I hop through routes, a tidy queue,
New paths for surveys, shiny and new.
Libraries listed, imports fly,
Orgs extended—bun meets sky.
I thump a note: “Check duplicates too!”
Then twitch my nose—version’s 1.0.18, woo! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "survey library and orgPolicies routes added" concisely describes the primary change—adding survey library routes and organization-related routes—and matches the changes in constants/routes.js and interface-routes/elevate-dev-routes.json. It is specific and actionable, though the term "orgPolicies" is a slight naming mismatch with the added "organizationExtension" routes in the diff.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch survey_libraryOrg_routes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
elevate-survey/constants/routes.js (1)

3013-3052: Routes added correctly; consider adding orchestrated: false for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a23c81 and 3d89b6c.

📒 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.json
  • elevate-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/list and /survey/v1/library/observations/list are 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).

Comment on lines +12064 to +12231
{
"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"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 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 -d

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

@praveenKDass praveenKDass merged commit a160e21 into master Sep 19, 2025
1 check passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 16, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 4, 2025
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