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>
61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Qms\Industry;
|
|
|
|
class IndustryPackageRegistry
|
|
{
|
|
/**
|
|
* @return array<string, string> key => label
|
|
*/
|
|
public function labels(): array
|
|
{
|
|
$labels = [];
|
|
foreach (array_keys(config('industry_packages.packages', [])) as $key) {
|
|
$package = $this->get($key);
|
|
if ($package) {
|
|
$labels[$key] = $package->label();
|
|
}
|
|
}
|
|
|
|
return $labels;
|
|
}
|
|
|
|
public function get(string $key): ?IndustryPackage
|
|
{
|
|
$definition = config("industry_packages.packages.{$key}");
|
|
if (! is_array($definition)) {
|
|
return null;
|
|
}
|
|
|
|
return new IndustryPackage($key, $definition);
|
|
}
|
|
|
|
public function has(string $key): bool
|
|
{
|
|
return $this->get($key) !== null;
|
|
}
|
|
|
|
/**
|
|
* @return list<IndustryPackage>
|
|
*/
|
|
public function all(): array
|
|
{
|
|
$packages = [];
|
|
foreach (array_keys(config('industry_packages.packages', [])) as $key) {
|
|
$package = $this->get($key);
|
|
if ($package) {
|
|
$packages[] = $package;
|
|
}
|
|
}
|
|
|
|
return $packages;
|
|
}
|
|
|
|
public function resolveKey(?string $key): string
|
|
{
|
|
$key = $key ?: 'custom';
|
|
|
|
return $this->has($key) ? $key : 'custom';
|
|
}
|
|
}
|