profcomff / profcomff/modal-service-api

Пользовательская ручка response

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2
Forks
0
Avg merge
18d 7h
Merged PRs (30d)
2

Description

  1. POST /user/rating/{id}/response
    тело:
    {"rating": 4}

Валидация: 1 <= rating <= note.rating_max.

  1. POST /user/text/{id}/response
    тело:
    {"text": "всё понравилось"}

Валидация: непустой после обрезки пробелов, длина не больше note.max_length.

  1. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.