feat(api): sincronizar tipo de elemento y activo/inactivo en la app móvil
- bundle: mapFeature incluye feature_type_id e is_active; nuevo array feature_types (catálogo) para que el móvil resuelva nombres/colores. - /sync feature.update acepta is_active y feature_type_id (last-write-wins). - openapi.yaml: bundle documenta feature_types. Tests: MobileApiTest cubre feature.update con los nuevos campos + bundle. Suite 88 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -368,10 +368,12 @@ class SyncController extends Controller
|
||||
private function featureUpdate(User $user, string $uuid, array $op): array
|
||||
{
|
||||
$v = Validator::make($op['data'], [
|
||||
'id' => ['required', 'integer', 'exists:features,id'],
|
||||
'status' => ['nullable', 'string'],
|
||||
'progress' => ['nullable', 'integer', 'min:0', 'max:100'],
|
||||
'responsible' => ['nullable', 'string'],
|
||||
'id' => ['required', 'integer', 'exists:features,id'],
|
||||
'status' => ['nullable', 'string'],
|
||||
'progress' => ['nullable', 'integer', 'min:0', 'max:100'],
|
||||
'responsible' => ['nullable', 'string'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
'feature_type_id' => ['nullable', 'integer', 'exists:feature_types,id'],
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
return $this->error($uuid, 'validation: ' . $v->errors()->first());
|
||||
|
||||
Reference in New Issue
Block a user