[Contracts] New contract statuses and migration

Abierto
#488 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start in backend/src/api/contracts/ and backend/src/migrations/ to see how contract status is stored and where a migration would go, then check frontend/src/pages/Contracts.tsx for the Perioadă column. The status labels are still an open question with the client, so confirm them in the issue before coding. Done means the migration mapping has a passing test, the flags are computed from the end date, and web and mobile show the new statuses and tag.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

back-end enhancement :rocket: mobile-app needs-info vic-2.0 web-app

Context

Move contracts to a simpler status model:

  • Active: signed and within its validity period. Can carry the flag "Expiră în curând".
  • Inactive: pending or expired. Expired ones carry the flag "Expirat".

So the possible states are: Active, Active + "Expiră în curând", Inactive, Inactive + "Expirat".

Migration of existing contracts:

  • signed and within the active period → Active;
  • pending or expired → Inactive (with the "Expirat" flag where applicable).

"Expiră în curând" is shown as a tag in the "Perioadă" column.

Open question: the design shows the statuses "Semnat", "În așteptare", "Expiră în curând" and "Expirat", with "Expiră în curând" as a tag while the status is "Semnat". Confirm the final labels against this model before implementing.

Design

Prototype: https://perch-pic-08148752.figma.site/ → Contracte. The prototype is indicative; this issue's text wins where they differ.

Acceptance criteria

  • Contracts have Active / Inactive status plus the flags "Expiră în curând" (within 1 month of end date) and "Expirat".
  • A migration maps existing contracts as described; the mapping is covered by a test.
  • Flags are computed from the end date, not stored manually.
  • Web and mobile show the new statuses and the "Expiră în curând" tag in the Perioadă column.

Dependencies

Phase 0. No blockers.

Where to look

  • backend/src/api/contracts/
  • backend/src/modules/documents/
  • backend/src/migrations/
  • frontend/src/pages/Contracts.tsx

Before starting

Resolve the open question above with the client and update this issue first.

Lenguaje dominante
TypeScript
Estrellas
3
Forks
2
Merge medio
18 min
PR fusionados (30 d)
118

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de code4romania/vic

Todos los issues de code4romania/vic

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.