feat(forms): add PHP enums for form builder
9 backed string enums covering purpose, field type, submission status/mode/review, field width, value storage hint, snapshot mode, webhook delivery status. FormPurpose/FormFieldType include helper methods per ARCH §3/§5. All with declare(strict_types=1) and values() helpers for validation rules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
api/app/Enums/FormBuilder/FormWebhookDeliveryStatus.php
Normal file
21
api/app/Enums/FormBuilder/FormWebhookDeliveryStatus.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Enums\FormBuilder;
|
||||
|
||||
enum FormWebhookDeliveryStatus: string
|
||||
{
|
||||
case PENDING = 'pending';
|
||||
case DELIVERED = 'delivered';
|
||||
case FAILED = 'failed';
|
||||
case DEAD_LETTER = 'dead_letter';
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_map(fn (self $case): string => $case->value, self::cases());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user