Petition: link student user_account on creation / first login; clerk endpoints by petition
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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: nullableuuid, FK →employee.user_accountwithON UPDATE CASCADE(same pattern as #138 / #141) - On petition creation: if an
Employeewithstudent_usernameexists, set it immediately - On first login (branch in
api/security.pywhere 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 viapetition.student_user_accountinstead of the username join (contract unchanged) - Replace
GET /clerk/prev_employments/petition/{petition_id}withGET /clerk/petitions/{petition_id}/prev_employments, resolved viapetition.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
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 39 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ClockGU/clockwork-backend
-
Add alembic upgrade predeployAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ClockGU/clockwork-backend#169 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
ClockGU/clockwork-backend#165 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
ClockGU/clockwork-backend#164 ·
Los mantenedores suelen responder en 1 día
-
[#160] Refactor EmployeeManagerAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
ClockGU/clockwork-backend#163 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ClockGU/clockwork-backend#162 ·
Los mantenedores suelen responder en 1 día
Todos los issues de ClockGU/clockwork-backend
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Nixtla/mlforecast#823 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
madenvel/KalinkaPlayer#503 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
EleutherAI/lm-evaluation-harness#4508 ·
Los mantenedores suelen responder en 1 día