fix apply the plan docs/alrahma_api_fix_plan_school_year_only_v7
API CI/CD / Validate (composer + pint) (push) Successful in 3m10s
API CI/CD / Test (PHPUnit) (push) Failing after 6m49s
API CI/CD / Build frontend assets (push) Successful in 1m3s
API CI/CD / Security audit (push) Failing after 1m0s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-07 01:52:29 -04:00
parent 58726ee0e9
commit 031e499819
35 changed files with 5633 additions and 182 deletions
@@ -99,7 +99,7 @@ class StaffControllerTest extends TestCase
'school_year' => '2025-2026',
]);
$response = $this->patchJson('/api/v1/staff/'.$staff->id, [
$response = $this->patchJson('/api/v1/staff/'.$staff->id.'?school_year=2025-2026', [
'firstname' => 'Updated',
]);
@@ -127,7 +127,7 @@ class StaffControllerTest extends TestCase
'school_year' => '2025-2026',
]);
$response = $this->deleteJson('/api/v1/staff/'.$staff->id);
$response = $this->deleteJson('/api/v1/staff/'.$staff->id.'?school_year=2025-2026');
$response->assertOk();
$this->assertDatabaseMissing('staff', [
@@ -137,6 +137,18 @@ class StaffControllerTest extends TestCase
private function createUser(string $roleName, ?string $email = null): User
{
DB::table('school_years')->updateOrInsert(
['name' => '2025-2026'],
[
'start_date' => '2025-09-01',
'end_date' => '2026-06-30',
'status' => 'active',
'is_current' => 1,
'updated_at' => now(),
'created_at' => now(),
],
);
$roleId = DB::table('roles')->insertGetId([
'name' => $roleName,
'priority' => 1,
@@ -154,6 +166,8 @@ class StaffControllerTest extends TestCase
'zip' => '12345',
'accept_school_policy' => 1,
'status' => 'Active',
'is_verified' => 1,
'is_suspended' => 0,
'password' => bcrypt('secret'),
'semester' => 'Fall',
'school_year' => '2025-2026',