Account deletion: endpoint + student branch

オープン
#179 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
18

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ClockGU/clockwork-backend のほかの issue

ClockGU/clockwork-backend の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。