Add industry packages that provision workflow stages on onboarding.
Deploy Ladill Queue / deploy (push) Successful in 1m39s
Deploy Ladill Queue / deploy (push) Successful in 1m39s
Queue Core stays generic; selecting Healthcare, Banking, Restaurant, and other industries installs departments, stages (queues), service points, workflows, terminology, and announcement profiles without code changes per vertical. Care-linked orgs skip stage materialization so Care remains the clinical provisioner. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ class VoiceAnnouncementService
|
||||
public function announceCalled(Ticket $ticket, Counter $counter, ?string $locale = null): VoiceAnnouncement
|
||||
{
|
||||
$locale ??= data_get($ticket->serviceQueue?->settings, 'announcement_locale', 'en');
|
||||
$ticket->loadMissing(['organization', 'serviceQueue']);
|
||||
$message = $this->buildMessage($ticket, $counter, $locale);
|
||||
|
||||
return VoiceAnnouncement::create([
|
||||
@@ -29,27 +30,37 @@ class VoiceAnnouncementService
|
||||
|
||||
protected function buildMessage(Ticket $ticket, Counter $counter, string $locale): string
|
||||
{
|
||||
$templates = config('qms.announcement_templates');
|
||||
$template = $templates[$locale] ?? $templates['en'];
|
||||
$destination = $counter->displayDestination();
|
||||
$staff = trim((string) ($counter->staff_display_name ?? ''));
|
||||
$queueName = trim((string) ($ticket->serviceQueue?->name ?? ''));
|
||||
|
||||
// Prefer rich healthcare-style copy when staff is known:
|
||||
// "A005, Dr. Mensah, Consultation Room 4."
|
||||
if ($staff !== '') {
|
||||
$parts = array_values(array_filter([
|
||||
$ticket->ticket_number,
|
||||
$staff,
|
||||
$queueName !== '' ? $queueName.' '.$destination : $destination,
|
||||
]));
|
||||
$industryAnnouncement = (array) data_get($ticket->organization?->settings, 'industry_package.announcement', []);
|
||||
$global = config('qms.announcement_templates', []);
|
||||
|
||||
return implode(', ', $parts).'.';
|
||||
if ($staff !== '') {
|
||||
$richDestination = $queueName !== '' && ! str_contains(strtolower($destination), strtolower($queueName))
|
||||
? trim($queueName.' '.$destination)
|
||||
: $destination;
|
||||
$template = $industryAnnouncement['with_staff']
|
||||
?? $global['with_staff']
|
||||
?? ':ticket, :staff, :destination.';
|
||||
|
||||
return rtrim(str_replace(
|
||||
[':ticket', ':staff', ':destination', ':counter'],
|
||||
[$ticket->ticket_number, $staff, $richDestination, $richDestination],
|
||||
$template,
|
||||
), '.').'.';
|
||||
}
|
||||
|
||||
$template = $industryAnnouncement[$locale]
|
||||
?? $industryAnnouncement['en']
|
||||
?? $global[$locale]
|
||||
?? $global['en']
|
||||
?? 'Ticket :ticket, please proceed to :destination.';
|
||||
|
||||
return str_replace(
|
||||
[':ticket', ':counter'],
|
||||
[$ticket->ticket_number, $destination],
|
||||
[':ticket', ':destination', ':counter'],
|
||||
[$ticket->ticket_number, $destination, $destination],
|
||||
$template,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user