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.
Subject: Enhance Service Assignment with Tool Count
Added 'toolCount' field to ServiceAssignment model for better resource tracking, enforcing a minimum value of 0 to ensure data integrity. Updated the enum values within the ServiceAssignment Schema to more accurately reflect the types of jobsites, changing 'Contract Job' and 'Service Job' to 'Contract Jobsite' and 'Service Jobsite,' respectively. This change clarifies the nature of the assignments in the system. Service assignment fetch operation is now more performance-efficient by using
.lean()
with the query to speed up data retrieval, beneficial for large datasets. Furthermore, the 'toolCount' field is now displayed in the service assignments settings view, with a visual emphasis on counts greater than zero, improving the user interface for site administrators by allowing quick identification of resource allocations per assignment.This integration offers a detailed insight into the resource distribution across different service assignments, facilitating better planning and resource management.
Resolves: add toolCount to ServiceAssignment model and settings page. #187
This change is