Skip to content

Publish real-time updates using Socket IO#677

Merged
zeel-codder merged 38 commits intomainfrom
develop
Jul 7, 2025
Merged

Publish real-time updates using Socket IO#677
zeel-codder merged 38 commits intomainfrom
develop

Conversation

@Siddhantsingh1230
Copy link
Copy Markdown
Collaborator

Description

This PR refactors the update_weekly_status_of_timesheet utility and introduces several improvements across the system. Key changes include:

  • Weekly status is now calculated using a per-day, priority-based approach.
  • Problem addressed: Previously, weekly status was based on total timesheet count, which led to incorrect approvals when multiple timesheets existed for a single day.
  • New logic:
    • For each day, the highest priority status among all timesheets is considered.
    • The weekly status is then derived from the distribution of these daily statuses.

Additionally, the PR removes manual API-based syncing for timesheet updates and replaces it with a SocketIO-based real-time event system, allowing the PMS frontend to reflect changes instantly. It also exports DocType permissions for NextPMS and conditionally renders Business Unit fields on frontend pages.

Relevant Technical Choices

  • Refactors update_weekly_status_of_timesheet to derive weekly status based on highest-priority status per working day, preventing issues from multiple timesheets on the same day.

Testing Instructions

  • Go to NPMS
  • Add Timesheets
  • Send them for approval
  • Normal Workflow should not break

Additional Information:

Priority of status are as followed
Rejected > Approval Pending > Approved > Not Submitted

Screenshot/Screencast

Checklist

  • I have carefully reviewed the code before submitting it for review.
  • This code is adequately covered by unit tests to validate its functionality.
  • I have conducted thorough testing to ensure it functions as intended.
  • A member of the QA team has reviewed and tested this PR (To be checked by QA or code reviewer)

niraj2477 and others added 30 commits June 23, 2025 18:10
…-updates

Update logic to update Weekly Status based on per day-priority status
Publish timesheet updates via socket IO
Add option to fetch data based on employee ids
Conditionally render BU field
@niraj2477 niraj2477 changed the title Refactor Timesheet Status Logic and Publish Real-Time Updates using Socket IO Publish real-time updates using Socket IO Jul 7, 2025
@zeel-codder zeel-codder merged commit 49cb951 into main Jul 7, 2025
8 of 9 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.

4 participants