This commit is contained in:
2025-04-07 12:16:11 +01:00
parent ce8b201a1c
commit e15a80163b
62 changed files with 149 additions and 131 deletions

View File

@@ -11,4 +11,4 @@ trait Arrayable
return array_combine($names, $values);
}
}
}

View File

@@ -7,10 +7,10 @@ use App\Enums\Concerns\Arrayable;
enum DeploymentStatus: string
{
use Arrayable;
case PENDING = 'pending';
case IN_PROGRESS = 'in-progress';
case COMPLETED = 'completed';
case CANCELLED = 'canceled';
case FAILED = 'failed';
}
}

View File

@@ -12,4 +12,4 @@ enum FirewallRuleStatus: string
case INSTALLED = 'installed';
case FAILED = 'failed';
case REMOVED = 'removed';
}
}

View File

@@ -6,4 +6,4 @@ enum FirewallRuleType: string
{
case ALLOW = 'allow';
case DENY = 'deny';
}
}

View File

@@ -7,7 +7,7 @@ use App\Enums\Concerns\Arrayable;
enum NetworkType: string
{
use Arrayable;
case EXTERNAL = 'external'; // managed by provider
case INTERNAL = 'internal'; // managed by keystone
}
}

View File

@@ -9,4 +9,4 @@ enum RepositoryType: string
use Arrayable;
case GIT = 'git';
}
}

View File

@@ -7,7 +7,7 @@ use App\Enums\Concerns\Arrayable;
enum ServerStatus: string
{
use Arrayable;
case WAITING_FOR_PROVIDER = 'waiting-for-provider';
case PROVIDER_TIMEOUT = 'provider-timeout';
case UNPROVISIONED = 'unprovisioned';

View File

@@ -7,20 +7,22 @@ use App\Enums\Concerns\Arrayable;
enum ServiceCategory: string
{
use Arrayable;
case DATABASE = 'database';
case APPLICATION = 'application';
case GATEWAY = 'gateway';
case STORAGE = 'storage';
case CACHE = 'cache';
public static function getDescription(ServiceCategory|string $category) {
public static function getDescription(ServiceCategory|string $category)
{
if (is_string($category)) {
$category = ServiceCategory::from($category);
}
if (! $category instanceof ServiceCategory) {
throw new \InvalidArgumentException('Invalid category provided');
}
return match ($category) {
self::APPLICATION => 'The base container image for your application',
self::DATABASE => 'Postgres or MySQL',
@@ -29,4 +31,4 @@ enum ServiceCategory: string
self::CACHE => 'Redis, Memcached or similar',
};
}
}
}

View File

@@ -7,11 +7,11 @@ use App\Enums\Concerns\Arrayable;
enum ServiceStatus: string
{
use Arrayable;
case NOT_INSTALLED = 'not-installed';
case INSTALLING = 'installing';
case RUNNING = 'running';
case STOPPED = 'stopped';
case ERROR = 'error';
case UNKNOWN = 'unknown';
}
}

View File

@@ -4,7 +4,8 @@ namespace App\Enums;
use App\Enums\Concerns\Arrayable;
enum ServiceType: string {
enum ServiceType: string
{
use Arrayable;
case FRANKENPHP = 'frankenphp';