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

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.

1 participant