feat(desfile): associate tickets menu with desfile tenant and add migration test
This commit is contained in:
@@ -8,9 +8,17 @@ class AdminAppTicketColumnService
|
||||
{
|
||||
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
||||
|
||||
private const DESFILE_PURA_TENDENCIA = 'desfile_pura_tendencia';
|
||||
|
||||
public function __construct(private readonly AdminAppTicketAttributeService $attributeService) {}
|
||||
|
||||
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string, excel_width: int}> */
|
||||
public function columns(Tenant $tenant): array
|
||||
{
|
||||
if ($tenant->codigo === self::DESFILE_PURA_TENDENCIA) {
|
||||
return $this->desfileColumns($tenant);
|
||||
}
|
||||
|
||||
$keys = $tenant->codigo === self::FIESTA_FUTBOL_INFANTIL
|
||||
? ['order_number', 'category', 'product', 'type', 'date', 'size', 'amount', 'client', 'id', 'status', 'scanned_by']
|
||||
: ['order_number', 'product', 'amount', 'client', 'id', 'status', 'scanned_by'];
|
||||
@@ -45,6 +53,31 @@ class AdminAppTicketColumnService
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string, excel_width: int}> */
|
||||
private function desfileColumns(Tenant $tenant): array
|
||||
{
|
||||
$attributeColumns = array_map(fn (array $attribute): array => [
|
||||
'key' => $attribute['code'],
|
||||
'label' => $attribute['label'],
|
||||
'type' => 'text',
|
||||
'sortable' => false,
|
||||
'sort_param' => $attribute['code'],
|
||||
'width' => '8%',
|
||||
'excel_width' => 15,
|
||||
], $this->attributeService->attributes($tenant));
|
||||
|
||||
return [
|
||||
$this->definitions()['order_number'],
|
||||
$this->definitions()['product'],
|
||||
...$attributeColumns,
|
||||
$this->definitions()['amount'],
|
||||
$this->definitions()['client'],
|
||||
$this->definitions()['id'],
|
||||
$this->definitions()['status'],
|
||||
$this->definitions()['scanned_by'],
|
||||
];
|
||||
}
|
||||
|
||||
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string}> */
|
||||
public function publicColumns(Tenant $tenant): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user