feat(issues): tipo/categoría de incidencia (defecto/seguridad/calidad/documentación/otro)

- Issue::TYPES + typeLabels() (ES) + accessors type_label/type_color; columna type
  (string, default 'other') + fillable.
- IssueForm: select "Tipo de incidencia" con validación/carga/guardado.
- IssueTable: columna Tipo (badge) + SelectFilter por tipo.
- IssueDetail: badge de tipo en la cabecera.
- Sync offline: issue.create/update aceptan type; bundle (mapIssue) lo incluye.

Tests: IssuesEnhancementsTest (create muestra el campo vía HTTP, edición persiste) +
MobileApiTest (create con type). Suite 61 passing (solo 2 pre-existentes sqlite).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-18 13:30:54 +02:00
parent 19e1f57983
commit 3d0f4d5cad
10 changed files with 114 additions and 2 deletions
+2 -1
View File
@@ -321,11 +321,12 @@ class MobileApiTest extends TestCase
$uuid = (string) Str::uuid();
$this->postJson('/api/v1/sync', ['operations' => [[
'entity' => 'issue', 'op' => 'create', 'uuid' => $uuid,
'data' => ['project_id' => $project->id, 'title' => 'Grieta', 'priority' => 'high'],
'data' => ['project_id' => $project->id, 'title' => 'Grieta', 'priority' => 'high', 'type' => 'safety'],
]]])->assertOk()->assertJsonPath('results.0.status', 'applied');
$issue = Issue::where('uuid', $uuid)->firstOrFail();
$this->assertEquals('open', $issue->status);
$this->assertEquals('safety', $issue->type);
// update (resolve) → resolved_at set
$this->postJson('/api/v1/sync', ['operations' => [[