docs(mobile): actualizar API v1.1 (templates globales+pivot, feature_types, issues enriquecidas)
- openapi.yaml: bumped a 1.1.0, añadido changelog con los cambios acumulados respecto al brief inicial; /templates y bundle.templates documentan que ahora usan pivot (asignación por proyecto); enums de issue documentados. - MOBILE_APP_BRIEF.md: reescrito para reflejar v1.1 — bundle con feature_types / issue_tasks / issue_comments; feature con feature_type_id/is_active; issue.type; nuevas ops (issue.update, issue_task.*, issue_comment.create); parent_entity admite issue_task/issue_comment; deleted incluye tasks/comments; y bloque detallado sobre templates ahora globales con fields[].group/question/help. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+59
-7
@@ -1,11 +1,37 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: ConstruProgress Mobile API
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
description: >
|
||||
Offline-first sync API for the mobile app. Auth via Laravel Sanctum bearer
|
||||
tokens (ability `mobile-sync`). All protected endpoints require
|
||||
`Authorization: Bearer <token>`. See docs/MOBILE_SYNC_PROTOCOL.md.
|
||||
|
||||
|
||||
## Changelog (from v1.0)
|
||||
|
||||
|
||||
- Inspection templates are now **global** and assigned to projects via
|
||||
pivot. `bundle.templates` and `/templates` return templates *assigned* to
|
||||
the accessible projects (no longer filtered by `project_id`).
|
||||
`template.phase_id` was **removed**. `project_id` remains in the schema
|
||||
for compatibility but no longer determines visibility.
|
||||
|
||||
- Template `fields[]` items may include `group` (section), `question` (short
|
||||
prompt shown at inspection time) and `help` (long help text).
|
||||
|
||||
- New entities in the bundle: `feature_types` (global catalogue),
|
||||
`issue_tasks`, `issue_comments`.
|
||||
|
||||
- `feature` gains `feature_type_id`, `is_active`; `issue` gains `type`.
|
||||
|
||||
- New `/sync` ops: `issue.update`, `issue_task.create`, `issue_task.update`,
|
||||
`issue_comment.create`. `feature.update` accepts `is_active` and
|
||||
`feature_type_id`; `issue.create`/`update` accept `type`.
|
||||
|
||||
- `POST /media` `parent_entity` also accepts `issue_task` and `issue_comment`.
|
||||
|
||||
- `deleted` tombstones include `issue_tasks` and `issue_comments`.
|
||||
servers:
|
||||
- url: /api/v1
|
||||
security:
|
||||
@@ -85,7 +111,12 @@ paths:
|
||||
"403": { description: Not a member of the project }
|
||||
/templates:
|
||||
get:
|
||||
summary: Inspection templates for accessible projects (with version/hash)
|
||||
summary: Global inspection templates ASSIGNED to any accessible project (via pivot)
|
||||
description: >
|
||||
Templates are a global catalogue. This endpoint returns the templates
|
||||
that have been *assigned* (via `inspection_template_project` pivot) to
|
||||
any of the user's accessible projects. Each item includes `version`
|
||||
(updated_at timestamp) and `hash` for change detection.
|
||||
parameters:
|
||||
- name: since
|
||||
in: query
|
||||
@@ -183,12 +214,33 @@ components:
|
||||
phases: { type: array, items: { type: object } }
|
||||
layers: { type: array, items: { type: object } }
|
||||
features: { type: array, items: { type: object } }
|
||||
feature_types: { type: array, items: { type: object } }
|
||||
feature_types:
|
||||
type: array
|
||||
description: Global catalogue of feature types (id, name, color)
|
||||
items: { type: object }
|
||||
inspections: { type: array, items: { type: object } }
|
||||
issues: { type: array, items: { type: object } }
|
||||
issue_tasks: { type: array, items: { type: object } }
|
||||
issue_comments: { type: array, items: { type: object } }
|
||||
templates: { type: array, items: { type: object } }
|
||||
issues:
|
||||
type: array
|
||||
description: >
|
||||
Includes `type` (defect|safety|quality|documentation|other),
|
||||
`status` (open|in_review|resolved|closed),
|
||||
`priority` (low|medium|high|critical).
|
||||
items: { type: object }
|
||||
issue_tasks:
|
||||
type: array
|
||||
description: Checklist tasks per issue.
|
||||
items: { type: object }
|
||||
issue_comments:
|
||||
type: array
|
||||
description: Comment thread per issue.
|
||||
items: { type: object }
|
||||
templates:
|
||||
type: array
|
||||
description: >
|
||||
Templates assigned to this project via pivot (no longer filtered by
|
||||
project_id). Each item exposes version/hash for change detection and
|
||||
`fields[]` where each field may include `group`, `question`, `help`.
|
||||
items: { type: object }
|
||||
media: { type: array, items: { type: object } }
|
||||
deleted:
|
||||
type: object
|
||||
|
||||
Reference in New Issue
Block a user