Petition: link student user_account on creation / first login; clerk endpoints by petition
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 38/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 0
- Forks
- 0
- Merge médio
- 39min
- PRs com merge (30d)
- 10
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de ClockGU/clockwork-backend
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
ClockGU/clockwork-backend#169 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 20/100
ClockGU/clockwork-backend#165 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
ClockGU/clockwork-backend#164 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
ClockGU/clockwork-backend#163 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
ClockGU/clockwork-backend#162 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de ClockGU/clockwork-backend
Issues semelhantes
-
ReadQwen3PaperTask5 rejects correct answers that differ only in order, case, or underscore formTalvez já em andamento @Kingpython123 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
Tongyi-MAI/MobileWorld#72 ·
-
_threads/application: Update typing annotations using `pyupgrade --py311-plus`Talvez já em andamento @gudnimg assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Health probes return 401 when authentication is enabled and the API is served under /orbTalvez já em andamento @fgogolli assumiu hoje. Abertaarea: api priority: p2 size: S type: bug
Dificuldade 2/5 Meio dia Facilidade para iniciantes 75/100
finos/open-resource-broker#704 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
BCDA-APS/polar-bits#93 ·
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
GoogleCloudPlatform/gce-rescue#218 ·
Mantenedores costumam responder em até 2 dias