Files
ladill-care/app/Services/Care/CareQueueContexts.php
T
isaaccladandCursor 015a4cc7fe
Deploy Ladill Care / deploy (push) Successful in 1m45s
Wire Care lists into Ladill Queue workflows instead of reception panels.
When Queue integration is on, role pages issue tickets into their own
department queues and drive Call next → Serve → Complete on the native
lists. Integration off leaves existing UI unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 16:27:48 +00:00

64 lines
1.8 KiB
PHP

<?php
namespace App\Services\Care;
/**
* Canonical Care → Ladill Queue department / specialty contexts.
*/
class CareQueueContexts
{
public const RECEPTION = 'reception';
public const CONSULTATION = 'consultation';
public const PHARMACY = 'pharmacy';
public const LABORATORY = 'laboratory';
public const BILLING = 'billing';
/**
* Core department queues provisioned for every branch when Queue integration is on.
*
* @return array<string, array{name: string, prefix: string}>
*/
public static function departments(): array
{
return [
self::RECEPTION => ['name' => 'Reception', 'prefix' => 'R'],
self::CONSULTATION => ['name' => 'Consultation', 'prefix' => 'C'],
self::PHARMACY => ['name' => 'Pharmacy', 'prefix' => 'P'],
self::LABORATORY => ['name' => 'Laboratory', 'prefix' => 'L'],
self::BILLING => ['name' => 'Billing', 'prefix' => 'B'],
];
}
public static function isDepartment(string $context): bool
{
return array_key_exists($context, self::departments());
}
public static function isSpecialty(string $context): bool
{
return array_key_exists($context, config('care.specialty_modules', []));
}
public static function queueExternalKey(string $context, int|string $careBranchId): string
{
if (self::isSpecialty($context)) {
return "care:specialty:{$context}:queue:{$careBranchId}";
}
return "care:dept:{$context}:queue:{$careBranchId}";
}
public static function counterExternalKey(string $context, int|string $careBranchId): string
{
if (self::isSpecialty($context)) {
return "care:specialty:{$context}:counter:{$careBranchId}";
}
return "care:dept:{$context}:counter:{$careBranchId}";
}
}