feat(api): add employer need contract with requirement versions and recommendations

This commit is contained in:
shira committed 2026-10-06 07:39:05 +03:00
1 parent 3adb0ef9e4
commit a7d5781f2d
95 files changed
+25352 -26

No files matched your search

+674
View File
@@ -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
+25
View File
@@ -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
+45
View File
@@ -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
+912
View File
@@ -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
+124
View File
@@ -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
+113
View File
@@ -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
+109
View File
@@ -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