Separate unit placements from shift duty assignments.
Deploy Ladill Care / deploy (push) Successful in 30s

Roster no longer writes temporary staff assignments; unit assignment UI drops shift fields and labels clarify the two workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 11:49:18 +00:00
co-authored by Cursor
parent 5125a6fe27
commit b7aca6ee2b
15 changed files with 68 additions and 101 deletions
@@ -110,7 +110,7 @@ class CareRosterAndNursingServicesTest extends TestCase
$this->assertSame(3, Shift::query()->where('organization_id', $this->organization->id)->count());
}
public function test_roster_assign_links_temporary_staff_assignment(): void
public function test_roster_assign_does_not_create_unit_assignment(): void
{
$roster = app(RosterService::class);
$shifts = $roster->ensureDefaultShifts($this->organization, $this->owner->public_id);
@@ -128,15 +128,11 @@ class CareRosterAndNursingServicesTest extends TestCase
$entry = RosterEntry::query()->first();
$this->assertNotNull($entry);
$this->assertSame(RosterEntry::STATUS_SCHEDULED, $entry->status);
$this->assertNotNull($entry->staff_assignment_id);
$assignment = StaffAssignment::query()->find($entry->staff_assignment_id);
$this->assertSame('temporary', $assignment->kind);
$this->assertSame('day', $assignment->shift_code);
$this->assertSame((int) $this->unit->id, (int) $assignment->care_unit_id);
$this->assertNull($entry->staff_assignment_id);
$this->assertSame(0, StaffAssignment::query()->count());
}
public function test_roster_cancel_ends_assignment_and_allows_reassign(): void
public function test_roster_cancel_allows_reassign(): void
{
$roster = app(RosterService::class);
$shifts = $roster->ensureDefaultShifts($this->organization, $this->owner->public_id);
@@ -157,10 +153,7 @@ class CareRosterAndNursingServicesTest extends TestCase
->assertRedirect();
$this->assertSoftDeleted('care_roster_entries', ['id' => $entry->id]);
$this->assertDatabaseHas('care_staff_assignments', [
'id' => $entry->staff_assignment_id,
'status' => 'ended',
]);
$this->assertSame(0, StaffAssignment::query()->count());
$this->actingAs($this->owner)
->post(route('care.care-units.roster.store', $this->unit), [
@@ -194,7 +187,7 @@ class CareRosterAndNursingServicesTest extends TestCase
$this->actingAs($this->owner)
->get(route('care.care-units.roster', $this->unit))
->assertOk()
->assertSee('Week roster')
->assertSee('Shift assignments')
->assertSee('Day shift');
}
}
+3 -3
View File
@@ -176,7 +176,6 @@ class CareStaffManagementTest extends TestCase
'care_unit_id' => $floatPool->id,
'kind' => 'primary',
'assignment_role' => 'float_nurse',
'shift_code' => 'rotating',
'starts_on' => now()->toDateString(),
'status' => 'active',
])
@@ -189,7 +188,6 @@ class CareStaffManagementTest extends TestCase
'care_unit_id' => $labour->id,
'kind' => 'temporary',
'assignment_role' => 'midwife',
'shift_code' => 'night',
'starts_on' => now()->toDateString(),
'ends_on' => now()->toDateString(),
'status' => 'active',
@@ -209,8 +207,10 @@ class CareStaffManagementTest extends TestCase
$this->actingAs($this->owner)
->get(route('care.staff-assignments.index'))
->assertOk()
->assertSee('Unit assignments')
->assertSee('Float Pool')
->assertSee('Labour Ward');
->assertSee('Labour Ward')
->assertDontSee('>Shift<', false);
}
public function test_temporary_assignment_requires_unit(): void