-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Opt into search placed candidates backend #12330
[Feature] Opt into search placed candidates backend #12330
Conversation
// asserts placed term/indeterminate candidates can appear in this query, can't check by id though so check that 2 out of 3 appear | ||
public function testPlacedSuspendedNotSuspendedCandidates() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supplemented by testScopeAvailable()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work. π Mostly, I'm just asking for more comments. π A few things to check out but this is great work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Appears to populate the activity log. All good to go then? |
Make it so. |
Could you please also try running the Eloquent command in Tinker, locally? |
Ah, too bad. Are you able to provide the commands that we can copy/paste for prod? |
Going back to the facade seems to do the trick
|
I dont' think it's necessary to go back to the DB facade. You can use use App\Enums\PoolCandidateStatus;
use App\Models\PoolCandidate;
use Illuminate\Database\Eloquent\Collection;
use Carbon\Carbon;
$applicableStatuses = [PoolCandidateStatus::PLACED_TERM->name, PoolCandidateStatus::PLACED_INDETERMINATE->name];
PoolCandidate::whereIn('pool_candidate_status', $applicableStatuses) \
->whereNull('suspended_at') \
->with('user') \
->chunkById(100, function (Collection $candidates) { \
foreach ($candidates as $candidate) { \
$candidate->suspended_at = Carbon::now(); \
$candidate->save(); \
} \
} \
); |
I guess we've got what we need then |
π€ Resolves #12212
π Introduction
Handles some of the backend work needed as well as introduces an Artisan command.
π΅οΈ Details
The command will update placed term and indeterminate candidates to have suspended dates.
Placement mutations will touch the suspended date field, and search accounts for the two statuses as well.
Issue to delete command #12331
π§ͺ Testing
/en/search
π Deployment
Run
php artisan app:suspend-placed-candidates