Account deletion: endpoint + student branch

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
fastapi, python
领域
api, backend

调研方向

Start in api/routers/employee.py and read the existing JWT and role dispatch patterns, plus the file deletion helpers in api/utils.py. The student branch must capture petition and file data before deleting the Employee and committing, then clean up files, schedule the required emails, and refresh the clerk list when applicable. Check the endpoint behavior for each role and confirm the student branch returns 204; the issue also requires a frontend logout change, but does not name its files or tests.

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

描述

Part of the Account deletion parent (#181). Depends on (a) #178.

Tasks

  • DELETE /employees/me in api/routers/employee.py, using decode_user_jwt (not get_current_student) and dispatching on user_role:
    • student → this issue
    • supervisor → (c), returns 204 until then
    • clerk → 403
  • Student branch (handler):
    1. Load the Employee by sub, or 404 if none exists
    2. Capture the non-completed petitions linked via student_user_account (id, student_username, start/end date, status, supervisor_mail, budget approvers) and all uploaded file names (StudentDocuments *_file, PrevEmployment proof)
    3. Delete the Employee (DB cascade removes documents, prev employments, petitions, budget positions) and commit
    4. Delete the files via delete_student_doc_file / delete_prev_emp_file (api/utils.py), best effort with logging
    5. Mail the supervisor + all budget approvers per captured petition (new DE+EN template via EmailHandler + BackgroundTasks)
    6. If any deleted petition had a clerk-relevant status, push the refreshed clerk list via send_serialized_data_to_clerks
    7. Return 204
  • Frontend changes doc: logout right after 204
主要语言
Python
星标
0
派生
0
平均合并
12 小时 7 分钟
30 天内合并 PR
18

环境准备

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

从这里开始

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

ClockGU/clockwork-backend 的其他 Issue

查看 ClockGU/clockwork-backend 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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