Skip to content

Sayali: add user state indicator backend - controller, models, routes#2074

Open
sayali-2308 wants to merge 7 commits intodevelopmentfrom
Sayali_User_State_Indicator
Open

Sayali: add user state indicator backend - controller, models, routes#2074
sayali-2308 wants to merge 7 commits intodevelopmentfrom
Sayali_User_State_Indicator

Conversation

@sayali-2308
Copy link
Contributor

@sayali-2308 sayali-2308 commented Feb 26, 2026

image

Description

Implements #4 (Priority Urgent)

Related PRS (if any):

Backend PR related to Frontend PR OneCommunityGlobal/HighestGoodNetworkApp#4899

Main changes explained:

  • Created src/controllers/userStateController.js — handles catalog CRUD and user selection
  • Created src/models/userStateCatalog.js — catalog schema with key, label, color, order, isActive
  • Created src/models/userStateSelection.js — user selection schema with userId and stateIndicators
  • Created src/routes/userState.js — GET/POST/PUT/PATCH routes for catalog and selection
  • Updated src/startup/routes.js — registered /api/userstate routes
  • Seeded catalog with 5 default items

How to test:

  1. GET http://localhost:4500/api/userstate/catalog — should return 5 items
  2. GET http://localhost:4500/api/userstate/selection/:userId — should return empty array
  3. PUT http://localhost:4500/api/userstate/selection/:userId with selectedKeys array — should save
  4. PATCH http://localhost:4500/api/userstate/catalog/:key with isActive false — should hide item

Screenshots or videos of changes:

image image image image

Note:

Requires frontend PR OneCommunityGlobal/HighestGoodNetworkApp#4899 to be merged together

@sayali-2308 sayali-2308 added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Feb 26, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

Copy link

@HemanthNidamanuru HemanthNidamanuru left a comment

Choose a reason for hiding this comment

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

Hi Sayali,

I reviewed these endpoints locally and everything is working as expected. All APIs are returning correct responses.

Image Image Image Image

Copy link

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Sayali,

I have reviewed your PR locally and it works as per requirement.

Image Image Image Image Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants