Feat: Add PMS User settings doctype and API - #2124
Open
saranshsinhaa wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-user PMS settings storage and APIs for retrieving and updating employee preferences.
Changes:
- Introduces the
PMS User SettingDocType. - Adds get-or-create and update endpoints with input validation.
- Adds placeholder controller and integration-test files.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pms_user_setting/__init__.py |
Initializes the DocType package. |
pms_user_setting/pms_user_setting.json |
Defines fields and permissions. |
pms_user_setting/pms_user_setting.py |
Implements settings APIs and validation. |
pms_user_setting/pms_user_setting.js |
Adds the generated client controller scaffold. |
pms_user_setting/test_pms_user_setting.py |
Adds an empty integration-test scaffold. |
Suppressed comments (1)
next_pms/next_pms/doctype/pms_user_setting/pms_user_setting.json:23
read_onlyonly protects the Desk UI; it does not make this identity field immutable on the server. Because Employees have owner-scoped write access at permlevel 0, an owner can updateuserthrough the generic resource API and reserve another user's unique value, causing that user's get-or-create flow to fail. Protectuserwith a higher permlevel granted only to System Manager, or reject changes to it in the controller.
"read_only": 1,
"reqd": 1,
"unique": 1
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
next_pms/next_pms/doctype/pms_user_setting/test_pms_user_setting.py:20
- This test class is empty despite introducing stateful GET/POST endpoints with permission checks, first-read creation, fallback behavior, and input validation. Add integration tests for those paths, including unauthorized users and rejected negative/non-integer or unsupported values, so regressions in per-user isolation are detected.
pass
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Relevant Technical Choices
Checklist
Part of: #2101 , #1776
Required for: #2125