Account deletion: endpoint + student branch

Aperta
#179 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
fastapi, python
Ambito
api, backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
12h 7m
PR unite (30g)
18

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ClockGU/clockwork-backend

Tutte le issue di ClockGU/clockwork-backend

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.