Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Petition: link student user_account on creation / first login; clerk endpoints by petition

Ouverte
#142 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
38/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python, sql
Domaine
api, backend, database

Piste de recherche

Start with the migration and schema patterns in issues #138 and #141, then read api/security.py where first-login Employee creation is handled. Trace petition creation and both clerk routes named in the issue, and add integration tests for linking at creation and first login, preserving existing links, and resolving both endpoints without username lookups. Done means the schema, linking paths, routes, and acceptance tests all match the stated behavior.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Context

Petitions identify the student only by student_username (the supervisor only knows the username, and the student may not have an account yet). Usernames are fine for sending mail but not for identity: the planned account fusion maps several usernames of one human to one user. Clerk endpoints currently resolve students by username.

Decision

  • Add Petition.student_user_account: nullable uuid, FK → employee.user_account with ON UPDATE CASCADE (same pattern as #138 / #141)
  • On petition creation: if an Employee with student_username exists, set it immediately
  • On first login (branch in api/security.py where the Employee is created): UPDATE petition SET student_user_account = :sub WHERE student_username = :username AND student_user_account IS NULL
  • Username is used only once as the binding key; afterwards identity is user_account

Tasks

  • Migration + schema; backfill existing petitions from employee.username
  • Linking on petition creation and on first login
  • GET /clerk/petitions/{petition_id}/documents (from #138): resolve via petition.student_user_account instead of the username join (contract unchanged)
  • Replace GET /clerk/prev_employments/petition/{petition_id} with GET /clerk/petitions/{petition_id}/prev_employments, resolved via petition.student_user_account (breaking change for the frontend; remove the old route)

Acceptance criteria (integration tests)

  • Petition for an existing student is linked at creation
  • Petition for an unknown student is linked on the student's first login
  • Already-linked petitions are not overwritten
  • Both clerk endpoints work without any username lookup

Related: #138, #141

Langage dominant
Python
Étoiles
0
Forks
0
Merge moyen
39 min
PR mergées (30 j)
10

Préparer son environnement

  • Fournit un Dockerfile ou un fichier Docker Compose
  • Aucun modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ClockGU/clockwork-backend

Toutes les issues de ClockGU/clockwork-backend

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.