pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
307 stars 447 forks source link

Port UserGroup to Use Eloquent Model #10506

Open Hafsa-Naeem opened 1 month ago

Hafsa-Naeem commented 1 month ago

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.

Hafsa-Naeem commented 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

Hafsa-Naeem commented 4 weeks ago

@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

Hafsa-Naeem commented 15 hours ago

@Vitaliy-1 Ready for review again pkp-lib pkp/pkp-lib#10506 Refactor UserGroup to use Eloquent #10519