profcomff / profcomff/modal-service-api
Пользовательская ручка response
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 18d 7h
- Merged PRs (30d)
- 2
Description
- POST /user/rating/{id}/response
тело:
{"rating": 4}
Валидация: 1 <= rating <= note.rating_max.
- POST /user/text/{id}/response
тело:
{"text": "всё понравилось"}
Валидация: непустой после обрезки пробелов, длина не больше note.max_length.
- POST /user/choice/{id}/response
тело:
{"selected_choices": [1, 3]}
Валидация: все id есть в choice_options, дублей нет, при is_multiple = false ровно один элемент.
Общее для трёх ручек ответа:
Проверяют по порядку: модалка существует (404), активна (403), не истекла (403), её тип совпадает с типом ручки (403), юзер ещё не отвечал (409).
Записывают строку в note_response.
После ответа модалка этому юзеру больше не показывается.
Типы 1 и 5 ответа не имеют — ручек для них нет.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the handlers for POST /user/rating/{id}/response, POST /user/text/{id}/response, and POST /user/choice/{id}/response, then inspect the modal and note_response models. Implement the stated validation and check order for each endpoint. Done means valid responses are stored, invalid states return the specified status codes, and answered modals no longer appear for that user.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100