feat(profile): persist candidate edits and enforce company access
This commit is contained in:
1 parent
3ab6bd91a3
commit
73c7caa225
67 files changed
+5286
-229
No files matched your search
+6
-4
@@ -180,7 +180,7 @@ Questionnaire:
|
||||
|
||||
### Candidate profile
|
||||
|
||||
The `candidate` tag also describes the private candidate profile that the candidate fills in by hand (FR02 in the PRD). The operations are in the contract, but their business logic is not implemented: a guest answers 401 `unauthenticated`, and a request with a verified session reaches 501 `not_implemented` after request validation. Unsafe protected operations also require the session-bound CSRF token and exact Origin.
|
||||
The `candidate` tag includes implemented `GetMyProfile` and `SaveMyProfile` operations for the private manual profile. A verified candidate reads and edits only their own profile; an employer receives 403 and a guest receives 401. PUT requires the session CSRF token and exact Origin. Data, version, overlap confirmations, history, and the step transition commit in one transaction. Without DATABASE_URL, the operations retain their 501 fallback.
|
||||
|
||||
| Method and path | operationId | Protection | Success | Specific errors |
|
||||
| --- | --- | --- | --- | --- |
|
||||
@@ -189,6 +189,8 @@ The `candidate` tag also describes the private candidate profile that the candid
|
||||
|
||||
Each operation also declares the default problem response. No new problem code is added: the contract uses `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed`, and `version_conflict`.
|
||||
|
||||
`experience_overlaps` lists intersecting inclusive month ranges and their decision state. A changed save requires explicit `confirmed_parallel_periods` with indices and exact dates for that version; an earlier decision survives only for the same indices and dates. A stored unconfirmed overlap permits an exact no-op, but no other edit without a decision. History is appended only on change. A successful PUT advances only `candidate_profile` to `candidate_questionnaire`; the earlier `candidate_consents` and later steps stay unchanged. Consent-step completion has no separate operation yet.
|
||||
|
||||
What the profile holds:
|
||||
|
||||
- The full name and contacts (`full_name`, `contacts.email`, `contacts.phone`, `contacts.telegram`), the stack (`stack`, `StackTag` tags), roles (`roles`: a catalog specialization and a self-assessed grade), work experience (`experience`: entries with a month-precision period `YYYY-MM`, a specialization, and a description of the tasks rather than a job title), soft skills (`soft_skills`, free text), and terms (`terms`: place, readiness to relocate, and the lowest salary with its currency, period, and tax basis). This is personal data of the candidate; the description of each such schema says so, and the values never reach logs, metrics, URLs, or events.
|
||||
@@ -228,7 +230,7 @@ Open questions for the product owner and legal:
|
||||
- The 152-FZ basis: which consent covers storing the profile (C1 at registration or a separate one), whether the name and the contacts need separate consents, the retention periods, and the deletion procedure. Today deleting an account cascades to its profile, and there are no retention rules.
|
||||
- The order of the version and the domain rules: the version is checked before the rules that depend on stored claims (a stale tab gets 412, not 400); the product owner should confirm.
|
||||
- Full replacement: `PUT` drops stored import suggestions that the client did not render and send back with the status `extracted`; whether that is acceptable or the server should keep suggestions that were never shown.
|
||||
- The minimum for the onboarding step `candidate_profile`: the contract requires no field; which fields complete the step is the product owner's decision.
|
||||
- The minimum for the onboarding step `candidate_profile`: the current contract requires no field, so any successful PUT completes that step, including an empty no-op. Requiring fields later needs a separate product decision and contract change.
|
||||
- One source between the questionnaire and the profile: keep the self-assessment and the stack independent, or store one claim and show it in both places.
|
||||
- Soft skills: there is no taxonomy, only free text, up to 10 items of 50 characters; whether a dictionary is needed.
|
||||
- Experience: employer names and descriptions are personal data; how the anonymous card generalizes them (PRD: industry and size) is for the card contract, not this one.
|
||||
@@ -557,7 +559,7 @@ No new problem code is added: the contract uses `validation_failed`, `unauthenti
|
||||
|
||||
### Organizations
|
||||
|
||||
The `organization` tag covers the organizations of employer accounts and the memberships that give an account its role in them (PRD FR07, 2.2, and 6.4): the profile with its public contacts and representatives, the verification level that only the server sets, and the active organization context. The operations are in the contract, but their business logic is not implemented: a guest answers 401 `unauthenticated`, and a request with a verified session reaches 501 `not_implemented` after request validation. Unsafe protected operations also require the session-bound CSRF token and exact Origin. The storage behind them exists (see [ARCHITECTURE.md](../docs/en/ARCHITECTURE.md#organizations-and-memberships)); creating, editing, and the membership checks of the other operations are planned as part of organization management and access control.
|
||||
The `organization` tag includes implemented creation, reading, editing, and the current account's organization directory. A verified employer creates an organization with an active owner; organization-scoped operations require an active owner on each request. Unsafe operations require the session CSRF token and exact Origin. The common middleware also protects unimplemented need and invitation operations before their 501 fallback. See [ARCHITECTURE.md](../docs/en/ARCHITECTURE.md#organizations-and-memberships).
|
||||
|
||||
| Method and path | operationId | Security | Success | Specific errors |
|
||||
| --- | --- | --- | --- | --- |
|
||||
@@ -577,7 +579,7 @@ Active organization context:
|
||||
Access:
|
||||
|
||||
- An employer account only. A candidate account answers 403 `forbidden` on all four operations, and an account without a session answers 401.
|
||||
- `GetOrganization` and `UpdateOrganization` answer 404 `not_found` for an account without an active membership in `org_id` and for an unknown organization alike, and also for a `suspended`, `removed`, or `left` member, so organizations cannot be enumerated and a revoked member loses the next read at once. A member whose role does not manage the organization answers 403 `forbidden` on `UpdateOrganization`; the FR07 matrix gives managing the company and its staff to the owner only. In the MVP every member is an owner, because the operations that add members are planned.
|
||||
- `GetOrganization` and `UpdateOrganization` answer 404 `not_found` for an account without an active membership in `org_id` and for an unknown organization alike, and also for a `suspended`, `removed`, or `left` member, so organizations cannot be enumerated and a revoked member loses the next read at once. A member whose role does not manage the organization answers 403 `forbidden` on `GetOrganization` and `UpdateOrganization`; the FR07 matrix gives managing the company and its staff to the owner only. In the MVP every member is an owner, because the operations that add members are planned.
|
||||
- `CreateOrganization` creates the organization and the owner membership of the caller in one transaction (role `owner`, state `active`), so an organization never exists without an owner; the database refuses to commit one that has none. The body has no owner, role, membership, or verification field.
|
||||
|
||||
Memberships:
|
||||
|
||||
+6
-4
@@ -180,7 +180,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
### Профиль кандидата
|
||||
|
||||
Тег `candidate` описывает и приватный профиль кандидата, который кандидат заполняет вручную (FR02 в PRD). Операции есть в контракте, но их бизнес-логика еще не реализована: гость получает 401 `unauthenticated`, а запрос с подтвержденной сессией достигает 501 `not_implemented` после проверки запроса. Небезопасные защищенные операции также требуют session-bound CSRF-токен и точный Origin.
|
||||
Тег `candidate` включает реализованные `GetMyProfile` и `SaveMyProfile` для приватного ручного профиля. Подтвержденный кандидат читает и меняет только свой профиль; работодатель получает 403, гость - 401. PUT требует CSRF-токен сессии и точный Origin. Данные, версия, подтверждения пересечений, история и переход шага сохраняются одной транзакцией. Без DATABASE_URL остается ответ 501.
|
||||
|
||||
| Метод и путь | operationId | Защита | Успех | Конкретные ошибки |
|
||||
| --- | --- | --- | --- | --- |
|
||||
@@ -189,6 +189,8 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
Каждая операция также объявляет problem-ответ `default`. Новый код problem не добавляется: контракт использует `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed` и `version_conflict`.
|
||||
|
||||
`experience_overlaps` перечисляет пересекающиеся включительные месяцы и состояние решения. Перед измененным сохранением требуется явное `confirmed_parallel_periods` с индексами и точными датами этой версии; прежнее решение переносится только при тех же индексах и датах. Сохраненный неподтвержденный overlap допускает точный no-op, но не изменение других полей без решения. История добавляется только при изменении. Успешный PUT переводит только `candidate_profile` в `candidate_questionnaire`; ранний `candidate_consents` и поздние шаги не меняются. Завершение шага согласий пока не имеет отдельной операции.
|
||||
|
||||
Состав профиля:
|
||||
|
||||
- Полное имя и контакты (`full_name`, `contacts.email`, `contacts.phone`, `contacts.telegram`), стек (`stack`, теги `StackTag`), роли (`roles`: специализация каталога и самооценка грейда), опыт работы (`experience`: записи с периодом по месяцам `YYYY-MM`, специализацией и описанием задач, а не названием должности), софт-скиллы (`soft_skills`, свободный текст) и условия (`terms`: место, готовность к переезду и минимальная зарплата с валютой, периодом и налоговой базой). Это ПДн кандидата; каждое такое поле в описании схемы помечено как персональные данные, а значения не попадают в логи, метрики, URL и события.
|
||||
@@ -228,7 +230,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
- Основание по 152-ФЗ: какое согласие покрывает хранение профиля (C1 при регистрации или отдельное), нужны ли отдельные согласия для имени и контактов, сроки хранения и порядок удаления. Сейчас удаление аккаунта каскадно удаляет профиль, а правил хранения нет.
|
||||
- Порядок версии и доменных правил: выбрано проверять версию раньше правил, зависящих от сохраненных заявлений (устаревшая вкладка получает 412, а не 400); нужно подтверждение владельца продукта.
|
||||
- Полная замена: `PUT` удаляет сохраненные предложения импорта, которых клиент не показал и не вернул со статусом `extracted`; допустимо ли это или сервер должен сохранять непоказанные предложения.
|
||||
- Минимум для шага онбординга `candidate_profile`: контракт не требует ни одного поля; какие поля нужны, чтобы шаг считался пройденным, решает владелец продукта.
|
||||
- Минимум для шага онбординга `candidate_profile`: текущий контракт не требует ни одного поля, поэтому любой успешный PUT завершает этот шаг, включая пустой no-op. Введение обязательных полей потребует отдельного решения владельца продукта и изменения контракта.
|
||||
- Единый источник между анкетой и профилем: оставить самооценку и стек независимыми или хранить одно заявление и показывать в обоих местах.
|
||||
- Софт-скиллы: таксономии нет, свободный текст до 10 штук по 50 символов; нужен ли справочник.
|
||||
- Опыт: названия работодателей и описания - ПДн; как анонимная карточка их обобщает (PRD: отрасль и размер), решает контракт карточки, а не этот.
|
||||
@@ -557,7 +559,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
### Организации
|
||||
|
||||
Тег `organization` описывает организации аккаунтов работодателя и членства, которые дают аккаунту роль в них (FR07, 2.2 и 6.4 в PRD): профиль с публичными контактами и представителями, уровень проверки, который задает только сервер, и активный контекст организации. Операции есть в контракте, но их бизнес-логика еще не реализована: гость получает 401 `unauthenticated`, а запрос с подтвержденной сессией достигает 501 `not_implemented` после проверки запроса. Небезопасные защищенные операции также требуют session-bound CSRF-токен и точный Origin. Хранение за ними уже есть (см. [ARCHITECTURE.md](../docs/ru/ARCHITECTURE.md#организации-и-членства)); создание, редактирование и проверки членства в остальных операциях запланированы в управлении организациями и контроле доступа.
|
||||
Тег `organization` включает реализованные создание, чтение, редактирование и список своих организаций. Подтвержденный работодатель создает организацию с активным владельцем; операции в области организации требуют активного владельца на каждом запросе. Небезопасные операции требуют CSRF-токен сессии и точный Origin. Общий middleware защищает также пока не реализованные потребности и приглашения до ответа 501. Подробности: [ARCHITECTURE.md](../docs/ru/ARCHITECTURE.md#организации-и-членства).
|
||||
|
||||
| Метод и путь | operationId | Защита | Успех | Конкретные ошибки |
|
||||
| --- | --- | --- | --- | --- |
|
||||
@@ -577,7 +579,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
Доступ:
|
||||
|
||||
- Только аккаунт работодателя. Аккаунт кандидата получает 403 `forbidden` на всех четырех операциях, аккаунт без сессии - 401.
|
||||
- `GetOrganization` и `UpdateOrganization` одинаково отвечают 404 `not_found` аккаунту без активного членства в `org_id` и на неизвестную организацию, а также участнику в состоянии `suspended`, `removed` или `left`, поэтому организации нельзя перечислить, а отозванный участник теряет следующее чтение сразу. Участник, чья роль не управляет организацией, получает 403 `forbidden` на `UpdateOrganization`; матрица FR07 отдает управление компанией и сотрудниками только владельцу. В MVP каждый участник - владелец, потому что операции добавления участников запланированы.
|
||||
- `GetOrganization` и `UpdateOrganization` одинаково отвечают 404 `not_found` аккаунту без активного членства в `org_id` и на неизвестную организацию, а также участнику в состоянии `suspended`, `removed` или `left`, поэтому организации нельзя перечислить, а отозванный участник теряет следующее чтение сразу. Участник, чья роль не управляет организацией, получает 403 `forbidden` на `GetOrganization` и `UpdateOrganization`; матрица FR07 отдает управление компанией и сотрудниками только владельцу. В MVP каждый участник - владелец, потому что операции добавления участников запланированы.
|
||||
- `CreateOrganization` создает организацию и членство владельца для вызывающего в одной транзакции (роль `owner`, состояние `active`), поэтому организации без владельца не существует; база отказывается фиксировать такую. В теле нет поля владельца, роли, членства или уровня проверки.
|
||||
|
||||
Членства:
|
||||
|
||||
@@ -3993,6 +3993,7 @@ NewCandidateProfile:
|
||||
stack: []
|
||||
roles: []
|
||||
experience: []
|
||||
experience_overlaps: []
|
||||
soft_skills: []
|
||||
terms:
|
||||
location:
|
||||
@@ -4093,6 +4094,7 @@ BackendCandidateProfile:
|
||||
quote: null
|
||||
extraction_version: null
|
||||
confirmed_at: "2026-10-05T09:30:00Z"
|
||||
experience_overlaps: []
|
||||
soft_skills:
|
||||
- skill: Mentoring
|
||||
status: confirmed
|
||||
|
||||
@@ -599,7 +599,8 @@ ProfileValidationFailed:
|
||||
salary that is not a positive multiple of 1000, more items than a list
|
||||
allows, a repeated tag, skill, or role specialization, a period that
|
||||
ends before it starts or lies in the future, a decision extracted for a
|
||||
value that is not a stored suggestion, or a missing or invalid
|
||||
value that is not a stored suggestion, an overlapping experience period
|
||||
without an explicit date-pair acknowledgement, or a missing or invalid
|
||||
expected_version; code validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed. The problem never repeats a submitted value, because the body is personal data.
|
||||
content:
|
||||
application/problem+json:
|
||||
|
||||
@@ -1988,6 +1988,68 @@ ProfileExperienceItem:
|
||||
$ref: '#/ProfileItemStatus'
|
||||
source:
|
||||
$ref: '#/ProfileClaimSource'
|
||||
ProfileExperienceOverlapStatus:
|
||||
type: string
|
||||
description: Whether the candidate confirmed that two overlapping periods are genuine parallel work.
|
||||
enum:
|
||||
- needs_confirmation
|
||||
- confirmed
|
||||
ProfileExperienceOverlap:
|
||||
type: object
|
||||
description: One pair of work history entries whose inclusive month ranges overlap. The indices refer to the experience array in this profile version. `confirmed` records an explicit acknowledgement for this pair of dates; otherwise the pair needs confirmation before a changed profile can be saved.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- status
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
status:
|
||||
$ref: '#/ProfileExperienceOverlapStatus'
|
||||
ProfileExperiencePeriod:
|
||||
type: object
|
||||
description: The exact month range of an experience entry, copied into a confirmation.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- started_on
|
||||
- ended_on
|
||||
properties:
|
||||
started_on:
|
||||
$ref: '#/ProfileYearMonth'
|
||||
ended_on:
|
||||
description: Last month of work, or null when the period is open-ended.
|
||||
oneOf:
|
||||
- $ref: '#/ProfileYearMonth'
|
||||
- type: 'null'
|
||||
ProfileParallelPeriodConfirmation:
|
||||
type: object
|
||||
description: Explicit acknowledgement that the two indexed experience periods are genuine parallel work. The indices and exact ranges must match the submitted experience array; expected_version binds the acknowledgement to the profile version the candidate read.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- first_period
|
||||
- second_period
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
first_period:
|
||||
$ref: '#/ProfileExperiencePeriod'
|
||||
second_period:
|
||||
$ref: '#/ProfileExperiencePeriod'
|
||||
ProfileConfirmedCategory:
|
||||
type: object
|
||||
description: 'A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`.'
|
||||
@@ -2023,6 +2085,7 @@ CandidateProfile:
|
||||
- stack
|
||||
- roles
|
||||
- experience
|
||||
- experience_overlaps
|
||||
- soft_skills
|
||||
- terms
|
||||
- confirmed_categories
|
||||
@@ -2052,6 +2115,12 @@ CandidateProfile:
|
||||
description: Work history entries in the order the candidate gave them.
|
||||
items:
|
||||
$ref: '#/ProfileExperienceItem'
|
||||
experience_overlaps:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: Every pair of overlapping experience periods, with its confirmation status. The indices refer to this version's experience array.
|
||||
items:
|
||||
$ref: '#/ProfileExperienceOverlap'
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
@@ -2311,6 +2380,12 @@ CandidateProfileUpdate:
|
||||
description: Work history entries.
|
||||
items:
|
||||
$ref: '#/ProfileExperienceItemInput'
|
||||
confirmed_parallel_periods:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: Explicit acknowledgements for overlapping periods. Each pair must use distinct in-range indices and repeat the exact normalized started_on and ended_on values of those entries in this body. A changed or reordered period needs a new acknowledgement. The server retains a previous acknowledgement only for the same indices and dates. Duplicate pairs and pairs that do not overlap are rejected.
|
||||
items:
|
||||
$ref: '#/ProfileParallelPeriodConfirmation'
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
|
||||
@@ -515,6 +515,76 @@ schemas:
|
||||
$ref: "#/schemas/ProfileItemStatus"
|
||||
source:
|
||||
$ref: "#/schemas/ProfileClaimSource"
|
||||
ProfileExperienceOverlapStatus:
|
||||
type: string
|
||||
description: Whether the candidate confirmed that two overlapping periods are genuine parallel work.
|
||||
enum:
|
||||
- needs_confirmation
|
||||
- confirmed
|
||||
ProfileExperienceOverlap:
|
||||
type: object
|
||||
description: >-
|
||||
One pair of work history entries whose inclusive month ranges overlap.
|
||||
The indices refer to the experience array in this profile version.
|
||||
`confirmed` records an explicit acknowledgement for this pair of dates;
|
||||
otherwise the pair needs confirmation before a changed profile can be saved.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- status
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
status:
|
||||
$ref: "#/schemas/ProfileExperienceOverlapStatus"
|
||||
ProfileExperiencePeriod:
|
||||
type: object
|
||||
description: The exact month range of an experience entry, copied into a confirmation.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- started_on
|
||||
- ended_on
|
||||
properties:
|
||||
started_on:
|
||||
$ref: "#/schemas/ProfileYearMonth"
|
||||
ended_on:
|
||||
description: Last month of work, or null when the period is open-ended.
|
||||
oneOf:
|
||||
- $ref: "#/schemas/ProfileYearMonth"
|
||||
- type: "null"
|
||||
ProfileParallelPeriodConfirmation:
|
||||
type: object
|
||||
description: >-
|
||||
Explicit acknowledgement that the two indexed experience periods are
|
||||
genuine parallel work. The indices and exact ranges must match the
|
||||
submitted experience array; expected_version binds the acknowledgement
|
||||
to the profile version the candidate read.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- first_period
|
||||
- second_period
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
first_period:
|
||||
$ref: "#/schemas/ProfileExperiencePeriod"
|
||||
second_period:
|
||||
$ref: "#/schemas/ProfileExperiencePeriod"
|
||||
ProfileConfirmedCategory:
|
||||
type: object
|
||||
description: >-
|
||||
@@ -573,6 +643,7 @@ schemas:
|
||||
- stack
|
||||
- roles
|
||||
- experience
|
||||
- experience_overlaps
|
||||
- soft_skills
|
||||
- terms
|
||||
- confirmed_categories
|
||||
@@ -606,6 +677,14 @@ schemas:
|
||||
description: Work history entries in the order the candidate gave them.
|
||||
items:
|
||||
$ref: "#/schemas/ProfileExperienceItem"
|
||||
experience_overlaps:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: >-
|
||||
Every pair of overlapping experience periods, with its confirmation
|
||||
status. The indices refer to this version's experience array.
|
||||
items:
|
||||
$ref: "#/schemas/ProfileExperienceOverlap"
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
@@ -921,6 +1000,18 @@ schemas:
|
||||
description: Work history entries.
|
||||
items:
|
||||
$ref: "#/schemas/ProfileExperienceItemInput"
|
||||
confirmed_parallel_periods:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: >-
|
||||
Explicit acknowledgements for overlapping periods. Each pair must
|
||||
use distinct in-range indices and repeat the exact normalized
|
||||
started_on and ended_on values of those entries in this body. A
|
||||
changed or reordered period needs a new acknowledgement. The server
|
||||
retains a previous acknowledgement only for the same indices and
|
||||
dates. Duplicate pairs and pairs that do not overlap are rejected.
|
||||
items:
|
||||
$ref: "#/schemas/ProfileParallelPeriodConfirmation"
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
|
||||
@@ -552,6 +552,8 @@ paths:
|
||||
|
||||
Every value carries its confirmation state and provenance, and every claim has trust level 0. The self-assessed grade of a role is separate from `confirmed_categories`, which only assessment results establish and which no request writes. The profile needs no file, no ML extraction, and no FSP account.
|
||||
|
||||
`experience_overlaps` lists every pair of entries whose inclusive month ranges overlap. Its indices refer to this response's `experience` array and are scoped to the same `version`; each pair is either `needs_confirmation` or `confirmed`.
|
||||
|
||||
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
@@ -584,7 +586,7 @@ paths:
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new state of every field and list; see CandidateProfileUpdate for the decisions that it carries. It replaces the stored profile as a whole.
|
||||
|
||||
Every field is optional in substance: a profile can be saved with any subset filled and the rest null or empty, so no value requires a resume, the ML service, an FSP account, or any other file or link. Which fields are needed to leave the onboarding step candidate_profile is an open product question that this contract does not decide; a save on that step advancing the account to candidate_questionnaire is planned.
|
||||
Every field is optional in substance: a profile can be saved with any subset filled and the rest null or empty, so no value requires a resume, the ML service, an FSP account, or any other file or link. A successful save advances an account whose current onboarding step is candidate_profile to candidate_questionnaire, including a no-op save; it never moves a later step backwards. This update is atomic with the profile and its history.
|
||||
|
||||
Provenance is the server's: a value typed in the form is `manual`, confirming a stored suggestion keeps its origin, and every claim keeps trust level 0. The body has no origin, trust level, confirmation time, confirmed grade, or category, and unknown fields are rejected. A self-assessed grade never becomes a confirmed grade or a category.
|
||||
|
||||
@@ -594,7 +596,9 @@ paths:
|
||||
|
||||
The save replaces the stored claims as a whole. A suggestion that an import stored and that the client did not render and send back with the decision `extracted` is dropped by the save; a client therefore sends every suggestion that it received, and a client that read an older version gets 412 instead of silently dropping a suggestion it never saw.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), domain rules that depend on the body alone (400), then the rules that depend on the stored claims against the version: a decision `extracted` for a value that is not a stored suggestion answers 412 when `expected_version` is stale, because another save may have confirmed that value, and 400 when it is current; an unchanged body (200); any other change over a stale version (412). The schema rejects an unknown field, an unknown specialization or grade, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside `YYYY-MM`, a salary that is not a positive multiple of 1000, and more items than a list allows. The server also rejects a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, and a decision `extracted` for a value that is not a stored suggestion, with 400 validation_failed and pointers to the items, for example `/roles/1/specialization` or `/stack/1/status`. Error bodies never repeat a submitted value.
|
||||
Experience periods use inclusive calendar months. An overlap is allowed only when `confirmed_parallel_periods` explicitly acknowledges that the two date ranges are genuine parallel work. Each acknowledgement names two distinct experience indices and repeats their exact normalized `started_on` and `ended_on` values; both indices and periods must match the submitted array and `expected_version`. A new or changed period needs an acknowledgement in that PUT. The server carries an earlier acknowledgement only when the same two indices still contain the same dates; reordering or changing either date requires a new acknowledgement. Editing other experience fields does not invalidate a matching date-pair acknowledgement. A missing acknowledgement answers 400 with pointers to the period fields and changes nothing. Duplicate, out-of-range, self, and non-overlapping acknowledgements are invalid.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), domain rules that depend on the body alone (400), then the rules that depend on the stored claims against the version: a decision `extracted` for a value that is not a stored suggestion answers 412 when `expected_version` is stale, because another save may have confirmed that value, and 400 when it is current; an unchanged body (200); any other change over a stale version (412). The schema rejects an unknown field, an unknown specialization or grade, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside `YYYY-MM`, a salary that is not a positive multiple of 1000, and more items than a list allows. The server also rejects a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, a changed overlap without explicit confirmation, and a decision `extracted` for a value that is not a stored suggestion, with 400 validation_failed and pointers to the items, for example `/roles/1/specialization` or `/stack/1/status`. Error bodies never repeat a submitted value.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
@@ -1152,15 +1156,13 @@ paths:
|
||||
/api/v1/organizations/{org_id}:
|
||||
get:
|
||||
operationId: GetOrganization
|
||||
summary: Read an organization of which the caller is a member.
|
||||
summary: Read an organization managed by the caller.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`. The organization comes from the path and is checked against the membership that the server holds for the session account on every request; the identifier itself grants nothing.
|
||||
Requires the session cookie of a verified employer account with an active owner membership in `org_id`. The organization comes from the path and is checked against the membership that the server holds for the session account on every request; the identifier itself grants nothing.
|
||||
|
||||
Returns the profile with its current `version`, the verification level (`verification`), and the card as a candidate sees it (`candidate_card`). The verification level is always the one the server holds: it never rises because the profile is complete, because the organization has members, or because of an email domain. The role of the caller is not part of this resource; ListMyOrganizations returns it with the membership.
|
||||
|
||||
In the MVP the profile is readable by any active member; every member is an owner, because the operations that add members are planned. The roles of PRD FR07 that read a company card without managing it change no field of this contract.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an account without an active membership in the organization, including a `suspended`, `removed`, or `left` one, and an unknown organization all answer 404 not_found, so organizations cannot be enumerated. A malformed `org_id` answers 400 validation_failed with the path pointer.
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an account without an active membership in the organization, including a `suspended`, `removed`, or `left` one, and an unknown organization all answer 404 not_found, so organizations cannot be enumerated. An active member whose role is not `owner` answers 403 forbidden. A malformed `org_id` answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
@@ -4067,6 +4069,68 @@ components:
|
||||
$ref: '#/components/schemas/ProfileItemStatus'
|
||||
source:
|
||||
$ref: '#/components/schemas/ProfileClaimSource'
|
||||
ProfileExperienceOverlapStatus:
|
||||
type: string
|
||||
description: Whether the candidate confirmed that two overlapping periods are genuine parallel work.
|
||||
enum:
|
||||
- needs_confirmation
|
||||
- confirmed
|
||||
ProfileExperienceOverlap:
|
||||
type: object
|
||||
description: One pair of work history entries whose inclusive month ranges overlap. The indices refer to the experience array in this profile version. `confirmed` records an explicit acknowledgement for this pair of dates; otherwise the pair needs confirmation before a changed profile can be saved.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- status
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
status:
|
||||
$ref: '#/components/schemas/ProfileExperienceOverlapStatus'
|
||||
ProfileExperiencePeriod:
|
||||
type: object
|
||||
description: The exact month range of an experience entry, copied into a confirmation.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- started_on
|
||||
- ended_on
|
||||
properties:
|
||||
started_on:
|
||||
$ref: '#/components/schemas/ProfileYearMonth'
|
||||
ended_on:
|
||||
description: Last month of work, or null when the period is open-ended.
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ProfileYearMonth'
|
||||
- type: 'null'
|
||||
ProfileParallelPeriodConfirmation:
|
||||
type: object
|
||||
description: Explicit acknowledgement that the two indexed experience periods are genuine parallel work. The indices and exact ranges must match the submitted experience array; expected_version binds the acknowledgement to the profile version the candidate read.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- first_index
|
||||
- second_index
|
||||
- first_period
|
||||
- second_period
|
||||
properties:
|
||||
first_index:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 19
|
||||
second_index:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 19
|
||||
first_period:
|
||||
$ref: '#/components/schemas/ProfileExperiencePeriod'
|
||||
second_period:
|
||||
$ref: '#/components/schemas/ProfileExperiencePeriod'
|
||||
ProfileConfirmedCategory:
|
||||
type: object
|
||||
description: 'A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`.'
|
||||
@@ -4101,6 +4165,7 @@ components:
|
||||
- stack
|
||||
- roles
|
||||
- experience
|
||||
- experience_overlaps
|
||||
- soft_skills
|
||||
- terms
|
||||
- confirmed_categories
|
||||
@@ -4130,6 +4195,12 @@ components:
|
||||
description: Work history entries in the order the candidate gave them.
|
||||
items:
|
||||
$ref: '#/components/schemas/ProfileExperienceItem'
|
||||
experience_overlaps:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: Every pair of overlapping experience periods, with its confirmation status. The indices refer to this version's experience array.
|
||||
items:
|
||||
$ref: '#/components/schemas/ProfileExperienceOverlap'
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
@@ -4389,6 +4460,12 @@ components:
|
||||
description: Work history entries.
|
||||
items:
|
||||
$ref: '#/components/schemas/ProfileExperienceItemInput'
|
||||
confirmed_parallel_periods:
|
||||
type: array
|
||||
maxItems: 190
|
||||
description: Explicit acknowledgements for overlapping periods. Each pair must use distinct in-range indices and repeat the exact normalized started_on and ended_on values of those entries in this body. A changed or reordered period needs a new acknowledgement. The server retains a previous acknowledgement only for the same indices and dates. Duplicate pairs and pairs that do not overlap are rejected.
|
||||
items:
|
||||
$ref: '#/components/schemas/ProfileParallelPeriodConfirmation'
|
||||
soft_skills:
|
||||
type: array
|
||||
maxItems: 10
|
||||
@@ -9756,7 +9833,7 @@ components:
|
||||
version_conflict:
|
||||
$ref: '#/components/examples/VersionConflict'
|
||||
ProfileValidationFailed:
|
||||
description: 'The body does not match the contract or violates a profile rule: an unknown field such as confirmed_grade, category, trust_level, or source, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside the YYYY-MM format, a salary that is not a positive multiple of 1000, more items than a list allows, a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, a decision extracted for a value that is not a stored suggestion, or a missing or invalid expected_version; code validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed. The problem never repeats a submitted value, because the body is personal data.'
|
||||
description: 'The body does not match the contract or violates a profile rule: an unknown field such as confirmed_grade, category, trust_level, or source, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside the YYYY-MM format, a salary that is not a positive multiple of 1000, more items than a list allows, a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, a decision extracted for a value that is not a stored suggestion, an overlapping experience period without an explicit date-pair acknowledgement, or a missing or invalid expected_version; code validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed. The problem never repeats a submitted value, because the body is personal data.'
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
@@ -10480,6 +10557,7 @@ components:
|
||||
stack: []
|
||||
roles: []
|
||||
experience: []
|
||||
experience_overlaps: []
|
||||
soft_skills: []
|
||||
terms:
|
||||
location:
|
||||
@@ -10573,6 +10651,7 @@ components:
|
||||
quote: null
|
||||
extraction_version: null
|
||||
confirmed_at: '2026-10-05T09:30:00Z'
|
||||
experience_overlaps: []
|
||||
soft_skills:
|
||||
- skill: Mentoring
|
||||
status: confirmed
|
||||
|
||||
@@ -321,6 +321,14 @@ components:
|
||||
$ref: ./components/schemas.yml#/ProfileRoleItem
|
||||
ProfileExperienceItem:
|
||||
$ref: ./components/schemas.yml#/ProfileExperienceItem
|
||||
ProfileExperienceOverlapStatus:
|
||||
$ref: ./components/schemas.yml#/ProfileExperienceOverlapStatus
|
||||
ProfileExperienceOverlap:
|
||||
$ref: ./components/schemas.yml#/ProfileExperienceOverlap
|
||||
ProfileExperiencePeriod:
|
||||
$ref: ./components/schemas.yml#/ProfileExperiencePeriod
|
||||
ProfileParallelPeriodConfirmation:
|
||||
$ref: ./components/schemas.yml#/ProfileParallelPeriodConfirmation
|
||||
ProfileConfirmedCategory:
|
||||
$ref: ./components/schemas.yml#/ProfileConfirmedCategory
|
||||
CandidateProfile:
|
||||
|
||||
@@ -8,6 +8,8 @@ get:
|
||||
|
||||
Every value carries its confirmation state and provenance, and every claim has trust level 0. The self-assessed grade of a role is separate from `confirmed_categories`, which only assessment results establish and which no request writes. The profile needs no file, no ML extraction, and no FSP account.
|
||||
|
||||
`experience_overlaps` lists every pair of entries whose inclusive month ranges overlap. Its indices refer to this response's `experience` array and are scoped to the same `version`; each pair is either `needs_confirmation` or `confirmed`.
|
||||
|
||||
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
@@ -40,7 +42,7 @@ put:
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new state of every field and list; see CandidateProfileUpdate for the decisions that it carries. It replaces the stored profile as a whole.
|
||||
|
||||
Every field is optional in substance: a profile can be saved with any subset filled and the rest null or empty, so no value requires a resume, the ML service, an FSP account, or any other file or link. Which fields are needed to leave the onboarding step candidate_profile is an open product question that this contract does not decide; a save on that step advancing the account to candidate_questionnaire is planned.
|
||||
Every field is optional in substance: a profile can be saved with any subset filled and the rest null or empty, so no value requires a resume, the ML service, an FSP account, or any other file or link. A successful save advances an account whose current onboarding step is candidate_profile to candidate_questionnaire, including a no-op save; it never moves a later step backwards. This update is atomic with the profile and its history.
|
||||
|
||||
Provenance is the server's: a value typed in the form is `manual`, confirming a stored suggestion keeps its origin, and every claim keeps trust level 0. The body has no origin, trust level, confirmation time, confirmed grade, or category, and unknown fields are rejected. A self-assessed grade never becomes a confirmed grade or a category.
|
||||
|
||||
@@ -50,7 +52,9 @@ put:
|
||||
|
||||
The save replaces the stored claims as a whole. A suggestion that an import stored and that the client did not render and send back with the decision `extracted` is dropped by the save; a client therefore sends every suggestion that it received, and a client that read an older version gets 412 instead of silently dropping a suggestion it never saw.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), domain rules that depend on the body alone (400), then the rules that depend on the stored claims against the version: a decision `extracted` for a value that is not a stored suggestion answers 412 when `expected_version` is stale, because another save may have confirmed that value, and 400 when it is current; an unchanged body (200); any other change over a stale version (412). The schema rejects an unknown field, an unknown specialization or grade, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside `YYYY-MM`, a salary that is not a positive multiple of 1000, and more items than a list allows. The server also rejects a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, and a decision `extracted` for a value that is not a stored suggestion, with 400 validation_failed and pointers to the items, for example `/roles/1/specialization` or `/stack/1/status`. Error bodies never repeat a submitted value.
|
||||
Experience periods use inclusive calendar months. An overlap is allowed only when `confirmed_parallel_periods` explicitly acknowledges that the two date ranges are genuine parallel work. Each acknowledgement names two distinct experience indices and repeats their exact normalized `started_on` and `ended_on` values; both indices and periods must match the submitted array and `expected_version`. A new or changed period needs an acknowledgement in that PUT. The server carries an earlier acknowledgement only when the same two indices still contain the same dates; reordering or changing either date requires a new acknowledgement. Editing other experience fields does not invalidate a matching date-pair acknowledgement. A missing acknowledgement answers 400 with pointers to the period fields and changes nothing. Duplicate, out-of-range, self, and non-overlapping acknowledgements are invalid.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), domain rules that depend on the body alone (400), then the rules that depend on the stored claims against the version: a decision `extracted` for a value that is not a stored suggestion answers 412 when `expected_version` is stale, because another save may have confirmed that value, and 400 when it is current; an unchanged body (200); any other change over a stale version (412). The schema rejects an unknown field, an unknown specialization or grade, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside `YYYY-MM`, a salary that is not a positive multiple of 1000, and more items than a list allows. The server also rejects a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, a changed overlap without explicit confirmation, and a decision `extracted` for a value that is not a stored suggestion, with 400 validation_failed and pointers to the items, for example `/roles/1/specialization` or `/stack/1/status`. Error bodies never repeat a submitted value.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
get:
|
||||
operationId: GetOrganization
|
||||
summary: Read an organization of which the caller is a member.
|
||||
summary: Read an organization managed by the caller.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`. The organization comes from the path and is checked against the membership that the server holds for the session account on every request; the identifier itself grants nothing.
|
||||
Requires the session cookie of a verified employer account with an active owner membership in `org_id`. The organization comes from the path and is checked against the membership that the server holds for the session account on every request; the identifier itself grants nothing.
|
||||
|
||||
Returns the profile with its current `version`, the verification level (`verification`), and the card as a candidate sees it (`candidate_card`). The verification level is always the one the server holds: it never rises because the profile is complete, because the organization has members, or because of an email domain. The role of the caller is not part of this resource; ListMyOrganizations returns it with the membership.
|
||||
|
||||
In the MVP the profile is readable by any active member; every member is an owner, because the operations that add members are planned. The roles of PRD FR07 that read a company card without managing it change no field of this contract.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an account without an active membership in the organization, including a `suspended`, `removed`, or `left` one, and an unknown organization all answer 404 not_found, so organizations cannot be enumerated. A malformed `org_id` answers 400 validation_failed with the path pointer.
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an account without an active membership in the organization, including a `suspended`, `removed`, or `left` one, and an unknown organization all answer 404 not_found, so organizations cannot be enumerated. An active member whose role is not `owner` answers 403 forbidden. A malformed `org_id` answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
|
||||
Reference in new issue
Block a user