[Contracts] New contract statuses and migration

未关闭
#488 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
3
派生
2
平均合并
18 分钟
30 天内合并 PR
118

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

code4romania/vic 的其他 Issue

查看 code4romania/vic 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。