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:
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Qms\Industry;
|
||||
|
||||
/**
|
||||
* Read-only view of a configured industry package.
|
||||
*
|
||||
* @phpstan-type StageDef array{
|
||||
* code: string,
|
||||
* department: string,
|
||||
* name: string,
|
||||
* prefix: string,
|
||||
* strategy?: string,
|
||||
* routing_mode?: string,
|
||||
* routing_strategy?: string,
|
||||
* optional?: bool,
|
||||
* service_points?: list<array{name: string, destination?: string, code?: string}>
|
||||
* }
|
||||
*/
|
||||
class IndustryPackage
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $definition
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $key,
|
||||
public readonly array $definition,
|
||||
) {}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return (string) ($this->definition['label'] ?? $this->key);
|
||||
}
|
||||
|
||||
public function description(): string
|
||||
{
|
||||
return (string) ($this->definition['description'] ?? '');
|
||||
}
|
||||
|
||||
public function ticketEntity(): string
|
||||
{
|
||||
return (string) ($this->definition['ticket_entity'] ?? 'customer');
|
||||
}
|
||||
|
||||
public function displayLayout(): string
|
||||
{
|
||||
return (string) ($this->definition['display_layout'] ?? 'standard');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function terminology(): array
|
||||
{
|
||||
return (array) ($this->definition['terminology'] ?? []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function announcement(): array
|
||||
{
|
||||
return (array) ($this->definition['announcement'] ?? []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function kpis(): array
|
||||
{
|
||||
return array_values((array) ($this->definition['kpis'] ?? []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{name: string, description?: string}
|
||||
*/
|
||||
public function workflowMeta(): array
|
||||
{
|
||||
return (array) ($this->definition['workflow'] ?? ['name' => $this->label().' workflow']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{code: string, name: string, type: string}>
|
||||
*/
|
||||
public function departments(): array
|
||||
{
|
||||
return array_values((array) ($this->definition['departments'] ?? []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<StageDef>
|
||||
*/
|
||||
public function stages(): array
|
||||
{
|
||||
return array_values((array) ($this->definition['stages'] ?? []));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function integrations(): array
|
||||
{
|
||||
return array_values((array) ($this->definition['integrations'] ?? []));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user