From 1953b824dfa94d364d0cd83133d996b8301c5290 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 16:05:46 +0100 Subject: [PATCH 1/9] Remove obsolete invitation code jobs --- app/Jobs/InvitationCreateJob.php | 31 ------------------------------- app/Jobs/InvitationDeleteJob.php | 32 -------------------------------- 2 files changed, 63 deletions(-) delete mode 100644 app/Jobs/InvitationCreateJob.php delete mode 100644 app/Jobs/InvitationDeleteJob.php diff --git a/app/Jobs/InvitationCreateJob.php b/app/Jobs/InvitationCreateJob.php deleted file mode 100644 index 5ab4acc38..000000000 --- a/app/Jobs/InvitationCreateJob.php +++ /dev/null @@ -1,31 +0,0 @@ -code = strtolower($code); - } - - /** - * @return Invitation|null - */ - public function handle() { - $test = Invitation::where('code', $this->code)->first(); - if ($test) { - $this->fail( - new \RuntimeException('Invitation code already existed') - ); - - return; // safegaurd - } - - return Invitation::create([ - 'code' => $this->code, - ]); - } -} diff --git a/app/Jobs/InvitationDeleteJob.php b/app/Jobs/InvitationDeleteJob.php deleted file mode 100644 index 81619679f..000000000 --- a/app/Jobs/InvitationDeleteJob.php +++ /dev/null @@ -1,32 +0,0 @@ -code = strtolower($code); - } - - /** - * @return void - */ - public function handle() { - $invite = Invitation::where('code', $this->code)->first(); - if ($invite) { - $invite->delete(); - } else { - $this->fail( - new \RuntimeException('Invitation not found, so can\'t delete') - ); - - return; // safegaurd - } - } -} From f9c3fb6cadfb7b39eb15f0fbdffbfa7a35a1ed13 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 16:17:25 +0100 Subject: [PATCH 2/9] Remove invitation commands --- app/Console/Commands/Invitation/All.php | 25 ------------- app/Console/Commands/Invitation/Create.php | 30 ---------------- .../Commands/Invitation/CreateBulk.php | 36 ------------------- app/Console/Commands/Invitation/Delete.php | 24 ------------- 4 files changed, 115 deletions(-) delete mode 100644 app/Console/Commands/Invitation/All.php delete mode 100644 app/Console/Commands/Invitation/Create.php delete mode 100644 app/Console/Commands/Invitation/CreateBulk.php delete mode 100644 app/Console/Commands/Invitation/Delete.php diff --git a/app/Console/Commands/Invitation/All.php b/app/Console/Commands/Invitation/All.php deleted file mode 100644 index f9abe7b93..000000000 --- a/app/Console/Commands/Invitation/All.php +++ /dev/null @@ -1,25 +0,0 @@ -line($invitation->code); - } - - return 0; - } -} diff --git a/app/Console/Commands/Invitation/Create.php b/app/Console/Commands/Invitation/Create.php deleted file mode 100644 index cc09c2da6..000000000 --- a/app/Console/Commands/Invitation/Create.php +++ /dev/null @@ -1,30 +0,0 @@ -argument('code')); - $jobResult = (new InvitationCreateJob($code))->handle(); - - if ($jobResult) { - $this->line('Successfully created invitation: ' . $code); - } else { - $this->line('Failed to create invitation: ' . $code); - } - - return 0; - } -} diff --git a/app/Console/Commands/Invitation/CreateBulk.php b/app/Console/Commands/Invitation/CreateBulk.php deleted file mode 100644 index 0379c17a4..000000000 --- a/app/Console/Commands/Invitation/CreateBulk.php +++ /dev/null @@ -1,36 +0,0 @@ -argument('numCodes')); - $helper = new InviteHelper(); - - for ($i = 0; $i < $numCodes; $i++) { - $code = $helper->generate(); - $jobResult = (new InvitationCreateJob($code))->handle(); - - if ($jobResult) { - $this->line('Successfully created invitation: ' . $code); - } else { - $this->line('Failed to create invitation: ' . $code); - } - } - - return 0; - } -} diff --git a/app/Console/Commands/Invitation/Delete.php b/app/Console/Commands/Invitation/Delete.php deleted file mode 100644 index a115846dc..000000000 --- a/app/Console/Commands/Invitation/Delete.php +++ /dev/null @@ -1,24 +0,0 @@ -argument('code')); - (new InvitationDeleteJob($code))->handle(); - - return 0; - } -} From 90531d72de9a0532bf8bbd1094b601035bd6f563 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 16:52:01 +0100 Subject: [PATCH 3/9] Remove Invitation class --- app/Invitation.php | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 app/Invitation.php diff --git a/app/Invitation.php b/app/Invitation.php deleted file mode 100644 index 3e7c6f5a6..000000000 --- a/app/Invitation.php +++ /dev/null @@ -1,39 +0,0 @@ - Date: Fri, 6 Nov 2026 16:53:21 +0100 Subject: [PATCH 4/9] remove Inviation Command from Kernel --- app/Console/Kernel.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index cca1f77ab..b221cd888 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -71,8 +71,6 @@ protected function commands(): void { $this->load(__DIR__ . '/Commands/User'); $this->load(__DIR__ . '/Commands/Job'); $this->load(__DIR__ . '/Commands/Wiki'); - $this->load(__DIR__ . '/Commands/Invitation'); - require base_path('routes/console.php'); } } From c3a5e21f19324078782fc2396b565ed4e0522fbe Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 16:54:51 +0100 Subject: [PATCH 5/9] Remove Invitation factory --- database/factories/InvitationFactory.php | 26 ------------------------ 1 file changed, 26 deletions(-) delete mode 100644 database/factories/InvitationFactory.php diff --git a/database/factories/InvitationFactory.php b/database/factories/InvitationFactory.php deleted file mode 100644 index 4928f0ebf..000000000 --- a/database/factories/InvitationFactory.php +++ /dev/null @@ -1,26 +0,0 @@ - $this->faker->unique()->text(20), - ]; - } -} From 79b9f9a39ad5463ca3c7508cdc7492fb3737bc72 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 16:58:32 +0100 Subject: [PATCH 6/9] Remove Invitation seeder --- database/seeds/InvitationsSeeder.php | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 database/seeds/InvitationsSeeder.php diff --git a/database/seeds/InvitationsSeeder.php b/database/seeds/InvitationsSeeder.php deleted file mode 100644 index e80a37be2..000000000 --- a/database/seeds/InvitationsSeeder.php +++ /dev/null @@ -1,13 +0,0 @@ - 'invite1']); - Invitation::create(['code' => 'invite2']); - Invitation::create(['code' => 'invite3']); - Invitation::factory()->create(); - } -} From 6b0a7f981d06381432270845880ee346cbc1f592 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 17:00:39 +0100 Subject: [PATCH 7/9] remove invitation doc --- docs/invitation-codes.md | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 docs/invitation-codes.md diff --git a/docs/invitation-codes.md b/docs/invitation-codes.md deleted file mode 100644 index cec356073..000000000 --- a/docs/invitation-codes.md +++ /dev/null @@ -1,24 +0,0 @@ -In order to create an account, you will need to `exec` into an api container and create an invitation code with the `artisan` command. - -To create the invite code `invite1`, use the following command: -``` -php artisan wbs-invitation:create invite1 -``` -You should see the output `Successfully created invitation: invite1` - -You can view all invitation codes that have been created (and not used) with: -``` -php artisan wbs-invitation:all -``` - -And delete (unused) invitation codes with: - -``` -php artisan wbs-invitation:delete -``` - -Bulk create multiple random codes with: - -``` -php artisan wbs-invitation:create-bulk -``` From ccc2004307a046572c4961880816d71215563027 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 17:01:59 +0100 Subject: [PATCH 8/9] Remove invitation seader from DatabaseSeeder --- database/seeds/DatabaseSeeder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 625b49d94..4377e7c78 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -14,7 +14,6 @@ class DatabaseSeeder extends Seeder { public function run() { Model::unguard(); $this->call(UsersSeeder::class); - $this->call(InvitationsSeeder::class); $this->call(WikiDbsSeeder::class); $this->call(QueryserviceNamespacesSeeder::class); $this->call(WikisSeeder::class); From 1b1ef176d3b5d507f16963fa67099a4717f45139 Mon Sep 17 00:00:00 2001 From: Dat Date: Fri, 6 Nov 2026 17:04:16 +0100 Subject: [PATCH 9/9] remove invitation code creation from register test --- tests/Routes/User/RegisterTest.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/Routes/User/RegisterTest.php b/tests/Routes/User/RegisterTest.php index 34982dfdf..b7a6937f4 100644 --- a/tests/Routes/User/RegisterTest.php +++ b/tests/Routes/User/RegisterTest.php @@ -2,7 +2,6 @@ namespace Tests\Routes\User; -use App\Invitation; use App\Notifications\UserCreationNotification; use App\Rules\ReCaptchaValidation; use App\User; @@ -32,7 +31,6 @@ public function testCreateSuccess() { $this->mockReCaptchaValidation(); Notification::fake(); - $invite = Invitation::factory()->create(); $userToCreate = User::factory()->make(); $resp = $this->json('POST', $this->route, [ @@ -48,15 +46,11 @@ public function testCreateSuccess() { Notification::assertSentTo( [User::whereEmail($userToCreate->email)->first()], UserCreationNotification::class ); - - // SHIFT doesnt have missingFromDatabase - // ->missingFromDatabase('invitations', ['code' => $invite->code]); } public function testCreateEmailAlreadyTaken() { $this->mockReCaptchaValidation(); - $invite = Invitation::factory()->create(); $user = User::factory()->create(); $this->json('POST', $this->route, [ @@ -70,7 +64,6 @@ public function testCreateEmailAlreadyTaken() { public function testCreateNoToken() { $this->mockReCaptchaValidation(false); - $invite = Invitation::factory()->create(); $user = User::factory()->make(); $this->json('POST', $this->route, [ @@ -91,8 +84,6 @@ public function testCreateNoEmailOrPassword() { public function testCreateBadEmail() { $this->mockReCaptchaValidation(); - $invite = Invitation::factory()->create(); - $this->json('POST', $this->route, [ 'email' => 'notAnEmail', 'password' => 'anyPassword',