Files
ladill-queue/app/Services/Qms/Industry/IndustryPackageRegistry.php
T
isaaccladandCursor a4d8775a82
Deploy Ladill Queue / deploy (push) Successful in 1m39s
Add industry packages that provision workflow stages on onboarding.
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>
2026-07-17 18:00:31 +00:00

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';
}
}