feat(invitations): add the candidate invitation inbox with C4 acceptance and decline

This commit is contained in:
shira committed 2026-10-09 20:30:35 +03:00
1 parent 12a7213d4a
commit a856066316
54 files changed
+3897 -136

No files matched your search

+3 -3
View File
@@ -17,9 +17,9 @@ Implemented in this build (backend API and frontend screens):
- Employer cabinet: organizations (one account can own several and be a recruiter in others), the company profile, needs with a salary range, deterministic candidate search over the bank or by a need without ML, with an explanation of the components, and the anonymous card with its evidence. Only an organization owner can search.
- Support cases in both cabinets, including a manual assessment request after a C3 refusal.
- The notification inbox in both cabinets. In this build no product workflow creates notifications yet, so the list is empty.
- Invitation drafts on the organization side only and through the API only: create, list, read, and change the terms with versions. There is no invitation screen.
- Organization-side invitations: create a draft, list, read, and change the terms with versions through the API; the invitation screen opens from a candidate search result, and the company's invitation list is still a placeholder.
Planned and not working: sending an invitation to a candidate (the API answers 501 `not_implemented`), the candidate invitation inbox, viewing, accepting, and declining, withdrawal, salary raise, and contact release, the invitation screens in both cabinets (placeholders now), password reset, mail for product notifications, resume upload and parsing, PDF, FSP integration, ML inference and semantic search, the adaptive test, sandbox practice, percentiles and calibrated grades, and the SMTP transport.
Planned and not working: sending an invitation to a candidate (the API answers 501 `not_implemented`), withdrawal, salary raise, and contact release, the company's invitation list screen (a placeholder now), password reset, mail for product notifications, resume upload and parsing, PDF, FSP integration, ML inference and semantic search, the adaptive test, sandbox practice, percentiles and calibrated grades, and the SMTP transport.
### Requirements
@@ -82,7 +82,7 @@ The full inventory and the seed rules are in [Isolated demo stand](#isolated-dem
2. On the same page start the Backend Junior full test with Go: 25 items, a 72-hour deadline, two work sessions, no practice. After it completes, the result is compared with the pass mark of the demo policy; a passed test receives an uncalibrated synthetic category, a failed one the result `not_confirmed`. The result and the history open at `/candidate/results`.
3. Prepared candidate: sign in as `prepared-1@demo.lincodex.test` and open the results, the skill evidence, and the privacy settings with the published card.
4. Employer: sign in as `employer-alpha@demo.lincodex.test`, select "Alpha", create a need, and open the search (`/employer/candidates`). The main group holds the six prepared cards with the flags `ml_unavailable` and `cohort_below_30`; a card and its evidence open from the results. In "Beta" the same account is a recruiter, and search answers 403: in the minimal release only the owner can search.
5. Invitations: the screen in both cabinets is a placeholder. A draft can be created through the API only; sending and the candidate's answer are planned.
5. Invitations: the company's invitation list is a placeholder. An invitation is created from a candidate search result; the candidate sees it in the incoming list and answers it on the invitation screen.
### 5. FSP, ML, and data
+2
View File
@@ -59,6 +59,8 @@ Deployment smoke checks infrastructure routes, Compose startup, PostgreSQL/Redis
- Waits for backend readiness, runs the suite with retries disabled, and returns its exit code; make reports any failure as exit status 2.
- Removes the containers, volumes, network, locally built images, and env file on every exit, including failures and interrupts. Only the cached Playwright image and the build cache remain.
Every browser of a run reaches the stand from the same client address: the browser container shares the frontend container's network namespace, so the app Nginx sees all requests from loopback. The per-address limit on `/api/v1/` (20 requests per second with a burst of 60, `deploy/nginx/nginx.conf` and `deploy/nginx/conf.d/app.conf`) is therefore one budget for the whole suite. A 429 from that limit is a failed stand, not a result of the flow under test, and the production limits stay unchanged; `deploy/scripts/test_perimeter.py` keeps checking them. The suite stays inside the budget by design. `frontend/playwright.config.ts` runs one worker. `frontend/e2e/assessment.spec.ts` pauses 250 ms after each saved answer of a full attempt, because a candidate reads each item. The real-bank search in `frontend/e2e/match-search.spec.ts` runs first, in its own project: an unfiltered bank search keeps ten entries per group, so candidates published by earlier specs would decide which entries the test sees. On the stand, a replay of this limit over the access log peaked at about two thirds of the burst with one worker and within about ten requests of it with two workers.
Artifacts of the last run are in `frontend/test-results/e2e/`, which Git ignores; the runner prints the path. `report/` holds the HTML report (`pnpm exec playwright show-report test-results/e2e/report` from `frontend/`). For each failed test, `results/` keeps `trace.zip` and a screenshot (`pnpm exec playwright show-trace <trace.zip>` needs a local browser; trace.playwright.dev opens the file without one). After a failed run, `stand.log` holds the stack logs. `E2E_SPEC_DIR=<dir>` runs specs from another directory, such as a scratch copy, against the same isolated stack.
## Local registration browser tests with a mail fixture
+3 -3
View File
@@ -17,9 +17,9 @@
- Кабинет работодателя: организации (один аккаунт может владеть несколькими и быть рекрутером в других), профиль компании, потребности с вилкой зарплаты, детерминированный поиск кандидатов по банку или по потребности без ML с объяснением компонентов, анонимная карточка и ее доказательства. Поиск доступен только владельцу организации.
- Обращения в поддержку в обоих кабинетах, в том числе запрос ручной оценки после отказа от C3.
- Inbox уведомлений в обоих кабинетах. В этой сборке ни один продуктовый сценарий еще не создает уведомлений, поэтому список пуст.
- Черновики приглашений только на стороне организации и только через API: создание, список, чтение и изменение условий с версиями. Экрана приглашений нет.
- Приглашения на стороне организации: создание черновика, список, чтение и изменение условий с версиями через API; экран приглашения открывается из поиска кандидатов, а список приглашений компании пока заготовка.
Запланировано и не работает: отправка приглашения кандидату (API отвечает 501 `not_implemented`), входящие приглашения кандидата, просмотр, принятие и отклонение, отзыв, повышение зарплаты и выдача контактов, экраны приглашений в обоих кабинетах (сейчас заготовки), сброс пароля, письма о продуктовых уведомлениях, загрузка и разбор резюме, PDF, интеграция с ФСП, ML inference и смысловой поиск, адаптивный тест, практика в песочнице, перцентиль и откалиброванные грейды, транспорт SMTP.
Запланировано и не работает: отправка приглашения кандидату (API отвечает 501 `not_implemented`), отзыв, повышение зарплаты и выдача контактов, экран приглашений компании (сейчас заготовка), сброс пароля, письма о продуктовых уведомлениях, загрузка и разбор резюме, PDF, интеграция с ФСП, ML inference и смысловой поиск, адаптивный тест, практика в песочнице, перцентиль и откалиброванные грейды, транспорт SMTP.
### Что нужно на машине
@@ -82,7 +82,7 @@ Docker Engine с Compose plugin, GNU make, python3 (цели `deploy` запус
2. Там же начните полный тест Backend Junior с Go: 25 заданий, срок 72 часа, две рабочие сессии, без практики. После завершения результат сравнивается с порогом демонстрационной политики; пройденный тест получает неоткалиброванную синтетическую категорию, непройденный - результат `not_confirmed`. Результат и история открываются в `/candidate/results`.
3. Подготовленный кандидат: войдите как `prepared-1@demo.lincodex.test` и откройте результаты, доказательства навыка и настройки приватности с опубликованной карточкой.
4. Работодатель: войдите как `employer-alpha@demo.lincodex.test`, выберите "Альфу", создайте потребность и откройте подбор (`/employer/candidates`). Основная группа содержит шесть подготовленных карточек с отметками `ml_unavailable` и `cohort_below_30`; карточка и ее доказательства открываются из выдачи. В "Бете" тот же аккаунт - рекрутер, и поиск отвечает 403: в минимальном выпуске искать может только владелец.
5. Приглашения: экран в обоих кабинетах - заготовка. Черновик можно создать только через API, а отправка и ответ кандидата запланированы.
5. Приглашения: список приглашений компании - заготовка. Приглашение создается из результата поиска кандидатов; кандидат видит его во входящих и отвечает на экране приглашения.
### 5. ФСП, ML и данные
+2
View File
@@ -59,6 +59,8 @@ Deployment smoke проверяет инфраструктурные маршр
- Ждет готовности backend, запускает набор без повторов и возвращает его код завершения; make сообщает о любой ошибке кодом 2.
- При любом завершении, включая ошибку и прерывание, удаляет контейнеры, тома, сеть, локально собранные образы и env-файл. Остаются только закешированный образ Playwright и кеш сборки.
Все браузеры одного прогона обращаются к стенду с одного клиентского адреса: контейнер браузера разделяет сетевое пространство контейнера frontend, и app Nginx видит все запросы с loopback. Поэтому лимит на адрес для `/api/v1/` (20 запросов в секунду с burst 60, `deploy/nginx/nginx.conf` и `deploy/nginx/conf.d/app.conf`) общий для всего набора. 429 от этого лимита означает сбой стенда, а не результат проверяемого сценария; продуктивные лимиты не меняются, их по-прежнему проверяет `deploy/scripts/test_perimeter.py`. Набор укладывается в бюджет по замыслу. `frontend/playwright.config.ts` запускает один воркер. `frontend/e2e/assessment.spec.ts` делает паузу 250 мс после каждого сохраненного ответа полной попытки, потому что кандидат читает каждый пункт. Поиск по реальному банку в `frontend/e2e/match-search.spec.ts` идет первым, в собственном проекте: нефильтрованный поиск по банку возвращает десять записей на группу, поэтому кандидаты, опубликованные более ранними спецификациями, определили бы, какие записи увидит тест. На стенде воспроизведение этого лимита по access-логу дало пик примерно в две трети burst при одном воркере и около десяти запросов до порога при двух.
Артефакты последнего прогона лежат в `frontend/test-results/e2e/`, который игнорируется Git; путь печатается в конце. В `report/` лежит HTML-отчет (`pnpm exec playwright show-report test-results/e2e/report` из `frontend/`). Для каждого упавшего теста `results/` сохраняет `trace.zip` и снимок экрана (`pnpm exec playwright show-trace <trace.zip>` требует локального браузера; trace.playwright.dev открывает файл без него). После неуспешного прогона `stand.log` содержит логи стека. `E2E_SPEC_DIR=<dir>` запускает спецификации из другого каталога, например из временной копии, на таком же изолированном стеке.
## Локальный браузерный тест регистрации с почтовым fixture