feat(api): add employer need contract with requirement versions and recommendations
This commit is contained in:
1 parent
3adb0ef9e4
commit
a7d5781f2d
95 files changed
+25352
-26
No files matched your search
+71
-3
@@ -14,7 +14,7 @@ From the repository root, `make -C api check` checks contracts and `make generat
|
||||
|
||||
## Contract conventions
|
||||
|
||||
`api/core/` fixes these conventions as reusable components in `openapi.yml` and the files under `components/`: schemas in `components/schemas/*_schemas.yml`, parameters in `parameters.yml`, response headers in `headers.yml`, responses in `responses.yml`, and examples in `examples.yml`. Operations reference them as they are added. Currently implemented: problem responses for errors of the Go public API and the ML service. Idempotency-Key storage, If-Match checks, and pagination are planned behavior for business operations; the declared `RegisterAccount` operation and the assessment commands require Idempotency-Key, but no operation stores keys yet.
|
||||
`api/core/` fixes these conventions as reusable components in `openapi.yml` and the files under `components/`: schemas in `components/schemas/*_schemas.yml`, parameters in `parameters.yml`, response headers in `headers.yml`, responses in `responses.yml`, and examples in `examples.yml`. Operations reference them as they are added. Currently implemented: problem responses for errors of the Go public API and the ML service. Idempotency-Key storage, If-Match checks, and pagination are planned behavior for business operations; the declared `RegisterAccount` operation, the assessment commands, and `CreateOrganizationNeed` require Idempotency-Key, but no operation stores keys yet.
|
||||
|
||||
### Errors
|
||||
|
||||
@@ -81,7 +81,7 @@ Lists use cursor pagination: `limit` from 1 to 100 (20 by default) and an opaque
|
||||
|
||||
### Time and money
|
||||
|
||||
Timestamps use the `Timestamp` schema: `string`, `format: date-time`, UTC with the `Z` suffix (RFC 3339). Servers always emit UTC. ogen generates `Timestamp` as a named Go type over `time.Time`; call `.UTC()` where a value is converted to it. Money is planned as an integer number of whole rubles with explicit fields for the base, such as the pay period and gross or net; the schema is added with the first business field that carries money.
|
||||
Timestamps use the `Timestamp` schema: `string`, `format: date-time`, UTC with the `Z` suffix (RFC 3339). Servers always emit UTC. ogen generates `Timestamp` as a named Go type over `time.Time`; call `.UTC()` where a value is converted to it. Money is an integer number of whole rubles (`RubAmount`, int64) with an explicit base: `SalaryRange` requires `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`), and `tax_basis` (`net` or `gross`); see Needs below. Invitations are expected to reuse `SalaryRange`.
|
||||
|
||||
### ML service errors
|
||||
|
||||
@@ -237,6 +237,73 @@ Result:
|
||||
|
||||
Planned, additive: a short approach description of up to 1500 characters next to the practice, which never decides the grade (PRD FR05); the debug run operation of the practice; the notice and storage of the anti-cheat signals (time, focus changes, pastes, parallel sessions), which lead to a review and an appeal, never to a public label and never to the employer (PRD FR05).
|
||||
|
||||
### Needs
|
||||
|
||||
The `need` tag covers the hiring needs of an organization (PRD FR08, with the versions of FR10): requirements with their confirmation state and provenance, immutable versions, readiness, and category recommendations. The operations are in the contract; their business logic is not implemented yet, so every one answers 401 `unauthenticated` until sessions exist (`v1.DenyAllSecurity`).
|
||||
|
||||
| Method and path | operationId | Security | Success | Specific errors |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/organizations/{org_id}/needs` | `ListOrganizationNeeds` | session | 200 `NeedList`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `forbidden`, 404 `not_found` |
|
||||
| `POST /api/v1/organizations/{org_id}/needs` | `CreateOrganizationNeed` | session and CSRF, Idempotency-Key | 201 `Need`, `Cache-Control: no-store` | 400, 401, 403 `csrf_check_failed` or `forbidden`, 404, 409 `idempotency_in_progress`, 422 `idempotency_key_reused`, 429 |
|
||||
| `GET /api/v1/organizations/{org_id}/needs/{need_id}` | `GetOrganizationNeed` | session | 200 `Need`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `forbidden`, 404 `not_found` |
|
||||
| `PATCH /api/v1/organizations/{org_id}/needs/{need_id}` | `UpdateOrganizationNeed` | session and CSRF | 200 `Need`, `Cache-Control: no-store` | 400, 401, 403, 404, 412 `version_conflict`, 429 |
|
||||
|
||||
Every operation also declares the `default` problem response. A malformed `org_id` or `need_id` answers 400 with the path pointer.
|
||||
|
||||
Access:
|
||||
|
||||
- `org_id` in the path is the only source of the organization, and the server checks it against the active membership of the session account; no request has an organization, membership, or role field. The organization contract (TASK-077) owns organizations and memberships and reuses the same path parameter, `parameters.yml#/OrganizationId`.
|
||||
- An account without an active membership in `org_id`, an unknown organization, an unknown need, and a need of another organization all answer 404 `not_found`, so identifiers cannot be probed. A candidate account answers 403 `forbidden`, and so does a member whose role does not allow the operation.
|
||||
- In the MVP only the owner of the organization works with needs. The other roles of the PRD FR07 matrix (recruiter, hiring manager and technical expert for assigned needs) are planned and change no field of the contract.
|
||||
|
||||
Fields and provenance:
|
||||
|
||||
- `requirements` (`NeedRequirementSet`) holds `specialization`, `grade`, `required_skills`, `desired_skills`, `tasks`, `domain`, `work_formats`, `location`, and `salary`. A field in a response is `{status, value, source}`; a list item has its own `status` and `source`.
|
||||
- `status` is `confirmed` (a member entered or confirmed the value), `extracted` (a suggestion that waits for confirmation), or `unknown` (no value). An unknown field has null `value` and `source`; the server never fills it with a default or a guess such as Senior, remote, or a zero salary. Only confirmed values feed readiness, recommendations, search, and invitations.
|
||||
- `source` has `origin` (`manual`, `extracted_from_text`, or the planned `imported`), `quote` (an exact excerpt of up to 300 characters, or null), `extracted_in_version`, and `extraction_version`. The quote is an excerpt of the `source_text` of `extracted_in_version`, not necessarily of the current text: a confirmed value keeps its quote after the text changes. Confirming a suggestion keeps its provenance; changing the value makes it `manual`.
|
||||
- A skill has `taxonomy_code`. It is null for a skill that the platform taxonomy does not know: the name stays as given, no code is guessed, and recommendations count the skill as not covered.
|
||||
- With `source_text`, the server extracts suggestions with deterministic rules and a dictionary before it answers, so needs work while ML is disabled. ML suggestions with quotes are planned as an asynchronous addition that creates a new version and never overwrites a confirmed value.
|
||||
- The text is stored as written and may contain requirements that discriminate by a protected characteristic; the extractor never turns them into a need field. The field for what a candidate must not have, with the Labor Code article 64 check, is deferred to TASK-182 and will be added without a breaking change.
|
||||
|
||||
Requests, confirmation, and changes:
|
||||
|
||||
- Every requirement field in a request is a decision `{value, status}` (`NeedSpecializationInput`, `NeedGradeInput`, `NeedDomainInput`, `NeedWorkFormatsInput`, `NeedLocationInput`, `NeedSalaryInput`), and every list item is `{name or text, status}`. `status` is `confirmed` or `extracted`. A bare value fails validation, so confirmation is always explicit.
|
||||
- `confirmed` with the stored suggested value confirms it and keeps its provenance; `confirmed` with another value sets a confirmed manual value. `extracted` keeps a stored suggestion open and is allowed only with exactly the stored suggested value; any other value, or a field or item without a suggestion, answers 400 with the pointer of that status, such as `/grade/status` or `/required_skills/2/status`. A client that sends back an unchanged form therefore confirms nothing by accident: it sends each suggestion with `extracted` or leaves the field out.
|
||||
- A need never requires a vacancy: only `title` is required, and `vacancy_id` is optional and nullable. Until vacancies exist in the contract, any vacancy identifier answers 400 with the pointer `/vacancy_id`.
|
||||
- On creation every decision must be `confirmed`, because a new need has no stored suggestion. An absent field is extracted from `source_text` or stays unknown. A nullable field sent as null stays unknown, and a skill or task list sent empty stays empty; neither is extracted. An empty `work_formats` value fails `minItems`.
|
||||
- `UpdateOrganizationNeed` uses explicit field replacement in `application/json`, not JSON Merge Patch (RFC 7396): a present field replaces that field as a whole, an absent field stays unchanged, a decision and a list are never merged, and a stored item left out of a sent list is deleted. Null removes a nullable field (it becomes `unknown`, or `vacancy_id` is unlinked); an empty skill or task list deletes every item; a list sent as null answers 400. ogen generates one optional, or optional and nullable, value per decision (`OptNilNeedGradeInput`, `OptNilNeedSalaryInput`).
|
||||
- A different `source_text` extracts again. New suggestions replace only the `extracted` values and items of fields not named in the body; confirmed values are never overwritten, a suggested skill whose name is already in either skill list is skipped, and a suggestion that a member deleted is not proposed again for this need.
|
||||
- The server also rejects a repeated skill or task and a skill in both lists, with 400 and the pointer of the later item, such as `/required_skills/1/name`.
|
||||
|
||||
Versions and concurrency:
|
||||
|
||||
- `version` starts at 1 and advances by exactly one with each committed change, including server-side ones. Each version is an immutable snapshot. GET always returns the latest version.
|
||||
- `requirements_version` is the version in which the confirmed requirements were last changed. Confirming, changing, or removing a requirement sets it to the new `version`; a change of the title, the vacancy link, the text, or suggestions only keeps it and invalidates neither the recommendations nor search results. Search runs, selection snapshots (FR10, TASK-193), and invitations refer to `(need_id, requirements_version)`, and only a new `requirements_version` calls for a new selection snapshot. Reading and comparing earlier versions are planned as separate operations that return `NeedRequirementSet` for a version; they add nothing to `Need`.
|
||||
- A change carries `expected_version`, the version the client read, in the body for the same reason as the questionnaire: the generated client cannot read `ETag` yet. A stale value answers 412 `version_conflict` and changes nothing; TASK-179 says 409, but the repository rule keeps 412 for If-Match and a body version alike. A body that changes nothing answers 200 with the current need even with an older version, so PATCH needs no Idempotency-Key. POST needs one with the 24-hour replay; only the 201 is stored.
|
||||
|
||||
Readiness:
|
||||
|
||||
- `readiness.missing_fields` lists each critical field without a confirmed value: `specialization`, `grade`, `required_skills` (at least one confirmed skill), `work_formats`, `salary`, and `location` when the confirmed formats include `office` or `hybrid`. Each item has `reason` (`unknown` or `unconfirmed`) and a specific Russian `question`.
|
||||
- An incomplete need is saved (201 or 200), not rejected. `Problem` allows no extension fields, so the missing fields live in the resource, not in a problem. Each later operation, such as search or an invitation, states which readiness it requires.
|
||||
|
||||
Salary:
|
||||
|
||||
- `SalaryRange` `[A; B]` has `salary_from` and `salary_to` (`RubAmount`, whole rubles), `currency` (`RUB` only), `period` (`month` only), and `tax_basis` (`net` or `gross`); every field is required. Requests send it as `salary: {value, status}`, so its pointers are under `/salary/value`.
|
||||
- The schema requires bounds that are positive multiples of 1000 up to 100000000 and rejects another currency, period, or basis, for example with `/salary/value/tax_basis`. A missing field of the nested range has the whole-body pointer.
|
||||
- The server checks the cross-field rules of PRD FR13 in integer arithmetic: `A < B` and a width `(B - A) / ((A + B) / 2)` from 10% to 40% inclusive, that is `20 * (B - A) >= A + B` and `5 * (B - A) <= A + B`. A violation, including equal bounds, answers 400 with the pointer `/salary/value/salary_to`. `[95000; 105000]` (exactly 10%) and `[80000; 120000]` (exactly 40%) are accepted. FR13 applies the same rules to the range of a need and of an invitation, and `docs/*/ARCHITECTURE.md` now states them for invitations instead of `0 < salary_from <= salary_to`.
|
||||
- Limit against probing hidden minimums (FR13, planned in TASK-211): setting a confirmed range, on creation or on a change, counts against a counter shared by the whole organization, every member and every need, so a new need does not reset it. At most three range settings a day; over the limit the server answers 429 with Retry-After and changes nothing. After five settings within seven days the money component is `withheld` for seven days. Repeated range changes also feed the private risk signals of TASK-319.
|
||||
|
||||
Recommendations:
|
||||
|
||||
- `recommendations` is computed by the server from the confirmed requirements of `requirements_version` with a versioned policy (`policy_version`, `algorithm_version`, `computed_at`). `status` is `computed`, `pending`, or `not_available` without a confirmed skill. The server may recompute them for the same `requirements_version`, for a new policy or a changed pool of candidates, without a new need version; `computed_at` and `policy_version` then change.
|
||||
- Each category (`specialization` and `grade`) has `score`, `skill_overlap` (weighted share with weight 2 for required and 1 for desired skills, covered and uncovered skills), `money`, and `supply` as a band: `fewer_than_5`, `from_5_to_29`, `30_or_more`. The list order is the ranking.
|
||||
- `money.status` is `computed`, `insufficient_data` (fewer than five candidates with a comparable known minimum), `no_salary`, or `withheld`; the last three use the neutral 0.5 and a null share. `money.share` is rounded down to a quarter (0, 0.25, 0.5, 0.75, 1): each probe of a new upper bound then tells at most which quarter of the group accepts it, and in the smallest allowed group of five a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.
|
||||
- `score` is `0.5 * Overlap + 0.3 * Money + 0.2 * Supply`, rounded half up to two decimals, computed from the published components: the exact overlap, the quarter-rounded share or the neutral 0.5, and `Supply = min(1, active / 30)`. It is null when `supply` is `fewer_than_5`. The ranking uses Supply only at band precision below five: every group of fewer than five candidates enters it with Supply 0, so neither the score nor the order reveals the exact size of a group below five, which FR08 forbids. For five or more candidates the exact Supply is used, so the TASK-183 fixture (Overlap 1, Money 0.5, 15 active candidates) gives `score` 0.75.
|
||||
- Deviation from the PRD formula and from TASK-183 and TASK-457: the money share in the score and ranking is the quarter-rounded share, not the exact one, and a category with fewer than five candidates has no score. Otherwise the score with the exact share would reveal the share that `money.share` rounds, and a score with the exact Supply of a small group would reveal its size. The breakdown that TASK-457 shows consists of the published components.
|
||||
- Requests cannot set a recommendation, its score, membership, or a candidate minimum: bodies have `additionalProperties: false`, and unknown fields such as `rec_score`, `members`, `candidate_minimum`, `version`, `requirements_version`, or `recommendations` answer 400 with the whole-body pointer. `TestNeedSchemaValidationPrecedesImplementation` checks the schema rejections through the generated server, `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart` checks the list decoding, and `frontend/src/shared/api/needs-contract.test.ts` pins the generated Zod limits, the explicit status of every decision, and the absence of these fields in the request types.
|
||||
|
||||
Planned, additive: reading and comparing versions, exclusions (TASK-182), the market range hint (P25-P75) of FR08, the check plan "vacancy -> tasks", a need status for archiving, list filters, and need assignments.
|
||||
|
||||
### Generator checks
|
||||
|
||||
`testdata/openapi-3.2.0.yml` contains test operations that use the components above: pagination, Idempotency-Key, If-Match, ETag, and problem responses. ogen does not resolve external references, so the fixture keeps copies of the api/core components; `scripts/test_contract_copies.py` (part of `make -C api check`) checks that they, the fixture responses, and the ML `Problem` copy match api/core.
|
||||
@@ -262,12 +329,13 @@ Known generator limitations:
|
||||
- ogen requires a `SecurityHandler` as soon as the contract has security schemes and evaluates the schemes in the order of their generated type names, so renaming a scheme can change the order; `TestGeneratedServerSecurityOrder` fails if it does. Security failures reach `NewError` without a response header, so clearing the cookie on a 401 from `Logout` needs handwritten code.
|
||||
- Orval does not expose security scheme values as typed arguments, so `X-CSRF-Token` is not a generated parameter; the shared API client is planned to attach it to mutating requests. Orval also generates no type for `Set-Cookie`, which the browser handles.
|
||||
- Orval Zod schemas ignore `uniqueItems` and do not reject unknown fields of `additionalProperties: false` objects; the server stays authoritative for both.
|
||||
- ogen generates an optional nullable field as `OptNil<T>`, which tells absent (`IsSet` false), null (`IsNull`), and a value apart. An optional array that is not nullable is a plain slice instead, where nil and `[]` mean different things: an absent field decodes to nil (unchanged) and `[]` to an empty non-nil slice (delete every item), and null fails decoding. An `UpdateOrganizationNeed` handler must therefore test lists with `!= nil`, never with `len`; `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart` pins this.
|
||||
- Orval clears `src/shared/api/endpoints/` and `src/shared/api/schemas/` before generation (`clean: true`), because a schema used by several tags moves from a tag directory to the schema root.
|
||||
|
||||
#### Format unions
|
||||
|
||||
- Format unions such as `ItemContent` and `AssessmentAnswer` are `oneOf` without a `discriminator` object. Redocly resolves `discriminator.mapping` values as references, and `scripts/merge-schemas.py` rewrites only `$ref`, so a mapping in a split schema file cannot resolve in the merged `components/schemas.yml`. Every variant fixes `format` with a one-value enum; ogen discriminates by that value and by the fields unique to a variant and rejects a body that matches several variants, and Orval generates a Zod union.
|
||||
- Orval names the constants of an inline property `<Schema><Property>`, so a property name that repeats another schema name collides in `index.ts` (TS2308). The union of item formats is therefore `ItemContent`, not `AssessmentItemContent`, next to the `AssessmentItem.content` property.
|
||||
- Orval names the constants of an inline property `<Schema><Property>`, so a property name that repeats another schema name collides in `index.ts` (TS2308). The union of item formats is therefore `ItemContent`, not `AssessmentItemContent`, next to the `AssessmentItem.content` property, and the parts of `Need` are `NeedRequirementSet`, `NeedReadinessReport`, and `NeedCategoryRecommendations`, not `NeedRequirements`, `NeedReadiness`, and `NeedRecommendations`.
|
||||
|
||||
Generated Zod is not strict. A body that mixes the fields of two formats or carries an extra `score` or `seed` is accepted after unknown keys are silently stripped, and `uniqueItems` is not checked; only the server rejects such bodies. `frontend/src/shared/api/assessment-contract.test.ts` pins the accepted formats and that no answer or item DTO has a score, key, seed, or correctness field.
|
||||
|
||||
|
||||
+71
-3
@@ -14,7 +14,7 @@
|
||||
|
||||
## Соглашения контракта
|
||||
|
||||
`api/core/` закрепляет эти соглашения как переиспользуемые компоненты в `openapi.yml` и файлах `components/`: схемы в `components/schemas/*_schemas.yml`, параметры в `parameters.yml`, заголовки ответов в `headers.yml`, ответы в `responses.yml`, примеры в `examples.yml`. Операции ссылаются на них по мере появления. Сейчас реализованы problem-ответы для ошибок публичного Go API и ML-сервиса. Хранение Idempotency-Key, проверки If-Match и пагинация - запланированное поведение бизнес-операций; объявленная операция `RegisterAccount` и команды оценки требуют Idempotency-Key, но ни одна операция пока не хранит ключи.
|
||||
`api/core/` закрепляет эти соглашения как переиспользуемые компоненты в `openapi.yml` и файлах `components/`: схемы в `components/schemas/*_schemas.yml`, параметры в `parameters.yml`, заголовки ответов в `headers.yml`, ответы в `responses.yml`, примеры в `examples.yml`. Операции ссылаются на них по мере появления. Сейчас реализованы problem-ответы для ошибок публичного Go API и ML-сервиса. Хранение Idempotency-Key, проверки If-Match и пагинация - запланированное поведение бизнес-операций; объявленная операция `RegisterAccount`, команды оценки и `CreateOrganizationNeed` требуют Idempotency-Key, но ни одна операция пока не хранит ключи.
|
||||
|
||||
### Ошибки
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
### Время и деньги
|
||||
|
||||
Метки времени используют схему `Timestamp`: `string`, `format: date-time`, UTC с суффиксом `Z` (RFC 3339). Серверы всегда отдают UTC. ogen генерирует `Timestamp` как именованный Go-тип поверх `time.Time`; при преобразовании к нему вызывайте `.UTC()`. Деньги запланированы как целое число полных рублей с явными полями базы, например периодом оплаты и gross или net; схема появится вместе с первым бизнес-полем с деньгами.
|
||||
Метки времени используют схему `Timestamp`: `string`, `format: date-time`, UTC с суффиксом `Z` (RFC 3339). Серверы всегда отдают UTC. ogen генерирует `Timestamp` как именованный Go-тип поверх `time.Time`; при преобразовании к нему вызывайте `.UTC()`. Деньги - целое число полных рублей (`RubAmount`, int64) с явной базой: `SalaryRange` требует `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`) и `tax_basis` (`net` или `gross`); см. раздел Потребности ниже. Приглашения, как ожидается, переиспользуют `SalaryRange`.
|
||||
|
||||
### Ошибки ML-сервиса
|
||||
|
||||
@@ -237,6 +237,73 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
Запланировано, добавляется без ломающих изменений: краткое описание подхода до 1500 знаков рядом с практикой, которое не определяет грейд (FR05 в PRD); операция отладочных запусков практики; уведомление о собираемых античит-сигналах (время, переключение фокуса, вставки, параллельные сессии) и их хранение; сигналы ведут к перепроверке и апелляции, а не к публичному ярлыку, и работодателю не показываются (FR05 в PRD).
|
||||
|
||||
### Потребности
|
||||
|
||||
Тег `need` описывает потребности организации в найме (FR08 в PRD, с версиями из FR10): требования с состоянием подтверждения и происхождением, неизменяемые версии, готовность и рекомендации категорий. Операции есть в контракте, бизнес-логика еще не реализована, поэтому каждая отвечает 401 `unauthenticated`, пока сессий нет (`v1.DenyAllSecurity`).
|
||||
|
||||
| Метод и путь | operationId | Защита | Успех | Конкретные ошибки |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/organizations/{org_id}/needs` | `ListOrganizationNeeds` | сессия | 200 `NeedList`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `forbidden`, 404 `not_found` |
|
||||
| `POST /api/v1/organizations/{org_id}/needs` | `CreateOrganizationNeed` | сессия и CSRF, Idempotency-Key | 201 `Need`, `Cache-Control: no-store` | 400, 401, 403 `csrf_check_failed` или `forbidden`, 404, 409 `idempotency_in_progress`, 422 `idempotency_key_reused`, 429 |
|
||||
| `GET /api/v1/organizations/{org_id}/needs/{need_id}` | `GetOrganizationNeed` | сессия | 200 `Need`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `forbidden`, 404 `not_found` |
|
||||
| `PATCH /api/v1/organizations/{org_id}/needs/{need_id}` | `UpdateOrganizationNeed` | сессия и CSRF | 200 `Need`, `Cache-Control: no-store` | 400, 401, 403, 404, 412 `version_conflict`, 429 |
|
||||
|
||||
Каждая операция также объявляет problem-ответ `default`. Некорректные `org_id` или `need_id` дают 400 с pointer на параметр пути.
|
||||
|
||||
Доступ:
|
||||
|
||||
- `org_id` в пути - единственный источник организации, и сервер сверяет его с действующим членством аккаунта сессии; ни один запрос не содержит поля организации, членства или роли. Организации и членства принадлежат контракту организации (TASK-077), который переиспользует тот же параметр пути `parameters.yml#/OrganizationId`.
|
||||
- Аккаунт без действующего членства в `org_id`, неизвестная организация, неизвестная потребность и потребность другой организации одинаково дают 404 `not_found`, поэтому идентификаторы нельзя перебрать. Аккаунт кандидата получает 403 `forbidden`, как и участник, чья роль не разрешает операцию.
|
||||
- В MVP с потребностями работает только владелец организации. Остальные роли матрицы FR07 в PRD (рекрутер, нанимающий менеджер и техэксперт для назначенных потребностей) запланированы и не меняют ни одного поля контракта.
|
||||
|
||||
Поля и происхождение:
|
||||
|
||||
- `requirements` (`NeedRequirementSet`) содержит `specialization`, `grade`, `required_skills`, `desired_skills`, `tasks`, `domain`, `work_formats`, `location` и `salary`. Поле в ответе - это `{status, value, source}`; у элемента списка свои `status` и `source`.
|
||||
- `status` - `confirmed` (участник ввел или подтвердил значение), `extracted` (предложение, ожидающее подтверждения) или `unknown` (значения нет). У неизвестного поля `value` и `source` равны null; сервер никогда не заполняет его значением по умолчанию или догадкой, например Senior, remote или нулевой зарплатой. Только подтвержденные значения влияют на готовность, рекомендации, поиск и приглашения.
|
||||
- `source` содержит `origin` (`manual`, `extracted_from_text` или запланированный `imported`), `quote` (точный фрагмент до 300 знаков или null), `extracted_in_version` и `extraction_version`. Цитата - фрагмент `source_text` версии `extracted_in_version`, а не обязательно текущего текста: подтвержденное значение сохраняет цитату после изменения текста. Подтверждение предложения сохраняет его происхождение; изменение значения делает его `manual`.
|
||||
- У навыка есть `taxonomy_code`. Он равен null для навыка, которого нет в таксономии платформы: название остается как указано, код не угадывается, а рекомендации считают навык непокрытым.
|
||||
- При наличии `source_text` сервер до ответа извлекает предложения детерминированными правилами и словарем, поэтому потребности работают при выключенном ML. ML-предложения с цитатами запланированы как асинхронное дополнение, которое создает новую версию и никогда не перезаписывает подтвержденное значение.
|
||||
- Текст хранится как написан и может содержать дискриминирующие требования по защищенным признакам; извлечение никогда не превращает их в поле потребности. Поле того, чего не должно быть у кандидата, с проверкой по ст. 64 ТК РФ отложено до TASK-182 и добавится без ломающих изменений.
|
||||
|
||||
Запросы, подтверждение и изменения:
|
||||
|
||||
- Каждое поле требования в запросе - это решение `{value, status}` (`NeedSpecializationInput`, `NeedGradeInput`, `NeedDomainInput`, `NeedWorkFormatsInput`, `NeedLocationInput`, `NeedSalaryInput`), а каждый элемент списка - `{name или text, status}`. `status` - `confirmed` или `extracted`. Голое значение не проходит валидацию, поэтому подтверждение всегда явное.
|
||||
- `confirmed` с сохраненным предложенным значением подтверждает его и сохраняет происхождение; `confirmed` с другим значением задает подтвержденное ручное значение. `extracted` оставляет сохраненное предложение открытым и допустим только с точно тем же предложенным значением; любое другое значение, а также поле или элемент без предложения дают 400 с pointer на этот статус, например `/grade/status` или `/required_skills/2/status`. Поэтому клиент, отправивший форму без изменений, ничего не подтверждает случайно: каждое предложение он отправляет с `extracted` или не отправляет поле.
|
||||
- Потребности никогда не нужна вакансия: обязателен только `title`, а `vacancy_id` необязателен и допускает null. Пока вакансий нет в контракте, любой идентификатор вакансии дает 400 с pointer `/vacancy_id`.
|
||||
- При создании каждое решение должно быть `confirmed`, потому что у новой потребности нет сохраненных предложений. Отсутствующее поле извлекается из `source_text` или остается неизвестным. Nullable-поле, переданное как null, остается неизвестным, а пустой список навыков или задач остается пустым; ни то ни другое не извлекается. Пустое значение `work_formats` не проходит `minItems`.
|
||||
- `UpdateOrganizationNeed` использует явную замену полей в `application/json`, а не JSON Merge Patch (RFC 7396): переданное поле заменяется целиком, отсутствующее не меняется, решения и списки не сливаются, а сохраненный элемент, которого нет в переданном списке, удаляется. Null удаляет nullable-поле (оно становится `unknown`, а `vacancy_id` отвязывается); пустой список навыков или задач удаляет все элементы; список, переданный как null, дает 400. ogen генерирует одно необязательное или необязательное nullable значение на решение (`OptNilNeedGradeInput`, `OptNilNeedSalaryInput`).
|
||||
- Другой `source_text` запускает повторное извлечение. Новые предложения заменяют только значения и элементы со статусом `extracted` в полях, не названных в теле; подтвержденные значения не перезаписываются, предложенный навык с названием, которое уже есть в одном из списков навыков, пропускается, а удаленное участником предложение для этой потребности больше не предлагается.
|
||||
- Сервер также отклоняет повтор навыка или задачи и навык в обоих списках - 400 с pointer на более поздний элемент, например `/required_skills/1/name`.
|
||||
|
||||
Версии и конкурентность:
|
||||
|
||||
- `version` начинается с 1 и растет ровно на единицу с каждым зафиксированным изменением, включая серверные. Каждая версия - неизменяемый снимок. GET всегда возвращает последнюю версию.
|
||||
- `requirements_version` - версия, в которой подтвержденные требования менялись последний раз. Подтверждение, изменение или удаление требования делает ее равной новой `version`; изменение названия, привязки вакансии, текста или только предложений ее сохраняет и не обесценивает ни рекомендации, ни результаты поиска. Запуски поиска, снимки подборки (FR10, TASK-193) и приглашения ссылаются на `(need_id, requirements_version)`, и новый снимок подборки нужен только при новой `requirements_version`. Чтение и сравнение прежних версий запланированы отдельными операциями, которые возвращают `NeedRequirementSet` для версии; в `Need` они ничего не добавляют.
|
||||
- Изменение передает `expected_version` - прочитанную клиентом версию - в теле по той же причине, что и анкета: сгенерированный клиент пока не читает `ETag`. Устаревшее значение дает 412 `version_conflict` и ничего не меняет; в TASK-179 указан 409, но правило репозитория сохраняет 412 и для If-Match, и для версии в теле. Тело, которое ничего не меняет, дает 200 с текущей потребностью даже со старой версией, поэтому PATCH не нужен Idempotency-Key. POST требует его с повтором в течение 24 часов; сохраняется только 201.
|
||||
|
||||
Готовность:
|
||||
|
||||
- `readiness.missing_fields` перечисляет каждое критичное поле без подтвержденного значения: `specialization`, `grade`, `required_skills` (хотя бы один подтвержденный навык), `work_formats`, `salary` и `location`, если подтвержденные форматы включают `office` или `hybrid`. У каждого элемента есть `reason` (`unknown` или `unconfirmed`) и конкретный вопрос `question` на русском.
|
||||
- Неполная потребность сохраняется (201 или 200), а не отклоняется. `Problem` не допускает полей расширения, поэтому недостающие поля находятся в ресурсе, а не в problem. Каждая следующая операция, например поиск или приглашение, сама указывает, какая готовность ей нужна.
|
||||
|
||||
Зарплата:
|
||||
|
||||
- `SalaryRange` `[A; B]` содержит `salary_from` и `salary_to` (`RubAmount`, целые рубли), `currency` (только `RUB`), `period` (только `month`) и `tax_basis` (`net` или `gross`); все поля обязательны. Запрос передает ее как `salary: {value, status}`, поэтому ее pointer начинаются с `/salary/value`.
|
||||
- Схема требует положительных границ, кратных 1000, до 100000000 и отклоняет другую валюту, период или базу, например с `/salary/value/tax_basis`. Для отсутствующего поля вложенной вилки pointer указывает на все тело.
|
||||
- Межполевые правила FR13 в PRD сервер проверяет в целочисленной арифметике: `A < B` и ширина `(B - A) / ((A + B) / 2)` от 10% до 40% включительно, то есть `20 * (B - A) >= A + B` и `5 * (B - A) <= A + B`. Нарушение, включая равные границы, дает 400 с pointer `/salary/value/salary_to`. `[95000; 105000]` (ровно 10%) и `[80000; 120000]` (ровно 40%) принимаются. FR13 применяет одни правила к вилке потребности и приглашения, и `docs/*/ARCHITECTURE.md` теперь указывает их для приглашений вместо `0 < salary_from <= salary_to`.
|
||||
- Ограничение против подбора скрытых минимумов (FR13, запланировано в TASK-211): задание подтвержденной вилки при создании или изменении учитывается в счетчике, общем для всей организации, всех участников и всех потребностей, поэтому новая потребность его не обнуляет. Не больше трех заданий вилки в сутки; сверх лимита сервер отвечает 429 с Retry-After и ничего не меняет. После пяти заданий за семь дней денежная компонента получает статус `withheld` на семь дней. Повторные изменения вилки также питают приватные сигналы риска TASK-319.
|
||||
|
||||
Рекомендации:
|
||||
|
||||
- `recommendations` вычисляет сервер по подтвержденным требованиям версии `requirements_version` с версионируемой политикой (`policy_version`, `algorithm_version`, `computed_at`). `status` - `computed`, `pending` или `not_available` без подтвержденного навыка. Сервер может пересчитать их для той же `requirements_version` при новой политике или изменившемся пуле кандидатов без новой версии потребности; тогда меняются `computed_at` и `policy_version`.
|
||||
- У каждой категории (`specialization` и `grade`) есть `score`, `skill_overlap` (взвешенная доля с весом 2 для обязательных и 1 для желательных навыков, покрытые и непокрытые навыки), `money` и `supply` диапазоном: `fewer_than_5`, `from_5_to_29`, `30_or_more`. Порядок списка задает ранжирование.
|
||||
- `money.status` - `computed`, `insufficient_data` (меньше пяти кандидатов с известным сопоставимым минимумом), `no_salary` или `withheld`; последние три используют нейтральное 0,5 и null в доле. `money.share` округляется вниз до четверти (0, 0.25, 0.5, 0.75, 1): каждая проба новой верхней границы говорит не больше того, какая четверть группы ее принимает, а в наименьшей допустимой группе из пяти один минимум часто не сдвигает значение; при этом доля по-прежнему отличает вилку, которую принимает большинство, от той, которую принимают немногие.
|
||||
- `score` равен `0.5 * Overlap + 0.3 * Money + 0.2 * Supply` с округлением половины вверх до двух знаков и вычисляется по опубликованным компонентам: точному покрытию, доле с округлением до четверти или нейтральному 0,5 и `Supply = min(1, active / 30)`. Он равен null, когда `supply` - `fewer_than_5`. Ниже пяти ранжирование использует Supply только с точностью диапазона: каждая группа меньше пяти кандидатов входит в него с Supply 0, поэтому ни балл, ни порядок не раскрывают точный размер группы меньше пяти, что запрещает FR08. Для пяти и более кандидатов используется точный Supply, поэтому фикстура TASK-183 (Overlap 1, Money 0,5, 15 активных кандидатов) дает `score` 0.75.
|
||||
- Отступление от формулы PRD, TASK-183 и TASK-457: в балле и ранжировании используется доля денег, округленная до четверти, а не точная, и у категории меньше чем с пятью кандидатами балла нет. Иначе балл с точной долей раскрыл бы долю, которую округляет `money.share`, а балл с точным Supply малой группы - ее размер. Разложение, которое показывает TASK-457, состоит из опубликованных компонент.
|
||||
- Запрос не может задать рекомендацию, ее балл, членство или минимум кандидата: у тел `additionalProperties: false`, и неизвестные поля, например `rec_score`, `members`, `candidate_minimum`, `version`, `requirements_version` или `recommendations`, дают 400 с pointer на все тело. `TestNeedSchemaValidationPrecedesImplementation` проверяет отказы схемы через сгенерированный сервер, `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart` - декодирование списков, а `frontend/src/shared/api/needs-contract.test.ts` закрепляет ограничения сгенерированного Zod, явный статус каждого решения и отсутствие этих полей в типах запросов.
|
||||
|
||||
Запланировано, добавляется без ломающих изменений: чтение и сравнение версий, исключения (TASK-182), подсказка рыночной вилки (P25-P75) из FR08, план проверки "вакансия -> задания", статус потребности для архивации, фильтры списка и назначения на потребность.
|
||||
|
||||
### Проверки генераторов
|
||||
|
||||
`testdata/openapi-3.2.0.yml` содержит тестовые операции с перечисленными компонентами: пагинацией, Idempotency-Key, If-Match, ETag и problem-ответами. ogen не разрешает внешние ссылки, поэтому фикстура хранит копии компонентов api/core; `scripts/test_contract_copies.py` (входит в `make -C api check`) проверяет, что они, ответы фикстуры и ML-копия `Problem` совпадают с api/core.
|
||||
@@ -262,12 +329,13 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
- ogen требует `SecurityHandler`, как только в контракте есть схемы защиты, и проверяет схемы в порядке имен их сгенерированных типов, поэтому переименование схемы может изменить порядок; тогда `TestGeneratedServerSecurityOrder` упадет. Сбои защиты попадают в `NewError` без заголовков ответа, поэтому удаление cookie при 401 от `Logout` требует ручного кода.
|
||||
- Orval не делает значения схем защиты типизированными аргументами, поэтому `X-CSRF-Token` не является сгенерированным параметром; его планируется добавлять к изменяющим запросам в общем API-клиенте. Тип для `Set-Cookie` Orval тоже не генерирует, этот заголовок обрабатывает браузер.
|
||||
- Zod-схемы Orval игнорируют `uniqueItems` и не отклоняют неизвестные поля объектов с `additionalProperties: false`; в обоих случаях решает сервер.
|
||||
- ogen генерирует необязательное nullable-поле как `OptNil<T>`, которое различает отсутствие (`IsSet` false), null (`IsNull`) и значение. Необязательный массив без null, напротив, - обычный slice, где nil и `[]` значат разное: отсутствующее поле декодируется в nil (без изменений), `[]` - в пустой slice, не равный nil (удалить все элементы), а null не декодируется. Поэтому обработчик `UpdateOrganizationNeed` должен проверять списки через `!= nil`, а не через `len`; это закрепляет `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart`.
|
||||
- Orval очищает `src/shared/api/endpoints/` и `src/shared/api/schemas/` перед генерацией (`clean: true`), потому что схема, используемая несколькими тегами, переезжает из каталога тега в корень схем.
|
||||
|
||||
#### Объединения форматов
|
||||
|
||||
- Объединения форматов, например `ItemContent` и `AssessmentAnswer`, - это `oneOf` без объекта `discriminator`. Redocly разрешает значения `discriminator.mapping` как ссылки, а `scripts/merge-schemas.py` переписывает только `$ref`, поэтому mapping из отдельного файла схем не разрешается в объединенном `components/schemas.yml`. Каждый вариант фиксирует `format` перечислением из одного значения; ogen различает варианты по этому значению и по полям, уникальным для варианта, и отклоняет тело, подходящее под несколько вариантов, а Orval генерирует Zod-объединение.
|
||||
- Orval называет константы встроенного свойства `<Schema><Property>`, поэтому имя свойства, повторяющее имя другой схемы, дает конфликт в `index.ts` (TS2308). Поэтому объединение форматов задания называется `ItemContent`, а не `AssessmentItemContent`, рядом со свойством `AssessmentItem.content`.
|
||||
- Orval называет константы встроенного свойства `<Schema><Property>`, поэтому имя свойства, повторяющее имя другой схемы, дает конфликт в `index.ts` (TS2308). Поэтому объединение форматов задания называется `ItemContent`, а не `AssessmentItemContent`, рядом со свойством `AssessmentItem.content`, а части `Need` называются `NeedRequirementSet`, `NeedReadinessReport` и `NeedCategoryRecommendations`, а не `NeedRequirements`, `NeedReadiness` и `NeedRecommendations`.
|
||||
|
||||
Сгенерированный Zod не строгий. Тело, смешивающее поля двух форматов или содержащее лишние `score` или `seed`, принимается после молчаливого удаления неизвестных ключей, а `uniqueItems` не проверяется; такие тела отклоняет только сервер. `frontend/src/shared/api/assessment-contract.test.ts` закрепляет принимаемые форматы и отсутствие в DTO ответа и задания полей балла, ключа, seed или правильности.
|
||||
|
||||
|
||||
@@ -1341,3 +1341,677 @@ AssessmentStaleVersion:
|
||||
code: version_conflict
|
||||
detail: The resource changed after it was read. Read it again before retrying.
|
||||
trace_id: 5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c
|
||||
NeedCreateManual:
|
||||
summary: A manual need without a vacancy and without a text
|
||||
description: Every field comes from the form as a decision with status confirmed, so every value is a confirmed manual value. There is no vacancy_id and no source_text; the domain is not given and stays unknown.
|
||||
value:
|
||||
title: Junior Go-разработчик для сервиса уведомлений
|
||||
specialization:
|
||||
value: backend
|
||||
status: confirmed
|
||||
grade:
|
||||
value: junior
|
||||
status: confirmed
|
||||
required_skills:
|
||||
- name: Go
|
||||
status: confirmed
|
||||
- name: PostgreSQL
|
||||
status: confirmed
|
||||
desired_skills:
|
||||
- name: Docker
|
||||
status: confirmed
|
||||
tasks:
|
||||
- text: Поддерживать и развивать сервис уведомлений
|
||||
status: confirmed
|
||||
work_formats:
|
||||
value:
|
||||
- hybrid
|
||||
status: confirmed
|
||||
location:
|
||||
value: Москва
|
||||
status: confirmed
|
||||
salary:
|
||||
value:
|
||||
salary_from: 120000
|
||||
salary_to: 160000
|
||||
currency: RUB
|
||||
period: month
|
||||
tax_basis: net
|
||||
status: confirmed
|
||||
NeedCreateFromText:
|
||||
summary: A need created from a pasted description
|
||||
description: Only the title and the text are given. The server extracts suggestions from the text; nothing is confirmed until a member confirms it.
|
||||
value:
|
||||
title: Backend в команду платежей
|
||||
source_text: "Ищем бэкенд-разработчика в команду платежей. Обязательно: Go, PostgreSQL и Temporal. Желательно опыт с Kafka. Задачи: развивать сервис выплат и переводить его на событийную модель. Работа удаленно."
|
||||
NeedManualWithoutVacancy:
|
||||
summary: A complete manual need without a vacancy, with computed recommendations
|
||||
description: The need created by NeedCreateManual. Every value is confirmed and manual, so the quote, extracted_in_version, and extraction_version are null; the domain was not given and stays unknown with null value and source rather than a guessed one. The hybrid format makes the location critical, and it is confirmed. The range of 120000-160000 has a width of about 29%. The first category scores 0.75 with Overlap 1, a money share rounded down to 0.5, and Supply 0.5 for 15 available candidates. The other two have fewer than five candidates, so their score is null and Supply enters their ranking as 0. The recommendation values are illustrative and say nothing about a deployed policy or real candidates.
|
||||
value:
|
||||
id: 01928f7a-2b3c-7d4e-9f5a-6b7c8d9e0f12
|
||||
organization_id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
vacancy_id: null
|
||||
title: Junior Go-разработчик для сервиса уведомлений
|
||||
source_text: null
|
||||
version: 1
|
||||
requirements_version: 1
|
||||
requirements:
|
||||
specialization:
|
||||
status: confirmed
|
||||
value: backend
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
grade:
|
||||
status: confirmed
|
||||
value: junior
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
required_skills:
|
||||
- name: Go
|
||||
taxonomy_code: go
|
||||
status: confirmed
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
- name: PostgreSQL
|
||||
taxonomy_code: postgresql
|
||||
status: confirmed
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
desired_skills:
|
||||
- name: Docker
|
||||
taxonomy_code: docker
|
||||
status: confirmed
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
tasks:
|
||||
- text: Поддерживать и развивать сервис уведомлений
|
||||
status: confirmed
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
domain:
|
||||
status: unknown
|
||||
value: null
|
||||
source: null
|
||||
work_formats:
|
||||
status: confirmed
|
||||
value:
|
||||
- hybrid
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
location:
|
||||
status: confirmed
|
||||
value: Москва
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
salary:
|
||||
status: confirmed
|
||||
value:
|
||||
salary_from: 120000
|
||||
salary_to: 160000
|
||||
currency: RUB
|
||||
period: month
|
||||
tax_basis: net
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
readiness:
|
||||
status: complete
|
||||
missing_fields: []
|
||||
recommendations:
|
||||
status: computed
|
||||
requirements_version: 1
|
||||
policy_version: 1
|
||||
algorithm_version: need-rec.2026-10.1
|
||||
computed_at: "2026-10-06T08:15:02Z"
|
||||
categories:
|
||||
- specialization: backend
|
||||
grade: junior
|
||||
score: 0.75
|
||||
skill_overlap:
|
||||
share: 1
|
||||
covered_skills:
|
||||
- Go
|
||||
- PostgreSQL
|
||||
- Docker
|
||||
uncovered_skills: []
|
||||
money:
|
||||
status: computed
|
||||
share: 0.5
|
||||
supply: from_5_to_29
|
||||
- specialization: backend
|
||||
grade: intern
|
||||
score: null
|
||||
skill_overlap:
|
||||
share: 0.8
|
||||
covered_skills:
|
||||
- Go
|
||||
- PostgreSQL
|
||||
uncovered_skills:
|
||||
- Docker
|
||||
money:
|
||||
status: insufficient_data
|
||||
share: null
|
||||
supply: fewer_than_5
|
||||
- specialization: devops_sre
|
||||
grade: junior
|
||||
score: null
|
||||
skill_overlap:
|
||||
share: 0.2
|
||||
covered_skills:
|
||||
- Docker
|
||||
uncovered_skills:
|
||||
- Go
|
||||
- PostgreSQL
|
||||
money:
|
||||
status: insufficient_data
|
||||
share: null
|
||||
supply: fewer_than_5
|
||||
created_at: "2026-10-06T08:15:00Z"
|
||||
updated_at: "2026-10-06T08:15:00Z"
|
||||
NeedExtractedWithUnknownSkill:
|
||||
summary: A need from text with suggestions, an unknown skill, and missing fields
|
||||
description: "The need created by NeedCreateFromText. Every value found in the text is extracted with its quote from the text of version 1 and the extractor version, and waits for confirmation. Temporal is not in the skill taxonomy, so its taxonomy_code is null instead of a guessed code. The text names no grade, place, or salary: they stay unknown with null value and source, and the critical ones are listed in missing_fields with a question. Without a confirmed skill there are no recommendations yet."
|
||||
value:
|
||||
id: 01928f7a-3c4d-7e5f-8a6b-7c8d9e0f1a23
|
||||
organization_id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
vacancy_id: null
|
||||
title: Backend в команду платежей
|
||||
source_text: "Ищем бэкенд-разработчика в команду платежей. Обязательно: Go, PostgreSQL и Temporal. Желательно опыт с Kafka. Задачи: развивать сервис выплат и переводить его на событийную модель. Работа удаленно."
|
||||
version: 1
|
||||
requirements_version: 1
|
||||
requirements:
|
||||
specialization:
|
||||
status: extracted
|
||||
value: backend
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Ищем бэкенд-разработчика
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
grade:
|
||||
status: unknown
|
||||
value: null
|
||||
source: null
|
||||
required_skills:
|
||||
- name: Go
|
||||
taxonomy_code: go
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
- name: PostgreSQL
|
||||
taxonomy_code: postgresql
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
- name: Temporal
|
||||
taxonomy_code: null
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
desired_skills:
|
||||
- name: Kafka
|
||||
taxonomy_code: kafka
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Желательно опыт с Kafka
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
tasks:
|
||||
- text: Развивать сервис выплат и переводить его на событийную модель
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Задачи: развивать сервис выплат и переводить его на событийную модель"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
domain:
|
||||
status: extracted
|
||||
value: платежи
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: в команду платежей
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
work_formats:
|
||||
status: extracted
|
||||
value:
|
||||
- remote
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Работа удаленно
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
location:
|
||||
status: unknown
|
||||
value: null
|
||||
source: null
|
||||
salary:
|
||||
status: unknown
|
||||
value: null
|
||||
source: null
|
||||
readiness:
|
||||
status: incomplete
|
||||
missing_fields:
|
||||
- field: specialization
|
||||
reason: unconfirmed
|
||||
question: Подтвердите специализацию, найденную в описании.
|
||||
- field: grade
|
||||
reason: unknown
|
||||
question: "Какой грейд нужен: Intern, Junior, Middle или Senior?"
|
||||
- field: required_skills
|
||||
reason: unconfirmed
|
||||
question: Подтвердите обязательные навыки, найденные в описании.
|
||||
- field: work_formats
|
||||
reason: unconfirmed
|
||||
question: Подтвердите формат работы, найденный в описании.
|
||||
- field: salary
|
||||
reason: unknown
|
||||
question: "Какую вилку в рублях вы предлагаете и в какой базе: на руки или до вычета НДФЛ?"
|
||||
recommendations:
|
||||
status: not_available
|
||||
requirements_version: 1
|
||||
policy_version: null
|
||||
algorithm_version: null
|
||||
computed_at: null
|
||||
categories: []
|
||||
created_at: "2026-10-06T09:00:00Z"
|
||||
updated_at: "2026-10-06T09:00:00Z"
|
||||
NeedUpdateConfirmSuggestions:
|
||||
summary: Confirm suggestions, answer the missing fields, and keep two suggestions open
|
||||
description: Sent over version 1 of NeedExtractedWithUnknownSkill. The specialization, the required skills, and the work format are sent with their stored values and status confirmed, so they are confirmed and keep their quotes. The grade and the salary are new manual values. Kafka and the domain are sent with status extracted and their stored values, so they stay open suggestions. The tasks are absent and stay unchanged.
|
||||
value:
|
||||
expected_version: 1
|
||||
specialization:
|
||||
value: backend
|
||||
status: confirmed
|
||||
grade:
|
||||
value: middle
|
||||
status: confirmed
|
||||
required_skills:
|
||||
- name: Go
|
||||
status: confirmed
|
||||
- name: PostgreSQL
|
||||
status: confirmed
|
||||
- name: Temporal
|
||||
status: confirmed
|
||||
desired_skills:
|
||||
- name: Kafka
|
||||
status: extracted
|
||||
domain:
|
||||
value: платежи
|
||||
status: extracted
|
||||
work_formats:
|
||||
value:
|
||||
- remote
|
||||
status: confirmed
|
||||
salary:
|
||||
value:
|
||||
salary_from: 250000
|
||||
salary_to: 320000
|
||||
currency: RUB
|
||||
period: month
|
||||
tax_basis: gross
|
||||
status: confirmed
|
||||
NeedConfirmedAfterUpdate:
|
||||
summary: The need after the confirmation, as version 2
|
||||
description: Confirmed suggestions keep the origin extracted_from_text, their quotes, and extracted_in_version 1; the grade and the salary are manual. A confirmed requirement changed, so requirements_version is 2 as well. Kafka and the domain are still open suggestions; Kafka does not count in the recommendations, and Temporal stays without a taxonomy code, so no category covers it. The place is unknown but not critical, because the only format is remote. The range of 250000-320000 has a width of about 25%. Scores use the overlap 4/6, the money share rounded down to a quarter or the neutral 0.5, and the exact Supply of groups of five or more. The recommendation values are illustrative.
|
||||
value:
|
||||
id: 01928f7a-3c4d-7e5f-8a6b-7c8d9e0f1a23
|
||||
organization_id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
vacancy_id: null
|
||||
title: Backend в команду платежей
|
||||
source_text: "Ищем бэкенд-разработчика в команду платежей. Обязательно: Go, PostgreSQL и Temporal. Желательно опыт с Kafka. Задачи: развивать сервис выплат и переводить его на событийную модель. Работа удаленно."
|
||||
version: 2
|
||||
requirements_version: 2
|
||||
requirements:
|
||||
specialization:
|
||||
status: confirmed
|
||||
value: backend
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Ищем бэкенд-разработчика
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
grade:
|
||||
status: confirmed
|
||||
value: middle
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
required_skills:
|
||||
- name: Go
|
||||
taxonomy_code: go
|
||||
status: confirmed
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
- name: PostgreSQL
|
||||
taxonomy_code: postgresql
|
||||
status: confirmed
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
- name: Temporal
|
||||
taxonomy_code: null
|
||||
status: confirmed
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Обязательно: Go, PostgreSQL и Temporal"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
desired_skills:
|
||||
- name: Kafka
|
||||
taxonomy_code: kafka
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Желательно опыт с Kafka
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
tasks:
|
||||
- text: Развивать сервис выплат и переводить его на событийную модель
|
||||
status: extracted
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: "Задачи: развивать сервис выплат и переводить его на событийную модель"
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
domain:
|
||||
status: extracted
|
||||
value: платежи
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: в команду платежей
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
work_formats:
|
||||
status: confirmed
|
||||
value:
|
||||
- remote
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Работа удаленно
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
location:
|
||||
status: unknown
|
||||
value: null
|
||||
source: null
|
||||
salary:
|
||||
status: confirmed
|
||||
value:
|
||||
salary_from: 250000
|
||||
salary_to: 320000
|
||||
currency: RUB
|
||||
period: month
|
||||
tax_basis: gross
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
readiness:
|
||||
status: complete
|
||||
missing_fields: []
|
||||
recommendations:
|
||||
status: computed
|
||||
requirements_version: 2
|
||||
policy_version: 1
|
||||
algorithm_version: need-rec.2026-10.1
|
||||
computed_at: "2026-10-06T09:20:01Z"
|
||||
categories:
|
||||
- specialization: backend
|
||||
grade: middle
|
||||
score: 0.61
|
||||
skill_overlap:
|
||||
share: 0.67
|
||||
covered_skills:
|
||||
- Go
|
||||
- PostgreSQL
|
||||
uncovered_skills:
|
||||
- Temporal
|
||||
money:
|
||||
status: computed
|
||||
share: 0.25
|
||||
supply: 30_or_more
|
||||
- specialization: devops_sre
|
||||
grade: middle
|
||||
score: 0.45
|
||||
skill_overlap:
|
||||
share: 0.33
|
||||
covered_skills:
|
||||
- PostgreSQL
|
||||
uncovered_skills:
|
||||
- Go
|
||||
- Temporal
|
||||
money:
|
||||
status: insufficient_data
|
||||
share: null
|
||||
supply: from_5_to_29
|
||||
- specialization: backend
|
||||
grade: senior
|
||||
score: 0.41
|
||||
skill_overlap:
|
||||
share: 0.67
|
||||
covered_skills:
|
||||
- Go
|
||||
- PostgreSQL
|
||||
uncovered_skills:
|
||||
- Temporal
|
||||
money:
|
||||
status: computed
|
||||
share: 0
|
||||
supply: from_5_to_29
|
||||
created_at: "2026-10-06T09:00:00Z"
|
||||
updated_at: "2026-10-06T09:20:00Z"
|
||||
NeedListPage:
|
||||
summary: The last page of the needs of an organization
|
||||
value:
|
||||
items:
|
||||
- id: 01928f7a-3c4d-7e5f-8a6b-7c8d9e0f1a23
|
||||
vacancy_id: null
|
||||
title: Backend в команду платежей
|
||||
version: 2
|
||||
specialization:
|
||||
status: confirmed
|
||||
value: backend
|
||||
source:
|
||||
origin: extracted_from_text
|
||||
quote: Ищем бэкенд-разработчика
|
||||
extracted_in_version: 1
|
||||
extraction_version: need-rules.2026-10.1
|
||||
grade:
|
||||
status: confirmed
|
||||
value: middle
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
readiness:
|
||||
status: complete
|
||||
missing_fields: []
|
||||
created_at: "2026-10-06T09:00:00Z"
|
||||
updated_at: "2026-10-06T09:20:00Z"
|
||||
- id: 01928f7a-2b3c-7d4e-9f5a-6b7c8d9e0f12
|
||||
vacancy_id: null
|
||||
title: Junior Go-разработчик для сервиса уведомлений
|
||||
version: 1
|
||||
specialization:
|
||||
status: confirmed
|
||||
value: backend
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
grade:
|
||||
status: confirmed
|
||||
value: junior
|
||||
source:
|
||||
origin: manual
|
||||
quote: null
|
||||
extracted_in_version: null
|
||||
extraction_version: null
|
||||
readiness:
|
||||
status: complete
|
||||
missing_fields: []
|
||||
created_at: "2026-10-06T08:15:00Z"
|
||||
updated_at: "2026-10-06T08:15:00Z"
|
||||
page:
|
||||
has_more: false
|
||||
next_cursor: null
|
||||
NeedSalaryRangeReversed:
|
||||
summary: The lower salary bound is above the upper one
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9f
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /salary/value/salary_to
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedSalaryEqualBounds:
|
||||
summary: Equal salary bounds; PRD FR13 requires salary_from < salary_to
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /salary/value/salary_to
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedSalaryRangeTooWide:
|
||||
summary: A salary range wider than 40% of its midpoint, such as 100000-200000
|
||||
description: The width (200000 - 100000) / 150000 is about 67%. A range narrower than 10%, such as 100000-105000, gets the same answer.
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /salary/value/salary_to
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedSalaryWithoutTaxBasis:
|
||||
summary: A salary range without its tax basis
|
||||
description: The decoder does not record the path of a missing field in a nested object, so the pointer is the whole body.
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 7c8d9e0f-1a2b-4c3d-9e4f-5a6b7c8d9e0a
|
||||
errors:
|
||||
- in: body
|
||||
pointer: ""
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedExtractedValueMismatch:
|
||||
summary: Status extracted with a value that is not the stored suggestion
|
||||
description: A request may keep only the stored suggestion unconfirmed. To set another value, it sends status confirmed.
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 3c4d5e6f-7a8b-4c9d-8e0f-2a3b4c5d6e7f
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /grade/status
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedUnknownField:
|
||||
summary: The client sent its own recommendation score
|
||||
description: Recommendations, membership, and candidate minimums are never request fields; any unknown field fails validation.
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1b
|
||||
errors:
|
||||
- in: body
|
||||
pointer: ""
|
||||
code: invalid
|
||||
message: The value does not match the contract.
|
||||
NeedMissingExpectedVersion:
|
||||
summary: A change without expected_version
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 9e0f1a2b-3c4d-4e5f-9a6b-7c8d9e0f1a2c
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /expected_version
|
||||
code: required
|
||||
message: The value is required.
|
||||
NeedStaleVersion:
|
||||
summary: The change carried a stale expected_version
|
||||
description: Another member or a server-side extraction changed the need after the client read it. Nothing was changed; the client reads the need again and reapplies its unsaved edits.
|
||||
value:
|
||||
type: urn:lincodex:problem:version_conflict
|
||||
title: Resource version conflict
|
||||
status: 412
|
||||
code: version_conflict
|
||||
detail: The resource changed after it was read. Read it again before retrying.
|
||||
trace_id: 0f1a2b3c-4d5e-4f6a-8b7c-8d9e0f1a2b3d
|
||||
@@ -68,3 +68,28 @@ AssessmentAttemptId:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 01928f7a-3c4d-7e5f-8a9b-0c1d2e3f4a5b
|
||||
OrganizationId:
|
||||
name: org_id
|
||||
in: path
|
||||
required: true
|
||||
description: >-
|
||||
Identifier of an organization. Access comes only from an active
|
||||
membership of the session account in this organization, checked by the
|
||||
server on every request; the identifier itself grants nothing. An
|
||||
organization without such a membership and an unknown identifier both
|
||||
answer 404 not_found, so organizations cannot be enumerated.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
NeedId:
|
||||
name: need_id
|
||||
in: path
|
||||
required: true
|
||||
description: >-
|
||||
Identifier of a need of the organization in the path. A need of another
|
||||
organization and an unknown identifier both answer 404 not_found.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 01928f7a-2b3c-7d4e-9f5a-6b7c8d9e0f12
|
||||
@@ -374,3 +374,48 @@ AssessmentVersionConflict:
|
||||
examples:
|
||||
version_conflict:
|
||||
$ref: ./examples.yml#/AssessmentStaleVersion
|
||||
NeedValidationFailed:
|
||||
description: >-
|
||||
The body does not match the contract or violates a need rule: an unknown
|
||||
field such as rec_score, members, or candidate_minimum, a field sent as a
|
||||
bare value instead of `{value, status}`, a list sent as null, an unknown
|
||||
specialization, grade, work format, currency, period, or tax basis, a
|
||||
salary bound that is not a positive multiple of 1000, a lower bound that
|
||||
is not below the upper one, a range width outside 10-40% of its midpoint,
|
||||
a repeated skill or task, status `extracted` with a value that is not the
|
||||
stored suggestion, a vacancy that is not a vacancy of the organization,
|
||||
or a missing or invalid expected_version; code validation_failed with
|
||||
body pointers. When the decoder does not record the path of a nested
|
||||
field, the pointer is the whole body. Nothing was changed, and the
|
||||
outcome is not stored under an Idempotency-Key.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
reversed_salary_range:
|
||||
$ref: ./examples.yml#/NeedSalaryRangeReversed
|
||||
equal_salary_bounds:
|
||||
$ref: ./examples.yml#/NeedSalaryEqualBounds
|
||||
salary_range_too_wide:
|
||||
$ref: ./examples.yml#/NeedSalaryRangeTooWide
|
||||
salary_without_tax_basis:
|
||||
$ref: ./examples.yml#/NeedSalaryWithoutTaxBasis
|
||||
extracted_value_mismatch:
|
||||
$ref: ./examples.yml#/NeedExtractedValueMismatch
|
||||
recommendation_score_sent_by_client:
|
||||
$ref: ./examples.yml#/NeedUnknownField
|
||||
missing_expected_version:
|
||||
$ref: ./examples.yml#/NeedMissingExpectedVersion
|
||||
NeedVersionConflict:
|
||||
description: >-
|
||||
`expected_version` is not the current need version; code
|
||||
version_conflict. Nothing was changed; read the need again before
|
||||
retrying.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
version_conflict:
|
||||
$ref: ./examples.yml#/NeedStaleVersion
|
||||
@@ -1624,6 +1624,918 @@ Session:
|
||||
$ref: '#/Account'
|
||||
csrf_token:
|
||||
$ref: '#/CsrfToken'
|
||||
NeedVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 1
|
||||
description: Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.
|
||||
examples:
|
||||
- 2
|
||||
NeedTitle:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 200
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.
|
||||
NeedSourceText:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 10000
|
||||
description: 'Free description of the team''s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'
|
||||
NeedValueStatus:
|
||||
type: string
|
||||
description: 'Confirmation state of one need field.
|
||||
|
||||
|
||||
- confirmed: a member of the organization entered the value or confirmed it. Only confirmed values feed readiness, category recommendations, search, and invitations.
|
||||
|
||||
- extracted: the server proposed the value from the need text or an import, and nobody has confirmed it yet. It is a suggestion: it never feeds search or recommendations and never counts as an answer in readiness.
|
||||
|
||||
- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a Senior grade, the remote format, or a zero salary.'
|
||||
enum:
|
||||
- confirmed
|
||||
- extracted
|
||||
- unknown
|
||||
NeedItemStatus:
|
||||
type: string
|
||||
description: 'Confirmation state of a list item, and the decision that a request sends for a field or an item: `confirmed` or `extracted`, with the meaning of NeedValueStatus. A request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value. An item is never `unknown`; a list with no confirmed item is what readiness reports as missing.'
|
||||
enum:
|
||||
- confirmed
|
||||
- extracted
|
||||
NeedValueOrigin:
|
||||
type: string
|
||||
description: 'Where the value of a field or item came from. The server sets it; a request never sends it.
|
||||
|
||||
|
||||
- manual: a member of the organization typed the value in the form. `quote`, `extraction_version`, and `extracted_in_version` are null.
|
||||
|
||||
- extracted_from_text: the server extracted the value from `source_text`, with the deterministic rules and dictionary or, planned, with the ML service. `extraction_version` names the extractor version.
|
||||
|
||||
- imported: planned; the value was copied from a linked vacancy or an import. No MVP operation produces it.
|
||||
|
||||
|
||||
Confirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'
|
||||
enum:
|
||||
- manual
|
||||
- extracted_from_text
|
||||
- imported
|
||||
NeedSourceQuote:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 300
|
||||
description: Exact excerpt of the `source_text` that the value was extracted from, so a reviewer can check it. It may contain line breaks. Plain text; clients show it as text, never as HTML.
|
||||
NeedVersionLabel:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 64
|
||||
pattern: ^[A-Za-z0-9._-]+$
|
||||
description: Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.
|
||||
NeedValueSource:
|
||||
type: object
|
||||
description: 'Provenance of a value: its origin, the quote it was extracted from, the need version whose text the quote belongs to, and the extractor version. Read-only; the server derives it and a request cannot set it.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- origin
|
||||
- quote
|
||||
- extracted_in_version
|
||||
- extraction_version
|
||||
properties:
|
||||
origin:
|
||||
$ref: '#/NeedValueOrigin'
|
||||
quote:
|
||||
description: Excerpt of the need text that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.
|
||||
oneOf:
|
||||
- $ref: '#/NeedSourceQuote'
|
||||
- type: 'null'
|
||||
extracted_in_version:
|
||||
description: Need version whose `source_text` the value was extracted from and the quote is an excerpt of, or null for a manual value. A confirmed value keeps it after the text changes, so its quote may be absent from the current `source_text`.
|
||||
oneOf:
|
||||
- $ref: '#/NeedVersion'
|
||||
- type: 'null'
|
||||
extraction_version:
|
||||
description: Extractor version for an extracted or imported value, or null for a manual value.
|
||||
oneOf:
|
||||
- $ref: '#/NeedVersionLabel'
|
||||
- type: 'null'
|
||||
SkillName:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: Name of a skill or technology as the employer gave it, for example Go, PostgreSQL, or Temporal. It has no leading or trailing whitespace and no line breaks. The server compares names without regard to letter case. Plain text; clients show it as text, never as HTML.
|
||||
SkillTaxonomyCode:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 64
|
||||
pattern: ^[a-z0-9][a-z0-9_.+#-]*$
|
||||
description: Code of a skill in the platform skill taxonomy, for example `postgresql`. The server assigns it from the taxonomy; clients never send it and never derive it from the name.
|
||||
NeedTaskText:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 300
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: One work task of the team, for example "Move the payout service to an event model". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.
|
||||
NeedDomainName:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: Business domain of the work, for example payments or logistics, as free text. Plain text without line breaks; clients show it as text, never as HTML.
|
||||
NeedLocationName:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: Place of work for the office or hybrid format, for example a city, as free text. It describes the employer's office, never a candidate's address. Plain text without line breaks; clients show it as text, never as HTML.
|
||||
RubAmount:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 1000
|
||||
maximum: 100000000
|
||||
multipleOf: 1000
|
||||
description: Amount of money in whole rubles. A salary bound is positive and a multiple of 1000, the step that PRD FR13 sets for the bounds of a salary range and for the bids of the sealed final.
|
||||
examples:
|
||||
- 120000
|
||||
CurrencyCode:
|
||||
type: string
|
||||
description: ISO 4217 currency code. The MVP accepts only RUB; adding a value is a contract change.
|
||||
enum:
|
||||
- RUB
|
||||
SalaryPeriod:
|
||||
type: string
|
||||
description: Pay period of a salary amount. The MVP uses only `month`; adding a value is a contract change.
|
||||
enum:
|
||||
- month
|
||||
SalaryTaxBasis:
|
||||
type: string
|
||||
description: 'Tax basis of a salary amount: `net`, the amount paid out after personal income tax, or `gross`, the amount before it. The basis is always explicit; amounts in different bases are never compared directly.'
|
||||
enum:
|
||||
- net
|
||||
- gross
|
||||
SalaryRange:
|
||||
type: object
|
||||
description: 'Salary range `[A; B]` in whole rubles with its base: the currency, the pay period, and the tax basis (PRD FR13). The schema requires every field, bounds that are positive multiples of 1000, and the known currency, period, and basis. The server checks the cross-field rules in integer arithmetic: `salary_from < salary_to`, and a width `(B - A) / ((A + B) / 2)` from 10% to 40% inclusive, that is `20 * (B - A) >= A + B` and `5 * (B - A) <= A + B`. A violation answers 400 validation_failed with the pointer of `salary_to` in the request, for example `/salary/value/salary_to`. For example, `[95000; 105000]` has a width of exactly 10% and `[80000; 120000]` exactly 40%; both are accepted. The rules are the same for a need and an invitation.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- salary_from
|
||||
- salary_to
|
||||
- currency
|
||||
- period
|
||||
- tax_basis
|
||||
properties:
|
||||
salary_from:
|
||||
$ref: '#/RubAmount'
|
||||
salary_to:
|
||||
$ref: '#/RubAmount'
|
||||
currency:
|
||||
$ref: '#/CurrencyCode'
|
||||
period:
|
||||
$ref: '#/SalaryPeriod'
|
||||
tax_basis:
|
||||
$ref: '#/SalaryTaxBasis'
|
||||
NeedSpecialization:
|
||||
type: object
|
||||
description: Target specialization of the need with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
oneOf:
|
||||
- $ref: '#/SpecializationCode'
|
||||
- type: 'null'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedGrade:
|
||||
type: object
|
||||
description: Target grade of the need with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`; a text that names no grade leaves the grade unknown instead of assuming one.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
oneOf:
|
||||
- $ref: '#/GradeCode'
|
||||
- type: 'null'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedDomain:
|
||||
type: object
|
||||
description: Business domain of the need with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
oneOf:
|
||||
- $ref: '#/NeedDomainName'
|
||||
- type: 'null'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedWorkFormats:
|
||||
type: object
|
||||
description: Work formats that the employer offers, with their confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`; a known value lists one to three formats.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
type:
|
||||
- array
|
||||
- 'null'
|
||||
minItems: 1
|
||||
maxItems: 3
|
||||
uniqueItems: true
|
||||
items:
|
||||
$ref: '#/WorkFormat'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedLocation:
|
||||
type: object
|
||||
description: Place of work with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`. Readiness requires a confirmed place only when the confirmed work formats include `office` or `hybrid`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
oneOf:
|
||||
- $ref: '#/NeedLocationName'
|
||||
- type: 'null'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedSalary:
|
||||
type: object
|
||||
description: Salary range that the employer offers, with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`. A text without a salary leaves it unknown; the server never substitutes zero, a market estimate, or a range from another need.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- value
|
||||
- source
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedValueStatus'
|
||||
value:
|
||||
oneOf:
|
||||
- $ref: '#/SalaryRange'
|
||||
- type: 'null'
|
||||
source:
|
||||
oneOf:
|
||||
- $ref: '#/NeedValueSource'
|
||||
- type: 'null'
|
||||
NeedSkill:
|
||||
type: object
|
||||
description: 'One required or desired skill of the need. `taxonomy_code` is null for a skill that the platform taxonomy does not know: the server keeps the name as given, never maps it to a guessed code, and counts it as not covered in category recommendations.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- name
|
||||
- taxonomy_code
|
||||
- status
|
||||
- source
|
||||
properties:
|
||||
name:
|
||||
$ref: '#/SkillName'
|
||||
taxonomy_code:
|
||||
oneOf:
|
||||
- $ref: '#/SkillTaxonomyCode'
|
||||
- type: 'null'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
source:
|
||||
$ref: '#/NeedValueSource'
|
||||
NeedTask:
|
||||
type: object
|
||||
description: One work task of the team with its confirmation state and provenance.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- text
|
||||
- status
|
||||
- source
|
||||
properties:
|
||||
text:
|
||||
$ref: '#/NeedTaskText'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
source:
|
||||
$ref: '#/NeedValueSource'
|
||||
NeedSpecializationInput:
|
||||
type: object
|
||||
description: Decision about the specialization in a request; see NeedUpdate for the rules of `status`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
$ref: '#/SpecializationCode'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedGradeInput:
|
||||
type: object
|
||||
description: Decision about the grade in a request; see NeedUpdate for the rules of `status`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
$ref: '#/GradeCode'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedDomainInput:
|
||||
type: object
|
||||
description: Decision about the domain in a request; see NeedUpdate for the rules of `status`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
$ref: '#/NeedDomainName'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedWorkFormatsInput:
|
||||
type: object
|
||||
description: Decision about the work formats in a request; see NeedUpdate for the rules of `status`. Formats are compared as a set.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
type: array
|
||||
minItems: 1
|
||||
maxItems: 3
|
||||
uniqueItems: true
|
||||
items:
|
||||
$ref: '#/WorkFormat'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedLocationInput:
|
||||
type: object
|
||||
description: Decision about the place of work in a request; see NeedUpdate for the rules of `status`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
$ref: '#/NeedLocationName'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedSalaryInput:
|
||||
type: object
|
||||
description: Decision about the salary range in a request; see NeedUpdate for the rules of `status` and SalaryRange for the rules of the range, whose pointers are under `/salary/value`.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- status
|
||||
properties:
|
||||
value:
|
||||
$ref: '#/SalaryRange'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedSkillInput:
|
||||
type: object
|
||||
description: 'One skill of a list in a request. A name that equals, without regard to letter case, a skill of the current version in either skill list refers to that skill and keeps its origin, quote, and taxonomy code; this is how an extracted skill is confirmed or moved between the required and desired lists. Any other name is a new manual skill. `status` follows the rules of NeedUpdate: `extracted` for a name that is not a stored suggestion answers 400 validation_failed with the pointer of that `status`, for example `/required_skills/2/status`. A name repeated within or across the two skill lists answers 400 with the pointer of the later `name`.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- name
|
||||
- status
|
||||
properties:
|
||||
name:
|
||||
$ref: '#/SkillName'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedTaskInput:
|
||||
type: object
|
||||
description: One task of the list in a request. A text equal to a task of the current version refers to that task and keeps its origin and quote; any other text is a new manual task. `status` and repeated texts follow the rules of NeedSkillInput.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- text
|
||||
- status
|
||||
properties:
|
||||
text:
|
||||
$ref: '#/NeedTaskText'
|
||||
status:
|
||||
$ref: '#/NeedItemStatus'
|
||||
NeedRequirementSet:
|
||||
type: object
|
||||
description: Requirements of one need version, each with its confirmation state and provenance. Read-only; requests change them through the fields of NeedCreate and NeedUpdate.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- specialization
|
||||
- grade
|
||||
- required_skills
|
||||
- desired_skills
|
||||
- tasks
|
||||
- domain
|
||||
- work_formats
|
||||
- location
|
||||
- salary
|
||||
properties:
|
||||
specialization:
|
||||
$ref: '#/NeedSpecialization'
|
||||
grade:
|
||||
$ref: '#/NeedGrade'
|
||||
required_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
description: Required skills; each has weight 2 in skill coverage. Only confirmed skills count.
|
||||
items:
|
||||
$ref: '#/NeedSkill'
|
||||
desired_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
description: Desired skills; each has weight 1 in skill coverage. Only confirmed skills count.
|
||||
items:
|
||||
$ref: '#/NeedSkill'
|
||||
tasks:
|
||||
type: array
|
||||
maxItems: 20
|
||||
description: Work tasks of the team in the order given.
|
||||
items:
|
||||
$ref: '#/NeedTask'
|
||||
domain:
|
||||
$ref: '#/NeedDomain'
|
||||
work_formats:
|
||||
$ref: '#/NeedWorkFormats'
|
||||
location:
|
||||
$ref: '#/NeedLocation'
|
||||
salary:
|
||||
$ref: '#/NeedSalary'
|
||||
NeedFieldName:
|
||||
type: string
|
||||
description: Name of a need field, equal to its property name in NeedRequirementSet and in the request bodies. Adding a value is a contract change.
|
||||
enum:
|
||||
- specialization
|
||||
- grade
|
||||
- required_skills
|
||||
- desired_skills
|
||||
- tasks
|
||||
- domain
|
||||
- work_formats
|
||||
- location
|
||||
- salary
|
||||
NeedMissingReason:
|
||||
type: string
|
||||
description: 'Why a critical field is missing: `unknown`, the field has no value, or `unconfirmed`, it has only an extracted value or, for required skills, only extracted items that wait for confirmation.'
|
||||
enum:
|
||||
- unknown
|
||||
- unconfirmed
|
||||
NeedMissingField:
|
||||
type: object
|
||||
description: One critical field that has no confirmed value, with a specific question that the client shows next to the field.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- field
|
||||
- reason
|
||||
- question
|
||||
properties:
|
||||
field:
|
||||
$ref: '#/NeedFieldName'
|
||||
reason:
|
||||
$ref: '#/NeedMissingReason'
|
||||
question:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 300
|
||||
description: Specific Russian question about the missing value, for example which grade is needed. Plain text; the client shows it as text, never as HTML.
|
||||
NeedReadinessStatus:
|
||||
type: string
|
||||
description: '`complete` when every critical field has a confirmed value, otherwise `incomplete`.'
|
||||
enum:
|
||||
- complete
|
||||
- incomplete
|
||||
NeedReadinessReport:
|
||||
type: object
|
||||
description: Completeness of the critical fields, computed by the server for the current version. The critical fields are `specialization`, `grade`, `required_skills` (at least one confirmed skill), `work_formats`, `salary`, and `location` when the confirmed work formats include `office` or `hybrid`. An incomplete need is still a valid saved need; each later operation, such as search or an invitation, states which readiness it requires.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- missing_fields
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedReadinessStatus'
|
||||
missing_fields:
|
||||
type: array
|
||||
maxItems: 9
|
||||
description: Critical fields without a confirmed value, each at most once, in the order of NeedFieldName. Empty exactly when `status` is `complete`.
|
||||
items:
|
||||
$ref: '#/NeedMissingField'
|
||||
NeedRecommendationStatus:
|
||||
type: string
|
||||
description: 'State of the category recommendations of the current requirements version.
|
||||
|
||||
|
||||
- computed: `categories` holds the recommendations computed from the confirmed requirements of `requirements_version`.
|
||||
|
||||
- pending: the computation for the current requirements version has not finished yet; `categories` is empty. Read the need again later.
|
||||
|
||||
- not_available: the current requirements have no confirmed required or desired skill to compute from; `categories` is empty.'
|
||||
enum:
|
||||
- computed
|
||||
- pending
|
||||
- not_available
|
||||
NeedSkillOverlap:
|
||||
type: object
|
||||
description: 'Skill coverage of a category: the weighted share of the confirmed skills of the need that the category taxonomy covers, with weight 2 for a required and 1 for a desired skill.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- share
|
||||
- covered_skills
|
||||
- uncovered_skills
|
||||
properties:
|
||||
share:
|
||||
type: number
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
description: Weighted share from 0 to 1, rounded to two decimals.
|
||||
covered_skills:
|
||||
type: array
|
||||
maxItems: 60
|
||||
description: Confirmed skills of the need that the category covers.
|
||||
items:
|
||||
$ref: '#/SkillName'
|
||||
uncovered_skills:
|
||||
type: array
|
||||
maxItems: 60
|
||||
description: Confirmed skills of the need that the category does not cover, including skills without a taxonomy code.
|
||||
items:
|
||||
$ref: '#/SkillName'
|
||||
NeedMoneyStatus:
|
||||
type: string
|
||||
description: 'How the salary component of a recommendation was obtained.
|
||||
|
||||
|
||||
- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.
|
||||
|
||||
- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.
|
||||
|
||||
- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.
|
||||
|
||||
- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.
|
||||
|
||||
|
||||
An unknown candidate minimum never counts as zero.'
|
||||
enum:
|
||||
- computed
|
||||
- insufficient_data
|
||||
- no_salary
|
||||
- withheld
|
||||
NeedMoneyFit:
|
||||
type: object
|
||||
description: Salary component of a recommendation. It is an aggregate over at least five candidates and never reveals a minimum of any candidate.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- share
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedMoneyStatus'
|
||||
share:
|
||||
type:
|
||||
- number
|
||||
- 'null'
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
description: 'Share of those candidates whose minimum is not above the upper bound of the range, rounded down to a multiple of 0.25 (one of 0, 0.25, 0.5, 0.75, 1), or null unless `status` is `computed`. The score and the ranking use this rounded value, never the exact share. A quarter step gives five levels: each probe of a new upper bound tells at most which quarter of the group accepts it, and in the smallest allowed group of five candidates a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.'
|
||||
NeedSupplyBand:
|
||||
type: string
|
||||
description: 'Number of available candidates of the category in the allowed detail: `fewer_than_5`, `from_5_to_29`, or `30_or_more`. Smaller groups are never counted exactly.'
|
||||
enum:
|
||||
- fewer_than_5
|
||||
- from_5_to_29
|
||||
- 30_or_more
|
||||
NeedCategoryRecommendation:
|
||||
type: object
|
||||
description: 'One recommended category, a specialization with a grade, with its score and the reasons for it. The score is `0.5 * Overlap + 0.3 * Money + 0.2 * Supply` (PRD FR08) computed from the published components: the exact skill overlap, the money share rounded down to a quarter or the neutral 0.5, and `Supply = min(1, active / 30)` when at least five candidates are available. For a group of fewer than five, Supply enters the ranking as 0, the same for every such group, so neither the score nor the order reveals the exact size of a group below five.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- specialization
|
||||
- grade
|
||||
- score
|
||||
- skill_overlap
|
||||
- money
|
||||
- supply
|
||||
properties:
|
||||
specialization:
|
||||
$ref: '#/SpecializationCode'
|
||||
grade:
|
||||
$ref: '#/GradeCode'
|
||||
score:
|
||||
type:
|
||||
- number
|
||||
- 'null'
|
||||
format: double
|
||||
minimum: 0
|
||||
maximum: 1
|
||||
description: Recommendation score from 0 to 1, rounded half up to two decimals, or null when `supply` is `fewer_than_5`. Read-only; no request can set it.
|
||||
skill_overlap:
|
||||
$ref: '#/NeedSkillOverlap'
|
||||
money:
|
||||
$ref: '#/NeedMoneyFit'
|
||||
supply:
|
||||
$ref: '#/NeedSupplyBand'
|
||||
NeedCategoryRecommendations:
|
||||
type: object
|
||||
description: 'Category recommendations computed by the server from the confirmed requirements of `requirements_version` with a versioned policy (PRD FR08). Read-only: no request can set a recommendation, a score, or one of its components. The server may recompute them for the same requirements version, for example for a new policy or a changed pool of available candidates, without a new need version; `computed_at` and `policy_version` then change. The policy version and the candidate group used are stored with each computation, so a later policy never rewrites it.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- status
|
||||
- requirements_version
|
||||
- policy_version
|
||||
- algorithm_version
|
||||
- computed_at
|
||||
- categories
|
||||
properties:
|
||||
status:
|
||||
$ref: '#/NeedRecommendationStatus'
|
||||
requirements_version:
|
||||
$ref: '#/NeedVersion'
|
||||
policy_version:
|
||||
type:
|
||||
- integer
|
||||
- 'null'
|
||||
format: int32
|
||||
minimum: 1
|
||||
description: Number of the policy version whose weights were applied, or null unless `status` is `computed`.
|
||||
algorithm_version:
|
||||
description: Version of the recommendation algorithm, or null unless `status` is `computed`.
|
||||
oneOf:
|
||||
- $ref: '#/NeedVersionLabel'
|
||||
- type: 'null'
|
||||
computed_at:
|
||||
description: Time of the computation, or null unless `status` is `computed`.
|
||||
oneOf:
|
||||
- $ref: '#/Timestamp'
|
||||
- type: 'null'
|
||||
categories:
|
||||
type: array
|
||||
maxItems: 10
|
||||
description: Recommended categories, best first by the score described in NeedCategoryRecommendation. Empty unless `status` is `computed`.
|
||||
items:
|
||||
$ref: '#/NeedCategoryRecommendation'
|
||||
Need:
|
||||
type: object
|
||||
description: 'Hiring need of an organization: what the team needs, independent of any published vacancy. It holds the current version of the requirements with their provenance, the readiness of the critical fields, and the category recommendations. It never contains membership data, a candidate''s personal data, or a candidate''s salary minimum.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- organization_id
|
||||
- vacancy_id
|
||||
- title
|
||||
- source_text
|
||||
- version
|
||||
- requirements_version
|
||||
- requirements
|
||||
- readiness
|
||||
- recommendations
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the need.
|
||||
organization_id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Organization that owns the need, equal to `org_id` of the path. It never changes.
|
||||
vacancy_id:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
format: uuid
|
||||
description: Linked vacancy of the same organization, or null. A need never requires a vacancy.
|
||||
title:
|
||||
$ref: '#/NeedTitle'
|
||||
source_text:
|
||||
description: Text the requirements were extracted from, or null.
|
||||
oneOf:
|
||||
- $ref: '#/NeedSourceText'
|
||||
- type: 'null'
|
||||
version:
|
||||
$ref: '#/NeedVersion'
|
||||
requirements_version:
|
||||
description: Need version in which the current confirmed requirements were last changed, at most `version`. A change that confirms, changes, or removes a requirement makes it equal to the new `version`. A change of the title, the vacancy link, or the text, or of suggestions only, creates a new `version` but keeps `requirements_version`, so it invalidates neither the recommendations nor search results and selection snapshots. Search runs and selection snapshots (PRD FR10) refer to `(need id, requirements_version)`, and a new selection snapshot is due only when it changes.
|
||||
allOf:
|
||||
- $ref: '#/NeedVersion'
|
||||
requirements:
|
||||
$ref: '#/NeedRequirementSet'
|
||||
readiness:
|
||||
$ref: '#/NeedReadinessReport'
|
||||
recommendations:
|
||||
$ref: '#/NeedCategoryRecommendations'
|
||||
created_at:
|
||||
$ref: '#/Timestamp'
|
||||
updated_at:
|
||||
$ref: '#/Timestamp'
|
||||
NeedSummary:
|
||||
type: object
|
||||
description: 'Need in a list: its identity, current version, target category fields, and readiness. Read the need for the requirements and the recommendations.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- vacancy_id
|
||||
- title
|
||||
- version
|
||||
- specialization
|
||||
- grade
|
||||
- readiness
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the need.
|
||||
vacancy_id:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
format: uuid
|
||||
description: Linked vacancy, or null.
|
||||
title:
|
||||
$ref: '#/NeedTitle'
|
||||
version:
|
||||
$ref: '#/NeedVersion'
|
||||
specialization:
|
||||
$ref: '#/NeedSpecialization'
|
||||
grade:
|
||||
$ref: '#/NeedGrade'
|
||||
readiness:
|
||||
$ref: '#/NeedReadinessReport'
|
||||
created_at:
|
||||
$ref: '#/Timestamp'
|
||||
updated_at:
|
||||
$ref: '#/Timestamp'
|
||||
NeedList:
|
||||
type: object
|
||||
description: One page of the needs of an organization, newest first by creation time.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Needs of the page.
|
||||
items:
|
||||
$ref: '#/NeedSummary'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
NeedCreate:
|
||||
type: object
|
||||
description: New need. Only `title` is required, so a need can start from a title, from a text, or from form fields, and with or without a vacancy. A field or list item given here must have `status` `confirmed` and becomes a confirmed manual value; `extracted` answers 400 with the pointer of that `status`, such as `/grade/status`, because a new need has no stored suggestion. A field that is absent is extracted from `source_text` when the text is given and is left unknown or empty otherwise. A nullable field sent as null, and a skill or task list sent as an empty list, stays unknown or empty and is not extracted; an empty `work_formats` value fails `minItems`. Unknown fields are rejected, so a request cannot set membership, a role, a status of the need, a provenance, readiness, a recommendation or its score, or a candidate's salary minimum.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- title
|
||||
properties:
|
||||
title:
|
||||
$ref: '#/NeedTitle'
|
||||
vacancy_id:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
format: uuid
|
||||
description: Vacancy of the same organization to link, or null or absent for a need without a vacancy.
|
||||
source_text:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSourceText'
|
||||
- type: 'null'
|
||||
specialization:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSpecializationInput'
|
||||
- type: 'null'
|
||||
grade:
|
||||
oneOf:
|
||||
- $ref: '#/NeedGradeInput'
|
||||
- type: 'null'
|
||||
required_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
items:
|
||||
$ref: '#/NeedSkillInput'
|
||||
desired_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
items:
|
||||
$ref: '#/NeedSkillInput'
|
||||
tasks:
|
||||
type: array
|
||||
maxItems: 20
|
||||
items:
|
||||
$ref: '#/NeedTaskInput'
|
||||
domain:
|
||||
oneOf:
|
||||
- $ref: '#/NeedDomainInput'
|
||||
- type: 'null'
|
||||
work_formats:
|
||||
oneOf:
|
||||
- $ref: '#/NeedWorkFormatsInput'
|
||||
- type: 'null'
|
||||
location:
|
||||
oneOf:
|
||||
- $ref: '#/NeedLocationInput'
|
||||
- type: 'null'
|
||||
salary:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSalaryInput'
|
||||
- type: 'null'
|
||||
NeedUpdate:
|
||||
type: object
|
||||
description: 'Change of a need over the version the client read. Each field present in the body replaces that field as a whole; an absent field stays unchanged. Nested objects and lists are not merged: a field decision and each list are replaced entirely, and a stored item missing from a sent list is deleted. A nullable field sent as null becomes unknown, or unlinked for `vacancy_id`; a skill or task list sent empty deletes every item; a list sent as null fails validation. A field decision `{value, status}` and a list item follow the same rules: `confirmed` with the stored value confirms it and keeps its origin and quote, and `confirmed` with another value sets a confirmed manual value; `extracted` keeps a stored suggestion unconfirmed and is allowed only with exactly the stored suggested value, otherwise it answers 400 with the pointer of that `status`, such as `/grade/status` or `/required_skills/0/status`. A client that sends back an unchanged form therefore confirms nothing by accident:
|
||||
it sends each suggestion with `extracted`, or leaves the field out. Sending a different `source_text` extracts again: new suggestions replace only the `extracted` values and items of fields not named in this body; confirmed values are never overwritten, a suggested skill whose name is already in either skill list is skipped, and a suggestion that a member deleted is not proposed again for this need. Unknown fields are rejected, so a request cannot set membership, a role, a provenance, readiness, a recommendation or its score, or a candidate''s salary minimum.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- expected_version
|
||||
properties:
|
||||
expected_version:
|
||||
$ref: '#/NeedVersion'
|
||||
title:
|
||||
$ref: '#/NeedTitle'
|
||||
vacancy_id:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
format: uuid
|
||||
description: Vacancy of the same organization to link, or null to unlink.
|
||||
source_text:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSourceText'
|
||||
- type: 'null'
|
||||
specialization:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSpecializationInput'
|
||||
- type: 'null'
|
||||
grade:
|
||||
oneOf:
|
||||
- $ref: '#/NeedGradeInput'
|
||||
- type: 'null'
|
||||
required_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
items:
|
||||
$ref: '#/NeedSkillInput'
|
||||
desired_skills:
|
||||
type: array
|
||||
maxItems: 30
|
||||
items:
|
||||
$ref: '#/NeedSkillInput'
|
||||
tasks:
|
||||
type: array
|
||||
maxItems: 20
|
||||
items:
|
||||
$ref: '#/NeedTaskInput'
|
||||
domain:
|
||||
oneOf:
|
||||
- $ref: '#/NeedDomainInput'
|
||||
- type: 'null'
|
||||
work_formats:
|
||||
oneOf:
|
||||
- $ref: '#/NeedWorkFormatsInput'
|
||||
- type: 'null'
|
||||
location:
|
||||
oneOf:
|
||||
- $ref: '#/NeedLocationInput'
|
||||
- type: 'null'
|
||||
salary:
|
||||
oneOf:
|
||||
- $ref: '#/NeedSalaryInput'
|
||||
- type: 'null'
|
||||
Problem:
|
||||
type: object
|
||||
description: Problem details (RFC 9457) returned with the application/problem+json media type for every error response. `code` is the stable, machine-readable reason; clients branch on it rather than on `title`, `detail`, or the HTTP status alone. The body never contains internal error text, stack traces, SQL, file paths, credentials, contact data, or echoed request values.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -26,6 +26,12 @@ tags:
|
||||
Assessment attempts of the current candidate: availability, start and
|
||||
resume, answers and the code practice, finalization, and the result.
|
||||
Answers, keys, and attempt history are visible only to the candidate.
|
||||
- name: need
|
||||
description: >-
|
||||
Hiring needs of an organization: requirements with their confirmation
|
||||
state and provenance, immutable versions, readiness, and category
|
||||
recommendations. Access comes only from an active membership in the
|
||||
organization; a need never requires a vacancy.
|
||||
# Operations require a session unless they declare `security: []`, so a new
|
||||
# operation that omits security is protected by default.
|
||||
security:
|
||||
@@ -63,6 +69,10 @@ paths:
|
||||
$ref: ./routes/candidate_assessment_attempt_finalize.yml
|
||||
/api/v1/me/assessment-attempts/{attempt_id}/result:
|
||||
$ref: ./routes/candidate_assessment_attempt_result.yml
|
||||
/api/v1/organizations/{org_id}/needs:
|
||||
$ref: ./routes/organization_needs.yml
|
||||
/api/v1/organizations/{org_id}/needs/{need_id}:
|
||||
$ref: ./routes/organization_need.yml
|
||||
components:
|
||||
schemas:
|
||||
Problem:
|
||||
@@ -265,6 +275,112 @@ components:
|
||||
$ref: ./components/schemas.yml#/AssessmentSpecializationAvailability
|
||||
AssessmentAvailability:
|
||||
$ref: ./components/schemas.yml#/AssessmentAvailability
|
||||
NeedVersion:
|
||||
$ref: ./components/schemas.yml#/NeedVersion
|
||||
NeedTitle:
|
||||
$ref: ./components/schemas.yml#/NeedTitle
|
||||
NeedSourceText:
|
||||
$ref: ./components/schemas.yml#/NeedSourceText
|
||||
NeedValueStatus:
|
||||
$ref: ./components/schemas.yml#/NeedValueStatus
|
||||
NeedItemStatus:
|
||||
$ref: ./components/schemas.yml#/NeedItemStatus
|
||||
NeedValueOrigin:
|
||||
$ref: ./components/schemas.yml#/NeedValueOrigin
|
||||
NeedSourceQuote:
|
||||
$ref: ./components/schemas.yml#/NeedSourceQuote
|
||||
NeedVersionLabel:
|
||||
$ref: ./components/schemas.yml#/NeedVersionLabel
|
||||
NeedValueSource:
|
||||
$ref: ./components/schemas.yml#/NeedValueSource
|
||||
SkillName:
|
||||
$ref: ./components/schemas.yml#/SkillName
|
||||
SkillTaxonomyCode:
|
||||
$ref: ./components/schemas.yml#/SkillTaxonomyCode
|
||||
NeedTaskText:
|
||||
$ref: ./components/schemas.yml#/NeedTaskText
|
||||
NeedDomainName:
|
||||
$ref: ./components/schemas.yml#/NeedDomainName
|
||||
NeedLocationName:
|
||||
$ref: ./components/schemas.yml#/NeedLocationName
|
||||
RubAmount:
|
||||
$ref: ./components/schemas.yml#/RubAmount
|
||||
CurrencyCode:
|
||||
$ref: ./components/schemas.yml#/CurrencyCode
|
||||
SalaryPeriod:
|
||||
$ref: ./components/schemas.yml#/SalaryPeriod
|
||||
SalaryTaxBasis:
|
||||
$ref: ./components/schemas.yml#/SalaryTaxBasis
|
||||
SalaryRange:
|
||||
$ref: ./components/schemas.yml#/SalaryRange
|
||||
NeedSpecialization:
|
||||
$ref: ./components/schemas.yml#/NeedSpecialization
|
||||
NeedGrade:
|
||||
$ref: ./components/schemas.yml#/NeedGrade
|
||||
NeedDomain:
|
||||
$ref: ./components/schemas.yml#/NeedDomain
|
||||
NeedWorkFormats:
|
||||
$ref: ./components/schemas.yml#/NeedWorkFormats
|
||||
NeedLocation:
|
||||
$ref: ./components/schemas.yml#/NeedLocation
|
||||
NeedSalary:
|
||||
$ref: ./components/schemas.yml#/NeedSalary
|
||||
NeedSkill:
|
||||
$ref: ./components/schemas.yml#/NeedSkill
|
||||
NeedTask:
|
||||
$ref: ./components/schemas.yml#/NeedTask
|
||||
NeedSpecializationInput:
|
||||
$ref: ./components/schemas.yml#/NeedSpecializationInput
|
||||
NeedGradeInput:
|
||||
$ref: ./components/schemas.yml#/NeedGradeInput
|
||||
NeedDomainInput:
|
||||
$ref: ./components/schemas.yml#/NeedDomainInput
|
||||
NeedWorkFormatsInput:
|
||||
$ref: ./components/schemas.yml#/NeedWorkFormatsInput
|
||||
NeedLocationInput:
|
||||
$ref: ./components/schemas.yml#/NeedLocationInput
|
||||
NeedSalaryInput:
|
||||
$ref: ./components/schemas.yml#/NeedSalaryInput
|
||||
NeedSkillInput:
|
||||
$ref: ./components/schemas.yml#/NeedSkillInput
|
||||
NeedTaskInput:
|
||||
$ref: ./components/schemas.yml#/NeedTaskInput
|
||||
NeedRequirementSet:
|
||||
$ref: ./components/schemas.yml#/NeedRequirementSet
|
||||
NeedFieldName:
|
||||
$ref: ./components/schemas.yml#/NeedFieldName
|
||||
NeedMissingReason:
|
||||
$ref: ./components/schemas.yml#/NeedMissingReason
|
||||
NeedMissingField:
|
||||
$ref: ./components/schemas.yml#/NeedMissingField
|
||||
NeedReadinessStatus:
|
||||
$ref: ./components/schemas.yml#/NeedReadinessStatus
|
||||
NeedReadinessReport:
|
||||
$ref: ./components/schemas.yml#/NeedReadinessReport
|
||||
NeedRecommendationStatus:
|
||||
$ref: ./components/schemas.yml#/NeedRecommendationStatus
|
||||
NeedSkillOverlap:
|
||||
$ref: ./components/schemas.yml#/NeedSkillOverlap
|
||||
NeedMoneyStatus:
|
||||
$ref: ./components/schemas.yml#/NeedMoneyStatus
|
||||
NeedMoneyFit:
|
||||
$ref: ./components/schemas.yml#/NeedMoneyFit
|
||||
NeedSupplyBand:
|
||||
$ref: ./components/schemas.yml#/NeedSupplyBand
|
||||
NeedCategoryRecommendation:
|
||||
$ref: ./components/schemas.yml#/NeedCategoryRecommendation
|
||||
NeedCategoryRecommendations:
|
||||
$ref: ./components/schemas.yml#/NeedCategoryRecommendations
|
||||
Need:
|
||||
$ref: ./components/schemas.yml#/Need
|
||||
NeedSummary:
|
||||
$ref: ./components/schemas.yml#/NeedSummary
|
||||
NeedList:
|
||||
$ref: ./components/schemas.yml#/NeedList
|
||||
NeedCreate:
|
||||
$ref: ./components/schemas.yml#/NeedCreate
|
||||
NeedUpdate:
|
||||
$ref: ./components/schemas.yml#/NeedUpdate
|
||||
parameters:
|
||||
IdempotencyKey:
|
||||
$ref: ./components/parameters.yml#/IdempotencyKey
|
||||
@@ -276,6 +392,10 @@ components:
|
||||
$ref: ./components/parameters.yml#/PageCursor
|
||||
AssessmentAttemptId:
|
||||
$ref: ./components/parameters.yml#/AssessmentAttemptId
|
||||
OrganizationId:
|
||||
$ref: ./components/parameters.yml#/OrganizationId
|
||||
NeedId:
|
||||
$ref: ./components/parameters.yml#/NeedId
|
||||
headers:
|
||||
ETag:
|
||||
$ref: ./components/headers.yml#/ETag
|
||||
@@ -344,6 +464,10 @@ components:
|
||||
$ref: ./components/responses.yml#/AssessmentResultNotReady
|
||||
AssessmentVersionConflict:
|
||||
$ref: ./components/responses.yml#/AssessmentVersionConflict
|
||||
NeedValidationFailed:
|
||||
$ref: ./components/responses.yml#/NeedValidationFailed
|
||||
NeedVersionConflict:
|
||||
$ref: ./components/responses.yml#/NeedVersionConflict
|
||||
securitySchemes:
|
||||
sessionCookie:
|
||||
type: apiKey
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
get:
|
||||
operationId: GetOrganizationNeed
|
||||
summary: Read the current version of a need of an organization.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`. The organization and the role come from the server-side membership, never from the request. In the MVP only the owner of the organization reads needs; the other roles of PRD FR07 are planned.
|
||||
|
||||
Returns the current version of the need: `version`, the requirements with the confirmation state and provenance of each field (`status`, and `source` with the origin, the quote, the version whose text the quote belongs to, and the extractor version), the readiness with `missing_fields`, and the category recommendations of the server. A field with status `unknown` has null value and source; an `extracted` value is a suggestion that waits for confirmation and never feeds search or recommendations.
|
||||
|
||||
Versions: every committed change creates a new immutable `version`, and this operation always returns the latest one. `requirements_version` is the version in which the confirmed requirements were last changed; a change of the title, the vacancy link, the text, or suggestions only keeps it. Search runs, selection snapshots, and invitations refer to a need by its identifier and `requirements_version`, so they keep the requirements they used, and only a new `requirements_version` calls for a new selection snapshot. Reading and comparing earlier versions (PRD FR10) are planned as separate operations that return the same NeedRequirementSet for a given version; they add no field here.
|
||||
|
||||
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, an unknown organization, an unknown need, and a need of another organization all answer 404 not_found, so identifiers cannot be probed; a member whose role does not allow reading the need answers 403 forbidden. An `org_id` or `need_id` that is not a UUID answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- need
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/NeedId
|
||||
responses:
|
||||
"200":
|
||||
description: The current version of the need.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/Need
|
||||
examples:
|
||||
manual_without_vacancy:
|
||||
$ref: ../components/examples.yml#/NeedManualWithoutVacancy
|
||||
from_text_with_unknown_skill:
|
||||
$ref: ../components/examples.yml#/NeedExtractedWithUnknownSkill
|
||||
confirmed:
|
||||
$ref: ../components/examples.yml#/NeedConfirmedAfterUpdate
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/Forbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
patch:
|
||||
operationId: UpdateOrganizationNeed
|
||||
summary: Confirm, change, or delete requirements of a need.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization and the role come from the server-side membership; the body has no organization, membership, or role field. In the MVP only the owner of the organization changes needs; the technical expert, who may refine the requirements of assigned needs under PRD FR07, is planned.
|
||||
|
||||
Merge rules: the body is `application/json` with explicit field replacement, not JSON Merge Patch. Each field present replaces that field as a whole and an absent field stays unchanged; a field decision and each list are replaced entirely and never merged. This keeps every field one optional value in the generated server and client, without nested partial updates.
|
||||
|
||||
Each requirement field is sent as a decision `{value, status}` and each list item as `{name or text, status}`, so confirmation is always explicit:
|
||||
- Confirm a suggestion: send its stored value with `confirmed`. It keeps its origin and quote.
|
||||
- Keep a suggestion open: send its stored value with `extracted`, or leave the field out. `extracted` with any other value, or for a field or item without a stored suggestion, answers 400 with the pointer of that `status`, for example `/grade/status` or `/required_skills/2/status`. A client that sends back an unchanged form therefore never confirms a suggestion by accident.
|
||||
- Change: send another value with `confirmed`. It becomes a confirmed manual value, and its quote is dropped.
|
||||
- Delete: send null for a nullable field, which makes it `unknown` (or unlinks `vacancy_id`), or leave the item out of a skill or task list, which deletes it. An empty skill or task list deletes every item; a list sent as null answers 400. A deleted requirement really changes the requirements that search uses, not only an explanation, and a deleted suggestion is not proposed again by a later extraction.
|
||||
- Text: a different `source_text` extracts again. New suggestions replace only the `extracted` values and items of the fields not named in the body; confirmed values are never overwritten, and a suggested skill whose name is already in either skill list is skipped. Null removes the text and keeps every value.
|
||||
|
||||
Versions: every committed change creates version `expected_version + 1` as an immutable snapshot and answers 200 with it. `requirements_version` becomes the new version only when a confirmed requirement was confirmed, changed, or removed. `expected_version` is the `version` the client read; when it is not current, the server answers 412 version_conflict and changes nothing, and the client reads the need again and reapplies its unsaved edits. The version travels in the body rather than in If-Match because the generated client cannot read the ETag response header yet, as for the questionnaire. Concurrent changes therefore never overwrite each other silently.
|
||||
|
||||
The operation needs no Idempotency-Key: a body that changes nothing when applied to the current version, such as a retry of a change that already succeeded, keeps the version and answers 200 with the current need even when `expected_version` is older. An incomplete need is a valid result; `readiness.missing_fields` tells what remains.
|
||||
|
||||
Salary limit: the recommendations aggregate candidates' minimums against the upper bound, so setting or changing a confirmed salary range counts against a limit shared by the whole organization, every member and every need, together with ranges set on creation: at most three a day (PRD FR13, planned in TASK-211). Over the limit the server answers 429 with Retry-After and changes nothing. After five settings within seven days the money component is `withheld` for seven days. Repeated range changes also feed the private risk signals of TASK-319.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for a candidate), membership (404 not_found) and role (403 forbidden), the need (404 not_found), a body that changes nothing (200), the version (412), domain rules (400 with a pointer such as `/salary/value/salary_to` for a range whose lower bound is not below the upper one or whose width is outside 10-40%, `/desired_skills/0/name` for a skill that is also in the required list, `/grade/status` or `/required_skills/2/status` for `extracted` with a value that is not the stored suggestion, or `/vacancy_id`), then the salary change limit (429). The schema rejects a missing or non-positive `expected_version`, unknown fields such as `rec_score`, `members`, `candidate_minimum`, or `version`, a field sent as a bare value instead of `{value, status}`, a list sent as null, a salary bound that is not a positive multiple of 1000, and an unknown currency, period, or tax basis.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- need
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/NeedId
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/NeedUpdate
|
||||
examples:
|
||||
confirm_suggestions:
|
||||
$ref: ../components/examples.yml#/NeedUpdateConfirmSuggestions
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The need after the change, or the current need when the body changes
|
||||
nothing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/Need
|
||||
examples:
|
||||
confirmed:
|
||||
$ref: ../components/examples.yml#/NeedConfirmedAfterUpdate
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/NeedValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/NeedVersionConflict
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,109 @@
|
||||
get:
|
||||
operationId: ListOrganizationNeeds
|
||||
summary: List the needs of an organization.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`. The organization and the role come from the membership that the server holds for the session account, never from the request. In the MVP only the owner of the organization works with needs; the other roles of the PRD FR07 matrix (recruiter, hiring manager and technical expert for assigned needs) are planned and change no field of this contract. The list holds only the needs that the role may read.
|
||||
|
||||
Returns a page of need summaries, newest first by creation time with the identifier as the tie-breaker, with cursor pagination. A summary has the current version, the target specialization and grade with their confirmation state, and the readiness; GetOrganizationNeed returns the requirements and the recommendations.
|
||||
|
||||
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 and an unknown organization both answer 404 not_found, so organizations cannot be enumerated; a member whose role does not allow reading needs answers 403 forbidden. A malformed `org_id`, `limit`, or `cursor` answers 400 validation_failed.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- need
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the needs of the organization.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/NeedList
|
||||
examples:
|
||||
last_page:
|
||||
$ref: ../components/examples.yml#/NeedListPage
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/Forbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
post:
|
||||
operationId: CreateOrganizationNeed
|
||||
summary: Create a need of an organization from a form, a text, or both.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The organization comes from the path and the server-side membership; the body has no organization, membership, or role field. In the MVP only the owner of the organization may create a need; the other roles of PRD FR07 are planned.
|
||||
|
||||
A need does not require a vacancy: `vacancy_id` is optional and nullable. When it is given, it must name a vacancy of the same organization; until vacancies exist in the contract, any vacancy identifier answers 400 with the pointer `/vacancy_id`, the same for an unknown vacancy and one of another organization.
|
||||
|
||||
Only `title` is required. A field is sent as a decision `{value, status}` and a list item as `{name or text, status}`; on creation the status must be `confirmed`, and the value becomes a confirmed manual value. When `source_text` is given, the server extracts suggestions for the absent fields with deterministic rules and a dictionary before it answers, so creation works while the ML service is disabled; every suggestion has the status `extracted`, the origin extracted_from_text, a quote where the extractor found one, and the extractor version, and it waits for a member to confirm it. A field that the text does not state stays `unknown` with null value and source; the server never guesses a grade, a format, or a salary. ML suggestions with quotes are planned as an asynchronous addition that creates a new version and never overwrites a confirmed value.
|
||||
|
||||
The need is saved even when critical fields are missing: the response is 201 with version 1, and `readiness.missing_fields` names each critical field without a confirmed value with a specific question. `recommendations` is computed by the server from the confirmed requirements only; the request cannot set a recommendation, its score, or its components. Creating a need never contacts a candidate or sends an invitation.
|
||||
|
||||
Salary limit: setting a salary range counts against a limit shared by the whole organization, every member and every need, on creation as on a change: at most three range settings a day (PRD FR13, planned in TASK-211). Over the limit the server answers 429 with Retry-After and creates nothing. After five settings within seven days the money component of the recommendations is `withheld` for seven days. The limit keeps an organization from probing hidden candidate minimums with new needs instead of edits; repeated range changes also feed the private risk signals of TASK-319.
|
||||
|
||||
Idempotency: a retry with the same key and body within 24 hours replays the stored 201 and creates nothing, so a lost response never creates a second need. A different body with the same key answers 422 idempotency_key_reused. 400 is never stored, so a corrected retry is evaluated again.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for a candidate), membership (404 not_found) and role (403 forbidden), the Idempotency-Key (422, 409 idempotency_in_progress, replay), domain rules (400 with a pointer: `/salary/value/salary_to` for a range whose lower bound is not below the upper one or whose width is outside 10-40%, `/required_skills/1/name` for a repeated skill, `/grade/status` or `/required_skills/0/status` for `extracted`, which a new need cannot have, or `/vacancy_id`), then the salary limit (429). The schema already rejects unknown fields such as `rec_score`, `members`, or `candidate_minimum`, a field sent as a bare value instead of `{value, status}`, a salary bound that is not a positive multiple of 1000, and an unknown currency, period, or tax basis. The general rate limit can answer 429 with Retry-After before any check. 429 is never stored.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- need
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/NeedCreate
|
||||
examples:
|
||||
manual_without_vacancy:
|
||||
$ref: ../components/examples.yml#/NeedCreateManual
|
||||
from_text:
|
||||
$ref: ../components/examples.yml#/NeedCreateFromText
|
||||
responses:
|
||||
"201":
|
||||
description: >-
|
||||
The need was created as version 1, or a retry with the same
|
||||
Idempotency-Key replayed its creation.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/Need
|
||||
examples:
|
||||
manual_without_vacancy:
|
||||
$ref: ../components/examples.yml#/NeedManualWithoutVacancy
|
||||
from_text_with_unknown_skill:
|
||||
$ref: ../components/examples.yml#/NeedExtractedWithUnknownSkill
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/NeedValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/IdempotencyInProgress
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
Reference in new issue
Block a user