Mirrors the frontend catch-up in 570f17e: a substantial amount of
finished-but-never-committed backend work had accumulated locally.
- New CustomField module: admin-managed field definitions per client,
reorderable, typed values stored per client (backing the frontend's
ClientCustomFieldCard + settings/fields page)
- History entries switch from a hardcoded type enum to a dynamic,
admin-managed HistoryType module (reorderable, backing
settings/history-types)
- New Import module: CSV client import (backing settings/import)
- Clients table gains soft deletes (deleted_at)
- Supporting factories, seeders, policies, and feature tests for all
of the above
All 63 backend tests pass locally before this commit.
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\CustomField\DTOs;
|
|
|
|
use App\Modules\CustomField\Requests\CreateCustomFieldDefinitionRequest;
|
|
use App\Modules\CustomField\Requests\UpdateCustomFieldDefinitionRequest;
|
|
|
|
final class CustomFieldDefinitionData
|
|
{
|
|
public function __construct(
|
|
public readonly ?string $label,
|
|
public readonly ?string $type,
|
|
public readonly ?array $options,
|
|
public readonly bool $isRequired,
|
|
) {}
|
|
|
|
public static function fromCreateRequest(CreateCustomFieldDefinitionRequest $request): self
|
|
{
|
|
return new self(
|
|
label: $request->validated('label'),
|
|
type: $request->validated('type'),
|
|
options: $request->validated('options'),
|
|
isRequired: (bool) $request->validated('is_required', false),
|
|
);
|
|
}
|
|
|
|
public static function fromUpdateRequest(UpdateCustomFieldDefinitionRequest $request): self
|
|
{
|
|
return new self(
|
|
label: $request->validated('label'),
|
|
type: $request->validated('type'),
|
|
options: $request->validated('options'),
|
|
isRequired: (bool) $request->validated('is_required', false),
|
|
);
|
|
}
|
|
}
|