feat(tickets): define tenant-specific table columns
This commit is contained in:
@@ -56,6 +56,7 @@ class AdminAppTicketFilterFormControllerTest extends TestCase
|
||||
'code' => 'tickets_filter',
|
||||
'action' => '/api/v1/adminapp/tenant/tickets',
|
||||
'method' => 'GET',
|
||||
'columns' => $this->commonColumns(),
|
||||
'fields' => [
|
||||
[
|
||||
'name' => 'date',
|
||||
@@ -104,7 +105,11 @@ class AdminAppTicketFilterFormControllerTest extends TestCase
|
||||
->assertJsonPath('data.fields.3.name', 'date')
|
||||
->assertJsonPath('data.fields.3.query_param', 'date')
|
||||
->assertJsonPath('data.fields.4.name', 'status')
|
||||
->assertJsonPath('data.fields.4.query_param', 'status');
|
||||
->assertJsonPath('data.fields.4.query_param', 'status')
|
||||
->assertJsonPath('data.columns.0.key', 'order_number')
|
||||
->assertJsonPath('data.columns.1.key', 'category')
|
||||
->assertJsonPath('data.columns.2.key', 'product')
|
||||
->assertJsonPath('data.columns.3.key', 'type');
|
||||
|
||||
$categories = collect($response->json('data.fields.0.options'));
|
||||
$this->assertSame(
|
||||
@@ -232,6 +237,21 @@ class AdminAppTicketFilterFormControllerTest extends TestCase
|
||||
return $tenant->refresh();
|
||||
}
|
||||
|
||||
/** @return list<array<string, mixed>> */
|
||||
private function commonColumns(): array
|
||||
{
|
||||
return [
|
||||
['key' => 'order_number', 'label' => 'N° de orden', 'type' => 'order_number', 'sortable' => true, 'width' => '11%'],
|
||||
['key' => 'product', 'label' => 'Producto', 'type' => 'text', 'sortable' => true, 'width' => '15%'],
|
||||
['key' => 'amount', 'label' => 'Importe', 'type' => 'currency', 'sortable' => true, 'width' => '10%'],
|
||||
['key' => 'client', 'label' => 'Cliente', 'type' => 'text', 'sortable' => true, 'width' => '15%'],
|
||||
['key' => 'ticket', 'label' => 'ID', 'type' => 'text', 'sortable' => true, 'width' => '19%'],
|
||||
['key' => 'date', 'label' => 'Fecha', 'type' => 'date', 'sortable' => true, 'width' => '11%'],
|
||||
['key' => 'status', 'label' => 'Estado', 'type' => 'status', 'sortable' => true, 'width' => '8%'],
|
||||
['key' => 'scanned_by', 'label' => 'Escaneado por', 'type' => 'text', 'sortable' => true, 'width' => '11%'],
|
||||
];
|
||||
}
|
||||
|
||||
private function createTenant(string $code): Tenant
|
||||
{
|
||||
$headerLogo = $this->createAttachment("{$code}-header.png");
|
||||
|
||||
Reference in New Issue
Block a user