Update README.md with project details for "Gestor de presupuestos y f… - #268
Update README.md with project details for "Gestor de presupuestos y f…#268ffabian-exafan wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe README was converted from a generic template into Spanish project documentation covering the construction budgeting and invoicing system, including architecture, data model, API endpoints, user stories, and work tickets. ChangesProject README Documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…acturas de obra" including project description, objectives, features, and system architecture.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@readme.md`:
- Around line 334-349: Update the API documentation for
/proyectos/importar-presupuesto and the related sections to explicitly define
the review-before-save persistence semantics: identify the upload result as a
draft/staged state, clarify whether returned project/invoice IDs are persisted
or temporary, and document that entities are saved only after confirmation.
Align the documented responses and acceptance criteria consistently across all
referenced sections.
- Around line 334-346: Add required: [fichero] to the multipart/form-data schema
for both upload endpoints, including /proyectos/importar-presupuesto and the
endpoint documented around the second referenced section. Keep
requestBody.required: true and the existing fichero property unchanged.
- Line 32: Fix the Markdown formatting in readme.md by adding the text language
to the affected fenced code block and correcting invalid emphasis spacing in the
project and test notes. Ensure the notes use matching opening and closing
underscores, including the sections around the visible deployment note and the
additionally referenced ranges.
- Around line 295-305: Update the ASIGNACION schema to enforce exactly one
assignment target: require one and only one of tarea_id or nave_id to be
non-null. Add the corresponding consistency constraint so a non-null tarea_id
belongs to the specified nave_id, while preserving valid task-level and
nave-level assignments.
- Around line 236-271: Update the PRESUPUESTO, NAVE, and TAREA schema
definitions so extracted NAVE and TAREA records reference the specific budget
version that produced them, preferably by adding a presupuesto_id FK
relationship to each relevant entity. Ensure the relationship preserves
historical imports and aligns with the existing PRESUPUESTO identifier and
version model.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| ### **0.4. URL del proyecto:** | ||
|
|
||
| > Puede ser pública o privada, en cuyo caso deberás compartir los accesos de manera segura. Puedes enviarlos a [alvaro@lidr.co](mailto:alvaro@lidr.co) usando algún servicio como [onetimesecret](https://onetimesecret.com/). | ||
| — Aún sin desplegar. Rellenar cuando exista entorno._ |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the Markdown formatting violations.
The repository reports a missing fenced-code language and invalid emphasis spacing. The project and test notes also contain trailing emphasis markers without a matching opening marker.
Proposed fix
- — Aún sin desplegar. Rellenar cuando exista entorno._
+ _Aún sin desplegar. Rellenar cuando exista entorno._
-```
+```text
app/
...-_ Propuesta; sin desplegar todavía._
+Propuesta; sin desplegar todavía.
-_ Batería prevista; marcar como hecho lo que se implemente._
+Batería prevista; marcar como hecho lo que se implemente.
</details>
Also applies to: 141-159, 165-165, 192-192
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @readme.md at line 32, Fix the Markdown formatting in readme.md by adding the
text language to the affected fenced code block and correcting invalid emphasis
spacing in the project and test notes. Ensure the notes use matching opening and
closing underscores, including the sections around the visible deployment note
and the additionally referenced ranges.
</details>
<!-- fingerprinting:phantom:triton:luna -->
<!-- cr-indicator-types:potential_issue -->
<!-- cr-comment:v1:cc0d5e3efd861096d9f9342d -->
_Source: Linters/SAST tools_
<!-- This is an auto-generated comment by CodeRabbit -->
| PRESUPUESTO { | ||
| int id PK | ||
| int proyecto_id FK | ||
| int version | ||
| string fichero_origen | ||
| date fecha | ||
| string estado_extraccion | ||
| } | ||
| NAVE { | ||
| int id PK | ||
| int proyecto_id FK | ||
| string codigo | ||
| string descripcion | ||
| decimal importe_presupuestado | ||
| } | ||
| CONTRATISTA { | ||
| int id PK | ||
| string nif UK | ||
| string nombre | ||
| string tipo "interno|externo" | ||
| string email | ||
| } | ||
| TAREA { | ||
| int id PK | ||
| int nave_id FK | ||
| int contratista_id FK "nullable" | ||
| string codigo | ||
| string capitulo | ||
| string descripcion | ||
| string unidad | ||
| decimal cantidad | ||
| decimal precio_unitario | ||
| decimal importe_presupuestado | ||
| string estado "no_iniciada|en_curso|finalizada" | ||
| decimal avance_fisico_pct | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Link extracted data to a specific budget version.
PRESUPUESTO stores version, but NAVE and TAREA do not reference a budget. Multiple imports therefore cannot reliably preserve which version produced each amount, contradicting the stated historical-version requirement. Add the appropriate presupuesto_id relationship or explicitly define a versioned snapshot model.
Also applies to: 308-313
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 236 - 271, Update the PRESUPUESTO, NAVE, and TAREA
schema definitions so extracted NAVE and TAREA records reference the specific
budget version that produced them, preferably by adding a presupuesto_id FK
relationship to each relevant entity. Ensure the relationship preserves
historical imports and aligns with the existing PRESUPUESTO identifier and
version model.
| ASIGNACION { | ||
| int id PK | ||
| int factura_id FK | ||
| int tarea_id FK "nullable" | ||
| int nave_id FK "nullable" | ||
| decimal importe_asignado | ||
| string metodo "manual|regla|trigram|vector|estimacion_proporcional" | ||
| bool es_estimacion | ||
| decimal confianza | ||
| int revisado_por FK "nullable" | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Enforce exactly one assignment target.
Both tarea_id and nave_id are nullable, so the schema permits an assignment targeting neither or both. Add a database constraint requiring exactly one target, and ensure task-level assignments remain consistent with their task’s nave.
Also applies to: 314-318
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 295 - 305, Update the ASIGNACION schema to enforce
exactly one assignment target: require one and only one of tarea_id or nave_id
to be non-null. Add the corresponding consistency constraint so a non-null
tarea_id belongs to the specified nave_id, while preserving valid task-level and
nave-level assignments.
| /proyectos/importar-presupuesto: | ||
| post: | ||
| summary: Sube un presupuesto en PDF y crea el proyecto con sus tareas | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| multipart/form-data: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| fichero: | ||
| type: string | ||
| format: binary |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Mark uploaded files as required in the OpenAPI schemas.
requestBody.required: true only requires a multipart body; it does not require the fichero field. Both upload endpoints currently document requests without a file, despite requiring one operationally. Add required: [fichero] to each multipart schema.
Also applies to: 360-374
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 334 - 346, Add required: [fichero] to the
multipart/form-data schema for both upload endpoints, including
/proyectos/importar-presupuesto and the endpoint documented around the second
referenced section. Keep requestBody.required: true and the existing fichero
property unchanged.
| /proyectos/importar-presupuesto: | ||
| post: | ||
| summary: Sube un presupuesto en PDF y crea el proyecto con sus tareas | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| multipart/form-data: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| fichero: | ||
| type: string | ||
| format: binary | ||
| responses: | ||
| "201": | ||
| description: Proyecto creado con tareas extraídas (pendientes de validar) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Align API persistence semantics with the review-before-save workflow.
The API says the project is created and the invoice is registered before review, while the user stories require that nothing is saved until confirmation. Define an explicit draft/staging state and document that behavior, or change the API responses and acceptance criteria; otherwise clients cannot know whether the returned IDs refer to persisted entities.
Also applies to: 360-385, 442-460
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@readme.md` around lines 334 - 349, Update the API documentation for
/proyectos/importar-presupuesto and the related sections to explicitly define
the review-before-save persistence semantics: identify the upload result as a
draft/staged state, clarify whether returned project/invoice IDs are persisted
or temporary, and document that entities are saved only after confirmation.
Align the documented responses and acceptance criteria consistently across all
referenced sections.
…acturas de obra" including project description, objectives, features, and system architecture.
Summary by CodeRabbit