Seed Blood Bank demo inventory_note on open visits.
Deploy Ladill Care / deploy (push) Successful in 28s
Deploy Ladill Care / deploy (push) Successful in 28s
Pro/enterprise DemoTenantSeeder now upserts visit-scoped facility stock so the Inventory tab and reports show unit counts and a low-stock alert without manual entry. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,7 @@ use App\Models\InvestigationType;
|
||||
use App\Models\Organization;
|
||||
use App\Models\Patient;
|
||||
use App\Models\Prescription;
|
||||
use App\Models\SpecialtyClinicalRecord;
|
||||
use App\Models\User;
|
||||
use App\Services\Care\DemoTenantSeeder;
|
||||
use App\Services\Care\PlanService;
|
||||
@@ -120,6 +121,22 @@ class DemoSeedCommandTest extends TestCase
|
||||
"Expected waiting specialty appointments for [{$key}]"
|
||||
);
|
||||
}
|
||||
|
||||
$inventoryNotes = SpecialtyClinicalRecord::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->where('module_key', 'blood_bank')
|
||||
->where('record_type', 'inventory_note')
|
||||
->get();
|
||||
$this->assertGreaterThan(
|
||||
0,
|
||||
$inventoryNotes->count(),
|
||||
'Expected blood bank inventory_note records after pro demo seed'
|
||||
);
|
||||
$this->assertNotNull($inventoryNotes->first()?->payload['packed_rbc_units'] ?? null);
|
||||
$this->assertTrue(
|
||||
$inventoryNotes->contains(fn (SpecialtyClinicalRecord $r) => ! empty($r->payload['low_stock_alert'])),
|
||||
'Expected at least one low-stock inventory demo flag'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_free_demo_does_not_enable_specialty_modules(): void
|
||||
|
||||
Reference in New Issue
Block a user