feat(api): add invitation, terms version, acceptance, and contact grant contract
This commit is contained in:
1 parent
b856d4ff54
commit
d2c6f1375a
140 files changed
+39767
-303
No files matched your search
+102
-6
@@ -14,7 +14,7 @@ From the repository root, `make -C api check` checks contracts and `make generat
|
||||
|
||||
## Contract conventions
|
||||
|
||||
`api/core/` fixes these conventions as reusable components in `openapi.yml` and the files under `components/`: schemas in `components/schemas/*_schemas.yml`, parameters in `parameters.yml`, response headers in `headers.yml`, responses in `responses.yml`, and examples in `examples.yml`. Operations reference them as they are added. Currently implemented: problem responses for errors of the Go public API and the ML service. Idempotency-Key storage, If-Match checks, and pagination are planned behavior for business operations; the declared `RegisterAccount` operation, the assessment commands, `CreateOrganizationNeed`, and `CreateMySupportCase` require Idempotency-Key, but no operation stores keys yet.
|
||||
`api/core/` fixes these conventions as reusable components in `openapi.yml` and the files under `components/`: schemas in `components/schemas/*_schemas.yml`, parameters in `parameters.yml`, response headers in `headers.yml`, responses in `responses.yml`, and examples in `examples.yml`. Operations reference them as they are added. Currently implemented: problem responses for errors of the Go public API and the ML service. Idempotency-Key storage, If-Match checks, and pagination are planned behavior for business operations; the declared `RegisterAccount` operation, the assessment commands, `CreateOrganizationNeed`, `CreateMySupportCase`, and the invitation commands require Idempotency-Key, but no operation stores keys yet.
|
||||
|
||||
### Errors
|
||||
|
||||
@@ -43,7 +43,7 @@ Every error is an RFC 9457 problem with the `application/problem+json` media typ
|
||||
| `internal` | 500 | Unexpected server error |
|
||||
| `not_implemented` | 501 | The operation is in the contract but not implemented |
|
||||
|
||||
Request validation uses 400 rather than 422. The generated ogen server reports malformed and schema-invalid parameters and bodies through the same decoding errors, and for parameters it does not separate syntax from schema violations; one status keeps client handling uniform. 422 then stays free for Idempotency-Key reuse, as the IETF Idempotency-Key header draft recommends. Domain rules on the body, such as `salary_from <= salary_to`, also answer 400 `validation_failed` with body pointers to the fields involved. Each `errors` item has `in` (`body`, `query`, `path`, `header`, `cookie`), `pointer` (JSON Pointer: `/salary_from` in the body, an empty string for the whole body, `/limit` for a parameter), `code` (`required` or `invalid`; clients tolerate new values), and a fixed `message`. When the decoder does not record the path of a nested body field, the pointer is the whole body. A body cut by an `http.MaxBytesReader` limit answers 413 `payload_too_large`.
|
||||
Request validation uses 400 rather than 422. The generated ogen server reports malformed and schema-invalid parameters and bodies through the same decoding errors, and for parameters it does not separate syntax from schema violations; one status keeps client handling uniform. 422 then stays free for Idempotency-Key reuse, as the IETF Idempotency-Key header draft recommends. Domain rules on the body, such as `salary_from <= salary_to`, also answer 400 `validation_failed` with body pointers to the fields involved. Each `errors` item has `in` (`body`, `query`, `path`, `header`, `cookie`), `pointer` (JSON Pointer: `/salary_from` in the body, an empty string for the whole body, `/limit` for a parameter), `code` (`required` or `invalid`; clients tolerate new values), and a fixed `message`. Body pointers follow the rules in Body pointers below. A body cut by an `http.MaxBytesReader` limit answers 413 `payload_too_large`.
|
||||
|
||||
`state_conflict` covers business state conflicts, such as accepting an invitation that was already withdrawn. `idempotency_in_progress` is reserved for concurrent retries; the reusable responses are `StateConflict` and `IdempotencyInProgress`.
|
||||
|
||||
@@ -51,6 +51,19 @@ Every operation declares `default: $ref: ../components/responses.yml#/Problem`;
|
||||
|
||||
Both verification token codes use 400 because the token is request content, not the target resource: 404 and 410 describe the URI, 409 a resource state, and 422 stays reserved for Idempotency-Key reuse. A malformed token fails schema validation and answers 400 `validation_failed` with the pointer `/token`. `invalid_credentials` and `unauthenticated` share 401 but mean a failed login and a missing session respectively. `email_not_verified` is returned only after the password matched, so it tells the verification state only to someone who already proved the password.
|
||||
|
||||
#### Body pointers
|
||||
|
||||
The generated decoder records no path of its own. It wraps the error of each object field as `decode field "<name>"` with go-faster/errors, and `problem.Responder` rebuilds the pointer from those wrappers, reading each link through the typed `errors.Formatter` instead of the joined error text. The rules:
|
||||
|
||||
- A missing required field answers `required` with its own pointer at any depth, for example `/terms/communication_method` or `/terms/salary/tax_basis`.
|
||||
- A value that fails during decoding, such as a wrong JSON type, a malformed UUID, or an ambiguous `oneOf` value, answers `invalid` with the pointer of that value, for example `/grade` for a bare grade or `/object/id`.
|
||||
- A value that decodes but breaks a schema rule, such as a length, a pattern, a multiple of 1000, or an enum, answers `invalid` with its full pointer, including array indices, for example `/required_skills/2/status`; this check runs after decoding.
|
||||
- An unknown property answers `invalid` with the pointer of the object that contains it, for example `/terms/salary` for a `candidate_minimum` inside the range; the property name is not echoed.
|
||||
- A failure inside an array element during decoding answers `invalid` with the pointer of the array, for example `/required_skills`, because jx reports no element index.
|
||||
- The whole-body pointer `""` remains only for a malformed JSON document, a missing body, an unknown top-level property, an unknown or missing discriminator of a top-level `oneOf`, and an error chain that the responder does not recognize, which falls back safely to the whole body.
|
||||
|
||||
`responder_test.go` covers a nested object, an array element, a `oneOf` variant field, a top-level field, and an unrecognized chain; the router tests of every contract pin the pointers through the generated server.
|
||||
|
||||
### Retries and Idempotency-Key
|
||||
|
||||
A mutating command declares the `IdempotencyKey` parameter. The client generates a key (a UUID v4 is recommended) and sends it in the `Idempotency-Key` header without quotes: 1-255 characters `A-Z a-z 0-9 . _ : -`. The server scopes the key by caller and operation and fingerprints the request by method, path, and body.
|
||||
@@ -81,7 +94,7 @@ Lists use cursor pagination: `limit` from 1 to 100 (20 by default) and an opaque
|
||||
|
||||
### Time and money
|
||||
|
||||
Timestamps use the `Timestamp` schema: `string`, `format: date-time`, UTC with the `Z` suffix (RFC 3339). Servers always emit UTC. ogen generates `Timestamp` as a named Go type over `time.Time`; call `.UTC()` where a value is converted to it. Money is an integer number of whole rubles (`RubAmount`, int64) with an explicit base: `SalaryRange` requires `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`), and `tax_basis` (`net` or `gross`); see Needs below. Invitations are expected to reuse `SalaryRange`.
|
||||
Timestamps use the `Timestamp` schema: `string`, `format: date-time`, UTC with the `Z` suffix (RFC 3339). Servers always emit UTC. ogen generates `Timestamp` as a named Go type over `time.Time`; call `.UTC()` where a value is converted to it. Money is an integer number of whole rubles (`RubAmount`, int64) with an explicit base: `SalaryRange` requires `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`), and `tax_basis` (`net` or `gross`); see Needs below. Invitation terms reuse `SalaryRange` with the same rules.
|
||||
|
||||
### ML service errors
|
||||
|
||||
@@ -289,7 +302,7 @@ Readiness:
|
||||
Salary:
|
||||
|
||||
- `SalaryRange` `[A; B]` has `salary_from` and `salary_to` (`RubAmount`, whole rubles), `currency` (`RUB` only), `period` (`month` only), and `tax_basis` (`net` or `gross`); every field is required. Requests send it as `salary: {value, status}`, so its pointers are under `/salary/value`.
|
||||
- The schema requires bounds that are positive multiples of 1000 up to 100000000 and rejects another currency, period, or basis, for example with `/salary/value/tax_basis`. A missing field of the nested range has the whole-body pointer.
|
||||
- The schema requires bounds that are positive multiples of 1000 up to 100000000 and rejects another currency, period, or basis, for example with `/salary/value/tax_basis`. A missing field of the nested range answers `required` with its pointer, such as `/salary/value/tax_basis`.
|
||||
- The server checks the cross-field rules of PRD FR13 in integer arithmetic: `A < B` and a width `(B - A) / ((A + B) / 2)` from 10% to 40% inclusive, that is `20 * (B - A) >= A + B` and `5 * (B - A) <= A + B`. A violation, including equal bounds, answers 400 with the pointer `/salary/value/salary_to`. `[95000; 105000]` (exactly 10%) and `[80000; 120000]` (exactly 40%) are accepted. FR13 applies the same rules to the range of a need and of an invitation, and `docs/*/ARCHITECTURE.md` now states them for invitations instead of `0 < salary_from <= salary_to`.
|
||||
- Limit against probing hidden minimums (FR13, planned in TASK-211): setting a confirmed range, on creation or on a change, counts against a counter shared by the whole organization, every member and every need, so a new need does not reset it. At most three range settings a day; over the limit the server answers 429 with Retry-After and changes nothing. After five settings within seven days the money component is `withheld` for seven days. Repeated range changes also feed the private risk signals of TASK-319.
|
||||
|
||||
@@ -332,10 +345,10 @@ Types and object references:
|
||||
| `anticheat_appeal` | candidate | required; an `assessment_attempt` of the caller with an anti-cheat review decision | none | 10 business days |
|
||||
| `manual_assessment` | candidate | optional; a prior `assessment_attempt` of the caller in the same specialization | required `assessment_target`; the server fixes `rubric_version` | 5 business days |
|
||||
|
||||
- The request is a `oneOf` of five variants selected by `type` (`SupportCaseCreateSupport`, `SupportCaseCreateComplaint`, `SupportCaseCreateGradeAppeal`, `SupportCaseCreateAnticheatAppeal`, `SupportCaseCreateManualAssessment`). Each variant restricts its reference schema, so the schema already rejects an organization in a grade appeal or a case in a complaint with the pointer `/object/type`, and a missing field of the type with its pointer, such as `/object` or `/assessment_target`. ogen selects the variant by the value of `type`. An unknown or missing type, a field of another variant such as `complaint_reason` in a support case, and an `object.id` that is not a UUID answer 400 with the whole-body pointer `""`, because the decoder does not record the path inside the selected variant (example `SupportCaseMalformedReference`).
|
||||
- The request is a `oneOf` of five variants selected by `type` (`SupportCaseCreateSupport`, `SupportCaseCreateComplaint`, `SupportCaseCreateGradeAppeal`, `SupportCaseCreateAnticheatAppeal`, `SupportCaseCreateManualAssessment`). Each variant restricts its reference schema, so the schema already rejects an organization in a grade appeal or a case in a complaint with the pointer `/object/type`, and a missing field of the type with its pointer, such as `/object` or `/assessment_target`. ogen selects the variant by the value of `type`. An unknown or missing type and a field of another variant such as `complaint_reason` in a support case answer 400 with the whole-body pointer `""`, because they concern the top-level variant; an `object.id` that is not a UUID answers 400 with `/object/id` (example `SupportCaseMalformedReference`).
|
||||
- A category assigned without an attempt is appealed too (FR18): a grade appeal may reference the caller's own manual assessment case once it is `resolved` with `assessed`. An unknown case and another account's case answer 404 `not_found`; an own case of another type, not resolved yet, or resolved with another outcome answers 409 `state_conflict`.
|
||||
- An organization is visible to a candidate that it invited or whose profile the organization contract (TASK-077) shows to the candidate, and to an employer account with an active membership. The server checks every reference against the session account: an unknown object and someone else's object both answer 404 `not_found`, so a reference never reveals whether a foreign object exists. The case stores only `{type, id}`.
|
||||
- Invitations and anti-cheat review decisions are not in the contract yet. Until they are, every `invitation` reference answers 404 and every anti-cheat appeal answers 409 `state_conflict`; the request shapes stay the same when they arrive.
|
||||
- Invitations are in the contract (see Invitations and contact grants below) but not implemented, and anti-cheat review decisions are not in the contract yet. Until they are implemented, every `invitation` reference answers 404 and every anti-cheat appeal answers 409 `state_conflict`; the request shapes stay the same.
|
||||
- `offer_content` and `salary_terms_violation` complaints require an invitation; another object answers 400 with the pointer `/object/type` (a domain rule after the schema).
|
||||
- A failed first test or no attempt at all never blocks a manual assessment. Creating a case never grants, revokes, or changes a consent, a grade, or an attempt; how a manual assessment relates to the C3 consent is decided by TASK-064 and TASK-315.
|
||||
|
||||
@@ -370,6 +383,88 @@ Planned, additive (a new operation or an optional field): replies of the author,
|
||||
|
||||
Planned contract changes (new enum values; like the catalog codes, generated clients reject an unknown value, so each one is released with regenerated clients): object types `vacancy` and `application` for the vacancies and protected applications of FR16, and an object type for the profile findings of TASK-272. `waiting_for_user` and `support_case` are already in the enums, so the reply operation and follow-up cases need no such change. No new event kind or actor kind is planned: an author reply is a `reply` with the actor `user`, a decision revision (TASK-317) is another `decision` event, and experts and moderators are `support`.
|
||||
|
||||
### Invitations and contact grants
|
||||
|
||||
The `invitation` tag covers invitations from an organization to one candidate (PRD FR12, with the salary rules of FR13 and the consent C4): drafts with complete terms, immutable terms versions, sending, the candidate's inbox, the view, acceptance with C4, structured declines, withdrawal, cancellation, and the contact grant. The operations are in the contract; their business logic is not implemented yet, so every one answers 401 `unauthenticated` until sessions exist (`v1.DenyAllSecurity`).
|
||||
|
||||
| Method and path | operationId | Security | Success | Specific errors |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/organizations/{org_id}/invitations` | `ListOrganizationInvitations` | session | 200 `OrganizationInvitationList` | 400, 401, 403 `forbidden`, 404 |
|
||||
| `POST /api/v1/organizations/{org_id}/invitations` | `CreateOrganizationInvitation` | session and CSRF, Idempotency-Key | 201 `OrganizationInvitation` (`draft`) | 400, 401, 403, 404, 409 `idempotency_in_progress`, 422, 429 |
|
||||
| `GET /api/v1/organizations/{org_id}/invitations/{invitation_id}` | `GetOrganizationInvitation` | session | 200 `OrganizationInvitation` | 400, 401, 403, 404 |
|
||||
| `PATCH /api/v1/organizations/{org_id}/invitations/{invitation_id}` | `UpdateOrganizationInvitation` | session and CSRF | 200 `OrganizationInvitation` | 400, 401, 403, 404, 409 `state_conflict`, 412, 429 |
|
||||
| `POST .../invitations/{invitation_id}/send` | `SendOrganizationInvitation` | session and CSRF, Idempotency-Key | 200 `OrganizationInvitation` (`delivered`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST .../invitations/{invitation_id}/salary-raise` | `RaiseOrganizationInvitationSalary` | session and CSRF, Idempotency-Key | 200 `OrganizationInvitation` | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST .../invitations/{invitation_id}/withdraw` | `WithdrawOrganizationInvitation` | session and CSRF, Idempotency-Key | 200 `OrganizationInvitation` (`withdrawn`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `GET .../invitations/{invitation_id}/contacts` | `GetOrganizationInvitationContacts` | session | 200 `ContactDisclosure` | 400, 401, 403, 404 |
|
||||
| `GET /api/v1/me/invitations` | `ListMyInvitations` | session | 200 `CandidateInvitationList` | 400, 401, 403 |
|
||||
| `GET /api/v1/me/invitations/{invitation_id}` | `GetMyInvitation` | session | 200 `CandidateInvitation` | 400, 401, 403, 404 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/view` | `ViewMyInvitation` | session and CSRF | 200 `CandidateInvitation` (`viewed`) | 400, 401, 403, 404, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/accept` | `AcceptMyInvitation` | session and CSRF, Idempotency-Key | 200 `CandidateInvitation` (`accepted`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/decline` | `DeclineMyInvitation` | session and CSRF, Idempotency-Key | 200 `CandidateInvitation` (`declined`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/cancel` | `CancelMyInvitation` | session and CSRF, Idempotency-Key | 200 `CandidateInvitation` (`cancelled_by_candidate`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
|
||||
Every success has `Cache-Control: no-store`, and every operation also declares the `default` problem response. The paths `...` start with `/api/v1/organizations/{org_id}`. 403 on an unsafe operation is `csrf_check_failed` or `forbidden`; 409 on a command is `state_conflict` or `idempotency_in_progress`; 412 is `version_conflict`; 422 is `idempotency_key_reused`. 429 on a command is the general rate limit with Retry-After, which can answer before any check; on create, update, and send it is also the salary limit or the weekly quota. The contact read and the plain reads declare no 429 of their own, like the other reads of the contract.
|
||||
|
||||
Access:
|
||||
|
||||
- Organization side: `org_id` in the path is the only source of the organization, checked against the active membership of the session account, as for needs. An account without the membership, an unknown organization, an unknown invitation, and an invitation of another organization all answer 404 `not_found`; a candidate account and a member whose role does not allow the operation answer 403 `forbidden`. In the MVP only the owner works with invitations; the other roles of FR07 are planned (TASK-463).
|
||||
- Candidate side: `/me/invitations` is bound to the session account. A draft, an invitation addressed to another candidate, and an unknown identifier answer 404 `not_found`; an employer account answers 403 `forbidden`. No request has a user, candidate, organization, or role field.
|
||||
- The candidate is named only by `candidate_handle` (`CandidateHandle` in `common_schemas.yml`, shared with the search results of FR11, TASK-185), never by an email address, a phone number, or an account or profile identifier. An unknown handle, a handle of another organization, and a profile that the organization may no longer see all answer 400 with the pointer `/candidate_handle`.
|
||||
|
||||
Terms (`InvitationTerms`):
|
||||
|
||||
- The terms are complete from the first draft and every field is required: `role_title`, `specialization`, `grade`, `offer_type` (`full_time`, `part_time`, `contract`, `internship`), `tasks`, `team`, `tech_stack`, `work_formats`, `location` (null only for a remote-only role; required for `office` or `hybrid` by a domain rule with the pointer `/terms/location`), `communication_method` (`channel` and an optional note), `salary` (`SalaryRange`), and `package`. A draft without the tax basis or the communication method therefore cannot exist: such a body answers 400 `required` with `/terms/salary/tax_basis` or `/terms/communication_method` (examples `InvitationWithoutTaxBasis` and `InvitationWithoutCommunicationMethod`).
|
||||
- `package` has `bonus`, `equipment`, `training`, and `health_insurance` (ДМС). Each is a `oneOf`: `{status: provided, description}` or `{status: not_provided}` ("Не предусмотрено" in the interface). "Not provided" is an explicit choice: a condition left out answers `required` with its pointer, such as `/terms/package/training`; a `provided` one without a description answers `required` at its `description`; a `not_provided` one with a description answers `invalid` at the item. Generated Zod is not strict and strips that description, so only the server rejects it.
|
||||
- Deliberate deviation from the wording of the acceptance criteria: the PRD package lists the work format next to the bonus, equipment, training, and ДМС, but here the format is the required `work_formats` term without a "not provided" variant, because a role always has a format and the indicator and the search compare it. This is an open question for the product owner.
|
||||
- The same schema is the request field and the stored snapshot, so a response can be sent back unchanged. The terms never contain data of the candidate.
|
||||
|
||||
Versions and conflicts:
|
||||
|
||||
- `version` advances with every committed change, including the view and the server expiry. `terms_version` advances only when the terms change: a draft change of `terms`, or the one raise of the upper bound after sending. Each terms version is immutable.
|
||||
- Every command except the view carries `expected_version`; `AcceptMyInvitation` also carries `terms_version`. 412 `version_conflict`: `expected_version` or, on acceptance, `terms_version` is not current (the stale terms case, example `InvitationStaleTerms`); nothing changed, nothing is stored under the key, and the client reads the invitation again. 409 `state_conflict`: the state does not allow the command, for example an acceptance of a withdrawn or expired invitation, a command at the deadline or later, a send blocked by the pending limit of a need or by the 30-day pause, a change of a sent invitation, or a second raise; it is stored under the key. TASK-197, TASK-201, and TASK-204 say 409 for stale terms; the repository rule keeps 412 for any stale version, as for needs and the questionnaire.
|
||||
- Order: after the invitation is found and a due expiry is applied, and after the repeat check, a terminal state (`declined`, `expired`, `withdrawn`, `cancelled_by_candidate`) or, for accept and decline, a passed deadline answers 409 before the version is compared, so the client gets 409 for a withdrawn, expired, or late invitation even with stale versions and shows the final state instead of rereading and retrying. Then come the versions (412) and the remaining state rules (409). This applies to accept, decline, cancel, withdraw, and the salary raise.
|
||||
- Repeats return the same result: a retry with the same Idempotency-Key replays the stored outcome, and a repeated command whose transition already happened answers 200 with the current invitation even with a new key or an older version: a send of a sent invitation, a withdrawal of a withdrawn one, a decline with the same reason and comment, a cancellation of a cancelled one, the same raise, and an acceptance whose `terms_version` and fields equal those of `contact_grant`, the version and fields the candidate accepted, even when a later raise advanced the current `terms_version`. No second consent, grant, quota charge, or audit event is created.
|
||||
- `UpdateOrganizationInvitation` follows the convention of `UpdateOrganizationNeed`: no Idempotency-Key, explicit field replacement, and a body that changes nothing answers 200.
|
||||
|
||||
States and the view:
|
||||
|
||||
- `InvitationState` lists every state of the FR12 table: `draft`, `delivered`, `viewed`, `counter`, `accepted`, `interview_scheduled`, `interviewed`, `negotiation`, `terms_agreed`, `no_deal`, `declined`, `expired`, `withdrawn`, `cancelled_by_candidate`. MVP operations produce `draft`, `delivered`, `viewed`, `accepted`, `declined`, `expired`, `withdrawn`, and `cancelled_by_candidate`; the others are listed now so that generated clients accept them when the counter offer, the interview, and the sealed final arrive. The internal `SENT` step is never visible: a send answers with `delivered` after the inbox entry exists.
|
||||
- `expiry_reason` is `invitation_timeout` or the planned `negotiation_timeout`, non-null exactly in `expired`.
|
||||
- The view is an explicit command, `ViewMyInvitation`: it moves `delivered` to `viewed`, keeps the deadline, and returns the current invitation unchanged in any other state. It is idempotent by its effect, so it needs neither an Idempotency-Key nor an `expected_version`, and it never fails because the invitation changed after the client read it. `GetMyInvitation` and `ListMyInvitations` have no side effect; a read only shows a due expiry, which the server applies at the deadline anyway. TASK-200 describes the view as a GET; the command keeps prefetches, retries, and cache refreshes from changing the state that the organization sees.
|
||||
- `withdrawn` is the organization's command from any unfinished state, including `draft` and `accepted`, and keeps an existing grant. `cancelled_by_candidate` is the candidate's command from any unfinished state after delivery and revokes the grant of this invitation. A decline is the structured answer before an acceptance.
|
||||
- The deadline is `delivered_at + response_period_days` (3, 7, or 14 days, 7 by default). A view, an email, or a raise never moves it; a command received at the deadline or later is late.
|
||||
|
||||
Salary and the hidden minimum:
|
||||
|
||||
- The terms reuse `SalaryRange` with the rules of the Needs section: RUB, month, `net` or `gross`, positive multiples of 1000, `A < B`, and a width of 10-40%, checked by the server with the pointer `/terms/salary/salary_to`.
|
||||
- The organization receives only `salary_fit`: `within_range`, `up_to_10_percent_above`, `above`, `withheld`, or `not_available` (no minimum for the offered formats, or one in the other tax basis). The exact minimum appears in no response, example, log, or problem. The server never rejects a range because of the minimum, since a rejection would reveal it. The candidate DTOs carry no indicator; the candidate compares with the own minimum in the profile.
|
||||
- Every change that can move the indicator is an indicator-relevant setting: the range on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, because the indicator compares with the minimum for the offered formats. Each counts against the organization-wide limit of three settings a day, shared with the ranges of needs (429 with Retry-After, TASK-211), and against the withheld counter. A change that keeps the range, the basis, and the formats does not count.
|
||||
- `withheld`: after five indicator-relevant settings within seven days the indicator is off for seven days from the fifth. The response to the fifth setting already shows `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.
|
||||
- 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.
|
||||
- After a send the base is fixed and the lower bound never decreases. `RaiseOrganizationInvitationSalary` raises `salary_to` once in the whole history of the invitation, creates the next terms version, and answers 409 on a second raise. It follows its own once-only rule and does not count against the daily limit, but it counts against the withheld counter because it moves the upper bound that the indicator compares.
|
||||
|
||||
Consent C4 and the contact grant:
|
||||
|
||||
- `GetMyInvitation` shows in `contact_consent` the C4 text for this organization and the kinds of contact that the profile holds. It is null when an acceptance is impossible: the state or the deadline does not allow it, or the profile holds no contact. In the last case the client asks the candidate to add a contact first, because a grant must cover at least one field.
|
||||
- `AcceptMyInvitation` sends `terms_version`, `expected_version`, and `consent_c4` (`ContactConsentAcceptance`): the shown C4 text version, `accepted: true`, and `fields`, at least one of `full_name`, `email`, `phone`, `telegram`, with no default and no preselection. A text version that is not published answers 400 `/consent_c4/text_version`, and a field the profile does not hold answers 400 `/consent_c4/fields/<i>`. The consent is analogous to the C1 acceptance by its `text_version`, and the record matches the C4 ledger of TASK-062 (purpose, text version and hash, organization, field set, source invitation). The permission to pass the data on to the organization's ATS (C4 and FR19) is planned as an additive optional flag that defaults to no transfer.
|
||||
- In one transaction the acceptance moves the invitation to `accepted`, records C4, creates the grant for exactly the selected fields, and writes the audit event (TASK-201). It never publishes the profile (C2) and never lifts a hiding.
|
||||
- The candidate's `contact_grant` has `status` (`active` or `revoked`), `readable`, and `blocked_by`. A grant created while the profile was not published or was hidden from the organization stays `active` with `readable: false` and `blocked_by: visibility`, so the candidate sees why the organization cannot read it (PRD FR12); it becomes readable once the candidate publishes the profile or unhides it. Any visibility change after the grant exists revokes it (`visibility_closed`), and a later publication never reopens it.
|
||||
- Contact values travel only in `ContactDisclosure` from `GetOrganizationInvitationContacts`, separate from the terms and the invitation. Each read checks the membership, C4, the grant and its fields, and the current visibility, without a cache. Without a readable grant the operation answers 404 `not_found`, the same as an unknown invitation. The organization's `contact_access` is `not_granted` (no grant), `available` (with the field kinds), or `closed`, which covers a revoked grant and a grant blocked from the start without saying which. This is the least revealing rule: a revocation, a hiding, and a missing publication look the same, and since every visibility change after the grant revokes it, the organization never observes a later toggle; only a grant blocked from the start can turn `available`, by the candidate's own choice. Fields that the grant does not cover are null.
|
||||
- Revocation: `CancelMyInvitation` revokes the grant of this invitation (`participation_cancelled`); revoking C4 for the organization closes all its grants (`consent_revoked`, TASK-064); revoking C2 or hiding the profile closes them (`visibility_closed`). A withdrawal, a no deal, and a negotiation timeout never revoke a grant; only a new explicit C4 creates a new one. A standalone grant revocation operation belongs to the consent contract (TASK-064, TASK-202).
|
||||
- Value formats: 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 converts or drops a stored value.
|
||||
|
||||
Decline and privacy:
|
||||
|
||||
- `DeclineMyInvitation` takes `reason` (`salary`, `tasks`, `stack`, `work_format`, `package`, `company`, `not_looking`, `other_offer`, `other`) and an optional `comment` of up to 500 characters; `other` needs no comment. The organization sees only `declined` and `responded_at`, never the reason or the comment: a reason such as `salary` would tell it that the hidden minimum is above the range. Reasons feed only aggregates with a minimum group size (planned). The candidate reads both back in `decline`.
|
||||
- No invitation DTO of either side carries the candidate's name, email address, phone number, Telegram username, account or profile identifier, or salary minimum; examples use synthetic data only. `TestInvitationSchemaValidationPrecedesImplementation` checks the schema rejections and pointers through the generated server, `TestInvitationDTOsCarryNoContactOrMinimum` checks the generated Go DTOs, and `frontend/src/shared/api/invitation-contract.test.ts` pins the generated Zod rules and, at the type level, the absence of contact, minimum, and decline fields.
|
||||
|
||||
Open product questions: whether a second unfinished invitation of the same organization to the same candidate is allowed (the PRD is silent, so the contract invents no rule), the package format deviation above, the offer types, the contact kinds, and the decline reasons.
|
||||
|
||||
Planned, additive: the counter offer and the company answer, reading earlier terms versions, interview and sealed final operations, list filters, the responsiveness metrics of the organization for the candidate, the approximate amount in the other tax basis, decline aggregates, the ATS flag of C4, and FSP fields as new contact kinds (a new enum value, released with regenerated clients).
|
||||
|
||||
No new problem code is added: the `ProblemCode` enum is copied byte-for-byte into the ML contract, and `version_conflict` and `state_conflict` cover the stale terms and the state conflicts.
|
||||
|
||||
### Generator checks
|
||||
|
||||
`testdata/openapi-3.2.0.yml` contains test operations that use the components above: pagination, Idempotency-Key, If-Match, ETag, and problem responses. ogen does not resolve external references, so the fixture keeps copies of the api/core components; `scripts/test_contract_copies.py` (part of `make -C api check`) checks that they, the fixture responses, and the ML `Problem` copy match api/core.
|
||||
@@ -397,6 +492,7 @@ Known generator limitations:
|
||||
- Orval Zod schemas ignore `uniqueItems` and do not reject unknown fields of `additionalProperties: false` objects; the server stays authoritative for both.
|
||||
- ogen generates an optional nullable field as `OptNil<T>`, which tells absent (`IsSet` false), null (`IsNull`), and a value apart. An optional array that is not nullable is a plain slice instead, where nil and `[]` mean different things: an absent field decodes to nil (unchanged) and `[]` to an empty non-nil slice (delete every item), and null fails decoding. An `UpdateOrganizationNeed` handler must therefore test lists with `!= nil`, never with `len`; `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart` pins this.
|
||||
- Orval clears `src/shared/api/endpoints/` and `src/shared/api/schemas/` before generation (`clean: true`), because a schema used by several tags moves from a tag directory to the schema root.
|
||||
- The post-Orval step `frontend/codegen/mock-patterns.ts` finds the length bounds of a patterned string by its property name and pattern, so two properties with the same name and pattern must have the same bounds. The invitation terms therefore name the technologies `tech_stack` (`SkillName`, up to 100 characters) next to the questionnaire `stack` (`StackTag`, up to 50), and a package condition carries `description` rather than `value`, which the need decisions use with other bounds.
|
||||
|
||||
#### Format unions
|
||||
|
||||
|
||||
+102
-6
@@ -14,7 +14,7 @@
|
||||
|
||||
## Соглашения контракта
|
||||
|
||||
`api/core/` закрепляет эти соглашения как переиспользуемые компоненты в `openapi.yml` и файлах `components/`: схемы в `components/schemas/*_schemas.yml`, параметры в `parameters.yml`, заголовки ответов в `headers.yml`, ответы в `responses.yml`, примеры в `examples.yml`. Операции ссылаются на них по мере появления. Сейчас реализованы problem-ответы для ошибок публичного Go API и ML-сервиса. Хранение Idempotency-Key, проверки If-Match и пагинация - запланированное поведение бизнес-операций; объявленная операция `RegisterAccount`, команды оценки, `CreateOrganizationNeed` и `CreateMySupportCase` требуют Idempotency-Key, но ни одна операция пока не хранит ключи.
|
||||
`api/core/` закрепляет эти соглашения как переиспользуемые компоненты в `openapi.yml` и файлах `components/`: схемы в `components/schemas/*_schemas.yml`, параметры в `parameters.yml`, заголовки ответов в `headers.yml`, ответы в `responses.yml`, примеры в `examples.yml`. Операции ссылаются на них по мере появления. Сейчас реализованы problem-ответы для ошибок публичного Go API и ML-сервиса. Хранение Idempotency-Key, проверки If-Match и пагинация - запланированное поведение бизнес-операций; объявленная операция `RegisterAccount`, команды оценки, `CreateOrganizationNeed`, `CreateMySupportCase` и команды приглашений требуют Idempotency-Key, но ни одна операция пока не хранит ключи.
|
||||
|
||||
### Ошибки
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
| `internal` | 500 | Непредвиденная ошибка сервера |
|
||||
| `not_implemented` | 501 | Операция есть в контракте, но не реализована |
|
||||
|
||||
Для валидации запроса выбран 400, а не 422. Сгенерированный ogen-сервер сообщает о синтаксически неверных и не прошедших проверку схемы параметрах и теле через одни и те же ошибки декодирования, а для параметров не отделяет синтаксис от нарушения схемы; единый статус упрощает обработку на клиенте. Поэтому 422 остается для повторного использования Idempotency-Key, как рекомендует черновик IETF о заголовке Idempotency-Key. Доменные правила тела, например `salary_from <= salary_to`, тоже отвечают 400 `validation_failed` с body pointer на участвующие поля. Каждый элемент `errors` содержит `in` (`body`, `query`, `path`, `header`, `cookie`), `pointer` (JSON Pointer: `/salary_from` в теле, пустая строка для всего тела, `/limit` для параметра), `code` (`required` или `invalid`; клиенты допускают новые значения) и фиксированный `message`. Если декодер не сохранил путь вложенного поля тела, pointer указывает на все тело. Тело, обрезанное лимитом `http.MaxBytesReader`, дает 413 `payload_too_large`.
|
||||
Для валидации запроса выбран 400, а не 422. Сгенерированный ogen-сервер сообщает о синтаксически неверных и не прошедших проверку схемы параметрах и теле через одни и те же ошибки декодирования, а для параметров не отделяет синтаксис от нарушения схемы; единый статус упрощает обработку на клиенте. Поэтому 422 остается для повторного использования Idempotency-Key, как рекомендует черновик IETF о заголовке Idempotency-Key. Доменные правила тела, например `salary_from <= salary_to`, тоже отвечают 400 `validation_failed` с body pointer на участвующие поля. Каждый элемент `errors` содержит `in` (`body`, `query`, `path`, `header`, `cookie`), `pointer` (JSON Pointer: `/salary_from` в теле, пустая строка для всего тела, `/limit` для параметра), `code` (`required` или `invalid`; клиенты допускают новые значения) и фиксированный `message`. Pointer тела строится по правилам из раздела Pointer тела ниже. Тело, обрезанное лимитом `http.MaxBytesReader`, дает 413 `payload_too_large`.
|
||||
|
||||
`state_conflict` обозначает конфликты бизнес-состояния, например принятие уже отозванного приглашения. `idempotency_in_progress` зарезервирован для параллельных повторов; переиспользуемые ответы - `StateConflict` и `IdempotencyInProgress`.
|
||||
|
||||
@@ -51,6 +51,19 @@
|
||||
|
||||
Оба кода токена подтверждения используют 400, потому что токен - содержимое запроса, а не целевой ресурс: 404 и 410 описывают URI, 409 - состояние ресурса, а 422 зарезервирован для повторного использования Idempotency-Key. Синтаксически неверный токен не проходит проверку схемы и дает 400 `validation_failed` с pointer `/token`. `invalid_credentials` и `unauthenticated` используют 401, но означают соответственно неудачный вход и отсутствие сессии. `email_not_verified` возвращается только после совпадения пароля, поэтому раскрывает состояние подтверждения только тому, кто уже доказал знание пароля.
|
||||
|
||||
#### Pointer тела
|
||||
|
||||
Сгенерированный декодер сам путь не записывает. Ошибку каждого поля объекта он оборачивает как `decode field "<name>"` через go-faster/errors, а `problem.Responder` восстанавливает pointer по этим оберткам, читая каждое звено через типизированный `errors.Formatter`, а не через склеенный текст ошибки. Правила:
|
||||
|
||||
- Отсутствующее обязательное поле дает `required` со своим pointer на любой глубине, например `/terms/communication_method` или `/terms/salary/tax_basis`.
|
||||
- Значение, которое не декодируется, например неверный тип JSON, некорректный UUID или неоднозначное значение `oneOf`, дает `invalid` с pointer этого значения, например `/grade` для грейда без решения или `/object/id`.
|
||||
- Значение, которое декодируется, но нарушает правило схемы (длину, pattern, кратность 1000, enum), дает `invalid` с полным pointer, включая индексы массивов, например `/required_skills/2/status`; эта проверка идет после декодирования.
|
||||
- Неизвестное свойство дает `invalid` с pointer объекта, который его содержит, например `/terms/salary` для `candidate_minimum` внутри вилки; имя свойства не повторяется.
|
||||
- Ошибка внутри элемента массива при декодировании дает `invalid` с pointer массива, например `/required_skills`, потому что jx не сообщает индекс элемента.
|
||||
- Pointer на все тело `""` остается только для некорректного JSON-документа, отсутствующего тела, неизвестного свойства верхнего уровня, неизвестного или отсутствующего дискриминатора `oneOf` верхнего уровня и цепочки ошибок, которую responder не распознал: она безопасно сводится ко всему телу.
|
||||
|
||||
`responder_test.go` покрывает вложенный объект, элемент массива, поле варианта `oneOf`, поле верхнего уровня и нераспознанную цепочку; router-тесты каждого контракта закрепляют pointer через сгенерированный сервер.
|
||||
|
||||
### Повторы и Idempotency-Key
|
||||
|
||||
Изменяющая команда объявляет параметр `IdempotencyKey`. Клиент создает ключ (рекомендуется UUID v4) и передает его в заголовке `Idempotency-Key` без кавычек: 1-255 символов `A-Z a-z 0-9 . _ : -`. Сервер ограничивает ключ вызывающим и операцией и снимает отпечаток запроса по методу, пути и телу.
|
||||
@@ -81,7 +94,7 @@
|
||||
|
||||
### Время и деньги
|
||||
|
||||
Метки времени используют схему `Timestamp`: `string`, `format: date-time`, UTC с суффиксом `Z` (RFC 3339). Серверы всегда отдают UTC. ogen генерирует `Timestamp` как именованный Go-тип поверх `time.Time`; при преобразовании к нему вызывайте `.UTC()`. Деньги - целое число полных рублей (`RubAmount`, int64) с явной базой: `SalaryRange` требует `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`) и `tax_basis` (`net` или `gross`); см. раздел Потребности ниже. Приглашения, как ожидается, переиспользуют `SalaryRange`.
|
||||
Метки времени используют схему `Timestamp`: `string`, `format: date-time`, UTC с суффиксом `Z` (RFC 3339). Серверы всегда отдают UTC. ogen генерирует `Timestamp` как именованный Go-тип поверх `time.Time`; при преобразовании к нему вызывайте `.UTC()`. Деньги - целое число полных рублей (`RubAmount`, int64) с явной базой: `SalaryRange` требует `salary_from`, `salary_to`, `currency` (`RUB`), `period` (`month`) и `tax_basis` (`net` или `gross`); см. раздел Потребности ниже. Условия приглашения переиспользуют `SalaryRange` с теми же правилами.
|
||||
|
||||
### Ошибки ML-сервиса
|
||||
|
||||
@@ -289,7 +302,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
Зарплата:
|
||||
|
||||
- `SalaryRange` `[A; B]` содержит `salary_from` и `salary_to` (`RubAmount`, целые рубли), `currency` (только `RUB`), `period` (только `month`) и `tax_basis` (`net` или `gross`); все поля обязательны. Запрос передает ее как `salary: {value, status}`, поэтому ее pointer начинаются с `/salary/value`.
|
||||
- Схема требует положительных границ, кратных 1000, до 100000000 и отклоняет другую валюту, период или базу, например с `/salary/value/tax_basis`. Для отсутствующего поля вложенной вилки pointer указывает на все тело.
|
||||
- Схема требует положительных границ, кратных 1000, до 100000000 и отклоняет другую валюту, период или базу, например с `/salary/value/tax_basis`. Отсутствующее поле вложенной вилки дает `required` со своим pointer, например `/salary/value/tax_basis`.
|
||||
- Межполевые правила FR13 в PRD сервер проверяет в целочисленной арифметике: `A < B` и ширина `(B - A) / ((A + B) / 2)` от 10% до 40% включительно, то есть `20 * (B - A) >= A + B` и `5 * (B - A) <= A + B`. Нарушение, включая равные границы, дает 400 с pointer `/salary/value/salary_to`. `[95000; 105000]` (ровно 10%) и `[80000; 120000]` (ровно 40%) принимаются. FR13 применяет одни правила к вилке потребности и приглашения, и `docs/*/ARCHITECTURE.md` теперь указывает их для приглашений вместо `0 < salary_from <= salary_to`.
|
||||
- Ограничение против подбора скрытых минимумов (FR13, запланировано в TASK-211): задание подтвержденной вилки при создании или изменении учитывается в счетчике, общем для всей организации, всех участников и всех потребностей, поэтому новая потребность его не обнуляет. Не больше трех заданий вилки в сутки; сверх лимита сервер отвечает 429 с Retry-After и ничего не меняет. После пяти заданий за семь дней денежная компонента получает статус `withheld` на семь дней. Повторные изменения вилки также питают приватные сигналы риска TASK-319.
|
||||
|
||||
@@ -332,10 +345,10 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
| `anticheat_appeal` | кандидат | обязательна; `assessment_attempt` автора с решением античит-проверки | нет | 10 рабочих дней |
|
||||
| `manual_assessment` | кандидат | необязательна; прежняя `assessment_attempt` автора в той же специализации | обязательный `assessment_target`; `rubric_version` фиксирует сервер | 5 рабочих дней |
|
||||
|
||||
- Запрос - `oneOf` из пяти вариантов, выбираемых по `type` (`SupportCaseCreateSupport`, `SupportCaseCreateComplaint`, `SupportCaseCreateGradeAppeal`, `SupportCaseCreateAnticheatAppeal`, `SupportCaseCreateManualAssessment`). Каждый вариант сужает схему своей ссылки, поэтому уже схема отклоняет организацию в апелляции грейда или обращение в жалобе с pointer `/object/type`, а отсутствующее поле типа - с его pointer, например `/object` или `/assessment_target`. ogen выбирает вариант по значению `type`. Неизвестный или отсутствующий тип, поле другого варианта, например `complaint_reason` в обращении в поддержку, и `object.id`, который не является UUID, дают 400 с pointer на все тело `""`, потому что декодер не записывает путь внутри выбранного варианта (пример `SupportCaseMalformedReference`).
|
||||
- Запрос - `oneOf` из пяти вариантов, выбираемых по `type` (`SupportCaseCreateSupport`, `SupportCaseCreateComplaint`, `SupportCaseCreateGradeAppeal`, `SupportCaseCreateAnticheatAppeal`, `SupportCaseCreateManualAssessment`). Каждый вариант сужает схему своей ссылки, поэтому уже схема отклоняет организацию в апелляции грейда или обращение в жалобе с pointer `/object/type`, а отсутствующее поле типа - с его pointer, например `/object` или `/assessment_target`. ogen выбирает вариант по значению `type`. Неизвестный или отсутствующий тип и поле другого варианта, например `complaint_reason` в обращении в поддержку, дают 400 с pointer на все тело `""`, потому что относятся к варианту верхнего уровня; `object.id`, который не является UUID, дает 400 с `/object/id` (пример `SupportCaseMalformedReference`).
|
||||
- Категорию, присвоенную без попытки, тоже можно оспорить (FR18): апелляция грейда может ссылаться на собственное обращение ручной оценки, когда оно `resolved` с `assessed`. Неизвестное обращение и обращение другого аккаунта дают 404 `not_found`; собственное обращение другого типа, еще не решенное или решенное с другим исходом дает 409 `state_conflict`.
|
||||
- Организацию видит кандидат, которого она пригласила или которому контракт организации (TASK-077) показывает ее профиль, и аккаунт работодателя с действующим членством в ней. Сервер сверяет каждую ссылку с аккаунтом сессии: неизвестный и чужой объект одинаково дают 404 `not_found`, поэтому ссылка не раскрывает, существует ли чужой объект. Обращение хранит только `{type, id}`.
|
||||
- Приглашений и решений античит-проверки в контракте пока нет. До их появления любая ссылка `invitation` дает 404, а любая античит-апелляция - 409 `state_conflict`; форма запроса при их появлении не меняется.
|
||||
- Приглашения есть в контракте (см. раздел Приглашения и контактные разрешения ниже), но не реализованы, а решений античит-проверки в контракте пока нет. До их реализации любая ссылка `invitation` дает 404, а любая античит-апелляция - 409 `state_conflict`; форма запроса не меняется.
|
||||
- Жалобы `offer_content` и `salary_terms_violation` требуют приглашения; другой объект дает 400 с pointer `/object/type` (доменное правило после схемы).
|
||||
- Неудачный первый тест или отсутствие попыток не блокируют ручную оценку. Создание обращения не дает, не отзывает и не меняет согласие, грейд или попытку; связь ручной оценки с согласием C3 решают TASK-064 и TASK-315.
|
||||
|
||||
@@ -370,6 +383,88 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
Запланированные изменения контракта (новые значения перечислений; как и коды каталога, сгенерированные клиенты отклоняют неизвестное значение, поэтому каждое выходит вместе с перегенерированными клиентами): типы объектов `vacancy` и `application` для вакансий и защищенных откликов из FR16 и тип объекта для замечаний к профилю из TASK-272. `waiting_for_user` и `support_case` уже есть в перечислениях, поэтому операции ответа и последующим обращениям такое изменение не нужно. Новых видов событий и участников не планируется: ответ автора - это `reply` с участником `user`, пересмотр решения (TASK-317) - еще одно событие `decision`, а эксперты и модераторы - это `support`.
|
||||
|
||||
### Приглашения и контактные разрешения
|
||||
|
||||
Тег `invitation` описывает приглашения организации одному кандидату (FR12 в PRD, с правилами вилки FR13 и согласием C4): черновики с полными условиями, неизменяемые версии условий, отправку, входящие кандидата, просмотр, принятие с C4, структурированный отказ, отзыв, отмену участия и контактное разрешение (grant). Операции есть в контракте; их бизнес-логика еще не реализована, поэтому каждая отвечает 401 `unauthenticated`, пока нет сессий (`v1.DenyAllSecurity`).
|
||||
|
||||
| Метод и путь | operationId | Защита | Успех | Конкретные ошибки |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/organizations/{org_id}/invitations` | `ListOrganizationInvitations` | сессия | 200 `OrganizationInvitationList` | 400, 401, 403 `forbidden`, 404 |
|
||||
| `POST /api/v1/organizations/{org_id}/invitations` | `CreateOrganizationInvitation` | сессия и CSRF, Idempotency-Key | 201 `OrganizationInvitation` (`draft`) | 400, 401, 403, 404, 409 `idempotency_in_progress`, 422, 429 |
|
||||
| `GET /api/v1/organizations/{org_id}/invitations/{invitation_id}` | `GetOrganizationInvitation` | сессия | 200 `OrganizationInvitation` | 400, 401, 403, 404 |
|
||||
| `PATCH /api/v1/organizations/{org_id}/invitations/{invitation_id}` | `UpdateOrganizationInvitation` | сессия и CSRF | 200 `OrganizationInvitation` | 400, 401, 403, 404, 409 `state_conflict`, 412, 429 |
|
||||
| `POST .../invitations/{invitation_id}/send` | `SendOrganizationInvitation` | сессия и CSRF, Idempotency-Key | 200 `OrganizationInvitation` (`delivered`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST .../invitations/{invitation_id}/salary-raise` | `RaiseOrganizationInvitationSalary` | сессия и CSRF, Idempotency-Key | 200 `OrganizationInvitation` | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST .../invitations/{invitation_id}/withdraw` | `WithdrawOrganizationInvitation` | сессия и CSRF, Idempotency-Key | 200 `OrganizationInvitation` (`withdrawn`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `GET .../invitations/{invitation_id}/contacts` | `GetOrganizationInvitationContacts` | сессия | 200 `ContactDisclosure` | 400, 401, 403, 404 |
|
||||
| `GET /api/v1/me/invitations` | `ListMyInvitations` | сессия | 200 `CandidateInvitationList` | 400, 401, 403 |
|
||||
| `GET /api/v1/me/invitations/{invitation_id}` | `GetMyInvitation` | сессия | 200 `CandidateInvitation` | 400, 401, 403, 404 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/view` | `ViewMyInvitation` | сессия и CSRF | 200 `CandidateInvitation` (`viewed`) | 400, 401, 403, 404, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/accept` | `AcceptMyInvitation` | сессия и CSRF, Idempotency-Key | 200 `CandidateInvitation` (`accepted`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/decline` | `DeclineMyInvitation` | сессия и CSRF, Idempotency-Key | 200 `CandidateInvitation` (`declined`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
| `POST /api/v1/me/invitations/{invitation_id}/cancel` | `CancelMyInvitation` | сессия и CSRF, Idempotency-Key | 200 `CandidateInvitation` (`cancelled_by_candidate`) | 400, 401, 403, 404, 409, 412, 422, 429 |
|
||||
|
||||
Каждый успешный ответ имеет `Cache-Control: no-store`, и каждая операция также объявляет problem-ответ `default`. Пути `...` начинаются с `/api/v1/organizations/{org_id}`. 403 на изменяющей операции - `csrf_check_failed` или `forbidden`; 409 на команде - `state_conflict` или `idempotency_in_progress`; 412 - `version_conflict`; 422 - `idempotency_key_reused`. 429 на команде - общий лимит частоты с Retry-After, который может ответить до любой проверки; на создании, изменении и отправке это также лимит вилки или недельная квота. Чтение контактов и простые чтения собственного 429 не объявляют, как и другие чтения контракта.
|
||||
|
||||
Доступ:
|
||||
|
||||
- Сторона организации: `org_id` в пути - единственный источник организации, сервер сверяет его с действующим членством аккаунта сессии, как для потребностей. Аккаунт без членства, неизвестная организация, неизвестное приглашение и приглашение другой организации одинаково дают 404 `not_found`; аккаунт кандидата и участник, чья роль не разрешает операцию, получают 403 `forbidden`. В MVP с приглашениями работает только владелец; остальные роли FR07 запланированы (TASK-463).
|
||||
- Сторона кандидата: `/me/invitations` привязаны к аккаунту сессии. Черновик, приглашение другому кандидату и неизвестный идентификатор дают 404 `not_found`; аккаунт работодателя получает 403 `forbidden`. Ни в одном запросе нет поля пользователя, кандидата, организации или роли.
|
||||
- Кандидат указывается только через `candidate_handle` (`CandidateHandle` в `common_schemas.yml`, общий с результатами поиска FR11, TASK-185), никогда через email, телефон или идентификатор аккаунта либо профиля. Неизвестный handle, handle другой организации и профиль, который организация больше не может видеть, одинаково дают 400 с pointer `/candidate_handle`.
|
||||
|
||||
Условия (`InvitationTerms`):
|
||||
|
||||
- Условия полны с первого черновика, и каждое поле обязательно: `role_title`, `specialization`, `grade`, `offer_type` (`full_time`, `part_time`, `contract`, `internship`), `tasks`, `team`, `tech_stack`, `work_formats`, `location` (null только для полностью удаленной роли; для `office` или `hybrid` обязательно по доменному правилу с pointer `/terms/location`), `communication_method` (`channel` и необязательная заметка), `salary` (`SalaryRange`) и `package`. Поэтому черновик без базы net/gross или способа связи существовать не может: такое тело дает 400 `required` с `/terms/salary/tax_basis` или `/terms/communication_method` (примеры `InvitationWithoutTaxBasis` и `InvitationWithoutCommunicationMethod`).
|
||||
- `package` содержит `bonus`, `equipment`, `training` и `health_insurance` (ДМС). Каждое поле - `oneOf`: `{status: provided, description}` или `{status: not_provided}` ("Не предусмотрено" в интерфейсе). "Не предусмотрено" - явный выбор: пропущенное условие дает `required` со своим pointer, например `/terms/package/training`; `provided` без описания дает `required` на его `description`; `not_provided` с описанием дает `invalid` на самом условии. Сгенерированный Zod не строгий и отбрасывает такое описание, поэтому отклоняет его только сервер.
|
||||
- Намеренное отступление от формулировки критериев приемки: пакет в PRD называет формат работы рядом с бонусом, оборудованием, обучением и ДМС, но здесь формат - обязательное условие `work_formats` без варианта "не предусмотрено", потому что у роли всегда есть формат, а индикатор и поиск его сравнивают. Это открытый вопрос к владельцу продукта.
|
||||
- Одна схема служит полем запроса и сохраненным снимком, поэтому ответ можно отправить обратно без изменений. Условия никогда не содержат данных кандидата.
|
||||
|
||||
Версии и конфликты:
|
||||
|
||||
- `version` растет с каждым зафиксированным изменением, включая просмотр и серверное истечение срока. `terms_version` растет только при изменении условий: изменении `terms` в черновике или единственном повышении верхней границы после отправки. Каждая версия условий неизменяема.
|
||||
- Каждая команда, кроме просмотра, передает `expected_version`; `AcceptMyInvitation` передает еще `terms_version`. 412 `version_conflict`: `expected_version` или, при принятии, `terms_version` не текущие (случай устаревших условий, пример `InvitationStaleTerms`); ничего не изменено, под ключом ничего не сохраняется, клиент перечитывает приглашение. 409 `state_conflict`: состояние не допускает команду, например принятие отозванного или истекшего приглашения, команда в момент дедлайна или позже, отправка, заблокированная лимитом ожидающих по потребности или 30-дневной паузой, изменение отправленного приглашения или второе повышение; такой ответ сохраняется под ключом. TASK-197, TASK-201 и TASK-204 называют 409 для устаревших условий; правило репозитория оставляет 412 для любой устаревшей версии, как для потребностей и анкеты.
|
||||
- Порядок: после того как приглашение найдено и наступивший срок применен, и после проверки повтора терминальное состояние (`declined`, `expired`, `withdrawn`, `cancelled_by_candidate`) или, для принятия и отказа, прошедший дедлайн дает 409 до сравнения версий. Поэтому клиент получает 409 для отозванного, истекшего или опоздавшего приглашения даже с устаревшими версиями и показывает итоговое состояние, а не перечитывает и повторяет. Затем идут версии (412) и остальные правила состояния (409). Это относится к принятию, отказу, отмене, отзыву и повышению вилки.
|
||||
- Повторы возвращают прежний результат: повтор с тем же Idempotency-Key воспроизводит сохраненный исход, а повтор команды, чей переход уже произошел, отвечает 200 с текущим приглашением даже с новым ключом или старой версией: отправка отправленного, отзыв отозванного, отказ с той же причиной и комментарием, отмена отмененного, то же повышение и принятие, чьи `terms_version` и поля совпадают с `contact_grant` - версией и полями, которые кандидат принял, даже если позднее повышение увеличило текущую `terms_version`. Второе согласие, grant, списание квоты или событие аудита не создаются.
|
||||
- `UpdateOrganizationInvitation` следует соглашению `UpdateOrganizationNeed`: без Idempotency-Key, с явной заменой полей, а тело, которое ничего не меняет, дает 200.
|
||||
|
||||
Состояния и просмотр:
|
||||
|
||||
- `InvitationState` перечисляет все состояния таблицы FR12: `draft`, `delivered`, `viewed`, `counter`, `accepted`, `interview_scheduled`, `interviewed`, `negotiation`, `terms_agreed`, `no_deal`, `declined`, `expired`, `withdrawn`, `cancelled_by_candidate`. Операции MVP производят `draft`, `delivered`, `viewed`, `accepted`, `declined`, `expired`, `withdrawn` и `cancelled_by_candidate`; остальные перечислены заранее, чтобы сгенерированные клиенты принимали их, когда появятся встречное предложение, интервью и закрытый финал. Внутренний этап `SENT` не виден: отправка отвечает `delivered` после создания входящей записи.
|
||||
- `expiry_reason` - `invitation_timeout` или запланированный `negotiation_timeout`, не null ровно в `expired`.
|
||||
- Просмотр - явная команда `ViewMyInvitation`: она переводит `delivered` в `viewed`, сохраняет дедлайн и в любом другом состоянии возвращает текущее приглашение без изменений. Команда идемпотентна по эффекту, поэтому ей не нужны ни Idempotency-Key, ни `expected_version`, и она никогда не падает из-за того, что приглашение изменилось после чтения клиентом. `GetMyInvitation` и `ListMyInvitations` побочных эффектов не имеют; чтение лишь показывает наступивший срок, который сервер применяет в момент дедлайна в любом случае. TASK-200 описывает просмотр как GET; команда не дает предзагрузке, повтору или обновлению кеша менять состояние, которое видит организация.
|
||||
- `withdrawn` - команда организации из любого незавершенного состояния, включая `draft` и `accepted`; существующий grant она сохраняет. `cancelled_by_candidate` - команда кандидата из любого незавершенного состояния после доставки; она отзывает grant этого приглашения. Отказ - структурированный ответ до принятия.
|
||||
- Дедлайн равен `delivered_at + response_period_days` (3, 7 или 14 дней, по умолчанию 7). Просмотр, письмо или повышение вилки его не сдвигают; команда, принятая в момент дедлайна или позже, опоздала.
|
||||
|
||||
Вилка и скрытый минимум:
|
||||
|
||||
- Условия переиспользуют `SalaryRange` с правилами раздела Потребности: RUB, месяц, `net` или `gross`, положительные границы, кратные 1000, `A < B` и ширина 10-40%, которую сервер проверяет с pointer `/terms/salary/salary_to`.
|
||||
- Организация получает только `salary_fit`: `within_range`, `up_to_10_percent_above`, `above`, `withheld` или `not_available` (нет минимума для предложенных форматов или он в другой базе). Точный минимум не появляется ни в ответе, ни в примере, ни в логе, ни в problem. Сервер никогда не отклоняет вилку из-за минимума, потому что отказ сам раскрыл бы его. В DTO кандидата индикатора нет; кандидат сравнивает с собственным минимумом из профиля.
|
||||
- Каждое изменение, которое может сдвинуть индикатор, считается установкой: вилка при создании, а в черновике изменение любой границы, базы или `work_formats`, потому что индикатор сравнивает с минимумом для предложенных форматов. Каждая установка учитывается в общем лимите организации - три в день вместе с вилками потребностей (429 с Retry-After, TASK-211) - и в счетчике `withheld`. Изменение, которое сохраняет вилку, базу и форматы, не учитывается.
|
||||
- `withheld`: после пяти установок за семь дней индикатор выключается на семь дней с пятой. Ответ на пятую установку уже показывает `withheld`, как и каждый черновик и каждое приглашение организации, включая существующие, до конца периода.
|
||||
- Переключение базы превращает `not_available` в диапазон или обратно и тем сообщает организации базу минимума; это принято, а переключение учитывается в лимите как любая установка.
|
||||
- После отправки база фиксирована, а нижняя граница не снижается. `RaiseOrganizationInvitationSalary` поднимает `salary_to` один раз за всю историю приглашения, создает следующую версию условий и отвечает 409 на второе повышение. Оно подчиняется своему однократному правилу и не входит в дневной лимит, но учитывается в счетчике `withheld`, потому что сдвигает верхнюю границу, с которой сравнивает индикатор.
|
||||
|
||||
Согласие C4 и контактное разрешение:
|
||||
|
||||
- `GetMyInvitation` показывает в `contact_consent` текст C4 для этой организации и виды контактов, которые есть в профиле. Поле равно null, когда принять приглашение нельзя: этого не допускает состояние или дедлайн либо в профиле нет контактов. В последнем случае клиент просит кандидата сначала добавить контакт, потому что grant должен покрывать хотя бы одно поле.
|
||||
- `AcceptMyInvitation` передает `terms_version`, `expected_version` и `consent_c4` (`ContactConsentAcceptance`): показанную версию текста C4, `accepted: true` и `fields` - хотя бы одно из `full_name`, `email`, `phone`, `telegram`, без значения по умолчанию и без предвыбора. Неопубликованная версия текста дает 400 `/consent_c4/text_version`, а поле, которого нет в профиле, - 400 `/consent_c4/fields/<i>`. Согласие аналогично принятию C1 по `text_version`, а запись совпадает с реестром C4 из TASK-062 (цель, версия и хэш текста, организация, набор полей, приглашение-источник). Разрешение передавать данные в ATS организации (C4 и FR19) запланировано как дополнительный необязательный флаг, по умолчанию без передачи.
|
||||
- В одной транзакции принятие переводит приглашение в `accepted`, записывает C4, создает grant ровно на выбранные поля и пишет событие аудита (TASK-201). Оно не публикует профиль (C2) и не снимает скрытие.
|
||||
- У `contact_grant` кандидата есть `status` (`active` или `revoked`), `readable` и `blocked_by`. Grant, созданный, когда профиль не был опубликован или был скрыт от организации, остается `active` с `readable: false` и `blocked_by: visibility`, чтобы кандидат видел, почему организация не может его прочитать (FR12 в PRD); он станет читаемым, когда кандидат опубликует профиль или снимет скрытие. Любое изменение видимости после появления grant отзывает его (`visibility_closed`), и повторная публикация его не открывает.
|
||||
- Значения контактов передаются только в `ContactDisclosure` из `GetOrganizationInvitationContacts`, отдельно от условий и приглашения. Каждое чтение проверяет членство, C4, grant и его поля и текущую видимость без кеша. Без читаемого grant операция отвечает 404 `not_found`, как для неизвестного приглашения. `contact_access` организации - `not_granted` (grant нет), `available` (с видами полей) или `closed`, что покрывает и отозванный grant, и grant, заблокированный с самого начала, не говоря, какой из них. Это наименее раскрывающее правило: отзыв, скрытие и отсутствие публикации выглядят одинаково, а поскольку любое изменение видимости после появления grant его отзывает, организация не наблюдает последующих переключений; стать `available` может только grant, заблокированный с начала, и лишь по собственному выбору кандидата. Поля вне grant равны null.
|
||||
- Отзыв: `CancelMyInvitation` отзывает grant этого приглашения (`participation_cancelled`); отзыв C4 для организации закрывает все ее grants (`consent_revoked`, TASK-064); отзыв C2 или скрытие профиля закрывает их (`visibility_closed`). Отзыв приглашения, `no_deal` и таймаут финала grant не отзывают; новый grant создает только новое явное C4. Отдельная операция отзыва grant относится к контракту согласий (TASK-064, TASK-202).
|
||||
- Форматы значений: ФИО одной строкой до 200 символов, телефон в формате E.164 и имя пользователя Telegram с ведущим @. Контракт профиля (FR02, TASK-066) должен хранить контакты в тех же форматах, чтобы раскрытие не преобразовывало и не отбрасывало сохраненное значение.
|
||||
|
||||
Отказ и приватность:
|
||||
|
||||
- `DeclineMyInvitation` принимает `reason` (`salary`, `tasks`, `stack`, `work_format`, `package`, `company`, `not_looking`, `other_offer`, `other`) и необязательный `comment` до 500 символов; для `other` комментарий не нужен. Организация видит только `declined` и `responded_at`, но не причину и не комментарий: причина вроде `salary` сообщила бы ей, что скрытый минимум выше вилки. Причины идут только в агрегаты с минимальным размером группы (запланировано). Кандидат читает их обратно в `decline`.
|
||||
- Ни один DTO приглашения ни одной стороны не содержит ФИО, email, телефон, Telegram, идентификатор аккаунта или профиля или минимум кандидата; примеры используют только синтетические данные. `TestInvitationSchemaValidationPrecedesImplementation` проверяет отказы схемы и pointer через сгенерированный сервер, `TestInvitationDTOsCarryNoContactOrMinimum` - сгенерированные Go DTO, а `frontend/src/shared/api/invitation-contract.test.ts` закрепляет правила сгенерированного Zod и на уровне типов отсутствие полей контактов, минимума и отказа.
|
||||
|
||||
Открытые продуктовые вопросы: допустимо ли второе незавершенное приглашение той же организации тому же кандидату (PRD об этом молчит, поэтому контракт правила не придумывает), отступление по формату в пакете выше, типы предложения, виды контактов и причины отказа.
|
||||
|
||||
Запланировано, добавляется без ломающих изменений: встречное предложение и ответ компании, чтение прежних версий условий, операции интервью и закрытого финала, фильтры списков, метрики отзывчивости организации для кандидата, ориентировочная сумма в другой базе, агрегаты причин отказа, флаг ATS в C4 и поля ФСП как новые виды контактов (новое значение enum выпускается вместе с перегенерированными клиентами).
|
||||
|
||||
Новый код ошибки не добавлен: enum `ProblemCode` побайтно копируется в ML-контракт, а `version_conflict` и `state_conflict` покрывают устаревшие условия и конфликты состояния.
|
||||
|
||||
### Проверки генераторов
|
||||
|
||||
`testdata/openapi-3.2.0.yml` содержит тестовые операции с перечисленными компонентами: пагинацией, Idempotency-Key, If-Match, ETag и problem-ответами. ogen не разрешает внешние ссылки, поэтому фикстура хранит копии компонентов api/core; `scripts/test_contract_copies.py` (входит в `make -C api check`) проверяет, что они, ответы фикстуры и ML-копия `Problem` совпадают с api/core.
|
||||
@@ -397,6 +492,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
- Zod-схемы Orval игнорируют `uniqueItems` и не отклоняют неизвестные поля объектов с `additionalProperties: false`; в обоих случаях решает сервер.
|
||||
- ogen генерирует необязательное nullable-поле как `OptNil<T>`, которое различает отсутствие (`IsSet` false), null (`IsNull`) и значение. Необязательный массив без null, напротив, - обычный slice, где nil и `[]` значат разное: отсутствующее поле декодируется в nil (без изменений), `[]` - в пустой slice, не равный nil (удалить все элементы), а null не декодируется. Поэтому обработчик `UpdateOrganizationNeed` должен проверять списки через `!= nil`, а не через `len`; это закрепляет `TestNeedUpdateDecodingKeepsAbsentAndEmptyListsApart`.
|
||||
- Orval очищает `src/shared/api/endpoints/` и `src/shared/api/schemas/` перед генерацией (`clean: true`), потому что схема, используемая несколькими тегами, переезжает из каталога тега в корень схем.
|
||||
- Шаг после Orval `frontend/codegen/mock-patterns.ts` ищет границы длины строки с pattern по имени свойства и pattern, поэтому два свойства с одинаковыми именем и pattern должны иметь одинаковые границы. Поэтому технологии в условиях приглашения называются `tech_stack` (`SkillName`, до 100 символов) рядом с `stack` анкеты (`StackTag`, до 50), а условие пакета передает `description`, а не `value`, которое решения потребности используют с другими границами.
|
||||
|
||||
#### Объединения форматов
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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
|
||||
@@ -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
|
||||
+1051
-1
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
|
||||
|
||||
+3107
-25
File diff suppressed because it is too large.
Load diff
@@ -32,6 +32,14 @@ tags:
|
||||
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.
|
||||
- name: invitation
|
||||
description: >-
|
||||
Invitations from an organization to one candidate: drafts with
|
||||
complete terms, immutable terms versions, sending, the candidate's
|
||||
inbox, acceptance with the consent C4, structured declines,
|
||||
withdrawal and cancellation, and the contact grant. Contacts are
|
||||
readable only through an active grant, in a response separate from
|
||||
the terms.
|
||||
- name: support
|
||||
description: >-
|
||||
Support cases of the current account: questions, complaints, appeals
|
||||
@@ -80,6 +88,30 @@ paths:
|
||||
$ref: ./routes/organization_needs.yml
|
||||
/api/v1/organizations/{org_id}/needs/{need_id}:
|
||||
$ref: ./routes/organization_need.yml
|
||||
/api/v1/organizations/{org_id}/invitations:
|
||||
$ref: ./routes/organization_invitations.yml
|
||||
/api/v1/organizations/{org_id}/invitations/{invitation_id}:
|
||||
$ref: ./routes/organization_invitation.yml
|
||||
/api/v1/organizations/{org_id}/invitations/{invitation_id}/send:
|
||||
$ref: ./routes/organization_invitation_send.yml
|
||||
/api/v1/organizations/{org_id}/invitations/{invitation_id}/salary-raise:
|
||||
$ref: ./routes/organization_invitation_salary_raise.yml
|
||||
/api/v1/organizations/{org_id}/invitations/{invitation_id}/withdraw:
|
||||
$ref: ./routes/organization_invitation_withdraw.yml
|
||||
/api/v1/organizations/{org_id}/invitations/{invitation_id}/contacts:
|
||||
$ref: ./routes/organization_invitation_contacts.yml
|
||||
/api/v1/me/invitations:
|
||||
$ref: ./routes/candidate_invitations.yml
|
||||
/api/v1/me/invitations/{invitation_id}:
|
||||
$ref: ./routes/candidate_invitation.yml
|
||||
/api/v1/me/invitations/{invitation_id}/view:
|
||||
$ref: ./routes/candidate_invitation_view.yml
|
||||
/api/v1/me/invitations/{invitation_id}/accept:
|
||||
$ref: ./routes/candidate_invitation_accept.yml
|
||||
/api/v1/me/invitations/{invitation_id}/decline:
|
||||
$ref: ./routes/candidate_invitation_decline.yml
|
||||
/api/v1/me/invitations/{invitation_id}/cancel:
|
||||
$ref: ./routes/candidate_invitation_cancel.yml
|
||||
/api/v1/me/support-cases:
|
||||
$ref: ./routes/support_cases.yml
|
||||
/api/v1/me/support-cases/{case_id}:
|
||||
@@ -446,6 +478,106 @@ components:
|
||||
$ref: ./components/schemas.yml#/SupportCaseSummary
|
||||
SupportCaseList:
|
||||
$ref: ./components/schemas.yml#/SupportCaseList
|
||||
InvitationVersion:
|
||||
$ref: ./components/schemas.yml#/InvitationVersion
|
||||
InvitationTermsVersion:
|
||||
$ref: ./components/schemas.yml#/InvitationTermsVersion
|
||||
InvitationState:
|
||||
$ref: ./components/schemas.yml#/InvitationState
|
||||
InvitationExpiryReason:
|
||||
$ref: ./components/schemas.yml#/InvitationExpiryReason
|
||||
InvitationResponsePeriod:
|
||||
$ref: ./components/schemas.yml#/InvitationResponsePeriod
|
||||
CandidateHandle:
|
||||
$ref: ./components/schemas.yml#/CandidateHandle
|
||||
InvitationRoleTitle:
|
||||
$ref: ./components/schemas.yml#/InvitationRoleTitle
|
||||
InvitationTeamDescription:
|
||||
$ref: ./components/schemas.yml#/InvitationTeamDescription
|
||||
InvitationOfferType:
|
||||
$ref: ./components/schemas.yml#/InvitationOfferType
|
||||
InvitationCommunicationChannel:
|
||||
$ref: ./components/schemas.yml#/InvitationCommunicationChannel
|
||||
InvitationCommunicationMethod:
|
||||
$ref: ./components/schemas.yml#/InvitationCommunicationMethod
|
||||
InvitationCommunicationNote:
|
||||
$ref: ./components/schemas.yml#/InvitationCommunicationNote
|
||||
InvitationPackageItemText:
|
||||
$ref: ./components/schemas.yml#/InvitationPackageItemText
|
||||
InvitationPackageItemProvided:
|
||||
$ref: ./components/schemas.yml#/InvitationPackageItemProvided
|
||||
InvitationPackageItemNotProvided:
|
||||
$ref: ./components/schemas.yml#/InvitationPackageItemNotProvided
|
||||
InvitationPackageItem:
|
||||
$ref: ./components/schemas.yml#/InvitationPackageItem
|
||||
InvitationPackage:
|
||||
$ref: ./components/schemas.yml#/InvitationPackage
|
||||
InvitationTerms:
|
||||
$ref: ./components/schemas.yml#/InvitationTerms
|
||||
InvitationNeedReference:
|
||||
$ref: ./components/schemas.yml#/InvitationNeedReference
|
||||
InvitationSalaryFit:
|
||||
$ref: ./components/schemas.yml#/InvitationSalaryFit
|
||||
InvitationContactAccessState:
|
||||
$ref: ./components/schemas.yml#/InvitationContactAccessState
|
||||
InvitationContactAccess:
|
||||
$ref: ./components/schemas.yml#/InvitationContactAccess
|
||||
InvitationOrganization:
|
||||
$ref: ./components/schemas.yml#/InvitationOrganization
|
||||
InvitationDeclineReason:
|
||||
$ref: ./components/schemas.yml#/InvitationDeclineReason
|
||||
InvitationDeclineComment:
|
||||
$ref: ./components/schemas.yml#/InvitationDeclineComment
|
||||
InvitationDeclineRecord:
|
||||
$ref: ./components/schemas.yml#/InvitationDeclineRecord
|
||||
OrganizationInvitation:
|
||||
$ref: ./components/schemas.yml#/OrganizationInvitation
|
||||
OrganizationInvitationSummary:
|
||||
$ref: ./components/schemas.yml#/OrganizationInvitationSummary
|
||||
OrganizationInvitationList:
|
||||
$ref: ./components/schemas.yml#/OrganizationInvitationList
|
||||
OrganizationInvitationCreate:
|
||||
$ref: ./components/schemas.yml#/OrganizationInvitationCreate
|
||||
OrganizationInvitationUpdate:
|
||||
$ref: ./components/schemas.yml#/OrganizationInvitationUpdate
|
||||
InvitationCommand:
|
||||
$ref: ./components/schemas.yml#/InvitationCommand
|
||||
InvitationSalaryRaise:
|
||||
$ref: ./components/schemas.yml#/InvitationSalaryRaise
|
||||
CandidateInvitation:
|
||||
$ref: ./components/schemas.yml#/CandidateInvitation
|
||||
CandidateInvitationSummary:
|
||||
$ref: ./components/schemas.yml#/CandidateInvitationSummary
|
||||
CandidateInvitationList:
|
||||
$ref: ./components/schemas.yml#/CandidateInvitationList
|
||||
InvitationAcceptance:
|
||||
$ref: ./components/schemas.yml#/InvitationAcceptance
|
||||
InvitationDeclineRequest:
|
||||
$ref: ./components/schemas.yml#/InvitationDeclineRequest
|
||||
ContactFieldKind:
|
||||
$ref: ./components/schemas.yml#/ContactFieldKind
|
||||
ContactConsentText:
|
||||
$ref: ./components/schemas.yml#/ContactConsentText
|
||||
ContactConsentOffer:
|
||||
$ref: ./components/schemas.yml#/ContactConsentOffer
|
||||
ContactConsentAcceptance:
|
||||
$ref: ./components/schemas.yml#/ContactConsentAcceptance
|
||||
ContactGrantState:
|
||||
$ref: ./components/schemas.yml#/ContactGrantState
|
||||
ContactAccessBlock:
|
||||
$ref: ./components/schemas.yml#/ContactAccessBlock
|
||||
ContactRevocationReason:
|
||||
$ref: ./components/schemas.yml#/ContactRevocationReason
|
||||
ContactGrant:
|
||||
$ref: ./components/schemas.yml#/ContactGrant
|
||||
ContactPhoneNumber:
|
||||
$ref: ./components/schemas.yml#/ContactPhoneNumber
|
||||
ContactTelegramUsername:
|
||||
$ref: ./components/schemas.yml#/ContactTelegramUsername
|
||||
ContactFullName:
|
||||
$ref: ./components/schemas.yml#/ContactFullName
|
||||
ContactDisclosure:
|
||||
$ref: ./components/schemas.yml#/ContactDisclosure
|
||||
parameters:
|
||||
IdempotencyKey:
|
||||
$ref: ./components/parameters.yml#/IdempotencyKey
|
||||
@@ -463,6 +595,10 @@ components:
|
||||
$ref: ./components/parameters.yml#/NeedId
|
||||
SupportCaseId:
|
||||
$ref: ./components/parameters.yml#/SupportCaseId
|
||||
InvitationId:
|
||||
$ref: ./components/parameters.yml#/InvitationId
|
||||
MyInvitationId:
|
||||
$ref: ./components/parameters.yml#/MyInvitationId
|
||||
headers:
|
||||
ETag:
|
||||
$ref: ./components/headers.yml#/ETag
|
||||
@@ -539,6 +675,14 @@ components:
|
||||
$ref: ./components/responses.yml#/SupportCaseValidationFailed
|
||||
SupportCaseCreateConflict:
|
||||
$ref: ./components/responses.yml#/SupportCaseCreateConflict
|
||||
InvitationValidationFailed:
|
||||
$ref: ./components/responses.yml#/InvitationValidationFailed
|
||||
InvitationAcceptValidationFailed:
|
||||
$ref: ./components/responses.yml#/InvitationAcceptValidationFailed
|
||||
InvitationVersionConflict:
|
||||
$ref: ./components/responses.yml#/InvitationVersionConflict
|
||||
InvitationCommandConflict:
|
||||
$ref: ./components/responses.yml#/InvitationCommandConflict
|
||||
securitySchemes:
|
||||
sessionCookie:
|
||||
type: apiKey
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
get:
|
||||
operationId: GetMyInvitation
|
||||
summary: Open the terms of an invitation addressed to the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session; the invitation must be addressed to this candidate.
|
||||
|
||||
Returns the organization, the current terms version with the full terms, the state, and the deadline. While an acceptance is possible (`delivered` or `viewed` before the deadline), `contact_consent` holds the published text of the consent C4 for this organization and the kinds of contact that the profile holds, with nothing preselected; otherwise it is null. It is null as well when the profile holds no contact: a grant must cover at least one field, so the client asks the candidate to add a contact to the profile before accepting. After an answer the response holds the candidate's own decline or the contact grant that the acceptance created, with the selected kinds, its status, and whether the organization can read it now (`readable`, with `blocked_by` `visibility` when the profile is not published or is hidden from the organization), never contact values. The response never carries the candidate's handle, the need of the organization, the salary indicator of the organization, or any contact or salary minimum of the candidate.
|
||||
|
||||
Reading has no side effect on the invitation: it never records a view. The client records that the candidate opened the terms with ViewMyInvitation, an explicit command, so a prefetch, a retry, or a cache refresh never changes the state that the organization sees. The only change a read can cause is the due expiry: a read at the deadline or later first applies the server transition to `expired` with `invitation_timeout`, which would happen without the read as well, and the response shows it. Reading earlier terms versions is planned as a separate operation.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden; a draft, an invitation addressed to another candidate, and an unknown identifier all answer 404 not_found, so identifiers cannot be enumerated. An `invitation_id` that is not a UUID answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/MyInvitationId
|
||||
responses:
|
||||
"200":
|
||||
description: The invitation in its current state.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitation
|
||||
examples:
|
||||
delivered:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationDelivered
|
||||
viewed:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationViewed
|
||||
accepted:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationAccepted
|
||||
declined:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationDeclined
|
||||
"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
|
||||
@@ -0,0 +1,69 @@
|
||||
post:
|
||||
operationId: AcceptMyInvitation
|
||||
summary: Accept the current terms and disclose the selected contacts.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The candidate comes from the session.
|
||||
|
||||
Only an acceptance of the current terms version with the consent C4 creates access to contacts (PRD FR12). The body names the `terms_version` the candidate read and accepts, the `expected_version` of the invitation, and `consent_c4`: the C4 text version that the candidate saw, `accepted: true`, and the contact fields the candidate selected. At least one field is required and nothing is preselected or defaulted, so a grant never covers a field the candidate did not choose. The fields come only from the candidate's profile; the request never carries contact values.
|
||||
|
||||
Allowed in `delivered` and `viewed` before `response_deadline_at`; accepting directly from `delivered` is allowed, as in the PRD FR12 transition table. In one transaction the server moves the invitation to `accepted`, records the consent C4 in the consent ledger with the organization, the fields, the invitation, the terms version, and the text version and its hash (TASK-062), creates the contact grant for exactly those fields, and writes the audit event (TASK-201). The response is the invitation with `contact_grant`. The acceptance never publishes the profile (C2) and never bypasses a profile hidden from the organization: the grant alone does not guarantee a read, and the organization reads only while the visibility allows it.
|
||||
|
||||
412 or 409: a `terms_version` or `expected_version` that is not current answers 412 version_conflict, the repository status for a stale version, and records nothing; this is the stale terms case, for example after the organization raised the salary, and the client reads the invitation again and shows the new terms for a new decision. A state that does not allow an acceptance answers 409 state_conflict: `withdrawn`, `expired`, `declined`, `cancelled_by_candidate`, the planned `counter`, or a command received at the deadline or later, which is late. A terminal state and a passed deadline are checked before the versions: the server first applies the due expiry, and the client then gets 409 for a withdrawn, expired, or late invitation even when its versions are stale, so it shows the final state instead of rereading and retrying. TASK-197, TASK-201, and TASK-204 say 409 for stale terms; the repository rule keeps 412 for any stale version, so clients branch on `version_conflict` to reread and on `state_conflict` to show the final state.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and an acceptance of an invitation that is already `accepted` whose `terms_version` and set of fields equal those of its `contact_grant`, the terms version and fields that the candidate accepted, answers 200 with it even with a new key, an older `expected_version`, or a current `terms_version` that a later raise advanced; no second consent, grant, or audit event is created. A different terms version or field set on an accepted invitation answers 409 state_conflict; changing the disclosed fields is a matter of the consent operations (TASK-064). Of two concurrent acceptances only one makes the transition.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the invitation (404 not_found, after any due expiry), the repeat on an accepted invitation (200), a terminal state or a passed deadline (409 state_conflict, whatever the versions), the versions (412), any other state that does not allow an acceptance (409 state_conflict), then the consent rules (400 with the pointer `/consent_c4/text_version` for a text version that is not the published one, or `/consent_c4/fields/0` for a field that the profile does not hold). The schema rejects a missing `terms_version`, an empty or repeated field list, an unknown field kind, `accepted` other than true, and unknown fields such as `email` or `phone`. The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/MyInvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationAcceptance
|
||||
examples:
|
||||
email_only:
|
||||
$ref: ../components/examples.yml#/InvitationAcceptEmailOnly
|
||||
stale_terms:
|
||||
$ref: ../components/examples.yml#/InvitationAcceptStaleTerms
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The accepted invitation with the contact grant, or the same
|
||||
invitation when this acceptance was already made.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitation
|
||||
examples:
|
||||
accepted:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationAccepted
|
||||
visibility_blocked:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationAcceptedVisibilityBlocked
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/InvitationAcceptValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,63 @@
|
||||
post:
|
||||
operationId: CancelMyInvitation
|
||||
summary: Cancel the participation in an invitation and revoke its contact grant.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The candidate comes from the session.
|
||||
|
||||
Moves an unfinished invitation to the terminal state `cancelled_by_candidate` (PRD FR12): `delivered`, `viewed`, `accepted`, and the planned stages up to `negotiation`. The process closes. In the same transaction the server revokes the contact grant that the acceptance of this invitation created, with the reason `participation_cancelled`, so the next contact read of the organization answers 404. Grants of other invitations or applications stay; revoking the consent C4 for the organization as a whole, which closes all of them, belongs to the consent operations (TASK-064).
|
||||
|
||||
Cancel differs from decline and withdraw: a decline is the structured answer before an acceptance and counts as a response; a cancellation leaves the process at any unfinished stage, mostly after an acceptance, and carries no reason; a withdrawal is the organization's command and keeps the grant. Before an answer the client offers the decline.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a cancellation of an invitation that is already `cancelled_by_candidate` answers 200 with it even with a new key or an older `expected_version`. A terminal state other than `cancelled_by_candidate` answers 409 state_conflict even with a stale `expected_version`; otherwise a stale `expected_version` answers 412 version_conflict. The deadline does not limit a cancellation.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the invitation (404 not_found, after any due expiry), the repeat on a cancelled invitation (200), a terminal state (409 state_conflict, whatever the version), then the version (412). The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/MyInvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationCommand
|
||||
examples:
|
||||
cancel:
|
||||
$ref: ../components/examples.yml#/InvitationCancelCommand
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The invitation in the state `cancelled_by_candidate` with its grant
|
||||
revoked.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitation
|
||||
examples:
|
||||
cancelled:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationCancelled
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,65 @@
|
||||
post:
|
||||
operationId: DeclineMyInvitation
|
||||
summary: Decline an invitation with a structured reason.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The candidate comes from the session.
|
||||
|
||||
Allowed in `delivered`, `viewed`, and the planned `counter`, before `response_deadline_at`. Moves the invitation to the terminal state `declined` with the reason and the optional comment; no consent and no access arise (PRD FR12). A timely decline counts as an answer for the responsiveness metrics, not as a consent or a hire. The reason is one of InvitationDeclineReason, including the neutral `other`; no reason requires a comment.
|
||||
|
||||
Visibility: the organization sees only the state `declined` and `responded_at`. It never sees the reason or the comment of an individual decline, because a reason such as `salary` would tell it that the hidden minimum is above the range. Reasons feed only aggregates with a minimum group size (planned); the comment is never shown to the organization, published, logged, or sent in a notification. The candidate reads both back in `decline`. A new invitation of the same organization to this candidate is possible only after the 30-day pause.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a decline of an invitation that is already `declined` with the same reason and comment answers 200 with it even with a new key or an older `expected_version`. A terminal state, another reason or comment on a declined invitation, and a command at the deadline or later answer 409 state_conflict even with a stale `expected_version`; otherwise a stale `expected_version` answers 412 version_conflict.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the invitation (404 not_found, after any due expiry), the repeat on a declined invitation (200), a terminal state or a passed deadline (409 state_conflict, whatever the version), the version (412), then any other state that does not allow a decline (409 state_conflict). The schema rejects an unknown reason, an empty comment or one of only white space, a comment over 500 characters, and unknown fields. The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/MyInvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationDeclineRequest
|
||||
examples:
|
||||
other_without_comment:
|
||||
$ref: ../components/examples.yml#/InvitationDeclineOther
|
||||
with_comment:
|
||||
$ref: ../components/examples.yml#/InvitationDeclineWithComment
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The declined invitation with the candidate's own reason, or the same
|
||||
invitation when this decline was already made.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitation
|
||||
examples:
|
||||
declined:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationDeclined
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,47 @@
|
||||
post:
|
||||
operationId: ViewMyInvitation
|
||||
summary: Record that the current candidate opened the terms of an invitation.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The candidate comes from the session. The request has no body.
|
||||
|
||||
The view transition of PRD FR12 (TASK-200) is an explicit command, so reading the invitation with GetMyInvitation stays free of side effects. The client sends it when the candidate opens the terms screen. For a `delivered` invitation the server moves it to `viewed`, sets `viewed_at`, advances `version`, and keeps the deadline. In any other state, including `viewed`, `accepted`, and the terminal states, it changes nothing and answers 200 with the current invitation. A view never reopens, extends, or answers an invitation, and the organization sees only the state `viewed` and `viewed_at`.
|
||||
|
||||
The command is idempotent by its effect: the first view wins and every repeat returns the current invitation. It therefore needs no Idempotency-Key and no `expected_version`: a view must never fail because the invitation changed after the client read it, for example after a salary raise. A view at the deadline or later first applies the due expiry and answers 200 with `expired`.
|
||||
|
||||
The general rate limit can answer 429 with Retry-After before any check.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a missing or wrong CSRF token or a disallowed Origin answers 403 csrf_check_failed; an employer account answers 403 forbidden; a draft, an invitation addressed to another candidate, and an unknown identifier all answer 404 not_found. An `invitation_id` that is not a UUID answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/MyInvitationId
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The invitation, now `viewed` when it was `delivered`, otherwise in
|
||||
its current state.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitation
|
||||
examples:
|
||||
viewed:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationViewed
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,37 @@
|
||||
get:
|
||||
operationId: ListMyInvitations
|
||||
summary: List the invitations addressed to the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. Returns a page of the candidate's inbox, newest first by delivery time with the identifier as the tie-breaker, with cursor pagination: every invitation that was delivered to this candidate, in any later state, including withdrawn and expired ones. Drafts and invitations addressed to other candidates are never listed.
|
||||
|
||||
A summary has the organization, the state, the versions, the role, the salary range, the work formats, and the deadline. Listing never records a view: the state `delivered` stays until ViewMyInvitation records that the candidate opened the terms. Responsiveness metrics of the organization and filters by state are planned and add fields or optional parameters.
|
||||
|
||||
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the invitations of the current candidate.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CandidateInvitationList
|
||||
examples:
|
||||
last_page:
|
||||
$ref: ../components/examples.yml#/CandidateInvitationListPage
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/Forbidden
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,106 @@
|
||||
get:
|
||||
operationId: GetOrganizationInvitation
|
||||
summary: Read an invitation 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 invitations.
|
||||
|
||||
Returns the invitation with the current terms version, the state, the deadline, the coarse salary indicator `salary_fit`, and `contact_access`. The candidate appears only as the opaque `candidate_handle`: before and after an acceptance this response never carries the candidate's name, email address, phone number, or other contact, the exact salary minimum, or the reason and comment of a decline. Contact values come only from GetOrganizationInvitationContacts while `contact_access.status` is `available`. Reading earlier terms versions is planned as a separate operation.
|
||||
|
||||
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 invitation, and an invitation of another organization all answer 404 not_found, so identifiers cannot be probed; a member whose role does not allow reading the invitation answers 403 forbidden. An `org_id` or `invitation_id` that is not a UUID answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
responses:
|
||||
"200":
|
||||
description: The invitation in its current state.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitation
|
||||
examples:
|
||||
draft:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationDraft
|
||||
delivered:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationDelivered
|
||||
accepted:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationAccepted
|
||||
"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: UpdateOrganizationInvitation
|
||||
summary: Change the terms, the need link, or the response period of a draft.
|
||||
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 body has no organization, membership, or role field. In the MVP only the owner of the organization changes drafts.
|
||||
|
||||
Only a `draft` can change; any other state answers 409 state_conflict. After sending, the only change of the terms is the one raise of the upper salary bound through RaiseOrganizationInvitationSalary. The candidate of a draft cannot change: a draft for another candidate is a new draft.
|
||||
|
||||
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. `terms` is always sent complete and replaces the terms as a whole, with the same validation as on creation, so a package condition is never dropped by omission. `need` sent as null unlinks the need.
|
||||
|
||||
Versions: every committed change creates version `expected_version + 1`; a change of the terms also creates the next terms version, an immutable snapshot, and a change of anything else keeps the terms version. `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 invitation again. The version travels in the body because the generated client cannot read the ETag response header yet. 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 invitation even when `expected_version` is older.
|
||||
|
||||
Salary limit: every change that can move `salary_fit` is an indicator-relevant setting: a change of either salary bound, of the tax basis, or of `work_formats`, because the indicator compares with the candidate's minimum for the offered formats, and switching formats or the basis would otherwise probe the minimum for free. Such a change counts against the limit shared by the organization with needs and other drafts, at most three settings a day, and against the withheld counter, which withholds `salary_fit` for seven days from the fifth setting within seven days (PRD FR13, planned in TASK-211; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and changes nothing. A change that keeps the range, the basis, and the formats does not count. The operation follows the convention of UpdateOrganizationNeed: no Idempotency-Key, and a body that changes nothing answers 200.
|
||||
|
||||
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 invitation (404 not_found), a body that changes nothing (200), the version (412), the state (409 state_conflict), domain rules (400 with the pointers of CreateOrganizationInvitation), then the salary limit (429).
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitationUpdate
|
||||
examples:
|
||||
change_terms:
|
||||
$ref: ../components/examples.yml#/InvitationUpdateTerms
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The draft after the change, or the current draft when the body
|
||||
changes nothing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitation
|
||||
examples:
|
||||
updated:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationDraftUpdated
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/InvitationValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/StateConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,43 @@
|
||||
get:
|
||||
operationId: GetOrganizationInvitationContacts
|
||||
summary: Read the contacts that the candidate disclosed to the organization.
|
||||
description: |-
|
||||
Requires the session cookie of an employer account with an active membership in `org_id`. In the MVP only the owner of the organization reads contacts (TASK-202); the other roles of PRD FR07 are planned.
|
||||
|
||||
This is the only operation that returns contact values, and its response is separate from the terms and from the invitation. It answers only while a grant created by the acceptance of this invitation is active and the read is allowed now: on every request the server checks the membership, the consent C4 for this organization, the grant and its fields, and the current visibility of the profile (C2 and the organizations the candidate hid the profile from), with no cache in between, so a revocation closes the next read at once. The response holds exactly the fields that the grant covers; every other field is null. A grant of organization A never answers for organization B.
|
||||
|
||||
Without such a grant the contacts do not exist for the caller, and the operation answers 404 not_found, the same as for an unknown invitation: before an acceptance, after a decline or an expiry, after the candidate revoked C4 or cancelled the participation, after the candidate closed the visibility, and while a grant created when the profile was not published or was hidden from the organization stays blocked. The answer does not tell which applies; `contact_access` of GetOrganizationInvitation tells the organization whether access is `not_granted`, `available`, or `closed`, without the reason, and the candidate sees `readable` and `blocked_by` on the grant. Withdrawing the invitation keeps an existing grant. A later publication of the profile never reopens a closed grant; only a new explicit C4 creates a new one.
|
||||
|
||||
Every successful read is recorded in the access audit (planned in TASK-090 and TASK-202), and the response has `Cache-Control: no-store`.
|
||||
|
||||
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 invitation, an invitation of another organization, and an invitation without an active readable grant all answer 404 not_found; a member whose role does not allow reading contacts answers 403 forbidden. An `org_id` or `invitation_id` that is not a UUID answers 400 validation_failed with the path pointer.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
responses:
|
||||
"200":
|
||||
description: The contacts that the active grant of this invitation covers.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/ContactDisclosure
|
||||
examples:
|
||||
email_only:
|
||||
$ref: ../components/examples.yml#/InvitationContactsEmailOnly
|
||||
"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
|
||||
@@ -0,0 +1,65 @@
|
||||
post:
|
||||
operationId: RaiseOrganizationInvitationSalary
|
||||
summary: Raise the upper salary bound of a sent invitation once.
|
||||
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. In the MVP only the owner of the organization changes invitations.
|
||||
|
||||
After sending, the salary base is fixed and the lower bound never decreases; the upper bound may be raised exactly once in the whole history of the invitation (PRD FR13). The body carries only the new `salary_to`, so the request cannot change the lower bound, the currency, the period, or the tax basis. The new bound must be above the current one and keep the width of the range from 10% to 40% of its midpoint, otherwise 400 validation_failed with the pointer `/salary_to`. The raise creates the next terms version with every other term unchanged and the next invitation version; the candidate sees the new terms, and an acceptance that names the previous terms version answers 412 version_conflict. The deadline does not change. The raise follows its own once-only rule and does not count against the organization-wide daily limit of three range settings, but it counts against the withheld counter of `salary_fit` (five settings within seven days), because it moves the upper bound that the indicator compares.
|
||||
|
||||
Allowed in `delivered`, `viewed`, and `accepted`, and in the planned states `counter`, `interview_scheduled`, `interviewed`, and `no_deal`, where FR13 lets a raise open an early repeated final. During `negotiation`, after `terms_agreed`, in a terminal state, in a `draft` (change the draft instead), and after the raise was used, the server answers 409 state_conflict. A raise after an acceptance changes neither the accepted terms version of the grant nor the grant.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a raise to the same `salary_to` that was already applied answers 200 with the current invitation even with a new key or an older `expected_version`.
|
||||
|
||||
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), the invitation (404 not_found, after any due expiry), the repeat of an applied raise (200), a terminal state (409 state_conflict, whatever the version), the version (412), any other state that does not allow a raise and the used raise (409 state_conflict), then the bound and the width (400). The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationSalaryRaise
|
||||
examples:
|
||||
raise:
|
||||
$ref: ../components/examples.yml#/InvitationSalaryRaiseCommand
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The invitation with the raised upper bound and the next terms
|
||||
version, or the current invitation when the same raise was already
|
||||
applied.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitation
|
||||
examples:
|
||||
raised:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationSalaryRaised
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,65 @@
|
||||
post:
|
||||
operationId: SendOrganizationInvitation
|
||||
summary: Send a draft to the candidate's inbox.
|
||||
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. In the MVP only the owner of the organization sends invitations.
|
||||
|
||||
Sends the current terms version of a `draft`. Sending is internal and never visible as a state: in one transaction the server records the delivery, creates the candidate's inbox entry, starts the deadline `response_deadline_at = delivered_at + response_period_days`, spends one invitation of the weekly organization quota, and writes the outbox event for the notification (TASK-199), then answers 200 with the state `delivered`. A successful answer therefore means the candidate can already read the invitation; an email is a separate notification that never blocks or delays it, and its retries never move the deadline. No contact of the candidate is disclosed by sending.
|
||||
|
||||
The server checks again that the candidate is still visible to the organization: a revoked publication C2 or a profile hidden from the organization answers 409 state_conflict without telling which. It also enforces the limits of the product policy: at most 20 invitations waiting for an answer per need (`delivered`, `viewed`, `counter`) and the 30-day pause for the pair of the organization and the candidate after a decline or a no deal, regardless of the member or the need, both with 409 state_conflict; and the rolling weekly quota of the organization (TASK-087), with 429 and Retry-After. The pending limit and the quota are planned in TASK-205 and TASK-087.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a send of an invitation that was already sent answers 200 with the invitation in its current state even with a new key or an older `expected_version`; the quota is spent once. A stale `expected_version` on a draft answers 412 version_conflict, so the organization never sends terms it did not read.
|
||||
|
||||
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), the invitation (404 not_found), the repeat of a completed send (200), the version (412), the state, the visibility of the candidate, the pending limit and the pause (409 state_conflict), then the quota (429). 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationCommand
|
||||
examples:
|
||||
send:
|
||||
$ref: ../components/examples.yml#/InvitationSendCommand
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The invitation in the candidate's inbox with the state `delivered`
|
||||
and its deadline, or the invitation in its current state when it was
|
||||
already sent.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitation
|
||||
examples:
|
||||
delivered:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationDelivered
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,62 @@
|
||||
post:
|
||||
operationId: WithdrawOrganizationInvitation
|
||||
summary: Withdraw an invitation.
|
||||
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. In the MVP only the owner of the organization withdraws invitations.
|
||||
|
||||
Moves an unfinished invitation to the terminal state `withdrawn` (PRD FR12): a `draft`, which the candidate never sees, a `delivered` or `viewed` invitation before the answer, an `accepted` one, and the planned stages up to `negotiation`. The process closes and no further transition happens in it. Withdrawing a delivered invitation frees its place in the pending limit of the need but never returns the weekly quota. Withdrawing never revokes the consent C4 or a grant that already exists: an accepted invitation keeps its `contact_access`, because only the candidate closes the access, by revoking C4, cancelling the participation, or closing the visibility.
|
||||
|
||||
`withdrawn` differs from `cancelled_by_candidate`: the organization withdraws, and the grant stays; the candidate cancels through CancelMyInvitation, and the grant of this invitation is revoked. A terminal invitation (`declined`, `expired`, `cancelled_by_candidate`) answers 409 state_conflict, even with a stale `expected_version`, so the organization sees the final state at once.
|
||||
|
||||
Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a withdrawal of an invitation that is already `withdrawn` answers 200 with it even with a new key or an older `expected_version`.
|
||||
|
||||
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), the invitation (404 not_found, after any due expiry), the repeat on a withdrawn invitation (200), a terminal state (409 state_conflict, whatever the version), then the version (412). The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/InvitationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/InvitationCommand
|
||||
examples:
|
||||
withdraw:
|
||||
$ref: ../components/examples.yml#/InvitationWithdrawCommand
|
||||
responses:
|
||||
"200":
|
||||
description: The invitation in the state `withdrawn`.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitation
|
||||
examples:
|
||||
withdrawn:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationWithdrawn
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"404":
|
||||
$ref: ../components/responses.yml#/NotFound
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/InvitationCommandConflict
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/InvitationVersionConflict
|
||||
"422":
|
||||
$ref: ../components/responses.yml#/UnprocessableContent
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,103 @@
|
||||
get:
|
||||
operationId: ListOrganizationInvitations
|
||||
summary: List the invitations 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 invitations, as with needs; the other roles of the PRD FR07 matrix are planned and change no field of this contract.
|
||||
|
||||
Returns a page of invitation summaries in every state, drafts included, newest first by creation time with the identifier as the tie-breaker, with cursor pagination. A summary names the candidate only by the opaque `candidate_handle` and has the state, the versions, the role, the salary range, the deadline, and the contact access without any contact value. A declined invitation shows the state `declined` without the reason or the comment. Filters by state and need are planned and add optional parameters.
|
||||
|
||||
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 invitations answers 403 forbidden. A malformed `org_id`, `limit`, or `cursor` answers 400 validation_failed.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the invitations of the organization.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitationList
|
||||
examples:
|
||||
last_page:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationListPage
|
||||
"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: CreateOrganizationInvitation
|
||||
summary: Create an invitation draft for one candidate.
|
||||
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 an invitation.
|
||||
|
||||
The draft is addressed to one person from a search result of this organization: `candidate_handle` is the opaque handle of that card, never an email address, a phone number, or an account identifier. The server resolves the handle for this organization only. An unknown handle, a handle of another organization, and a profile that the organization may no longer see, because the candidate revoked the publication C2 or hid the profile from it, all answer 400 with the pointer `/candidate_handle`, so a handle never reveals which case applies. `need` is optional: a direct invitation has none, and a need given must be a need of the organization with a `requirements_version` that it has had, otherwise 400 with the pointer `/need`. `response_period_days` is 3, 7, or 14 and defaults to 7.
|
||||
|
||||
The terms are complete from the start (PRD FR12): the role, the specialization and the grade, the offer type, the tasks, the team, the technology stack, the work formats and the place of work, the communication method, the salary range in RUB with its tax basis, and the package. Each package condition is either `provided` with a description or explicitly `not_provided`; leaving one out fails validation. A draft without the tax basis or the communication method therefore cannot exist. The draft is created as version 1 with terms version 1, and the candidate does not see it until SendOrganizationInvitation.
|
||||
|
||||
Salary: SalaryRange applies the same rules as for a need: whole rubles, positive multiples of 1000, `salary_from < salary_to`, and a width from 10% to 40% of the midpoint, checked by the server in integer arithmetic. The response carries `salary_fit`, the coarse indicator of PRD FR13 against the candidate's hidden minimum; the exact minimum appears in no response. The server never rejects a range because of the minimum, since a rejection would reveal it. Creating a draft is an indicator-relevant setting: it counts against the limit shared by the whole organization with the ranges of needs, at most three settings a day, and against the withheld counter, after five settings within seven days the indicator is `withheld` for seven days from the fifth, on every draft and invitation of the organization (PRD FR13, planned in TASK-211; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and creates nothing.
|
||||
|
||||
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 draft. A different body with the same key answers 422 idempotency_key_reused. 400 and 429 are never stored.
|
||||
|
||||
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: `/candidate_handle`, `/need`, `/terms/salary/salary_to` for a reversed range or a width outside 10-40%, `/terms/location` for the `office` or `hybrid` format without a place of work, or `/terms/tech_stack/1` for a repeated technology), then the salary limit (429). The schema already rejects a missing term or package condition, a salary bound that is not a positive multiple of 1000, an unknown currency, period, or tax basis, and unknown fields such as `state`, `version`, `salary_fit`, `candidate_email`, or `salary_minimum`. The general rate limit can answer 429 with Retry-After before any check.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- invitation
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/OrganizationId
|
||||
- $ref: ../components/parameters.yml#/IdempotencyKey
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/OrganizationInvitationCreate
|
||||
examples:
|
||||
valid_invitation:
|
||||
$ref: ../components/examples.yml#/InvitationCreateFromNeed
|
||||
responses:
|
||||
"201":
|
||||
description: >-
|
||||
The draft was created as version 1 with terms 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#/OrganizationInvitation
|
||||
examples:
|
||||
draft:
|
||||
$ref: ../components/examples.yml#/OrganizationInvitationDraft
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/InvitationValidationFailed
|
||||
"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
|
||||
@@ -49,9 +49,9 @@ post:
|
||||
| `anticheat_appeal` | candidate | required; `assessment_attempt` of the caller with an anti-cheat review decision | none |
|
||||
| `manual_assessment` | candidate | optional; a prior `assessment_attempt` of the caller in the same specialization | required `assessment_target` |
|
||||
|
||||
An organization is visible to a candidate when it sent the candidate an invitation or when the organization contract (TASK-077) shows the candidate its profile, and to an employer account when the account has an active membership in it. Invitations are not in the contract yet, so until they are, every `invitation` reference answers 404 not_found; anti-cheat review decisions are not either, so until TASK-173 every anti-cheat appeal answers 409 state_conflict. The schema rejects an object type that the case type does not accept, for example an organization in a grade appeal.
|
||||
An organization is visible to a candidate when it sent the candidate an invitation or when the organization contract (TASK-077) shows the candidate its profile, and to an employer account when the account has an active membership in it. Invitations are in the contract (TASK-196) but not implemented yet, so until they are, every `invitation` reference answers 404 not_found; anti-cheat review decisions are not either, so until TASK-173 every anti-cheat appeal answers 409 state_conflict. The schema rejects an object type that the case type does not accept, for example an organization in a grade appeal.
|
||||
|
||||
Ownership of the reference: the server checks the object against the session account on every create. An unknown object and an object of someone else, such as another candidate's attempt, another account's case, or an invitation addressed to another person, both answer 404 not_found, so a reference never reveals whether a foreign object exists. An own case that a grade appeal cannot dispute, because it is not a manual assessment, is not resolved yet, or was resolved with another outcome, answers 409 state_conflict. An identifier that is not a UUID fails validation with the whole-body pointer, because the decoder does not record the path inside the selected variant. The case stores only the type and the identifier of the object.
|
||||
Ownership of the reference: the server checks the object against the session account on every create. An unknown object and an object of someone else, such as another candidate's attempt, another account's case, or an invitation addressed to another person, both answer 404 not_found, so a reference never reveals whether a foreign object exists. An own case that a grade appeal cannot dispute, because it is not a manual assessment, is not resolved yet, or was resolved with another outcome, answers 409 state_conflict. An identifier that is not a UUID fails validation with the pointer `/object/id`. The case stores only the type and the identifier of the object.
|
||||
|
||||
Limits: an attempt and a resolved manual assessment each accept at most one grade appeal, and an attempt at most one anti-cheat appeal, in any status; a disagreement with the decision goes into a support case that references the appeal as `support_case`. A specialization accepts one open manual assessment, and an object accepts one open complaint; open means not `resolved` or `closed`. A second one answers 409 state_conflict. A grade appeal of an attempt that is still active also answers 409. Every create that passed authentication, validation, and the account scenario counts against a per-account limit from the product policy, including replays, 404, and 409, so the limit also bounds probing of references; over the limit the server answers 429 with Retry-After and creates nothing.
|
||||
|
||||
|
||||
Reference in new issue
Block a user