refactor(backend): reorganize domains into Core, Commerce, Ticketing and Shared
This commit is contained in:
24
app/Shared/Forms/Services/SaleFormService.php
Normal file
24
app/Shared/Forms/Services/SaleFormService.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Forms\Services;
|
||||
|
||||
use App\Domains\Purchase\Models\Purchase;
|
||||
|
||||
class SaleFormService
|
||||
{
|
||||
/** @return array{statuses: list<array{value: string, label: string, real_statuses: list<string>}>} */
|
||||
public function get(): array
|
||||
{
|
||||
return [
|
||||
'statuses' => array_map(
|
||||
fn (string $code, array $definition): array => [
|
||||
'value' => $code,
|
||||
'label' => $definition['name'],
|
||||
'real_statuses' => $definition['statuses'],
|
||||
],
|
||||
array_keys(Purchase::adminStatuses()),
|
||||
array_values(Purchase::adminStatuses()),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user