feat(api): add invitation, terms version, acceptance, and contact grant contract

This commit is contained in:
shira committed 2026-10-06 13:48:35 +03:00
1 parent b856d4ff54
commit d2c6f1375a
140 files changed
+39767 -303

No files matched your search

File diff suppressed because it is too large. Load diff
+24
View File
@@ -105,3 +105,27 @@ SupportCaseId:
type: string
format: uuid
example: 01928f7a-6e7f-7a8b-9c0d-1e2f3a4b5c6d
InvitationId:
name: invitation_id
in: path
required: true
description: >-
Identifier of an invitation of the organization in the path. An
invitation of another organization and an unknown identifier both answer
404 not_found.
schema:
type: string
format: uuid
example: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e6f
MyInvitationId:
name: invitation_id
in: path
required: true
description: >-
Identifier of an invitation addressed to the current candidate. A draft,
an invitation addressed to another candidate, and an unknown identifier
all answer 404 not_found, so identifiers cannot be enumerated.
schema:
type: string
format: uuid
example: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e6f
+97 -9
View File
@@ -235,9 +235,7 @@ QuestionnaireValidationFailed:
more than two specializations, an unknown specialization, grade, or task
language, an unknown field such as confirmed_grade, a repeated
specialization, or a task language that the specialization's published
bank does not offer; 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.
bank does not offer; code validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed.
content:
application/problem+json:
schema:
@@ -284,8 +282,7 @@ AssessmentAnswerValidationFailed:
element, more selections than the item allows, a text longer than the
item allows, a language that the practice does not offer, or an unknown
field such as score or duration; 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 stored, and the outcome is
pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was stored, and the outcome is
not stored under the Idempotency-Key.
content:
application/problem+json:
@@ -385,8 +382,7 @@ NeedValidationFailed:
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
body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed, and the
outcome is not stored under an Idempotency-Key.
content:
application/problem+json:
@@ -428,8 +424,7 @@ SupportCaseValidationFailed:
case type does not accept, a missing required field of the type, an
unknown field such as status, decision, moderator, or priority, or a
complaint reason that requires an invitation reference; 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
validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was
created, and the outcome is not stored under the Idempotency-Key.
content:
application/problem+json:
@@ -466,3 +461,96 @@ SupportCaseCreateConflict:
$ref: ./examples.yml#/SupportCaseAppealExists
idempotency_in_progress:
$ref: ./examples.yml#/IdempotencyInProgress
InvitationValidationFailed:
description: >-
The body does not match the contract or violates an invitation rule: a
missing term or package condition, a package condition left out instead
of `not_provided`, a salary range without its 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, the
`office` or `hybrid` format without a place of work, a repeated
technology, a candidate handle that the organization cannot use, a need
or requirements version that the organization does not have, a response
period other than 3, 7, or 14 days, an unknown field such as a
candidate's email address or salary minimum, or a missing or invalid
expected_version; code validation_failed with body pointers. A missing nested field has its own pointer with the code required; an unknown field points at the object that contains it, a failure inside an array element points at the array, and only a malformed document, an unknown top-level field, or an unknown top-level variant points at the whole body. Nothing was changed, and the outcome is not stored under an
Idempotency-Key.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
without_tax_basis:
$ref: ./examples.yml#/InvitationWithoutTaxBasis
without_communication_method:
$ref: ./examples.yml#/InvitationWithoutCommunicationMethod
package_condition_left_out:
$ref: ./examples.yml#/InvitationPackageItemMissing
salary_range_too_wide:
$ref: ./examples.yml#/InvitationSalaryRangeTooWide
location_required:
$ref: ./examples.yml#/InvitationLocationRequired
unknown_candidate:
$ref: ./examples.yml#/InvitationUnknownCandidate
candidate_data_in_body:
$ref: ./examples.yml#/InvitationCandidateDataInBody
InvitationAcceptValidationFailed:
description: >-
The body does not match the contract or violates a rule of the consent
C4: a missing `terms_version` or `expected_version`, `accepted` other
than true, an empty or repeated choice of contact fields, an unknown
field kind, a field that the candidate's profile does not hold, a
consent text version that is not the published one, or an unknown field
such as a contact value; code validation_failed with body pointers.
Nothing was changed, no consent or grant was recorded, and the outcome
is not stored under the Idempotency-Key.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
empty_field_choice:
$ref: ./examples.yml#/InvitationConsentWithoutFields
outdated_consent_text:
$ref: ./examples.yml#/InvitationConsentTextOutdated
missing_terms_version:
$ref: ./examples.yml#/InvitationMissingTermsVersion
InvitationVersionConflict:
description: >-
`expected_version` is not the current invitation version, or, for an
acceptance, `terms_version` is not the current terms version; code
version_conflict. Nothing was changed, no consent or grant was
recorded, and the outcome is not stored under an Idempotency-Key; read
the invitation again before retrying.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
stale_terms:
$ref: ./examples.yml#/InvitationStaleTerms
stale_version:
$ref: ./examples.yml#/InvitationStaleVersion
InvitationCommandConflict:
description: >-
The state of the invitation does not allow the command, code
state_conflict: for example an acceptance of a withdrawn or expired
invitation or one past its deadline, a send of an invitation that is no
longer a draft, a send blocked by the pending limit of the need or by
the pause after a decline, or a second raise of the upper salary bound.
The invitation tells the client its state. Or a request with the same
Idempotency-Key is still running, code idempotency_in_progress. Nothing
was changed in either case.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
not_answerable:
$ref: ./examples.yml#/InvitationNotAnswerable
salary_raise_used:
$ref: ./examples.yml#/InvitationSalaryRaiseUsed
send_blocked:
$ref: ./examples.yml#/InvitationSendBlocked
idempotency_in_progress:
$ref: ./examples.yml#/IdempotencyInProgress
File diff suppressed because it is too large. Load diff
@@ -32,3 +32,18 @@ schemas:
description: >-
Opaque cursor of the next page, or null on the last page. Clients
must not parse, build, or store it beyond the current listing.
CandidateHandle:
type: string
minLength: 1
maxLength: 128
pattern: "^[A-Za-z0-9_-]+$"
description: >-
Opaque reference to a candidate as one organization sees it, taken
from a search result card of that organization. It is not the
candidate's account or profile identifier, it never contains an email
address or a phone number, and it means nothing to another
organization. The server resolves it only for the organization in the
path. Clients never parse it. It is shared by the invitations of
FR12 and the search results of FR11 (TASK-185), which issue it.
examples:
- cand_7Qm2xVb9Lr4Kp0Zt
@@ -0,0 +1,279 @@
schemas:
ContactFieldKind:
type: string
description: |-
Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.
- full_name: the full name from the profile.
- email: the contact email address from the profile.
- phone: the contact phone number from the profile.
- telegram: the Telegram username from the profile.
The value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.
enum:
- full_name
- email
- phone
- telegram
ContactConsentText:
type: object
description: >-
Currently published text of the consent C4 for this invitation. The
server stores an acceptance with `text_version` and the hash of
exactly this text, together with the organization, the selected
fields, the invitation, and its terms version (the ledger of TASK-062).
additionalProperties: false
required:
- text_version
- text
properties:
text_version:
$ref: "./identity_schemas.yml#/schemas/ConsentTextVersion"
text:
type: string
minLength: 1
maxLength: 100000
description: >-
Full consent text in plain UTF-8 with the name of the
organization; paragraphs are separated by an empty line. The
client shows it as text, never as HTML, next to the field choice.
ContactConsentOffer:
type: object
description: >-
What the candidate can consent to in an acceptance: the consent text
and the kinds of contact that the candidate's profile holds now. It
holds kinds only, never contact values, and nothing is preselected.
additionalProperties: false
required:
- text
- available_fields
properties:
text:
$ref: "#/schemas/ContactConsentText"
available_fields:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
description: >-
Kinds of contact that the profile holds and that an acceptance may
select. A kind outside this list answers 400 in an acceptance.
items:
$ref: "#/schemas/ContactFieldKind"
ContactConsentAcceptance:
type: object
description: >-
Consent C4 given in an acceptance: the text version the candidate saw,
an explicit `accepted`, and the contact fields the candidate selected.
At least one field is required, so a hidden default or an empty choice
never creates a grant. A text version that is not the currently
published one answers 400 validation_failed with the pointer
`/consent_c4/text_version`, and a field that the profile does not hold
answers 400 with the pointer of that item, such as
`/consent_c4/fields/1`. C4 is given only here, never at registration.
The permission to pass the selected data on to the organization's ATS
(PRD C4 and FR19) is planned as an additive optional flag that
defaults to no transfer.
additionalProperties: false
required:
- text_version
- accepted
- fields
properties:
text_version:
$ref: "./identity_schemas.yml#/schemas/ConsentTextVersion"
accepted:
type: boolean
enum:
- true
description: Explicit consent. Only true is valid.
fields:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
description: >-
Contact fields the organization may read after the acceptance.
The grant covers exactly these fields and no other.
items:
$ref: "#/schemas/ContactFieldKind"
ContactGrantState:
type: string
description: |-
State of a contact grant.
- active: the grant exists. Each read by the organization still checks the consent C4, the grant, and the current visibility of the profile.
- revoked: the grant is closed for good; the organization reads no contact through it. A later publication of the profile or a new acceptance never reopens it; only a new explicit C4 creates a new grant.
enum:
- active
- revoked
ContactRevocationReason:
type: string
description: |-
Why a contact grant was revoked, shown only to the candidate.
- consent_revoked: the candidate revoked the consent C4 for the organization; every grant under it is closed.
- participation_cancelled: the candidate cancelled the participation in this invitation; only the grant of this invitation is closed.
- visibility_closed: the candidate revoked the publication C2 or hid the profile from the organization after the grant existed. A grant created while the visibility already did not allow a read stays active with `blocked_by` `visibility` instead.
The withdrawal of an invitation by the organization, a no deal, and a negotiation timeout never revoke a grant.
enum:
- consent_revoked
- participation_cancelled
- visibility_closed
ContactAccessBlock:
type: string
description: |-
Why an active grant does not allow a read now, shown only to the candidate.
- visibility: the profile was not published (C2) or was hidden from the organization when the candidate accepted, and it still is. The acceptance never publishes the profile or lifts the hiding by itself (PRD FR12); the grant becomes readable once the candidate publishes the profile or unhides it for the organization.
enum:
- visibility
ContactGrant:
type: object
description: >-
Contact grant as the candidate reads it: which fields one organization
may read, from which invitation and terms version, and whether it is
still active. It holds kinds only, never contact values. A grant is
stored apart from the invitation state, so a later change of the
state does not change it unless the state is a cancellation by the
candidate.
additionalProperties: false
required:
- id
- fields
- status
- readable
- blocked_by
- terms_version
- consent_text_version
- granted_at
- revoked_at
- revocation_reason
properties:
id:
type: string
format: uuid
description: Identifier of the grant.
fields:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
description: Contact fields that the grant covers.
items:
$ref: "#/schemas/ContactFieldKind"
status:
$ref: "#/schemas/ContactGrantState"
readable:
type: boolean
description: >-
Whether the organization can read the covered fields now: true
only for an active grant whose current consent and visibility
allow the read. The organization sees the same fact as
`contact_access.status` `available`, without the reason.
blocked_by:
description: >-
Why an active grant is not readable now, or null when it is
readable or revoked; a revoked grant has `revocation_reason`
instead.
oneOf:
- $ref: "#/schemas/ContactAccessBlock"
- type: "null"
terms_version:
description: Terms version of the invitation that the acceptance accepted.
allOf:
- $ref: "./invitation_schemas.yml#/schemas/InvitationTermsVersion"
consent_text_version:
description: Version of the consent C4 text that the candidate accepted.
allOf:
- $ref: "./identity_schemas.yml#/schemas/ConsentTextVersion"
granted_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
revoked_at:
description: Moment of the revocation, or null while the grant is active.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
revocation_reason:
description: Reason of the revocation, or null while the grant is active.
oneOf:
- $ref: "#/schemas/ContactRevocationReason"
- type: "null"
ContactPhoneNumber:
type: string
minLength: 8
maxLength: 16
pattern: '^\+[1-9][0-9]{6,14}$'
description: Phone number in the E.164 format, for example +70000000000.
ContactTelegramUsername:
type: string
minLength: 6
maxLength: 33
pattern: "^@[A-Za-z0-9_]{5,32}$"
description: Telegram username with the leading @.
ContactFullName:
type: string
minLength: 1
maxLength: 200
pattern: '^\S(?:.*\S)?$'
description: >-
Full name as the candidate wrote it in the profile. Plain text without
line breaks; clients show it as text, never as HTML.
ContactDisclosure:
type: object
description: >-
Contacts of the candidate that the organization may read through an
active grant of this invitation. This is the only response that
carries contact values, and it is separate from the terms and from
the invitation. Each field the grant does not cover is null, and so
is a covered field that the profile no longer holds. The response is
never cached or stored by the server for later reads, so a
revocation closes the next read at once. The value formats depend on
the profile contract (FR02, TASK-066), which must store the same
formats; see ContactFieldKind.
additionalProperties: false
required:
- invitation_id
- grant_id
- fields
- granted_at
- full_name
- email
- phone
- telegram
properties:
invitation_id:
type: string
format: uuid
description: Invitation whose acceptance created the grant.
grant_id:
type: string
format: uuid
description: Grant that allows the read.
fields:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
description: Contact fields that the grant covers.
items:
$ref: "#/schemas/ContactFieldKind"
granted_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
full_name:
oneOf:
- $ref: "#/schemas/ContactFullName"
- type: "null"
email:
oneOf:
- $ref: "./identity_schemas.yml#/schemas/EmailAddress"
- type: "null"
phone:
oneOf:
- $ref: "#/schemas/ContactPhoneNumber"
- type: "null"
telegram:
oneOf:
- $ref: "#/schemas/ContactTelegramUsername"
- type: "null"
@@ -0,0 +1,944 @@
schemas:
InvitationVersion:
type: integer
format: int64
minimum: 1
description: >-
Version of an invitation. Creation makes version 1, and every committed
change advances it by exactly one: a change of the draft, a send, the
first view, an answer, a salary raise, a withdrawal, a cancellation,
and an expiry made by the server. Every command carries the version
the client read as `expected_version`; a stale value answers 412
version_conflict and changes nothing.
examples:
- 3
InvitationTermsVersion:
type: integer
format: int64
minimum: 1
description: >-
Version of the terms of an invitation. The terms of a version are an
immutable snapshot: every committed change of the terms, in the draft
or by the one raise of the upper salary bound after sending, creates
the next terms version, and a change of anything else keeps it. An
acceptance names the terms version it accepts, and the consent C4 and
the contact grant record it.
examples:
- 2
InvitationState:
type: string
description: |-
State of an invitation (PRD FR12). The internal sending step is never visible: a successful send already answers with `delivered`.
- draft: the organization prepares the terms. The candidate does not see the invitation.
- delivered: the invitation is in the candidate's inbox and the response deadline runs.
- viewed: the candidate opened the terms; ViewMyInvitation records it. The deadline is unchanged.
- counter: planned; the candidate sent the one counter offer. No MVP operation produces it.
- accepted: the candidate accepted the current terms version and gave the consent C4; the contact grant exists.
- interview_scheduled, interviewed, negotiation, terms_agreed, no_deal: planned stages after an acceptance (interview and the sealed final of FR13). No MVP operation produces them.
- declined: terminal; the candidate declined with a structured reason. No access arises.
- expired: terminal; a server deadline passed, see `expiry_reason`. No access arises.
- withdrawn: terminal; the organization withdrew the invitation. A grant that already exists is not revoked by it.
- cancelled_by_candidate: terminal; the candidate cancelled the participation. The grant of this invitation is revoked.
Planned states are listed now so that generated clients accept them when their operations arrive. Adding another value is a contract change.
enum:
- draft
- delivered
- viewed
- counter
- accepted
- interview_scheduled
- interviewed
- negotiation
- terms_agreed
- no_deal
- declined
- expired
- withdrawn
- cancelled_by_candidate
InvitationExpiryReason:
type: string
description: |-
Why an invitation expired. Set exactly when the state is `expired`, null otherwise.
- invitation_timeout: the candidate did not answer by `response_deadline_at`. No grant is created.
- negotiation_timeout: planned; the sealed final of FR13 closed without both bids. No MVP operation produces it.
enum:
- invitation_timeout
- negotiation_timeout
InvitationResponsePeriod:
type: integer
format: int32
enum:
- 3
- 7
- 14
description: >-
Days the candidate has to answer, chosen by the organization in the
draft from the product policy: 3, 7, or 14. The deadline starts at the
first delivery and is never reset by an email, a view, or a counter
offer.
examples:
- 7
InvitationRoleTitle:
type: string
minLength: 1
maxLength: 200
pattern: '^\S(?:.*\S)?$'
description: >-
Name of the offered role, for example "Middle Go developer in the
payments team". It has no leading or trailing whitespace and no line
breaks. Plain text; clients show it as text, never as HTML.
InvitationTeamDescription:
type: string
minLength: 1
maxLength: 1000
pattern: '\S'
description: >-
Description of the team the candidate would join, such as its size,
roles, and way of working. It may contain line breaks and has at least
one character that is not white space. Plain text; clients show it as
text, never as HTML. It describes the job and must not contain
personal data of employees or candidates.
InvitationOfferType:
type: string
description: |-
Type of the offer.
- full_time: employment with a full working week.
- part_time: employment with a part-time working week.
- contract: a fixed-term or project contract outside employment.
- internship: an internship.
Adding a value is a contract change.
enum:
- full_time
- part_time
- contract
- internship
InvitationCommunicationChannel:
type: string
description: |-
Channel through which the organization will contact the candidate after an acceptance.
- email: a letter to the email address the candidate disclosed.
- phone: a call or a text to the phone number the candidate disclosed.
- telegram: a message to the Telegram username the candidate disclosed.
- video_call: an invitation to a video call, sent through one of the disclosed contacts.
The channel describes the organization's plan; the candidate decides which contacts to disclose, and the server never requires that the disclosed fields include the channel.
enum:
- email
- phone
- telegram
- video_call
InvitationCommunicationMethod:
type: object
description: >-
How the organization will contact the candidate after an acceptance.
It is part of the terms, so the candidate sees it before choosing
which contacts to disclose. An invitation without it cannot exist,
because the terms require it.
additionalProperties: false
required:
- channel
- details
properties:
channel:
$ref: "#/schemas/InvitationCommunicationChannel"
details:
description: >-
Optional short note, for example the first step or the expected
time of the first contact, or null. Plain text without line
breaks; it never contains a link or a contact of an employee.
oneOf:
- $ref: "#/schemas/InvitationCommunicationNote"
- type: "null"
InvitationCommunicationNote:
type: string
minLength: 1
maxLength: 300
pattern: '^\S(?:.*\S)?$'
description: >-
Short note on the communication method, for example "A 30-minute call
with the team lead within three working days". It has no leading or
trailing whitespace and no line breaks. Plain text; clients show it as
text, never as HTML.
InvitationPackageItemText:
type: string
minLength: 1
maxLength: 300
pattern: '^\S(?:.*\S)?$'
description: >-
Short description of a condition, for example "Quarterly bonus up to
20% of the salary". It has no leading or trailing whitespace and no
line breaks. Plain text; clients show it as text, never as HTML.
InvitationPackageItemProvided:
type: object
description: The condition is part of the offer, with its description.
additionalProperties: false
required:
- status
- description
properties:
status:
type: string
enum:
- provided
description:
$ref: "#/schemas/InvitationPackageItemText"
InvitationPackageItemNotProvided:
type: object
description: >-
The organization states explicitly that the offer does not include the
condition ("Не предусмотрено" in the interface). It has no
description.
additionalProperties: false
required:
- status
properties:
status:
type: string
enum:
- not_provided
InvitationPackageItem:
description: >-
One required condition of the package, selected by `status`:
`provided` with a description, or `not_provided` without one. Not
providing a condition is an explicit choice: the field is required in
the package, so an absent field fails validation instead of meaning
"not provided": it answers 400 `required` with its pointer, such as
`/terms/package/training`. A `provided` item without a description
answers `required` with the pointer of the description, and a
`not_provided` item with a description answers `invalid` with the
pointer of the item. ogen selects the variant by the value of
`status`.
oneOf:
- $ref: "#/schemas/InvitationPackageItemProvided"
- $ref: "#/schemas/InvitationPackageItemNotProvided"
InvitationPackage:
type: object
description: >-
Required section of the package (PRD FR12): the bonus, the equipment,
the training, and the voluntary health insurance (ДМС). Every field is
required and is either provided with a description or explicitly not
provided. The work format of the package is the required
`work_formats` term, which has no "not provided" variant. Adding a
required condition is a breaking change; an optional one is additive.
additionalProperties: false
required:
- bonus
- equipment
- training
- health_insurance
properties:
bonus:
$ref: "#/schemas/InvitationPackageItem"
equipment:
$ref: "#/schemas/InvitationPackageItem"
training:
$ref: "#/schemas/InvitationPackageItem"
health_insurance:
$ref: "#/schemas/InvitationPackageItem"
InvitationTerms:
type: object
description: >-
Terms of an invitation: everything the candidate sees before deciding
and before any contact is disclosed. The same schema is the request
field of a draft and the stored snapshot of a terms version, so a
response can be sent back unchanged. Every field is required; a field
that may have no value says so with an explicit variant (`location`
null for a remote role, a package item `not_provided`). The terms never
contain data of the candidate: no contact, no salary minimum, and no
indicator derived from it. The server checks the cross-field rules
after the schema and answers 400 validation_failed with the pointer of
the field: the salary rules of SalaryRange with `/terms/salary/salary_to`,
a missing place of work for the `office` or `hybrid` format with
`/terms/location`, and a repeated technology in `tech_stack` with the
pointer of the later item.
additionalProperties: false
required:
- role_title
- specialization
- grade
- offer_type
- tasks
- team
- tech_stack
- work_formats
- location
- communication_method
- salary
- package
properties:
role_title:
$ref: "#/schemas/InvitationRoleTitle"
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
grade:
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
offer_type:
$ref: "#/schemas/InvitationOfferType"
tasks:
type: array
minItems: 1
maxItems: 20
description: Work tasks of the role in the order given.
items:
$ref: "./need_schemas.yml#/schemas/NeedTaskText"
team:
$ref: "#/schemas/InvitationTeamDescription"
tech_stack:
type: array
minItems: 1
maxItems: 30
uniqueItems: true
description: >-
Technologies of the role. The server compares names without regard
to letter case.
items:
$ref: "./need_schemas.yml#/schemas/SkillName"
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
description: >-
Work formats the organization offers; the candidate may choose any
of them.
items:
$ref: "./questionnaire_schemas.yml#/schemas/WorkFormat"
location:
description: >-
Place of work for the `office` or `hybrid` format, or null when
the only format is `remote`. It is required with either of those
formats.
oneOf:
- $ref: "./need_schemas.yml#/schemas/NeedLocationName"
- type: "null"
communication_method:
$ref: "#/schemas/InvitationCommunicationMethod"
salary:
$ref: "./need_schemas.yml#/schemas/SalaryRange"
package:
$ref: "#/schemas/InvitationPackage"
InvitationNeedReference:
type: object
description: >-
Need of the same organization that the invitation was built from, with
the requirements version used. A direct invitation has no need. The
link is informational: the invitation keeps its own terms, which may
differ from the need, and a later change of the need never changes
them.
additionalProperties: false
required:
- need_id
- requirements_version
properties:
need_id:
type: string
format: uuid
description: Identifier of a need of the organization in the path.
requirements_version:
description: >-
`requirements_version` of the need that the invitation refers to;
it must be a version that the need has had.
allOf:
- $ref: "./need_schemas.yml#/schemas/NeedVersion"
InvitationSalaryFit:
type: string
description: |-
Coarse indicator for the organization of how the salary range relates to the candidate's hidden minimum (PRD FR13). It is the only information about the minimum that the organization receives; the exact minimum never appears in any response, log, or problem. The server compares the upper bound `B` with the lowest minimum the candidate set for the offered work formats, in integer arithmetic and only in the same tax basis.
- within_range: the minimum is not above `B`.
- up_to_10_percent_above: the minimum is above `B` by at most 10%, that is `10 * minimum <= 11 * B`.
- above: the minimum is more than 10% above `B`.
- withheld: the organization made five indicator-relevant settings within seven days, so the indicator is off for seven days from the fifth (the limit of TASK-211). The response to the fifth setting already carries `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.
- not_available: the candidate set no minimum for the offered formats, or set it in the other tax basis.
Every change that can move this indicator is an indicator-relevant setting: the range set on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, since the minimum depends on the format. Each counts against the organization-wide limit of three settings a day (429) and against the withheld counter of five settings within seven days, together with the ranges of needs. The one raise of the upper bound of a sent invitation counts against the withheld counter but not against the daily limit, because FR13 gives it its own once-only rule. Switching the tax basis turns `not_available` into a band or back and so tells the organization the basis of the minimum; this is accepted, and the switch counts against the limit like any other setting.
The server never rejects or changes a range because of the minimum: a rejection would itself reveal it.
enum:
- within_range
- up_to_10_percent_above
- above
- withheld
- not_available
InvitationContactAccessState:
type: string
description: |-
Whether the organization may read the candidate's contacts through GetOrganizationInvitationContacts now.
- not_granted: the candidate has not accepted this invitation, so no grant exists.
- available: a grant from this invitation is active and the current consent and visibility allow the read.
- closed: a grant from this invitation exists but does not allow the read now: it was revoked (the candidate revoked C4, cancelled the participation, or revoked the publication C2 or hid the profile after the acceptance), or it was created while the visibility already did not allow the read. The organization is not told which. A revoked grant never becomes `available` again; a grant blocked from the start becomes `available` once the candidate's visibility allows the read, which only follows the candidate's own choice to publish the profile or unhide it for the organization. Since every visibility change after a grant exists revokes the grant, a later toggle is never visible to the organization.
enum:
- not_granted
- available
- closed
InvitationContactAccess:
type: object
description: >-
Contact access of the organization through this invitation, without
any contact value. The values come only from
GetOrganizationInvitationContacts.
additionalProperties: false
required:
- status
- fields
properties:
status:
$ref: "#/schemas/InvitationContactAccessState"
fields:
type: array
maxItems: 4
uniqueItems: true
description: >-
Kinds of contact that the read returns while `status` is
`available`; empty otherwise.
items:
$ref: "./contact_grant_schemas.yml#/schemas/ContactFieldKind"
InvitationOrganization:
type: object
description: >-
Organization that sent the invitation, as the candidate sees it before
deciding. The organization contract (TASK-077) adds the public card;
this object only names it.
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
format: uuid
description: Identifier of the organization.
name:
type: string
minLength: 1
maxLength: 200
description: >-
Public name of the organization. Plain text; clients show it as
text, never as HTML.
InvitationDeclineReason:
type: string
description: |-
Structured reason of a decline. Every reason is neutral and none requires a comment.
- salary: the salary range does not fit.
- tasks: the role or the tasks do not fit.
- stack: the technologies do not fit.
- work_format: the work format or the place of work does not fit.
- package: the package does not fit.
- company: the company or its domain does not fit.
- not_looking: the candidate is not looking for a job now.
- other_offer: the candidate accepted another offer.
- other: another reason ("Другое"); a comment stays optional.
The organization never sees the reason of an individual decline: a reason such as `salary` would tell it that the hidden minimum is above the range. Reasons feed only the aggregates of FR12 with a minimum group size (planned). Adding a value is a contract change.
enum:
- salary
- tasks
- stack
- work_format
- package
- company
- not_looking
- other_offer
- other
InvitationDeclineComment:
type: string
minLength: 1
maxLength: 500
pattern: '\S'
description: >-
Optional comment of the candidate on the offer. It may contain line
breaks and has at least one character that is not white space. It is
never shown to the organization, never published, and never written to
logs or notifications; only the candidate reads it back. Plain text;
clients show it as text, never as HTML.
InvitationDeclineRecord:
type: object
description: The candidate's own decline, as the candidate reads it back.
additionalProperties: false
required:
- reason
- comment
- declined_at
properties:
reason:
$ref: "#/schemas/InvitationDeclineReason"
comment:
oneOf:
- $ref: "#/schemas/InvitationDeclineComment"
- type: "null"
declined_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
OrganizationInvitation:
type: object
description: >-
Invitation as the organization reads it: the candidate handle, the
current terms version, the state, the coarse salary indicator, and the
contact access without contact values. It never contains the
candidate's name, email address, phone number, or other contact, the
exact salary minimum, or the reason and comment of a decline.
additionalProperties: false
required:
- id
- organization_id
- candidate_handle
- need
- state
- expiry_reason
- version
- terms_version
- terms
- response_period_days
- response_deadline_at
- salary_raise_used
- salary_fit
- contact_access
- created_at
- updated_at
- delivered_at
- viewed_at
- responded_at
properties:
id:
type: string
format: uuid
description: Identifier of the invitation.
organization_id:
type: string
format: uuid
description: >-
Organization that owns the invitation, equal to `org_id` of the
path. It never changes.
candidate_handle:
$ref: "./common_schemas.yml#/schemas/CandidateHandle"
need:
description: Need the invitation was built from, or null for a direct invitation.
oneOf:
- $ref: "#/schemas/InvitationNeedReference"
- type: "null"
state:
$ref: "#/schemas/InvitationState"
expiry_reason:
description: Reason of an expiry, or null unless `state` is `expired`.
oneOf:
- $ref: "#/schemas/InvitationExpiryReason"
- type: "null"
version:
$ref: "#/schemas/InvitationVersion"
terms_version:
$ref: "#/schemas/InvitationTermsVersion"
terms:
$ref: "#/schemas/InvitationTerms"
response_period_days:
$ref: "#/schemas/InvitationResponsePeriod"
response_deadline_at:
description: >-
Moment when the candidate's time to answer ends, set at the first
delivery to `delivered_at` plus `response_period_days`, or null for
a draft. A command received at this moment or later is late. After
an acceptance the deadline no longer applies.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
salary_raise_used:
type: boolean
description: >-
Whether the one raise of the upper salary bound after sending
(PRD FR13) has been used. It counts the whole history of the
invitation.
salary_fit:
$ref: "#/schemas/InvitationSalaryFit"
contact_access:
$ref: "#/schemas/InvitationContactAccess"
created_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
updated_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
delivered_at:
description: Moment of delivery to the candidate's inbox, or null for a draft.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
viewed_at:
description: Moment when the candidate first opened the terms, or null.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
responded_at:
description: Moment of the candidate's acceptance or decline, or null.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
OrganizationInvitationSummary:
type: object
description: >-
Invitation in the organization's list: its identity, state, versions,
role, salary range, deadline, and contact access. Read the invitation
for the full terms and the salary indicator.
additionalProperties: false
required:
- id
- candidate_handle
- need
- state
- expiry_reason
- version
- terms_version
- role_title
- salary
- response_deadline_at
- contact_access
- created_at
- updated_at
properties:
id:
type: string
format: uuid
description: Identifier of the invitation.
candidate_handle:
$ref: "./common_schemas.yml#/schemas/CandidateHandle"
need:
oneOf:
- $ref: "#/schemas/InvitationNeedReference"
- type: "null"
state:
$ref: "#/schemas/InvitationState"
expiry_reason:
oneOf:
- $ref: "#/schemas/InvitationExpiryReason"
- type: "null"
version:
$ref: "#/schemas/InvitationVersion"
terms_version:
$ref: "#/schemas/InvitationTermsVersion"
role_title:
$ref: "#/schemas/InvitationRoleTitle"
salary:
$ref: "./need_schemas.yml#/schemas/SalaryRange"
response_deadline_at:
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
contact_access:
$ref: "#/schemas/InvitationContactAccess"
created_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
updated_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
OrganizationInvitationList:
type: object
description: >-
One page of the invitations of an organization, newest first by
creation time.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Invitations of the page.
items:
$ref: "#/schemas/OrganizationInvitationSummary"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
OrganizationInvitationCreate:
type: object
description: >-
New draft for one candidate. The candidate is named only by the
handle from a search result of this organization, never by an email
address, a phone number, or an account identifier. The terms are
complete from the start, so a draft without the tax basis or the
communication method cannot exist. Unknown fields are rejected, so a
request cannot set the state, a version, a deadline, the salary
indicator, contact access, or a candidate's minimum or contact.
additionalProperties: false
required:
- candidate_handle
- terms
properties:
candidate_handle:
$ref: "./common_schemas.yml#/schemas/CandidateHandle"
need:
description: >-
Need of the organization the invitation is built from, or null or
absent for a direct invitation.
oneOf:
- $ref: "#/schemas/InvitationNeedReference"
- type: "null"
response_period_days:
description: Days to answer; absent means 7, the default of the product policy.
allOf:
- $ref: "#/schemas/InvitationResponsePeriod"
terms:
$ref: "#/schemas/InvitationTerms"
OrganizationInvitationUpdate:
type: object
description: >-
Change of a draft over the version the client read. Each field present
replaces that field as a whole and an absent field stays unchanged;
`terms` is always replaced completely, never merged, and a change of
the terms creates the next terms version. `need` sent as null unlinks
the need. The candidate cannot change: a draft for another candidate
is a new draft. Unknown fields are rejected.
additionalProperties: false
required:
- expected_version
properties:
expected_version:
$ref: "#/schemas/InvitationVersion"
need:
oneOf:
- $ref: "#/schemas/InvitationNeedReference"
- type: "null"
response_period_days:
$ref: "#/schemas/InvitationResponsePeriod"
terms:
$ref: "#/schemas/InvitationTerms"
InvitationCommand:
type: object
description: >-
Command without parameters over the invitation version the client
read: send, withdraw, or cancel. Unknown fields are rejected.
additionalProperties: false
required:
- expected_version
properties:
expected_version:
$ref: "#/schemas/InvitationVersion"
InvitationSalaryRaise:
type: object
description: >-
The one raise of the upper salary bound of a sent invitation (PRD
FR13). Only `salary_to` changes; the lower bound, the currency, the
period, and the tax basis stay fixed. Unknown fields are rejected, so
the request cannot lower the lower bound or change the basis.
additionalProperties: false
required:
- expected_version
- salary_to
properties:
expected_version:
$ref: "#/schemas/InvitationVersion"
salary_to:
description: >-
New upper bound, above the current one, with a width of the range
from 10% to 40% of its midpoint.
allOf:
- $ref: "./need_schemas.yml#/schemas/RubAmount"
CandidateInvitation:
type: object
description: >-
Invitation as the addressed candidate reads it: the organization, the
current terms with their version, the state and the deadline, the
text and the choice of the consent C4 while an acceptance is
possible, the candidate's own decline, and the contact grant that the
acceptance created. It has no candidate handle, no need, no salary
indicator, and no contact value: the candidate's own contacts and
salary minimum stay in the profile.
additionalProperties: false
required:
- id
- organization
- state
- expiry_reason
- version
- terms_version
- terms
- response_deadline_at
- delivered_at
- viewed_at
- responded_at
- updated_at
- contact_consent
- decline
- contact_grant
properties:
id:
type: string
format: uuid
description: Identifier of the invitation.
organization:
$ref: "#/schemas/InvitationOrganization"
state:
$ref: "#/schemas/InvitationState"
expiry_reason:
oneOf:
- $ref: "#/schemas/InvitationExpiryReason"
- type: "null"
version:
$ref: "#/schemas/InvitationVersion"
terms_version:
$ref: "#/schemas/InvitationTermsVersion"
terms:
$ref: "#/schemas/InvitationTerms"
response_deadline_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
delivered_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
viewed_at:
description: >-
Moment of the first view recorded by ViewMyInvitation, or null
when the candidate has not opened the terms.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
responded_at:
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
updated_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
contact_consent:
description: >-
Text and choice of the consent C4 for an acceptance, or null when
an acceptance is impossible now: the state does not allow it, the
deadline has passed, or the profile holds no contact to disclose.
In the last case the client tells the candidate to add a contact
to the profile first, because a grant must cover at least one
field.
oneOf:
- $ref: "./contact_grant_schemas.yml#/schemas/ContactConsentOffer"
- type: "null"
decline:
description: The candidate's decline, or null unless `state` is `declined`.
oneOf:
- $ref: "#/schemas/InvitationDeclineRecord"
- type: "null"
contact_grant:
description: >-
Contact grant that the acceptance of this invitation created, or
null when the invitation was never accepted. It stays after a
revocation, with its status and reason.
oneOf:
- $ref: "./contact_grant_schemas.yml#/schemas/ContactGrant"
- type: "null"
CandidateInvitationSummary:
type: object
description: >-
Invitation in the candidate's inbox: the organization, the state, the
versions, the role, the salary range, and the deadline. Listing never
records a view; GetMyInvitation returns the full terms, and
ViewMyInvitation records the view.
additionalProperties: false
required:
- id
- organization
- state
- expiry_reason
- version
- terms_version
- role_title
- salary
- work_formats
- response_deadline_at
- delivered_at
- viewed_at
- updated_at
properties:
id:
type: string
format: uuid
description: Identifier of the invitation.
organization:
$ref: "#/schemas/InvitationOrganization"
state:
$ref: "#/schemas/InvitationState"
expiry_reason:
oneOf:
- $ref: "#/schemas/InvitationExpiryReason"
- type: "null"
version:
$ref: "#/schemas/InvitationVersion"
terms_version:
$ref: "#/schemas/InvitationTermsVersion"
role_title:
$ref: "#/schemas/InvitationRoleTitle"
salary:
$ref: "./need_schemas.yml#/schemas/SalaryRange"
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: "./questionnaire_schemas.yml#/schemas/WorkFormat"
response_deadline_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
delivered_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
viewed_at:
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
updated_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
CandidateInvitationList:
type: object
description: >-
One page of the candidate's invitations, newest first by delivery
time.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Invitations of the page.
items:
$ref: "#/schemas/CandidateInvitationSummary"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
InvitationAcceptance:
type: object
description: >-
Acceptance of the current terms with the consent C4. The client sends
the `version` and the `terms_version` it read and the contact fields
the candidate selected; nothing is preselected or defaulted. Unknown
fields are rejected, so a request cannot carry contact values, a
grant, or another consent.
additionalProperties: false
required:
- expected_version
- terms_version
- consent_c4
properties:
expected_version:
$ref: "#/schemas/InvitationVersion"
terms_version:
description: >-
Terms version that the candidate read and accepts. A version that
is not the current one answers 412 version_conflict.
allOf:
- $ref: "#/schemas/InvitationTermsVersion"
consent_c4:
$ref: "./contact_grant_schemas.yml#/schemas/ContactConsentAcceptance"
InvitationDeclineRequest:
type: object
description: >-
Structured decline: a reason and an optional comment. Unknown fields
are rejected.
additionalProperties: false
required:
- expected_version
- reason
properties:
expected_version:
$ref: "#/schemas/InvitationVersion"
reason:
$ref: "#/schemas/InvitationDeclineReason"
comment:
description: Optional comment for any reason, including `other`; absent or null means none.
oneOf:
- $ref: "#/schemas/InvitationDeclineComment"
- type: "null"
@@ -55,7 +55,7 @@ schemas:
- assessment_attempt: an assessment attempt of the caller.
- organization: an organization that the caller can see.
- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.
- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.
- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.
enum:
- assessment_attempt