Open Hafsa-Naeem opened 1 month ago
@Vitaliy-1 I've submitted a draft PR as discussed in the meeting. Could you please review it and share your feedback so I continue with the commits for usage and migrations? pkp/pkp-lib pkp/pkp-lib#10506 Refactor UserGroup to use Eloquent #10519
@Vitaliy-1 I've made changes according to our discussion in the meeting and also updated usage part. pkp/pkp-lib pkp/pkp-lib#10506 Refactor UserGroup to use Eloquent #10519
@Vitaliy-1 Ready for review again pkp-lib pkp/pkp-lib#10506 Refactor UserGroup to use Eloquent #10519
Issue Description
The current implementation of the UserGroup does not utilize Eloquent. This limitation makes it hard to manage relationships, run complex queries efficiently and perform eager loading, especially when adding new fields to the Submission API (Issue #10480)
Proposed Solution
Refactor
UserGroup
class to use Eloquent Model and define appropriate Eloquent relationships. This will enable the use of eager loading(StageAssignment::with('userGroup'))
to optimize data retrieval, reduce the number of database queries, and ensure accurate computation of the additional fields required for the Submission API.