Skip to content

♻️ Refactor(current-result.service): Update readOnly logic to include additional status check#653

Merged
xKeCo merged 2 commits intomasterfrom
staging
Mar 16, 2026
Merged

♻️ Refactor(current-result.service): Update readOnly logic to include additional status check#653
xKeCo merged 2 commits intomasterfrom
staging

Conversation

@xKeCo
Copy link
Copy Markdown
Member

@xKeCo xKeCo commented Mar 13, 2026

No description provided.

@xKeCo xKeCo self-assigned this Mar 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

@xKeCo xKeCo requested a review from yecksin March 16, 2026 12:37
Copy link
Copy Markdown
Contributor

@yecksin yecksin left a comment

Choose a reason for hiding this comment

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

@xKeCo

Review Notes

Overall, this is a clean, low-risk change — CI passes, SonarQube is green, and the intent is clear from reading the code. Just a few suggestions that could improve clarity and maintainability:

1. PR description

It would be helpful to add a brief description in the PR body explaining the business context — e.g., why "Approved" (status 6) results should now be editable. This makes it easier for reviewers (and future devs reading git history) to understand the reasoning behind the change.

2. Jira ticket reference

Consider linking a Jira ticket (P2-XXXX) in the commit message or PR title. This helps with traceability when looking back at changes later.

3. Test coverage for status_id == 6

The existing spec file (current-result.service.spec.ts) has tests for status_id == 1 (editable) and status_id == 2 (readOnly), but there's no test covering the new status_id == 6 scenario. Adding one would help document the expected behavior and prevent regressions.

4. Magic numbers

The values 1 and 6 are used directly in the condition. This is a pre-existing pattern, but as more status IDs get added to this logic, it might be worth considering extracting them into named constants (e.g., ResultStatus.Editing, ResultStatus.Approved) for readability. Just something to keep in mind for the future.


None of these are blockers — just ideas to consider for improving maintainability going forward. 👍

Copy link
Copy Markdown
Contributor

@yecksin yecksin left a comment

Choose a reason for hiding this comment

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

Looks good — small, focused change with all CI checks passing. Left some suggestions for future improvements but nothing blocking. ✅

@xKeCo xKeCo merged commit fc6128b into master Mar 16, 2026
11 checks passed
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.

2 participants