feat(visibility): add the candidate publication, hiding and search status contract
This commit is contained in:
1 parent
4436f626a3
commit
0529601021
87 files changed
+21456
-83
No files matched your search
+67
-1
@@ -534,7 +534,7 @@ The `consent` tag covers the consent ledger of the current account (PRD FR01, FR
|
||||
|
||||
- Purposes (`ConsentPurposeCode`): `c1` personal data processing, `c2` publication of the candidate card, `c3` automatic categorization, `c4` transfer of selected contacts to one organization, `c5` import of FSP results. `ConsentPurpose` stays the subset whose text is public before registration (`c1`), so `GetConsentText` does not widen.
|
||||
- The subject comes from the session; no parameter names an account, so the response holds only the caller's own records. A page lists records newest grant first with cursor pagination; the optional `state` filter takes `active`, `superseded`, or `revoked`, and an unknown value answers 400 with the pointer `/state`.
|
||||
- A `ConsentRecord` has the purpose, the accepted `text_version`, the `source` (`registration`, `consent_settings`, or `invitation_acceptance`), `granted_at`, the computed `state`, and `revoked_at` with `revocation_source` (`consent_settings` or `support_request`). A `c4` record also names the `organization` (`ConsentOrganization`, whose `name` is the snapshot the consent text showed, so a later rename does not change it), the contact `fields` (`ContactFieldKind`), the `invitation_id`, and the `invitation_terms_version`; they are null for every other purpose. A `c2` record proves the consent to the publication text; which fields were published, and when, is evidence of the publication history (TASK-088), and a field scope on `c2` records would be an additive change. The record never carries a contact value, the subject, or the text hash: the server stores the SHA-256 of exactly the text the subject saw, and the client never sends or receives it, as for C1 at registration.
|
||||
- A `ConsentRecord` has the purpose, the accepted `text_version`, the `source` (`registration`, `consent_settings`, or `invitation_acceptance`), `granted_at`, the computed `state`, and `revoked_at` with `revocation_source` (`consent_settings` or `support_request`). A `c4` record also names the `organization` (`ConsentOrganization`, whose `name` is the snapshot the consent text showed, so a later rename does not change it), the contact `fields` (`ContactFieldKind`), the `invitation_id`, and the `invitation_terms_version`; they are null for every other purpose. A `c2` record proves the consent to the publication text; which fields were published, and when, is evidence of the publication history ([Candidate visibility](#candidate-visibility), TASK-088), and a field scope on `c2` records would be an additive change. The record never carries a contact value, the subject, or the text hash: the server stores the SHA-256 of exactly the text the subject saw, and the client never sends or receives it, as for C1 at registration.
|
||||
- The ledger is append-only. A newer text version of a purpose is a new record and the earlier one becomes `superseded` without any change; a revocation stamps the unrevoked records of the purpose, and for `c4` of one organization, once; a later grant is a new record, and a revoked `c4` of an invitation never comes back. Purposes are independent.
|
||||
- Planned, additive: granting C1, C2, C3, and C5 in the consent settings (TASK-063) and revoking any purpose with its consequences (TASK-064), as new operations of this tag; C1 at registration and C4 in `AcceptMyInvitation` already have their own operations. The C4 permission to pass data on to an ATS and the C4 of an application (PRD Q9) are planned as an additive flag and an additional `source` value.
|
||||
|
||||
@@ -607,6 +607,72 @@ Planned, additive: member invitations, listing, role changes, and removal (TASK-
|
||||
|
||||
No new problem code is added: the contract reuses `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed`, `not_found`, `version_conflict`, `idempotency_in_progress`, `idempotency_key_reused`, and `rate_limited`. `TestOrganizationSchemaValidationPrecedesImplementation`, `TestOrganizationAccessBeforeImplementation`, `TestOrganizationDTOsCarryNoRoleOrVerificationInTheirRequests`, `TestOrganizationUpdateDecodingKeepsAbsentAndEmptyListsApart`, and `TestOrganizationContractFollowsThePRD` pin the generated server and the bundle, and `frontend/src/shared/api/organization-contract.test.ts` pins the generated Zod rules and, at the type level, the absence of role, owner, member, and verification fields in the requests.
|
||||
|
||||
### Candidate visibility
|
||||
|
||||
The tag `privacy` describes what organizations may see of the current candidate: the publication of the anonymous card, the search status, the organizations the candidate hides the profile from, a preview, and two histories (FR02 and FR12 in the PRD, TASK-088). The operations are in the contract but their business logic is not implemented, so each answers 401 `unauthenticated` while there are no sessions (`v1.DenyAllSecurity`), and 501 `not_implemented` after an accepted session and a valid request. The storage behind them exists (migration 00015, see [ARCHITECTURE.md](../docs/en/ARCHITECTURE.md#candidate-visibility)).
|
||||
|
||||
| Method and path | operationId | Protection | Success | Specific errors |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/me/privacy` | `GetMyPrivacySettings` | session | 200 `PrivacySettings`, `Cache-Control: no-store` | 401, 403 `forbidden` |
|
||||
| `PUT /api/v1/me/privacy/publication` | `SetMyPublication` | session and CSRF | 200 `Publication`, `Cache-Control: no-store` | 400, 401, 403 `csrf_check_failed` or `forbidden`, 409 `state_conflict`, 412 `version_conflict` |
|
||||
| `GET /api/v1/me/privacy/preview` | `GetMyCardPreview` | session | 200 `CardPreview`, `Cache-Control: no-store` | 401, 403 |
|
||||
| `PUT /api/v1/me/privacy/search-status` | `SetMySearchStatus` | session and CSRF | 200 `SearchStatus`, `Cache-Control: no-store` | 400, 401, 403, 412 |
|
||||
| `GET /api/v1/me/privacy/hidden-organizations` | `ListMyHiddenOrganizations` | session | 200 `HiddenOrganizationList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
| `PUT /api/v1/me/privacy/hidden-organizations/{org_id}` | `HideOrganization` | session and CSRF | 200 `HiddenOrganization`, `Cache-Control: no-store` | 400, 401, 403, 404 `not_found`, 409 `state_conflict`, 429 |
|
||||
| `DELETE /api/v1/me/privacy/hidden-organizations/{org_id}` | `UnhideOrganization` | session and CSRF | 204 | 400, 401, 403 |
|
||||
| `GET /api/v1/me/privacy/history` | `ListMyPrivacyHistory` | session | 200 `PrivacyEventList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
| `GET /api/v1/me/privacy/access-history` | `ListMyCardAccessHistory` | session | 200 `CardAccessList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
|
||||
Each operation also declares the problem response `default`. No new problem code is added: the contract uses `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed`, `not_found`, `state_conflict`, `version_conflict`, and `rate_limited`. An employer account answers 403 `forbidden` on all nine operations.
|
||||
|
||||
Closed by default and three independent settings:
|
||||
|
||||
- A profile is closed by default. A candidate who never published reads `publication.state` `closed`, `closed_reason` `never_published`, an empty field set, and version 0; saving the profile, filling in the questionnaire, or taking an assessment never publishes it. Every setting has its own `version` (0 is "never set"), its own operation, and its own `expected_version` in the body, so a change of one never makes another stale.
|
||||
- The publication and C2 are separate. The consent C2 stays in the consent ledger (`ListMyConsents`) and proves that the candidate accepted the publication text. `Publication` records which fields are published and when, and refers to the C2 record behind them (`consent_id`, the `id` of a `ConsentRecord` of the same account). It does not duplicate the consent: `state` is `published` only while that record is unrevoked, so a revocation of C2 closes the card at once, and `closed_reason` says `consent_revoked`. A new C2 grant never reopens it: the candidate publishes again and the new publication binds to the new record. The body of `SetMyPublication` names no consent: the server binds the current unrevoked C2 record of the account, and without one answers 409 `state_conflict` (the candidate gives C2 first; the grant operation is planned in the consent settings, TASK-063).
|
||||
- The search status is not a consent. `SearchStatus` and `SearchStatusUpdate` have no consent, publication, or organization property, no schema of one family reaches another (a test walks the references), and `SetMySearchStatus` changes nothing but the status. A candidate whose profile is closed who sets `looking` becomes visible to no one.
|
||||
- Hidden organizations are records of the candidate (`HiddenOrganization`: the organization with its current name and `hidden_at`). One record per candidate and organization, at most 1000 per candidate. An organization never reads them, never learns that it is hidden, and sees a hidden candidate exactly as it sees one who is not published. Hiding and lifting a hiding change neither C2, nor the publication, nor the search status.
|
||||
- Hiding is a PUT of a state, so it is idempotent and takes no Idempotency-Key: hiding an organization again answers 200 with the original record and writes no history. Lifting is a DELETE that answers 204 whether the organization was hidden or not.
|
||||
|
||||
The search status and its 30 days:
|
||||
|
||||
- `looking` ("Ищу") stores `confirmed_at` and `lapses_at`. The interval is not a constant of the contract or the code: it is `search_status.searching_confirmation_interval_days` of the effective `product` policy version (30 in the demo version 1), read when the status is confirmed. The stored row names the policy version it used and fixes `lapses_at`, so a later policy change moves no stored time. The owner changes the interval by publishing a new policy version.
|
||||
- After `lapses_at` the status holds as `not_looking` with `lapsed` true. The lapse is computed on every read and never written, so it needs no job and can only narrow: it never publishes, never unhides, and never changes C2 or the hidden organizations. The candidate confirms again with `SetMySearchStatus` and `looking`, which replaces `confirmed_at` and advances the version. A reminder before the lapse is a planned notification.
|
||||
- A lapsed status is never "more public": the non-public `not_looking` is the only state a lapse reaches. Whether `looking` gates the appearance of a published card in search results is a search contract decision (TASK-185), not decided here.
|
||||
|
||||
The anonymous card and the preview:
|
||||
|
||||
- `CardField` is a closed set of groups of card values that the candidate chooses to publish: `categories` (the categories confirmed by assessment results), `stack`, `experience` (total months), `soft_skills`, `location`, and `relocation`. The full name, any contact, and the lowest salary have no value, so no request can publish them; contacts reach an organization only through the contact grant of an accepted invitation (C4), and the lowest salary never does. A self-assessed grade is not a category and is never published. The server stores and answers the set in ascending order of the codes.
|
||||
- `AnonymousCardContent` is the card as an organization reads it: a closed object of the six properties above, each null when it is not published or has no value, so the card does not tell the two apart. It has no name, email, phone, Telegram name, employer, salary figure, or account or profile identifier, and no schema of the private profile, a contact, a consent, an invitation, or an organization is reachable from it (`TestAnonymousCardReachesNoProfileOrContactSchema` walks the references). `GetMyCardPreview` returns it with the published fields, or `card` null while the profile is closed, as a private read that creates no view and no history record. The card of an organization's search result (TASK-185) must reuse this content and cannot add a property that identifies the candidate.
|
||||
|
||||
Versions and checks:
|
||||
|
||||
- Both `PUT` operations of the settings follow the profile pattern: the complete new state in the body, `expected_version` in the body (the generated client cannot read the ETag yet), 412 `version_conflict` for a stale or non-existent version, and an unchanged body answers 200 with the current state even over a stale version, so no Idempotency-Key is needed. Order of checks: session (401), CSRF and Origin (403), request validation (400), account scenario (403), a version above the current one (412), an unchanged state (200), a stale version (412), then the C2 for a publication (409). A published state without a field and a closed state with a field answer 400 with the pointer `/fields`; the schema rejects an unknown or repeated card field and unknown properties such as a consent identifier or a confirmation time. `looking` always changes the stored confirmation, so it answers 412 for a stale version even as a repeat. The two 409 `state_conflict` answers are told apart by `errors`: `{in: body, pointer: /state, code: consent_required}` for a publication without an active C2, and `{in: path, pointer: /org_id, code: limit_reached}` for the 1001st hidden organization. A closing over a stored publication whose C2 was revoked is a real change (it stores the closing, records `publication_closed`, and revokes the grants); the C2 revocation path (TASK-064) closes the stored publication and revokes the grants in its own transaction. Publishing, hiding, and the history need a verified email (a usecase requirement). `Problem.errors` is not only for `validation_failed`: a `state_conflict` carries one entry as a disambiguator (`consent_required`, `limit_reached`), so a future problem writer must not strip `errors` from non-validation responses. Only values that the candidate confirmed reach the card, a free text value that looks like a contact (email, phone, URL, Telegram link, @handle) is dropped, and adding a card field is a contract change and a migration.
|
||||
- 404 and anti-enumeration. `HideOrganization` answers the same 404 `not_found`, with the same body and without a different timing, for an organization that does not exist and for one that the candidate cannot see, so it is not a way to ask whether an identifier belongs to an organization. The candidate can see an organization that has sent them an invitation, and the organizations that a candidate lookup lists (planned). The identifiers are random, and the general rate limit can answer 429 with Retry-After before any check. `UnhideOrganization` reveals nothing: 204 for any well-formed identifier. A malformed `org_id` answers 400 with the pointer `/org_id`.
|
||||
- Contact grants. Closing the publication, and hiding an organization that holds an active contact grant, revoke that grant with the reason `visibility_closed`, in the same transaction as the change (planned together with the operations; the reason is fixed in the invitation contract). Lifting a hiding or publishing again never reopens a grant. The search status never revokes a grant.
|
||||
|
||||
History:
|
||||
|
||||
- `ListMyPrivacyHistory` returns the append-only history of the settings, newest first (the history stores only the organization identifier, and the current name is resolved when it is read): `publication_opened`, `publication_changed` (with the published fields and the `consent_id` behind them), `publication_closed`, `search_status_confirmed`, `search_status_cleared`, `organization_hidden`, and `organization_unhidden` (with the organization's current name). This is the evidence of the published field set and its changes with their times that the C2 record does not carry. A revocation of C2 and a lapse are computed and are not events; the consent history shows the revocation. The history holds no profile value.
|
||||
- `ListMyCardAccessHistory` returns the accesses of organizations to the card: `card_viewed` and `contact_read`. A view by an organization that has no invitation relation with the candidate has `organization` null; a contact read always names the organization. The entries carry no query or ranking. Its storage comes with the search and contact-read tasks, so the operation is contract-only.
|
||||
|
||||
Open questions for the product owner and the lawyer:
|
||||
|
||||
- The search status values: the contract has `looking` and `not_looking`. Whether the PRD needs a third status such as "open to offers" is not decided; a value is an additive change.
|
||||
- Whether `looking` gates the appearance of a published card in search (an organization sees only candidates who are searching) or is only a label. This decides the meaning of a lapse for visibility and belongs to the search contract (TASK-185).
|
||||
- The set of card fields. The six values are a proposal that matches the profile; the PRD card (FR11) may add, split, or drop some, for example a generalized employer industry and size instead of employers, and each is an additive contract change.
|
||||
- Whether publishing needs a minimum: at least one confirmed category, or a saved profile. The contract only requires one card field and an active C2.
|
||||
- Whether narrowing the published fields, not only closing the publication or hiding an organization, must revoke the contact grants. The invitation contract says any visibility change after a grant revokes it; this contract revokes on closing and hiding only.
|
||||
- How a candidate finds an organization to hide before any invitation. The contract hides by identifier and answers 404 for an organization the candidate cannot see, so hiding the current employer in advance needs an organization lookup for candidates (by name or domain), which must itself be safe against enumeration (a minimum query length, a rate limit, public data only). Without it, hiding works only for organizations that have written to the candidate.
|
||||
- Whether the candidate should learn the name of an organization that viewed the card without an invitation (`CardAccess.organization`), and how long accesses are kept.
|
||||
- The limit of hidden organizations (1000 now) and the retention of the settings and their history together with the consent evidence (152-FZ, PRD 7.3). The history references the account with `ON DELETE CASCADE`, guarded by two triggers: UPDATE is always refused, and DELETE (and the deletion of the account) is refused while the account is verified, the same condition as the consent ledger; the unverified account cleanup removes the history of an account it deletes, and the account deletion procedure extends the condition.
|
||||
- Free text in the card (stack tags, soft skills, location) is guarded only by `CardTextLooksLikeContact`, which errs on the side of dropping (Socket.io is dropped, a bare obfuscation can still slip through); the residual risk is closed by TASK-089 with a closed taxonomy instead of free text.
|
||||
- Whether C2 is a consent to the distribution of personal data under article 10.1 of 152-FZ and needs its own field scope (see Consents); the history keeps the fields and times in the meantime.
|
||||
- Whether a new C2 text version requires the candidate to consent again for an existing publication. Now a publication stays effective while its C2 record is unrevoked, so a newer text version that the candidate has not accepted does not close it.
|
||||
- Quasi-identifiers and k-anonymity of the card: a rare combination of location, stack, and experience can identify a candidate even without a name. The generalization of rare features and a minimum group size are acceptance criteria of TASK-089, which builds the card; the contract here only fixes the closed set of fields, the confirmed-values-only rule, and the dropping of free text that looks like a contact.
|
||||
- Retention and the right to erasure for the settings history. The hide and unhide records are sensitive (they say which employer a candidate avoids). The history is kept like the consent evidence and is not deletable while the account is confirmed; whether a candidate can erase it, when, and how this meets the three-year consent retention (PRD 7.3) is an open legal question. The account deletion procedure extends the delete condition of the table.
|
||||
|
||||
No new problem code is added. `TestPrivacyOperationsFollowTheConventions`, `TestPublicationAndSearchStatusAreNotConsents`, `TestAnonymousCardReachesNoProfileOrContactSchema`, `TestGeneratedPrivacyDTOsCarryNoServerOwnedFields`, `TestPrivacySchemaValidationPrecedesImplementation`, and `TestPrivacyAccessBeforeImplementation` pin the generated server and the bundle, and `frontend/src/shared/api/privacy-contract.test.ts` pins the generated Zod rules, the absence of a consent, a time, a contact, or a salary in the request and card types, and the absence of settings in the organization, invitation, need, profile, and consent files.
|
||||
|
||||
### 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.
|
||||
|
||||
+67
-1
@@ -534,7 +534,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
- Цели (`ConsentPurposeCode`): `c1` - обработка персональных данных, `c2` - публикация карточки кандидата, `c3` - автоматическая категоризация, `c4` - передача выбранных контактов одной организации, `c5` - импорт результатов ФСП. `ConsentPurpose` остается подмножеством, текст которого доступен до регистрации (`c1`), поэтому `GetConsentText` не расширяется.
|
||||
- Субъект берется из сессии; ни один параметр не называет аккаунт, поэтому ответ содержит только собственные записи вызывающего. Страница перечисляет записи от новой выдачи к старой с курсорной пагинацией; необязательный фильтр `state` принимает `active`, `superseded` или `revoked`, а неизвестное значение отвечает 400 с указателем `/state`.
|
||||
- `ConsentRecord` содержит цель, принятую `text_version`, `source` (`registration`, `consent_settings` или `invitation_acceptance`), `granted_at`, вычисленное `state`, а также `revoked_at` и `revocation_source` (`consent_settings` или `support_request`). Запись `c4` дополнительно называет `organization` (`ConsentOrganization`, где `name` - снимок названия из текста согласия, поэтому последующее переименование его не меняет), поля контакта `fields` (`ContactFieldKind`), `invitation_id` и `invitation_terms_version`; для остальных целей они равны null. Запись `c2` доказывает согласие с текстом публикации; какие поля и когда опубликованы - доказательства истории публикации (TASK-088), а scope полей в записях `c2` был бы аддитивным изменением. Запись никогда не содержит значения контакта, субъекта или хэш текста: сервер хранит SHA-256 ровно того текста, который видел субъект, а клиент его не отправляет и не получает, как и для C1 при регистрации.
|
||||
- `ConsentRecord` содержит цель, принятую `text_version`, `source` (`registration`, `consent_settings` или `invitation_acceptance`), `granted_at`, вычисленное `state`, а также `revoked_at` и `revocation_source` (`consent_settings` или `support_request`). Запись `c4` дополнительно называет `organization` (`ConsentOrganization`, где `name` - снимок названия из текста согласия, поэтому последующее переименование его не меняет), поля контакта `fields` (`ContactFieldKind`), `invitation_id` и `invitation_terms_version`; для остальных целей они равны null. Запись `c2` доказывает согласие с текстом публикации; какие поля и когда опубликованы - доказательства истории публикации ([Видимость кандидата](#видимость-кандидата), TASK-088), а scope полей в записях `c2` был бы аддитивным изменением. Запись никогда не содержит значения контакта, субъекта или хэш текста: сервер хранит SHA-256 ровно того текста, который видел субъект, а клиент его не отправляет и не получает, как и для C1 при регистрации.
|
||||
- Журнал только дополняется. Новая версия текста цели - новая запись, а прежняя становится `superseded` без изменений; отзыв один раз ставит отметку на неотозванные записи цели, а для `c4` - одной организации; последующая выдача - новая запись, и отозванное `c4` приглашения не возвращается. Цели независимы.
|
||||
- Запланировано, аддитивно: выдача C1, C2, C3 и C5 в настройках согласий (TASK-063) и отзыв любой цели с последствиями (TASK-064) новыми операциями этого тега; у C1 при регистрации и C4 в `AcceptMyInvitation` уже есть свои операции. Разрешение C4 на передачу данных в ATS и C4 при отклике (Q9 в PRD) запланированы как аддитивный флаг и дополнительное значение `source`.
|
||||
|
||||
@@ -607,6 +607,72 @@ ML-сервис отвечает на ошибки той же схемой `Pro
|
||||
|
||||
Новый код problem не добавляется: контракт использует `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed`, `not_found`, `version_conflict`, `idempotency_in_progress`, `idempotency_key_reused` и `rate_limited`. `TestOrganizationSchemaValidationPrecedesImplementation`, `TestOrganizationAccessBeforeImplementation`, `TestOrganizationDTOsCarryNoRoleOrVerificationInTheirRequests`, `TestOrganizationUpdateDecodingKeepsAbsentAndEmptyListsApart` и `TestOrganizationContractFollowsThePRD` закрепляют сгенерированный сервер и бандл, а `frontend/src/shared/api/organization-contract.test.ts` - сгенерированные правила Zod и, на уровне типов, отсутствие полей роли, владельца, участников и уровня проверки в запросах.
|
||||
|
||||
### Видимость кандидата
|
||||
|
||||
Тег `privacy` описывает, что организации могут видеть о текущем кандидате: публикацию анонимной карточки, статус поиска, организации, от которых кандидат скрывает профиль, предпросмотр и две истории (FR02 и FR12 в PRD, TASK-088). Операции есть в контракте, но их бизнес-логика еще не реализована, поэтому каждая отвечает 401 `unauthenticated`, пока сессий нет (`v1.DenyAllSecurity`), а после принятой сессии и валидного запроса - 501 `not_implemented`. Хранение за ними уже есть (миграция 00015, см. [ARCHITECTURE.md](../docs/ru/ARCHITECTURE.md#видимость-кандидата)).
|
||||
|
||||
| Метод и путь | operationId | Защита | Успех | Конкретные ошибки |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `GET /api/v1/me/privacy` | `GetMyPrivacySettings` | сессия | 200 `PrivacySettings`, `Cache-Control: no-store` | 401, 403 `forbidden` |
|
||||
| `PUT /api/v1/me/privacy/publication` | `SetMyPublication` | сессия и CSRF | 200 `Publication`, `Cache-Control: no-store` | 400, 401, 403 `csrf_check_failed` или `forbidden`, 409 `state_conflict`, 412 `version_conflict` |
|
||||
| `GET /api/v1/me/privacy/preview` | `GetMyCardPreview` | сессия | 200 `CardPreview`, `Cache-Control: no-store` | 401, 403 |
|
||||
| `PUT /api/v1/me/privacy/search-status` | `SetMySearchStatus` | сессия и CSRF | 200 `SearchStatus`, `Cache-Control: no-store` | 400, 401, 403, 412 |
|
||||
| `GET /api/v1/me/privacy/hidden-organizations` | `ListMyHiddenOrganizations` | сессия | 200 `HiddenOrganizationList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
| `PUT /api/v1/me/privacy/hidden-organizations/{org_id}` | `HideOrganization` | сессия и CSRF | 200 `HiddenOrganization`, `Cache-Control: no-store` | 400, 401, 403, 404 `not_found`, 409 `state_conflict`, 429 |
|
||||
| `DELETE /api/v1/me/privacy/hidden-organizations/{org_id}` | `UnhideOrganization` | сессия и CSRF | 204 | 400, 401, 403 |
|
||||
| `GET /api/v1/me/privacy/history` | `ListMyPrivacyHistory` | сессия | 200 `PrivacyEventList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
| `GET /api/v1/me/privacy/access-history` | `ListMyCardAccessHistory` | сессия | 200 `CardAccessList`, `Cache-Control: no-store` | 400, 401, 403 |
|
||||
|
||||
Каждая операция также объявляет problem-ответ `default`. Новый код problem не добавляется: контракт использует `validation_failed`, `unauthenticated`, `forbidden`, `csrf_check_failed`, `not_found`, `state_conflict`, `version_conflict` и `rate_limited`. Аккаунт работодателя получает 403 `forbidden` на всех девяти операциях.
|
||||
|
||||
Закрыто по умолчанию и три независимые настройки:
|
||||
|
||||
- Профиль закрыт по умолчанию. Кандидат, который никогда не публиковал, читает `publication.state` `closed`, `closed_reason` `never_published`, пустой набор полей и версию 0; сохранение профиля, заполнение анкеты и оценка его не публикуют. У каждой настройки своя `version` (0 - "никогда не задавалась"), своя операция и свой `expected_version` в теле, поэтому изменение одной никогда не делает устаревшей другую.
|
||||
- Публикация и C2 разделены. Согласие C2 остается в журнале согласий (`ListMyConsents`) и доказывает, что кандидат принял текст публикации. `Publication` хранит, какие поля опубликованы и когда, и ссылается на запись C2 за ними (`consent_id` - `id` записи `ConsentRecord` того же аккаунта). Она не дублирует согласие: `state` равен `published`, только пока эта запись не отозвана, поэтому отзыв C2 закрывает карточку сразу, а `closed_reason` показывает `consent_revoked`. Новая выдача C2 карточку не открывает: кандидат публикует заново, и новая публикация привязывается к новой записи. Тело `SetMyPublication` не называет согласие: сервер привязывает текущую неотозванную запись C2 аккаунта, а без нее отвечает 409 `state_conflict` (кандидат сначала дает C2; операция выдачи запланирована в настройках согласий, TASK-063).
|
||||
- Статус поиска - не согласие. В `SearchStatus` и `SearchStatusUpdate` нет свойств согласия, публикации или организации, схемы одного семейства не достигают другого (тест обходит ссылки), а `SetMySearchStatus` не меняет ничего, кроме статуса. Кандидат с закрытым профилем, который задал `looking`, не становится видимым никому.
|
||||
- Скрытые организации - записи кандидата (`HiddenOrganization`: организация с ее текущим названием и `hidden_at`). Одна запись на кандидата и организацию, не более 1000 на кандидата. Организация их не читает, не узнает, что скрыта, и видит скрывшего кандидата так же, как неопубликованного. Скрытие и его снятие не меняют ни C2, ни публикацию, ни статус поиска.
|
||||
- Скрытие - это PUT состояния, поэтому оно идемпотентно и не требует Idempotency-Key: повторное скрытие отвечает 200 с исходной записью и не пишет историю. Снятие - DELETE, который отвечает 204, была организация скрыта или нет.
|
||||
|
||||
Статус поиска и его 30 дней:
|
||||
|
||||
- `looking` ("Ищу") хранит `confirmed_at` и `lapses_at`. Срок - не константа контракта или кода: это `search_status.searching_confirmation_interval_days` действующей версии политики `product` (в демо-версии 1 - 30), прочитанное при подтверждении статуса. Строка называет версию политики, которой воспользовалась, и фиксирует `lapses_at`, поэтому последующее изменение политики не сдвигает сохраненные времена. Владелец меняет срок публикацией новой версии политики.
|
||||
- После `lapses_at` статус действует как `not_looking` с `lapsed` true. Истечение вычисляется при каждом чтении и нигде не записывается, поэтому не требует задачи и может только сужать: оно никогда не публикует, не снимает скрытие и не меняет C2 или скрытые организации. Кандидат подтверждает снова через `SetMySearchStatus` со значением `looking`, которое заменяет `confirmed_at` и увеличивает версию. Напоминание до истечения - запланированное уведомление.
|
||||
- Истекший статус никогда не становится "более публичным": единственное состояние, до которого доходит истечение, - непубличное `not_looking`. Влияет ли `looking` на появление опубликованной карточки в выдаче поиска - решение контракта поиска (TASK-185), здесь не принято.
|
||||
|
||||
Анонимная карточка и предпросмотр:
|
||||
|
||||
- `CardField` - закрытый набор групп значений карточки, которые кандидат выбирает публиковать: `categories` (категории, подтвержденные результатами оценки), `stack`, `experience` (суммарно в месяцах), `soft_skills`, `location` и `relocation`. У полного имени, любого контакта и минимальной зарплаты значения нет, поэтому ни один запрос не может их опубликовать; контакты доходят до организации только через контактное разрешение принятого приглашения (C4), а минимальная зарплата не доходит никогда. Самооценка грейда не категория и никогда не публикуется. Сервер хранит и отдает набор в порядке возрастания кодов.
|
||||
- `AnonymousCardContent` - карточка так, как ее читает организация: закрытый объект из шести свойств выше, каждое равно null, если не опубликовано или значения нет, поэтому карточка не различает эти случаи. В ней нет имени, email, телефона, имени в Telegram, работодателя, суммы зарплаты, идентификатора аккаунта или профиля, и из нее недостижима ни одна схема приватного профиля, контакта, согласия, приглашения или организации (`TestAnonymousCardReachesNoProfileOrContactSchema` обходит ссылки). `GetMyCardPreview` возвращает ее с опубликованными полями или `card` null, пока профиль закрыт, как приватное чтение, которое не создает просмотра и записи в истории. Карточка результата поиска организации (TASK-185) должна использовать это содержимое и не вправе добавлять свойство, идентифицирующее кандидата.
|
||||
|
||||
Версии и проверки:
|
||||
|
||||
- Обе операции `PUT` настроек следуют образцу профиля: полное новое состояние в теле, `expected_version` в теле (сгенерированный клиент пока не читает ETag), 412 `version_conflict` для устаревшей или несуществующей версии, а тело без изменений отвечает 200 с текущим состоянием даже при устаревшей версии, поэтому Idempotency-Key не нужен. Порядок проверок: сессия (401), CSRF и Origin (403), валидация запроса (400), сценарий аккаунта (403), версия выше текущей (412), неизмененное состояние (200), устаревшая версия (412), затем C2 для публикации (409). Состояние `published` без поля и `closed` с полем отвечают 400 с указателем `/fields`; схема отклоняет неизвестное или повторное поле карточки и неизвестные свойства, например идентификатор согласия или время подтверждения. `looking` всегда меняет сохраненное подтверждение, поэтому при устаревшей версии отвечает 412 даже как повтор. Два вида 409 `state_conflict` различаются через `errors`: `{in: body, pointer: /state, code: consent_required}` для публикации без действующей C2 и `{in: path, pointer: /org_id, code: limit_reached}` для 1001-й скрытой организации. Закрытие поверх сохраненной публикации с отозванной C2 - настоящее изменение (сохраняет закрытие, пишет `publication_closed` и отзывает разрешения); путь отзыва C2 (TASK-064) сам закрывает сохраненную публикацию и отзывает разрешения в своей транзакции. Публикации, скрытию и истории нужен подтвержденный email (требование юзкейса). `Problem.errors` не только для `validation_failed`: `state_conflict` несет одну запись как уточнение (`consent_required`, `limit_reached`), поэтому будущий писатель problem не должен вырезать `errors` из ответов, не связанных с валидацией. В карточку попадают только подтвержденные значения, свободный текст, похожий на контакт (email, телефон, URL, ссылка Telegram, @handle), отбрасывается, а новое поле карточки - это изменение контракта и миграция.
|
||||
- 404 и защита от перебора. `HideOrganization` отвечает одинаковым 404 `not_found`, с тем же телом и без другого времени ответа, и для несуществующей организации, и для той, которую кандидат не видит, поэтому операция не позволяет спросить, принадлежит ли идентификатор организации. Кандидат видит организацию, приславшую ему приглашение, и организации, которые покажет поиск организаций для кандидата (запланирован). Идентификаторы случайные, а общий лимит запросов может ответить 429 с Retry-After до любой проверки. `UnhideOrganization` ничего не раскрывает: 204 на любой корректный идентификатор. Некорректный `org_id` отвечает 400 с указателем `/org_id`.
|
||||
- Контактные разрешения. Закрытие публикации и скрытие организации, у которой есть активное контактное разрешение, отзывают его с причиной `visibility_closed` в той же транзакции, что и изменение (запланировано вместе с операциями; причину задает контракт приглашений). Снятие скрытия и повторная публикация разрешение не возвращают. Статус поиска разрешение никогда не отзывает.
|
||||
|
||||
История:
|
||||
|
||||
- `ListMyPrivacyHistory` возвращает журнал изменений настроек только для добавления, от новых к старым (история хранит только идентификатор организации, а текущее название определяется при чтении): `publication_opened`, `publication_changed` (с опубликованными полями и `consent_id` за ними), `publication_closed`, `search_status_confirmed`, `search_status_cleared`, `organization_hidden` и `organization_unhidden` (с текущим названием организации). Это доказательство набора опубликованных полей и его изменений со временем, которого нет в записи C2. Отзыв C2 и истечение статуса вычисляются и событиями не являются; отзыв показывает история согласий. Значений профиля в истории нет.
|
||||
- `ListMyCardAccessHistory` возвращает обращения организаций к карточке: `card_viewed` и `contact_read`. У просмотра организацией, не связанной с кандидатом приглашением, `organization` равно null; чтение контактов всегда называет организацию. Записи не несут запроса или ранга. Хранение для них придет с задачами поиска и чтения контактов, поэтому операция только в контракте.
|
||||
|
||||
Открытые вопросы к владельцу продукта и юристу:
|
||||
|
||||
- Значения статуса поиска: в контракте `looking` и `not_looking`. Нужен ли по PRD третий статус, например "открыт к предложениям", не решено; значение - аддитивное изменение.
|
||||
- Влияет ли `looking` на появление опубликованной карточки в поиске (организация видит только ищущих) или это только метка. Это определяет смысл истечения для видимости и относится к контракту поиска (TASK-185).
|
||||
- Набор полей карточки. Шесть значений - предложение, согласованное с профилем; карточка в PRD (FR11) может добавить, разделить или убрать часть, например обобщенную отрасль и размер работодателя вместо работодателей, и каждое изменение аддитивно для контракта.
|
||||
- Нужен ли для публикации минимум: хотя бы одна подтвержденная категория или сохраненный профиль. Контракт требует только одно поле карточки и действующую C2.
|
||||
- Должно ли сужение опубликованных полей, а не только закрытие публикации или скрытие организации, отзывать контактные разрешения. Контракт приглашений говорит, что любое изменение видимости после разрешения его отзывает; этот контракт отзывает только при закрытии и скрытии.
|
||||
- Как кандидат находит организацию, чтобы скрыть ее до любого приглашения. Контракт скрывает по идентификатору и отвечает 404 на организацию, которую кандидат не видит, поэтому заранее скрыть текущего работодателя можно только при поиске организаций для кандидата (по названию или домену), который сам должен быть защищен от перебора (минимальная длина запроса, лимит, только публичные данные). Без него скрытие работает только для организаций, которые уже написали кандидату.
|
||||
- Должен ли кандидат узнавать название организации, которая смотрела карточку без приглашения (`CardAccess.organization`), и сколько хранятся обращения.
|
||||
- Предел скрытых организаций (сейчас 1000) и срок хранения настроек и их истории вместе с доказательствами согласий (152-ФЗ, PRD 7.3). История ссылается на аккаунт с `ON DELETE CASCADE` под защитой двух триггеров: UPDATE запрещен всегда, а DELETE (и удаление аккаунта) запрещен, пока аккаунт подтвержден, как у журнала согласий; очистка неподтвержденных аккаунтов удаляет историю удаляемого аккаунта, а процедура удаления аккаунта расширит условие.
|
||||
- Свободный текст в карточке (теги стека, софт-скиллы, место) защищает только `CardTextLooksLikeContact`, который ошибается в сторону отбрасывания (Socket.io отбрасывается, а простая обфускация все же может пройти); остаточный риск закрывает TASK-089 закрытой таксономией вместо свободного текста.
|
||||
- Является ли C2 согласием на распространение персональных данных по статье 10.1 152-ФЗ и нужна ли ей собственная область полей (см. Согласия); пока поля и времена хранит история.
|
||||
- Требует ли новая версия текста C2 повторного согласия кандидата для уже существующей публикации. Сейчас публикация действует, пока ее запись C2 не отозвана, поэтому более новая версия текста, которую кандидат не принимал, ее не закрывает.
|
||||
- Квазиидентификаторы и k-анонимность карточки: редкое сочетание места, стека и опыта может идентифицировать кандидата и без имени. Обобщение редких признаков и минимальный размер группы - критерии приемки TASK-089, который строит карточку; здесь контракт фиксирует только закрытый набор полей, правило "только подтвержденные значения" и отбрасывание свободного текста, похожего на контакт.
|
||||
- Хранение и право на удаление истории настроек. Записи о скрытии и снятии скрытия чувствительны (они говорят, каких работодателей кандидат избегает). История хранится как доказательства согласий и не удаляется, пока аккаунт подтвержден; может ли кандидат стереть ее, когда и как это согласуется с трехлетним хранением согласий (PRD 7.3) - открытый юридический вопрос. Процедура удаления аккаунта расширит условие удаления таблицы.
|
||||
|
||||
Новый код problem не добавляется. `TestPrivacyOperationsFollowTheConventions`, `TestPublicationAndSearchStatusAreNotConsents`, `TestAnonymousCardReachesNoProfileOrContactSchema`, `TestGeneratedPrivacyDTOsCarryNoServerOwnedFields`, `TestPrivacySchemaValidationPrecedesImplementation` и `TestPrivacyAccessBeforeImplementation` закрепляют сгенерированный сервер и бандл, а `frontend/src/shared/api/privacy-contract.test.ts` - сгенерированные правила Zod, отсутствие согласия, времени, контакта и зарплаты в типах запросов и карточки и отсутствие настроек в файлах организации, приглашения, потребности, профиля и согласий.
|
||||
|
||||
### Проверки генераторов
|
||||
|
||||
`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.
|
||||
|
||||
@@ -4056,3 +4056,230 @@ ProfileStaleVersion:
|
||||
code: version_conflict
|
||||
detail: The resource changed after it was read. Read it again before retrying.
|
||||
trace_id: 9a0b1c2d-3e4f-4a5b-9c7d-8e9f0a1b2c34
|
||||
PrivacyPublishedWithoutFields:
|
||||
summary: A publication without any field
|
||||
value:
|
||||
type: urn:lincodex:problem:validation_failed
|
||||
title: Request validation failed
|
||||
status: 400
|
||||
code: validation_failed
|
||||
detail: One or more request fields are invalid.
|
||||
trace_id: 3b4c5d6e-7f80-4a91-8b2c-3d4e5f6a7b8c
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /fields
|
||||
code: invalid
|
||||
message: A published profile needs at least one field, and a closed one none.
|
||||
NewCandidatePrivacySettings:
|
||||
summary: A new candidate with the profile closed
|
||||
description: Nothing was ever published, announced, or hidden. Every version is 0.
|
||||
value:
|
||||
publication:
|
||||
state: closed
|
||||
closed_reason: never_published
|
||||
fields: []
|
||||
consent_id: null
|
||||
published_at: null
|
||||
version: 0
|
||||
search_status:
|
||||
value: not_looking
|
||||
lapsed: false
|
||||
confirmed_at: null
|
||||
lapses_at: null
|
||||
version: 0
|
||||
hidden_organizations_total: 0
|
||||
PublishedCandidatePrivacySettings:
|
||||
summary: A published profile with a confirmed search status
|
||||
value:
|
||||
publication:
|
||||
state: published
|
||||
closed_reason: null
|
||||
fields:
|
||||
- categories
|
||||
- stack
|
||||
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
|
||||
published_at: "2026-10-06T09:10:00Z"
|
||||
version: 1
|
||||
search_status:
|
||||
value: looking
|
||||
lapsed: false
|
||||
confirmed_at: "2026-10-06T09:12:00Z"
|
||||
lapses_at: "2026-11-05T09:12:00Z"
|
||||
version: 1
|
||||
hidden_organizations_total: 1
|
||||
PublicationUpdatePublish:
|
||||
summary: Publish the confirmed categories and the stack
|
||||
value:
|
||||
expected_version: 0
|
||||
state: published
|
||||
fields:
|
||||
- categories
|
||||
- stack
|
||||
PublicationUpdateClose:
|
||||
summary: Close the publication
|
||||
value:
|
||||
expected_version: 1
|
||||
state: closed
|
||||
fields: []
|
||||
PublishedPublication:
|
||||
summary: The publication after the first publish
|
||||
value:
|
||||
state: published
|
||||
closed_reason: null
|
||||
fields:
|
||||
- categories
|
||||
- stack
|
||||
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
|
||||
published_at: "2026-10-06T09:10:00Z"
|
||||
version: 1
|
||||
SearchStatusUpdateLooking:
|
||||
summary: Set or confirm the status looking
|
||||
value:
|
||||
expected_version: 0
|
||||
value: looking
|
||||
LookingSearchStatus:
|
||||
summary: A confirmed status that lapses after the policy interval
|
||||
value:
|
||||
value: looking
|
||||
lapsed: false
|
||||
confirmed_at: "2026-10-06T09:12:00Z"
|
||||
lapses_at: "2026-11-05T09:12:00Z"
|
||||
version: 1
|
||||
LapsedSearchStatus:
|
||||
summary: A status that was not confirmed in time
|
||||
description: The candidate set looking and did not confirm it again, so it holds as not_looking. Nothing else changed; the publication and the hidden organizations are as they were.
|
||||
value:
|
||||
value: not_looking
|
||||
lapsed: true
|
||||
confirmed_at: "2026-10-06T09:12:00Z"
|
||||
lapses_at: "2026-11-05T09:12:00Z"
|
||||
version: 1
|
||||
HiddenOrganizationRecord:
|
||||
summary: An organization that the candidate hides the profile from
|
||||
value:
|
||||
organization:
|
||||
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
name: ООО Пример Платежи
|
||||
hidden_at: "2026-10-06T09:20:00Z"
|
||||
HiddenOrganizationListPage:
|
||||
summary: One hidden organization
|
||||
value:
|
||||
items:
|
||||
- organization:
|
||||
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
name: ООО Пример Платежи
|
||||
hidden_at: "2026-10-06T09:20:00Z"
|
||||
page:
|
||||
has_more: false
|
||||
next_cursor: null
|
||||
PublishedCardPreview:
|
||||
summary: The card of a published profile with two fields
|
||||
description: The fields that are not published are null. The card carries no name and no contact.
|
||||
value:
|
||||
state: published
|
||||
fields:
|
||||
- categories
|
||||
- stack
|
||||
card:
|
||||
categories:
|
||||
- specialization: backend
|
||||
grade: middle
|
||||
stack:
|
||||
- PostgreSQL
|
||||
- Kafka
|
||||
experience_months: null
|
||||
soft_skills: null
|
||||
location: null
|
||||
relocation: null
|
||||
generated_at: "2026-10-06T09:30:00Z"
|
||||
ClosedCardPreview:
|
||||
summary: The preview of a closed profile
|
||||
value:
|
||||
state: closed
|
||||
fields: []
|
||||
card: null
|
||||
generated_at: "2026-10-06T09:30:00Z"
|
||||
PrivacyEventListPage:
|
||||
summary: A publication, a hiding, and a confirmed status
|
||||
value:
|
||||
items:
|
||||
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9f01
|
||||
kind: organization_hidden
|
||||
occurred_at: "2026-10-06T09:20:00Z"
|
||||
fields: null
|
||||
consent_id: null
|
||||
organization:
|
||||
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
name: ООО Пример Платежи
|
||||
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9e02
|
||||
kind: search_status_confirmed
|
||||
occurred_at: "2026-10-06T09:12:00Z"
|
||||
fields: null
|
||||
consent_id: null
|
||||
organization: null
|
||||
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9e01
|
||||
kind: publication_opened
|
||||
occurred_at: "2026-10-06T09:10:00Z"
|
||||
fields:
|
||||
- categories
|
||||
- stack
|
||||
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
|
||||
organization: null
|
||||
page:
|
||||
has_more: false
|
||||
next_cursor: null
|
||||
CardAccessListPage:
|
||||
summary: An anonymous view and a contact read
|
||||
value:
|
||||
items:
|
||||
- id: 01928f7a-c1d2-7e3f-8a4b-5c6d7e8f9a02
|
||||
kind: contact_read
|
||||
occurred_at: "2026-10-07T08:00:00Z"
|
||||
organization:
|
||||
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
name: ООО Пример Платежи
|
||||
- id: 01928f7a-c1d2-7e3f-8a4b-5c6d7e8f9a01
|
||||
kind: card_viewed
|
||||
occurred_at: "2026-10-06T12:00:00Z"
|
||||
organization: null
|
||||
page:
|
||||
has_more: false
|
||||
next_cursor: null
|
||||
PrivacyStaleVersion:
|
||||
summary: The change carried a stale expected_version
|
||||
description: The setting changed, for example in another tab, after the client read it. Nothing was changed; the client reads the settings again and reapplies its edit.
|
||||
value:
|
||||
type: urn:lincodex:problem:version_conflict
|
||||
title: Resource version conflict
|
||||
status: 412
|
||||
code: version_conflict
|
||||
detail: The resource changed after it was read. Read it again before retrying.
|
||||
trace_id: 4c5d6e7f-8091-4ba2-9c3d-4e5f6a7b8c9d
|
||||
PublicationConsentRequiredConflict:
|
||||
summary: Publishing without an active C2 consent
|
||||
value:
|
||||
type: urn:lincodex:problem:state_conflict
|
||||
title: Resource state conflict
|
||||
status: 409
|
||||
code: state_conflict
|
||||
detail: The resource is in a state that does not allow this operation.
|
||||
trace_id: 5d6e7f80-91a2-4cb3-8d4e-5f6a7b8c9d0e
|
||||
errors:
|
||||
- in: body
|
||||
pointer: /state
|
||||
code: consent_required
|
||||
message: Publishing needs an active C2 consent of the account.
|
||||
HiddenOrganizationLimitReached:
|
||||
summary: The candidate hides the maximum number of organizations
|
||||
value:
|
||||
type: urn:lincodex:problem:state_conflict
|
||||
title: Resource state conflict
|
||||
status: 409
|
||||
code: state_conflict
|
||||
detail: The resource is in a state that does not allow this operation.
|
||||
trace_id: 6e7f8091-a2b3-4dc4-9e5f-6a7b8c9d0e1f
|
||||
errors:
|
||||
- in: path
|
||||
pointer: /org_id
|
||||
code: limit_reached
|
||||
message: The candidate already hides the maximum number of organizations.
|
||||
@@ -129,3 +129,19 @@ MyInvitationId:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e6f
|
||||
HiddenOrganizationId:
|
||||
name: org_id
|
||||
in: path
|
||||
required: true
|
||||
description: >-
|
||||
Identifier of the organization that the current candidate hides or stops
|
||||
hiding the profile from. It names the target of a candidate's own
|
||||
setting and grants the candidate nothing about the organization. Hiding
|
||||
answers the same 404 not_found for an organization that does not exist
|
||||
and for one that the candidate cannot see, so organizations cannot be
|
||||
enumerated; lifting the hiding answers 204 for any well-formed
|
||||
identifier.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
|
||||
@@ -624,3 +624,55 @@ ProfileVersionConflict:
|
||||
examples:
|
||||
version_conflict:
|
||||
$ref: ./examples.yml#/ProfileStaleVersion
|
||||
PrivacyValidationFailed:
|
||||
description: >-
|
||||
The body does not match the contract or breaks a visibility rule: an
|
||||
unknown field, a repeated or unknown card field, a published state with
|
||||
no field, a closed state with a field, a search status other than
|
||||
looking and not_looking, or a missing or invalid expected_version; code
|
||||
validation_failed with body pointers. Nothing was changed. The problem
|
||||
never repeats a submitted value.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
published_without_fields:
|
||||
$ref: ./examples.yml#/PrivacyPublishedWithoutFields
|
||||
PrivacyVersionConflict:
|
||||
description: >-
|
||||
`expected_version` is not the current version of the setting; code
|
||||
version_conflict. Nothing was changed; read the settings again before
|
||||
retrying.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
version_conflict:
|
||||
$ref: ./examples.yml#/PrivacyStaleVersion
|
||||
PublicationConsentRequired:
|
||||
description: >-
|
||||
The profile cannot be published because the account has no active,
|
||||
unrevoked C2 consent; code state_conflict. Nothing was changed. The
|
||||
candidate gives C2 in the consent settings first. `errors` holds the entry
|
||||
`{in: body, pointer: /state, code: consent_required}`.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
state_conflict:
|
||||
$ref: ./examples.yml#/PublicationConsentRequiredConflict
|
||||
HiddenOrganizationLimit:
|
||||
description: >-
|
||||
The candidate already hides the maximum number of organizations (1000);
|
||||
code state_conflict with the entry `{in: path, pointer: /org_id, code:
|
||||
limit_reached}` in `errors`. Nothing was changed.
|
||||
content:
|
||||
application/problem+json:
|
||||
schema:
|
||||
$ref: ./schemas.yml#/Problem
|
||||
examples:
|
||||
limit_reached:
|
||||
$ref: ./examples.yml#/HiddenOrganizationLimitReached
|
||||
@@ -4874,6 +4874,469 @@ MyOrganizationList:
|
||||
$ref: '#/MyOrganization'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
PublicationVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
description: Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.
|
||||
examples:
|
||||
- 2
|
||||
SearchStatusVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
description: Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.
|
||||
examples:
|
||||
- 3
|
||||
CardField:
|
||||
type: string
|
||||
description: 'A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.
|
||||
|
||||
|
||||
- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.
|
||||
|
||||
- stack: the technology tags of the profile.
|
||||
|
||||
- experience: the total months of work experience, without employers, periods, or descriptions.
|
||||
|
||||
- soft_skills: the soft skills of the profile.
|
||||
|
||||
- location: the city or region of the profile.
|
||||
|
||||
- relocation: whether the candidate is ready to relocate.
|
||||
|
||||
|
||||
Only values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.
|
||||
|
||||
|
||||
Adding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.'
|
||||
enum:
|
||||
- categories
|
||||
- stack
|
||||
- experience
|
||||
- soft_skills
|
||||
- location
|
||||
- relocation
|
||||
CardFieldSet:
|
||||
type: array
|
||||
minItems: 0
|
||||
maxItems: 6
|
||||
uniqueItems: true
|
||||
description: Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.
|
||||
items:
|
||||
$ref: '#/CardField'
|
||||
PublicationState:
|
||||
type: string
|
||||
description: 'Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.
|
||||
|
||||
|
||||
- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.
|
||||
|
||||
- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'
|
||||
enum:
|
||||
- closed
|
||||
- published
|
||||
PublicationClosedReason:
|
||||
type: string
|
||||
description: 'Why a closed profile is closed, shown only to the candidate.
|
||||
|
||||
|
||||
- never_published: the candidate has never published the profile.
|
||||
|
||||
- closed_by_candidate: the candidate closed the publication.
|
||||
|
||||
- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.'
|
||||
enum:
|
||||
- never_published
|
||||
- closed_by_candidate
|
||||
- consent_revoked
|
||||
Publication:
|
||||
type: object
|
||||
description: 'Publication setting of the candidate card. It is separate from the consent: the C2 consent in the ledger proves that the candidate accepted the publication text, and this setting records whether and which fields are published. `state` is `published` only while the referenced C2 record is unrevoked, whatever the stored setting says, so a revocation closes the card at once. The state, the fields, and the times belong to the history that the C2 consent record does not carry.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- state
|
||||
- closed_reason
|
||||
- fields
|
||||
- consent_id
|
||||
- published_at
|
||||
- version
|
||||
properties:
|
||||
state:
|
||||
$ref: '#/PublicationState'
|
||||
closed_reason:
|
||||
description: Why the profile is closed, or null while it is published.
|
||||
oneOf:
|
||||
- $ref: '#/PublicationClosedReason'
|
||||
- type: 'null'
|
||||
fields:
|
||||
description: Card fields that organizations may read. Empty exactly when `state` is `closed`.
|
||||
allOf:
|
||||
- $ref: '#/CardFieldSet'
|
||||
consent_id:
|
||||
description: Identifier of the C2 record of the consent ledger that backs the current or the last publication, the `id` of a `ConsentRecord` of this account, or null when the profile was never published.
|
||||
oneOf:
|
||||
- type: string
|
||||
format: uuid
|
||||
- type: 'null'
|
||||
published_at:
|
||||
description: Moment of the latest change that published or republished the card, or null while the profile was never published. It stays after a closing, as the time of the last publication.
|
||||
oneOf:
|
||||
- $ref: '#/Timestamp'
|
||||
- type: 'null'
|
||||
version:
|
||||
$ref: '#/PublicationVersion'
|
||||
PublicationUpdate:
|
||||
type: object
|
||||
description: 'The complete new publication setting. `published` needs a non-empty set of fields and an active C2 consent of the account; `closed` needs an empty set and never fails for a missing consent. The body names no consent: the server binds the publication to the account''s current unrevoked C2 record, and a client can neither supply nor forge one.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- expected_version
|
||||
- state
|
||||
- fields
|
||||
properties:
|
||||
expected_version:
|
||||
$ref: '#/PublicationVersion'
|
||||
state:
|
||||
$ref: '#/PublicationState'
|
||||
fields:
|
||||
$ref: '#/CardFieldSet'
|
||||
SearchStatusValue:
|
||||
type: string
|
||||
description: 'Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.
|
||||
|
||||
|
||||
- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.
|
||||
|
||||
- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.'
|
||||
enum:
|
||||
- looking
|
||||
- not_looking
|
||||
SearchStatus:
|
||||
type: object
|
||||
description: 'Search status of the candidate as it holds now. The status `looking` stores the moment of its confirmation and lapses when the confirmation interval of the product policy passes without a new confirmation. A lapse only ever narrows: the status falls to `not_looking`, which is the non-public state, and a lapse never changes the publication or the hidden organizations. It needs no stored change, so no process can make a candidate more visible by expiry, and a lapsed candidate confirms again explicitly.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- lapsed
|
||||
- confirmed_at
|
||||
- lapses_at
|
||||
- version
|
||||
properties:
|
||||
value:
|
||||
description: 'The status that holds now: `looking` only while the confirmation has not lapsed.'
|
||||
allOf:
|
||||
- $ref: '#/SearchStatusValue'
|
||||
lapsed:
|
||||
type: boolean
|
||||
description: True when the candidate set `looking`, did not confirm it again, and the interval ended, so `value` is `not_looking`. False otherwise, including a status the candidate cleared.
|
||||
confirmed_at:
|
||||
description: Moment of the latest confirmation of `looking`, or null when the candidate never set it or cleared it.
|
||||
oneOf:
|
||||
- $ref: '#/Timestamp'
|
||||
- type: 'null'
|
||||
lapses_at:
|
||||
description: Moment at which the confirmed status lapses, fixed when it was confirmed from the `search_status` section of the product policy version in force then, or null when `confirmed_at` is null. A later policy change does not move it; it stays in the past for a lapsed status.
|
||||
oneOf:
|
||||
- $ref: '#/Timestamp'
|
||||
- type: 'null'
|
||||
version:
|
||||
$ref: '#/SearchStatusVersion'
|
||||
SearchStatusUpdate:
|
||||
type: object
|
||||
description: 'The complete new search status. `looking` is also the confirmation of a status that still holds or has lapsed: it sets the confirmation time to now. The body carries no time, interval, or policy version; the server takes them from the effective product policy.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- expected_version
|
||||
- value
|
||||
properties:
|
||||
expected_version:
|
||||
$ref: '#/SearchStatusVersion'
|
||||
value:
|
||||
$ref: '#/SearchStatusValue'
|
||||
PrivacyOrganization:
|
||||
type: object
|
||||
description: Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the organization.
|
||||
name:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 200
|
||||
description: Current name of the organization. Plain text; clients show it as text, never as HTML.
|
||||
HiddenOrganization:
|
||||
type: object
|
||||
description: 'One organization that the candidate hides the profile from. The record belongs to the candidate: no organization reads it, learns that it was hidden, or can tell a hidden candidate from one who is not published.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- organization
|
||||
- hidden_at
|
||||
properties:
|
||||
organization:
|
||||
$ref: '#/PrivacyOrganization'
|
||||
hidden_at:
|
||||
$ref: '#/Timestamp'
|
||||
HiddenOrganizationList:
|
||||
type: object
|
||||
description: One page of the organizations that the candidate hides the profile from, newest first with the organization identifier as the tie-breaker.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Hidden organizations of the page.
|
||||
items:
|
||||
$ref: '#/HiddenOrganization'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
PrivacySettings:
|
||||
type: object
|
||||
description: 'The visibility settings of the current candidate in one read: the publication, the search status, and the number of hidden organizations. The three are independent: each has its own version and its own operation, and a change of one leaves the others as they were. A new account reads a closed profile, `not_looking`, and no hidden organization.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- publication
|
||||
- search_status
|
||||
- hidden_organizations_total
|
||||
properties:
|
||||
publication:
|
||||
$ref: '#/Publication'
|
||||
search_status:
|
||||
$ref: '#/SearchStatus'
|
||||
hidden_organizations_total:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 1000
|
||||
description: Number of organizations that the candidate hides the profile from. The list is read with `ListMyHiddenOrganizations`.
|
||||
CardCategory:
|
||||
type: object
|
||||
description: A category confirmed by assessment results, as the card shows it.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- specialization
|
||||
- grade
|
||||
properties:
|
||||
specialization:
|
||||
$ref: '#/SpecializationCode'
|
||||
grade:
|
||||
$ref: '#/GradeCode'
|
||||
AnonymousCardContent:
|
||||
type: object
|
||||
description: The anonymous candidate card as an organization reads it. Only values that the candidate confirmed reach it; an unconfirmed suggestion and an unknown value never do. A free text value (a stack tag, a soft skill, the location) that looks like a contact (an email address, a phone number, a URL or domain, a Telegram link, an @handle) is dropped by the builder (TASK-089) and never published. It carries no name, contact, resume text, employer, salary figure, account or profile identifier, and no schema of the private profile or of a contact disclosure is reachable from it; a contact reaches an organization only through the contact grant of an accepted invitation. Each property is null when its field is not published or the candidate has no value for it, so the card does not tell the two apart. The set of properties is closed, and an organization-visible card must never gain a property that identifies the candidate. The search ranking and the full card of an organization's search
|
||||
result are defined by the search contract (TASK-185), which reuses this content.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- categories
|
||||
- stack
|
||||
- experience_months
|
||||
- soft_skills
|
||||
- location
|
||||
- relocation
|
||||
properties:
|
||||
categories:
|
||||
type:
|
||||
- array
|
||||
- 'null'
|
||||
maxItems: 9
|
||||
description: Categories confirmed by assessment results, or null.
|
||||
items:
|
||||
$ref: '#/CardCategory'
|
||||
stack:
|
||||
type:
|
||||
- array
|
||||
- 'null'
|
||||
maxItems: 30
|
||||
description: Technology tags of the candidate, or null.
|
||||
items:
|
||||
$ref: '#/StackTag'
|
||||
experience_months:
|
||||
type:
|
||||
- integer
|
||||
- 'null'
|
||||
minimum: 0
|
||||
maximum: 1200
|
||||
description: Total months of work experience, summed by the server without the employers, periods, or descriptions, or null.
|
||||
soft_skills:
|
||||
type:
|
||||
- array
|
||||
- 'null'
|
||||
maxItems: 10
|
||||
description: Soft skills of the candidate, or null.
|
||||
items:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 50
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: Plain text; clients show it as text, never as HTML.
|
||||
location:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
pattern: ^\S(?:.*\S)?$
|
||||
description: City or region as free text, never a street address, or null. Plain text; clients show it as text, never as HTML.
|
||||
relocation:
|
||||
type:
|
||||
- boolean
|
||||
- 'null'
|
||||
description: Whether the candidate is ready to relocate, or null.
|
||||
CardPreview:
|
||||
type: object
|
||||
description: 'What an organization that the candidate does not hide the profile from would read now, computed from the current profile, the current publication, and the consent ledger. It is a read for the candidate: it creates no view and no history record, and it never reaches an organization. `card` is null while the profile is closed.'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- state
|
||||
- fields
|
||||
- card
|
||||
- generated_at
|
||||
properties:
|
||||
state:
|
||||
$ref: '#/PublicationState'
|
||||
fields:
|
||||
$ref: '#/CardFieldSet'
|
||||
card:
|
||||
oneOf:
|
||||
- $ref: '#/AnonymousCardContent'
|
||||
- type: 'null'
|
||||
generated_at:
|
||||
$ref: '#/Timestamp'
|
||||
PrivacyEventKind:
|
||||
type: string
|
||||
description: 'Kind of a change of the visibility settings that the history records.
|
||||
|
||||
|
||||
- publication_opened: the candidate published a closed profile.
|
||||
|
||||
- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.
|
||||
|
||||
- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.
|
||||
|
||||
- search_status_confirmed: the candidate set or confirmed `looking`.
|
||||
|
||||
- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.
|
||||
|
||||
- organization_hidden: the candidate hid the profile from an organization.
|
||||
|
||||
- organization_unhidden: the candidate lifted the hiding for an organization.'
|
||||
enum:
|
||||
- publication_opened
|
||||
- publication_changed
|
||||
- publication_closed
|
||||
- search_status_confirmed
|
||||
- search_status_cleared
|
||||
- organization_hidden
|
||||
- organization_unhidden
|
||||
PrivacyEvent:
|
||||
type: object
|
||||
description: One recorded change of the visibility settings of the current candidate, as evidence of what was published, hidden, or announced and when. The history is append-only and returns only the caller's own records. A publication event carries the published fields and the C2 record behind them; an organization event names the organization; the other properties are null.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- kind
|
||||
- occurred_at
|
||||
- fields
|
||||
- consent_id
|
||||
- organization
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the event.
|
||||
kind:
|
||||
$ref: '#/PrivacyEventKind'
|
||||
occurred_at:
|
||||
$ref: '#/Timestamp'
|
||||
fields:
|
||||
description: Published fields after the change for `publication_opened` and `publication_changed`, an empty set for `publication_closed`, and null for every other kind.
|
||||
oneOf:
|
||||
- $ref: '#/CardFieldSet'
|
||||
- type: 'null'
|
||||
consent_id:
|
||||
description: C2 record that backs the publication, for `publication_opened` and `publication_changed`, or null.
|
||||
oneOf:
|
||||
- type: string
|
||||
format: uuid
|
||||
- type: 'null'
|
||||
organization:
|
||||
description: Organization of `organization_hidden` and `organization_unhidden` with its current name, resolved when the history is read (the event stores only the identifier), or null.
|
||||
oneOf:
|
||||
- $ref: '#/PrivacyOrganization'
|
||||
- type: 'null'
|
||||
PrivacyEventList:
|
||||
type: object
|
||||
description: One page of the settings history of the current candidate, newest first.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Events of the page.
|
||||
items:
|
||||
$ref: '#/PrivacyEvent'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
CardAccessKind:
|
||||
type: string
|
||||
description: 'How an organization reached the candidate.
|
||||
|
||||
|
||||
- card_viewed: an organization read the anonymous card in a search result.
|
||||
|
||||
- contact_read: an organization read the contacts through the contact grant of an accepted invitation.'
|
||||
enum:
|
||||
- card_viewed
|
||||
- contact_read
|
||||
CardAccess:
|
||||
type: object
|
||||
description: One access of an organization to the card or the contacts of the current candidate. `organization` is null for a view by an organization that has no invitation relation with the candidate, so the history shows that the card was viewed without naming a company that the candidate cannot otherwise see; whether the candidate should learn the name is an open product question. The record carries no query, ranking, or search filter of the organization.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- kind
|
||||
- occurred_at
|
||||
- organization
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the access record.
|
||||
kind:
|
||||
$ref: '#/CardAccessKind'
|
||||
occurred_at:
|
||||
$ref: '#/Timestamp'
|
||||
organization:
|
||||
oneOf:
|
||||
- $ref: '#/PrivacyOrganization'
|
||||
- type: 'null'
|
||||
CardAccessList:
|
||||
type: object
|
||||
description: One page of the accesses to the card of the current candidate, newest first.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Accesses of the page.
|
||||
items:
|
||||
$ref: '#/CardAccess'
|
||||
page:
|
||||
$ref: '#/PageInfo'
|
||||
Problem:
|
||||
type: object
|
||||
description: Problem details (RFC 9457) returned with the application/problem+json media type for every error response. `code` is the stable, machine-readable reason; clients branch on it rather than on `title`, `detail`, or the HTTP status alone. The body never contains internal error text, stack traces, SQL, file paths, credentials, contact data, or echoed request values.
|
||||
@@ -4920,7 +5383,7 @@ Problem:
|
||||
errors:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Field-level reasons for validation_failed. Other codes omit it.
|
||||
description: Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.
|
||||
items:
|
||||
$ref: '#/ProblemFieldError'
|
||||
ProblemCode:
|
||||
@@ -5010,7 +5473,7 @@ ProblemFieldError:
|
||||
minLength: 1
|
||||
maxLength: 64
|
||||
pattern: ^[a-z][a-z0-9_]*$
|
||||
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.
|
||||
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema), and, on a state_conflict, `consent_required` (the operation needs a consent that is not active) and `limit_reached` (a per-account bound is reached). Clients must tolerate new values.
|
||||
message:
|
||||
type: string
|
||||
minLength: 1
|
||||
|
||||
@@ -0,0 +1,574 @@
|
||||
schemas:
|
||||
PublicationVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
description: >-
|
||||
Version of the publication setting of the candidate. A candidate who
|
||||
has never published has version 0 and the profile is closed; every
|
||||
change that alters the setting advances it by one. The client sends
|
||||
the version it read as `expected_version`. It is independent of the
|
||||
versions of the profile and of the search status, so a change of one
|
||||
never makes another stale.
|
||||
examples:
|
||||
- 2
|
||||
SearchStatusVersion:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
description: >-
|
||||
Version of the search status of the candidate. A candidate who never
|
||||
set the status has version 0 and the status `not_looking`; every
|
||||
confirmation or change advances it by one. The client sends the
|
||||
version it read as `expected_version`.
|
||||
examples:
|
||||
- 3
|
||||
CardField:
|
||||
type: string
|
||||
description: |-
|
||||
A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.
|
||||
|
||||
- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.
|
||||
- stack: the technology tags of the profile.
|
||||
- experience: the total months of work experience, without employers, periods, or descriptions.
|
||||
- soft_skills: the soft skills of the profile.
|
||||
- location: the city or region of the profile.
|
||||
- relocation: whether the candidate is ready to relocate.
|
||||
|
||||
Only values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.
|
||||
|
||||
Adding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.
|
||||
enum:
|
||||
- categories
|
||||
- stack
|
||||
- experience
|
||||
- soft_skills
|
||||
- location
|
||||
- relocation
|
||||
CardFieldSet:
|
||||
type: array
|
||||
minItems: 0
|
||||
maxItems: 6
|
||||
uniqueItems: true
|
||||
description: >-
|
||||
Distinct card fields. The server stores them in ascending order of
|
||||
the codes and answers them in that order, whatever order the client
|
||||
sent, so equal sets are equal arrays.
|
||||
items:
|
||||
$ref: "#/schemas/CardField"
|
||||
PublicationState:
|
||||
type: string
|
||||
description: |-
|
||||
Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.
|
||||
|
||||
- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.
|
||||
- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.
|
||||
enum:
|
||||
- closed
|
||||
- published
|
||||
PublicationClosedReason:
|
||||
type: string
|
||||
description: |-
|
||||
Why a closed profile is closed, shown only to the candidate.
|
||||
|
||||
- never_published: the candidate has never published the profile.
|
||||
- closed_by_candidate: the candidate closed the publication.
|
||||
- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.
|
||||
enum:
|
||||
- never_published
|
||||
- closed_by_candidate
|
||||
- consent_revoked
|
||||
Publication:
|
||||
type: object
|
||||
description: >-
|
||||
Publication setting of the candidate card. It is separate from the
|
||||
consent: the C2 consent in the ledger proves that the candidate
|
||||
accepted the publication text, and this setting records whether and
|
||||
which fields are published. `state` is `published` only while the
|
||||
referenced C2 record is unrevoked, whatever the stored setting says,
|
||||
so a revocation closes the card at once. The state, the fields, and
|
||||
the times belong to the history that the C2 consent record does not
|
||||
carry.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- state
|
||||
- closed_reason
|
||||
- fields
|
||||
- consent_id
|
||||
- published_at
|
||||
- version
|
||||
properties:
|
||||
state:
|
||||
$ref: "#/schemas/PublicationState"
|
||||
closed_reason:
|
||||
description: Why the profile is closed, or null while it is published.
|
||||
oneOf:
|
||||
- $ref: "#/schemas/PublicationClosedReason"
|
||||
- type: "null"
|
||||
fields:
|
||||
description: >-
|
||||
Card fields that organizations may read. Empty exactly when `state`
|
||||
is `closed`.
|
||||
allOf:
|
||||
- $ref: "#/schemas/CardFieldSet"
|
||||
consent_id:
|
||||
description: >-
|
||||
Identifier of the C2 record of the consent ledger that backs the
|
||||
current or the last publication, the `id` of a `ConsentRecord` of
|
||||
this account, or null when the profile was never published.
|
||||
oneOf:
|
||||
- type: string
|
||||
format: uuid
|
||||
- type: "null"
|
||||
published_at:
|
||||
description: >-
|
||||
Moment of the latest change that published or republished the
|
||||
card, or null while the profile was never published. It stays
|
||||
after a closing, as the time of the last publication.
|
||||
oneOf:
|
||||
- $ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
- type: "null"
|
||||
version:
|
||||
$ref: "#/schemas/PublicationVersion"
|
||||
PublicationUpdate:
|
||||
type: object
|
||||
description: >-
|
||||
The complete new publication setting. `published` needs a non-empty
|
||||
set of fields and an active C2 consent of the account; `closed` needs
|
||||
an empty set and never fails for a missing consent. The body names no
|
||||
consent: the server binds the publication to the account's current
|
||||
unrevoked C2 record, and a client can neither supply nor forge one.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- expected_version
|
||||
- state
|
||||
- fields
|
||||
properties:
|
||||
expected_version:
|
||||
$ref: "#/schemas/PublicationVersion"
|
||||
state:
|
||||
$ref: "#/schemas/PublicationState"
|
||||
fields:
|
||||
$ref: "#/schemas/CardFieldSet"
|
||||
SearchStatusValue:
|
||||
type: string
|
||||
description: |-
|
||||
Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.
|
||||
|
||||
- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.
|
||||
- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.
|
||||
enum:
|
||||
- looking
|
||||
- not_looking
|
||||
SearchStatus:
|
||||
type: object
|
||||
description: >-
|
||||
Search status of the candidate as it holds now. The status `looking`
|
||||
stores the moment of its confirmation and lapses when the
|
||||
confirmation interval of the product policy passes without a new
|
||||
confirmation. A lapse only ever narrows: the status falls to
|
||||
`not_looking`, which is the non-public state, and a lapse never
|
||||
changes the publication or the hidden organizations. It needs no
|
||||
stored change, so no process can make a candidate more visible by
|
||||
expiry, and a lapsed candidate confirms again explicitly.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- value
|
||||
- lapsed
|
||||
- confirmed_at
|
||||
- lapses_at
|
||||
- version
|
||||
properties:
|
||||
value:
|
||||
description: >-
|
||||
The status that holds now: `looking` only while the confirmation
|
||||
has not lapsed.
|
||||
allOf:
|
||||
- $ref: "#/schemas/SearchStatusValue"
|
||||
lapsed:
|
||||
type: boolean
|
||||
description: >-
|
||||
True when the candidate set `looking`, did not confirm it again,
|
||||
and the interval ended, so `value` is `not_looking`. False
|
||||
otherwise, including a status the candidate cleared.
|
||||
confirmed_at:
|
||||
description: >-
|
||||
Moment of the latest confirmation of `looking`, or null when the
|
||||
candidate never set it or cleared it.
|
||||
oneOf:
|
||||
- $ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
- type: "null"
|
||||
lapses_at:
|
||||
description: >-
|
||||
Moment at which the confirmed status lapses, fixed when it was
|
||||
confirmed from the `search_status` section of the product policy
|
||||
version in force then, or null when `confirmed_at` is null. A
|
||||
later policy change does not move it; it stays in the past for a
|
||||
lapsed status.
|
||||
oneOf:
|
||||
- $ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
- type: "null"
|
||||
version:
|
||||
$ref: "#/schemas/SearchStatusVersion"
|
||||
SearchStatusUpdate:
|
||||
type: object
|
||||
description: >-
|
||||
The complete new search status. `looking` is also the confirmation of
|
||||
a status that still holds or has lapsed: it sets the confirmation time
|
||||
to now. The body carries no time, interval, or policy version; the
|
||||
server takes them from the effective product policy.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- expected_version
|
||||
- value
|
||||
properties:
|
||||
expected_version:
|
||||
$ref: "#/schemas/SearchStatusVersion"
|
||||
value:
|
||||
$ref: "#/schemas/SearchStatusValue"
|
||||
PrivacyOrganization:
|
||||
type: object
|
||||
description: >-
|
||||
Organization as the candidate who hid it reads it. The name is the
|
||||
current name of the organization. The candidate must already have been
|
||||
able to see the organization to hide it, so the reference tells them
|
||||
nothing that they could not read before.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the organization.
|
||||
name:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 200
|
||||
description: >-
|
||||
Current name of the organization. Plain text; clients show it as
|
||||
text, never as HTML.
|
||||
HiddenOrganization:
|
||||
type: object
|
||||
description: >-
|
||||
One organization that the candidate hides the profile from. The record
|
||||
belongs to the candidate: no organization reads it, learns that it was
|
||||
hidden, or can tell a hidden candidate from one who is not published.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- organization
|
||||
- hidden_at
|
||||
properties:
|
||||
organization:
|
||||
$ref: "#/schemas/PrivacyOrganization"
|
||||
hidden_at:
|
||||
$ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
HiddenOrganizationList:
|
||||
type: object
|
||||
description: >-
|
||||
One page of the organizations that the candidate hides the profile
|
||||
from, newest first with the organization identifier as the
|
||||
tie-breaker.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Hidden organizations of the page.
|
||||
items:
|
||||
$ref: "#/schemas/HiddenOrganization"
|
||||
page:
|
||||
$ref: "./common_schemas.yml#/schemas/PageInfo"
|
||||
PrivacySettings:
|
||||
type: object
|
||||
description: >-
|
||||
The visibility settings of the current candidate in one read: the
|
||||
publication, the search status, and the number of hidden
|
||||
organizations. The three are independent: each has its own version and
|
||||
its own operation, and a change of one leaves the others as they were.
|
||||
A new account reads a closed profile, `not_looking`, and no hidden
|
||||
organization.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- publication
|
||||
- search_status
|
||||
- hidden_organizations_total
|
||||
properties:
|
||||
publication:
|
||||
$ref: "#/schemas/Publication"
|
||||
search_status:
|
||||
$ref: "#/schemas/SearchStatus"
|
||||
hidden_organizations_total:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 1000
|
||||
description: >-
|
||||
Number of organizations that the candidate hides the profile from.
|
||||
The list is read with `ListMyHiddenOrganizations`.
|
||||
CardCategory:
|
||||
type: object
|
||||
description: A category confirmed by assessment results, as the card shows it.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- specialization
|
||||
- grade
|
||||
properties:
|
||||
specialization:
|
||||
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
|
||||
grade:
|
||||
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
|
||||
AnonymousCardContent:
|
||||
type: object
|
||||
description: >-
|
||||
The anonymous candidate card as an organization reads it. Only values
|
||||
that the candidate confirmed reach it; an unconfirmed suggestion and an
|
||||
unknown value never do. A free text value (a stack tag, a soft skill, the
|
||||
location) that looks like a contact (an email address, a phone number, a
|
||||
URL or domain, a Telegram link, an @handle) is dropped by the builder
|
||||
(TASK-089) and never published. It carries
|
||||
no name, contact, resume text, employer, salary figure, account or
|
||||
profile identifier, and no schema of the private profile or of a
|
||||
contact disclosure is reachable from it; a contact reaches an
|
||||
organization only through the contact grant of an accepted
|
||||
invitation. Each property is null when its field is not published or
|
||||
the candidate has no value for it, so the card does not tell the two
|
||||
apart. The set of properties is closed, and an organization-visible
|
||||
card must never gain a property that identifies the candidate. The
|
||||
search ranking and the full card of an organization's search result
|
||||
are defined by the search contract (TASK-185), which reuses this
|
||||
content.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- categories
|
||||
- stack
|
||||
- experience_months
|
||||
- soft_skills
|
||||
- location
|
||||
- relocation
|
||||
properties:
|
||||
categories:
|
||||
type:
|
||||
- array
|
||||
- "null"
|
||||
maxItems: 9
|
||||
description: Categories confirmed by assessment results, or null.
|
||||
items:
|
||||
$ref: "#/schemas/CardCategory"
|
||||
stack:
|
||||
type:
|
||||
- array
|
||||
- "null"
|
||||
maxItems: 30
|
||||
description: Technology tags of the candidate, or null.
|
||||
items:
|
||||
$ref: "./questionnaire_schemas.yml#/schemas/StackTag"
|
||||
experience_months:
|
||||
type:
|
||||
- integer
|
||||
- "null"
|
||||
minimum: 0
|
||||
maximum: 1200
|
||||
description: >-
|
||||
Total months of work experience, summed by the server without the
|
||||
employers, periods, or descriptions, or null.
|
||||
soft_skills:
|
||||
type:
|
||||
- array
|
||||
- "null"
|
||||
maxItems: 10
|
||||
description: Soft skills of the candidate, or null.
|
||||
items:
|
||||
type: string
|
||||
minLength: 1
|
||||
maxLength: 50
|
||||
pattern: '^\S(?:.*\S)?$'
|
||||
description: Plain text; clients show it as text, never as HTML.
|
||||
location:
|
||||
type:
|
||||
- string
|
||||
- "null"
|
||||
minLength: 1
|
||||
maxLength: 100
|
||||
pattern: '^\S(?:.*\S)?$'
|
||||
description: >-
|
||||
City or region as free text, never a street address, or null.
|
||||
Plain text; clients show it as text, never as HTML.
|
||||
relocation:
|
||||
type:
|
||||
- boolean
|
||||
- "null"
|
||||
description: Whether the candidate is ready to relocate, or null.
|
||||
CardPreview:
|
||||
type: object
|
||||
description: >-
|
||||
What an organization that the candidate does not hide the profile from
|
||||
would read now, computed from the current profile, the current
|
||||
publication, and the consent ledger. It is a read for the candidate: it
|
||||
creates no view and no history record, and it never reaches an
|
||||
organization. `card` is null while the profile is closed.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- state
|
||||
- fields
|
||||
- card
|
||||
- generated_at
|
||||
properties:
|
||||
state:
|
||||
$ref: "#/schemas/PublicationState"
|
||||
fields:
|
||||
$ref: "#/schemas/CardFieldSet"
|
||||
card:
|
||||
oneOf:
|
||||
- $ref: "#/schemas/AnonymousCardContent"
|
||||
- type: "null"
|
||||
generated_at:
|
||||
$ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
PrivacyEventKind:
|
||||
type: string
|
||||
description: |-
|
||||
Kind of a change of the visibility settings that the history records.
|
||||
|
||||
- publication_opened: the candidate published a closed profile.
|
||||
- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.
|
||||
- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.
|
||||
- search_status_confirmed: the candidate set or confirmed `looking`.
|
||||
- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.
|
||||
- organization_hidden: the candidate hid the profile from an organization.
|
||||
- organization_unhidden: the candidate lifted the hiding for an organization.
|
||||
enum:
|
||||
- publication_opened
|
||||
- publication_changed
|
||||
- publication_closed
|
||||
- search_status_confirmed
|
||||
- search_status_cleared
|
||||
- organization_hidden
|
||||
- organization_unhidden
|
||||
PrivacyEvent:
|
||||
type: object
|
||||
description: >-
|
||||
One recorded change of the visibility settings of the current
|
||||
candidate, as evidence of what was published, hidden, or announced and
|
||||
when. The history is append-only and returns only the caller's own
|
||||
records. A publication event carries the published fields and the C2
|
||||
record behind them; an organization event names the organization; the
|
||||
other properties are null.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- kind
|
||||
- occurred_at
|
||||
- fields
|
||||
- consent_id
|
||||
- organization
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the event.
|
||||
kind:
|
||||
$ref: "#/schemas/PrivacyEventKind"
|
||||
occurred_at:
|
||||
$ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
fields:
|
||||
description: >-
|
||||
Published fields after the change for `publication_opened` and
|
||||
`publication_changed`, an empty set for `publication_closed`, and
|
||||
null for every other kind.
|
||||
oneOf:
|
||||
- $ref: "#/schemas/CardFieldSet"
|
||||
- type: "null"
|
||||
consent_id:
|
||||
description: >-
|
||||
C2 record that backs the publication, for `publication_opened` and
|
||||
`publication_changed`, or null.
|
||||
oneOf:
|
||||
- type: string
|
||||
format: uuid
|
||||
- type: "null"
|
||||
organization:
|
||||
description: >-
|
||||
Organization of `organization_hidden` and `organization_unhidden`
|
||||
with its current name, resolved when the history is read (the event
|
||||
stores only the identifier), or null.
|
||||
oneOf:
|
||||
- $ref: "#/schemas/PrivacyOrganization"
|
||||
- type: "null"
|
||||
PrivacyEventList:
|
||||
type: object
|
||||
description: >-
|
||||
One page of the settings history of the current candidate, newest
|
||||
first.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Events of the page.
|
||||
items:
|
||||
$ref: "#/schemas/PrivacyEvent"
|
||||
page:
|
||||
$ref: "./common_schemas.yml#/schemas/PageInfo"
|
||||
CardAccessKind:
|
||||
type: string
|
||||
description: |-
|
||||
How an organization reached the candidate.
|
||||
|
||||
- card_viewed: an organization read the anonymous card in a search result.
|
||||
- contact_read: an organization read the contacts through the contact grant of an accepted invitation.
|
||||
enum:
|
||||
- card_viewed
|
||||
- contact_read
|
||||
CardAccess:
|
||||
type: object
|
||||
description: >-
|
||||
One access of an organization to the card or the contacts of the
|
||||
current candidate. `organization` is null for a view by an
|
||||
organization that has no invitation relation with the candidate, so the
|
||||
history shows that the card was viewed without naming a company that
|
||||
the candidate cannot otherwise see; whether the candidate should learn
|
||||
the name is an open product question. The record carries no query,
|
||||
ranking, or search filter of the organization.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- id
|
||||
- kind
|
||||
- occurred_at
|
||||
- organization
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Identifier of the access record.
|
||||
kind:
|
||||
$ref: "#/schemas/CardAccessKind"
|
||||
occurred_at:
|
||||
$ref: "./common_schemas.yml#/schemas/Timestamp"
|
||||
organization:
|
||||
oneOf:
|
||||
- $ref: "#/schemas/PrivacyOrganization"
|
||||
- type: "null"
|
||||
CardAccessList:
|
||||
type: object
|
||||
description: >-
|
||||
One page of the accesses to the card of the current candidate, newest
|
||||
first.
|
||||
additionalProperties: false
|
||||
required:
|
||||
- items
|
||||
- page
|
||||
properties:
|
||||
items:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Accesses of the page.
|
||||
items:
|
||||
$ref: "#/schemas/CardAccess"
|
||||
page:
|
||||
$ref: "./common_schemas.yml#/schemas/PageInfo"
|
||||
@@ -61,7 +61,7 @@ schemas:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: >-
|
||||
Field-level reasons for validation_failed. Other codes omit it.
|
||||
Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.
|
||||
items:
|
||||
$ref: "#/schemas/ProblemFieldError"
|
||||
ProblemCode:
|
||||
@@ -138,8 +138,10 @@ schemas:
|
||||
pattern: "^[a-z][a-z0-9_]*$"
|
||||
description: >-
|
||||
Stable field reason. Current values are `required` (missing value)
|
||||
and `invalid` (malformed value or a value outside the schema).
|
||||
Clients must tolerate new values.
|
||||
and `invalid` (malformed value or a value outside the schema), and,
|
||||
on a state_conflict, `consent_required` (the operation needs a
|
||||
consent that is not active) and `limit_reached` (a per-account
|
||||
bound is reached). Clients must tolerate new values.
|
||||
message:
|
||||
type: string
|
||||
minLength: 1
|
||||
|
||||
+1094
-2
File diff suppressed because it is too large.
Load diff
@@ -50,6 +50,16 @@ tags:
|
||||
withdrawal and cancellation, and the contact grant. Contacts are
|
||||
readable only through an active grant, in a response separate from
|
||||
the terms.
|
||||
- name: privacy
|
||||
description: >-
|
||||
Visibility of the current candidate: the publication of the anonymous
|
||||
card (a setting that refers to the C2 consent of the ledger and never
|
||||
replaces it), the search status that is not a consent, the
|
||||
organizations that the candidate hides the profile from, the preview
|
||||
of the card, and the history of the settings and of the accesses.
|
||||
Everything is closed by default, and no change makes a candidate more
|
||||
visible than they chose. No schema here reaches a contact, a name, or
|
||||
the lowest salary.
|
||||
- name: consent
|
||||
description: >-
|
||||
The consent ledger of the current account: the independent consents
|
||||
@@ -137,6 +147,22 @@ paths:
|
||||
$ref: ./routes/candidate_invitation_cancel.yml
|
||||
/api/v1/me/consents:
|
||||
$ref: ./routes/consents.yml
|
||||
/api/v1/me/privacy:
|
||||
$ref: ./routes/candidate_privacy.yml
|
||||
/api/v1/me/privacy/publication:
|
||||
$ref: ./routes/candidate_privacy_publication.yml
|
||||
/api/v1/me/privacy/preview:
|
||||
$ref: ./routes/candidate_privacy_preview.yml
|
||||
/api/v1/me/privacy/search-status:
|
||||
$ref: ./routes/candidate_privacy_search_status.yml
|
||||
/api/v1/me/privacy/hidden-organizations:
|
||||
$ref: ./routes/candidate_privacy_hidden_organizations.yml
|
||||
/api/v1/me/privacy/hidden-organizations/{org_id}:
|
||||
$ref: ./routes/candidate_privacy_hidden_organization.yml
|
||||
/api/v1/me/privacy/history:
|
||||
$ref: ./routes/candidate_privacy_history.yml
|
||||
/api/v1/me/privacy/access-history:
|
||||
$ref: ./routes/candidate_privacy_access_history.yml
|
||||
/api/v1/me/support-cases:
|
||||
$ref: ./routes/support_cases.yml
|
||||
/api/v1/me/support-cases/{case_id}:
|
||||
@@ -741,6 +767,54 @@ components:
|
||||
$ref: ./components/schemas.yml#/MyOrganization
|
||||
MyOrganizationList:
|
||||
$ref: ./components/schemas.yml#/MyOrganizationList
|
||||
PublicationVersion:
|
||||
$ref: ./components/schemas.yml#/PublicationVersion
|
||||
SearchStatusVersion:
|
||||
$ref: ./components/schemas.yml#/SearchStatusVersion
|
||||
CardField:
|
||||
$ref: ./components/schemas.yml#/CardField
|
||||
CardFieldSet:
|
||||
$ref: ./components/schemas.yml#/CardFieldSet
|
||||
PublicationState:
|
||||
$ref: ./components/schemas.yml#/PublicationState
|
||||
PublicationClosedReason:
|
||||
$ref: ./components/schemas.yml#/PublicationClosedReason
|
||||
Publication:
|
||||
$ref: ./components/schemas.yml#/Publication
|
||||
PublicationUpdate:
|
||||
$ref: ./components/schemas.yml#/PublicationUpdate
|
||||
SearchStatusValue:
|
||||
$ref: ./components/schemas.yml#/SearchStatusValue
|
||||
SearchStatus:
|
||||
$ref: ./components/schemas.yml#/SearchStatus
|
||||
SearchStatusUpdate:
|
||||
$ref: ./components/schemas.yml#/SearchStatusUpdate
|
||||
PrivacyOrganization:
|
||||
$ref: ./components/schemas.yml#/PrivacyOrganization
|
||||
HiddenOrganization:
|
||||
$ref: ./components/schemas.yml#/HiddenOrganization
|
||||
HiddenOrganizationList:
|
||||
$ref: ./components/schemas.yml#/HiddenOrganizationList
|
||||
PrivacySettings:
|
||||
$ref: ./components/schemas.yml#/PrivacySettings
|
||||
CardCategory:
|
||||
$ref: ./components/schemas.yml#/CardCategory
|
||||
AnonymousCardContent:
|
||||
$ref: ./components/schemas.yml#/AnonymousCardContent
|
||||
CardPreview:
|
||||
$ref: ./components/schemas.yml#/CardPreview
|
||||
PrivacyEventKind:
|
||||
$ref: ./components/schemas.yml#/PrivacyEventKind
|
||||
PrivacyEvent:
|
||||
$ref: ./components/schemas.yml#/PrivacyEvent
|
||||
PrivacyEventList:
|
||||
$ref: ./components/schemas.yml#/PrivacyEventList
|
||||
CardAccessKind:
|
||||
$ref: ./components/schemas.yml#/CardAccessKind
|
||||
CardAccess:
|
||||
$ref: ./components/schemas.yml#/CardAccess
|
||||
CardAccessList:
|
||||
$ref: ./components/schemas.yml#/CardAccessList
|
||||
parameters:
|
||||
IdempotencyKey:
|
||||
$ref: ./components/parameters.yml#/IdempotencyKey
|
||||
@@ -762,6 +836,8 @@ components:
|
||||
$ref: ./components/parameters.yml#/InvitationId
|
||||
MyInvitationId:
|
||||
$ref: ./components/parameters.yml#/MyInvitationId
|
||||
HiddenOrganizationId:
|
||||
$ref: ./components/parameters.yml#/HiddenOrganizationId
|
||||
headers:
|
||||
ETag:
|
||||
$ref: ./components/headers.yml#/ETag
|
||||
@@ -854,6 +930,14 @@ components:
|
||||
$ref: ./components/responses.yml#/OrganizationValidationFailed
|
||||
OrganizationVersionConflict:
|
||||
$ref: ./components/responses.yml#/OrganizationVersionConflict
|
||||
PrivacyValidationFailed:
|
||||
$ref: ./components/responses.yml#/PrivacyValidationFailed
|
||||
PrivacyVersionConflict:
|
||||
$ref: ./components/responses.yml#/PrivacyVersionConflict
|
||||
PublicationConsentRequired:
|
||||
$ref: ./components/responses.yml#/PublicationConsentRequired
|
||||
HiddenOrganizationLimit:
|
||||
$ref: ./components/responses.yml#/HiddenOrganizationLimit
|
||||
securitySchemes:
|
||||
sessionCookie:
|
||||
type: apiKey
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
get:
|
||||
operationId: GetMyPrivacySettings
|
||||
summary: Read the visibility settings of the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. Returns the publication of the candidate card, the search status, and the number of hidden organizations in one read. The response is `Cache-Control: no-store`.
|
||||
|
||||
A profile is closed by default. A candidate who never published reads `publication.state` `closed` with `closed_reason` `never_published`, an empty field set, and version 0; creating or saving the profile (`SaveMyProfile`) never publishes it, and no operation of the profile, the questionnaire, or an assessment changes these settings. The C2 consent, the search status, and the hidden organizations are three independent settings: the C2 record in the consent ledger proves that the candidate accepted the publication text, the publication records which fields are published, and the search status is a statement of the candidate that is not a consent. A change of one never changes another, and none of them ever makes the candidate more visible by itself: the search status lapses to the non-public `not_looking`, a revoked C2 closes the card, and a new C2 grant publishes nothing.
|
||||
|
||||
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- privacy
|
||||
responses:
|
||||
"200":
|
||||
description: The visibility settings of the current candidate.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/PrivacySettings
|
||||
examples:
|
||||
new_candidate:
|
||||
$ref: ../components/examples.yml#/NewCandidatePrivacySettings
|
||||
published_and_looking:
|
||||
$ref: ../components/examples.yml#/PublishedCandidatePrivacySettings
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/Forbidden
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,39 @@
|
||||
get:
|
||||
operationId: ListMyCardAccessHistory
|
||||
summary: List the accesses of organizations to the card of the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only accesses to the caller's own card. Returns a page, newest first with the record identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
|
||||
An access is a view of the anonymous card by an organization (`card_viewed`) or a read of the contacts through an active contact grant (`contact_read`). Reading the history is not an access and writes nothing. A view of the card by an organization that has no invitation relation with the candidate carries `organization` null, so the candidate sees that the card was viewed without learning a company that they cannot otherwise see; a contact read always names the organization, because the candidate accepted its invitation. The entries carry no search query, filter, or ranking of the organization, and no organization the candidate hides ever appears as a viewer, because a hidden organization cannot read the card.
|
||||
|
||||
The storage of accesses is planned with the card and contact operations of the organization side (TASK-185 and the contact read of the invitation contract); until then the operation answers 501 not_implemented after the session and request checks.
|
||||
|
||||
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:
|
||||
- privacy
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the accesses to the card of the current candidate.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CardAccessList
|
||||
examples:
|
||||
page:
|
||||
$ref: ../components/examples.yml#/CardAccessListPage
|
||||
"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,81 @@
|
||||
put:
|
||||
operationId: HideOrganization
|
||||
summary: Hide the candidate profile from one organization.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The request has no body: the path names the organization and the candidate comes from the session. The hiding is a record that belongs to the candidate and references the organization; it changes neither the C2 consent, nor the publication, nor the search status.
|
||||
|
||||
The operation sets a state, so it is idempotent and needs no Idempotency-Key: hiding an organization that is already hidden answers 200 with the existing record and its original `hidden_at`, changes nothing, and writes no history record. There is one record per candidate and organization.
|
||||
|
||||
Anti-enumeration: an organization that does not exist and an organization that the candidate cannot see answer the same 404 not_found, with the same body and without a timing or an error code that tells them apart, so the operation is not a way to ask whether an identifier belongs to an organization. The candidate can see an organization that has sent them an invitation, and the organizations that a candidate lookup will list (planned; see the open questions of the contract). The response names the organization only after that check, with its current name. The identifiers are random, the general rate limit applies and can answer 429 with Retry-After before any check, and the record never reveals to an organization that a candidate hides it.
|
||||
|
||||
A candidate hides at most 1000 organizations; hiding one more answers 409 state_conflict with the entry `{in: path, pointer: /org_id, code: limit_reached}` in `errors`, which tells it apart from other conflicts, and changes nothing, and a repeat of an existing hiding is never refused for the limit.
|
||||
|
||||
Hiding an organization that holds an active contact grant of the candidate revokes that grant with the reason `visibility_closed` in the same transaction (planned together with the invitation operations). Lifting the hiding never reopens a grant.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), the organization and its visibility to the candidate (404 not_found), then the repeat (200), then the limit (409 state_conflict). Like every visibility change, hiding needs a verified email (a usecase requirement).
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- privacy
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/HiddenOrganizationId
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The organization is hidden from the candidate profile: the new record
|
||||
or the one that existed.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/HiddenOrganization
|
||||
examples:
|
||||
hidden:
|
||||
$ref: ../components/examples.yml#/HiddenOrganizationRecord
|
||||
"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#/HiddenOrganizationLimit
|
||||
"429":
|
||||
$ref: ../components/responses.yml#/TooManyRequests
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
delete:
|
||||
operationId: UnhideOrganization
|
||||
summary: Lift the hiding of the candidate profile from one organization.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. Deletes the hiding record of the candidate for the organization in the path. The request is idempotent: it answers 204 whether the organization was hidden, was not hidden, or does not exist, so the operation reveals nothing about the organization, and a repeat after a lost response succeeds. The record is deleted, the settings history keeps the event `organization_unhidden` only when a record was deleted.
|
||||
|
||||
Lifting the hiding makes the candidate readable by that organization again only if the profile is published and the organization otherwise may read it. It changes neither the C2 consent, nor the publication, nor the search status, and it never reopens a contact grant that the hiding closed.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), then the deletion (204).
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- privacy
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/HiddenOrganizationId
|
||||
responses:
|
||||
"204":
|
||||
description: The organization is not hidden from the candidate profile.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/ValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,37 @@
|
||||
get:
|
||||
operationId: ListMyHiddenOrganizations
|
||||
summary: List the organizations that the candidate hides the profile from.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records and no request can name another account. Returns a page of the hidden organizations, newest first with the organization identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
|
||||
The records belong to the candidate. An organization never reads them, never learns that it is hidden, and sees a hidden candidate exactly as it sees one who is not published: no search result, no card, no contact read.
|
||||
|
||||
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:
|
||||
- privacy
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the hidden organizations of the current candidate.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/HiddenOrganizationList
|
||||
examples:
|
||||
page:
|
||||
$ref: ../components/examples.yml#/HiddenOrganizationListPage
|
||||
"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,37 @@
|
||||
get:
|
||||
operationId: ListMyPrivacyHistory
|
||||
summary: List the changes of the visibility settings of the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records. Returns a page of the settings history, newest first with the event identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
|
||||
The history is append-only evidence of what the candidate published, hid, and announced, and when. A publication event keeps the published fields and the C2 record behind them, which is what the consent ledger deliberately does not carry (the C2 record proves the consent to the text, not the field set). A revocation of C2 and a lapse of the search status are computed and are not events here; the consent history shows the revocation. The history never contains a profile value.
|
||||
|
||||
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:
|
||||
- privacy
|
||||
parameters:
|
||||
- $ref: ../components/parameters.yml#/PageLimit
|
||||
- $ref: ../components/parameters.yml#/PageCursor
|
||||
responses:
|
||||
"200":
|
||||
description: A page of the settings history of the current candidate.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/PrivacyEventList
|
||||
examples:
|
||||
page:
|
||||
$ref: ../components/examples.yml#/PrivacyEventListPage
|
||||
"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,34 @@
|
||||
get:
|
||||
operationId: GetMyCardPreview
|
||||
summary: Preview the anonymous card that organizations would read.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account. Returns the card exactly as an organization that the candidate does not hide the profile from would read it now, built from the current profile, the current publication, and the consent ledger. The response is `Cache-Control: no-store`.
|
||||
|
||||
The preview is a private read for the candidate: it creates no view, leaves no access record, and is never shown to an organization. While the profile is closed `card` is null. `card` is `AnonymousCardContent`, whose schema reaches no private profile schema, no contact, and no identifier of the candidate: it has no name, email, phone, Telegram name, employer, salary figure, or account or profile identifier, and each property is null when it is not published or has no value, so a reader cannot tell the two apart. Only the fields in `fields` are filled, and only with values that the candidate confirmed: an unconfirmed suggestion and an unknown value never appear. A free text value that looks like a contact (an email address, a phone number, a URL, a Telegram link, an @handle) is dropped from the card, so the preview shows exactly what an organization would read. The self-assessed grade is not a category and never appears; categories come only from assessment results.
|
||||
|
||||
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
tags:
|
||||
- privacy
|
||||
responses:
|
||||
"200":
|
||||
description: The anonymous card as organizations would read it now.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/CardPreview
|
||||
examples:
|
||||
published:
|
||||
$ref: ../components/examples.yml#/PublishedCardPreview
|
||||
closed:
|
||||
$ref: ../components/examples.yml#/ClosedCardPreview
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/Forbidden
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,56 @@
|
||||
put:
|
||||
operationId: SetMyPublication
|
||||
summary: Publish or close the anonymous candidate card.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new publication setting: `state` `published` with the non-empty set of card fields, or `closed` with an empty set. It changes only the publication; the search status and the hidden organizations stay as they were.
|
||||
|
||||
Publication is not a consent and does not duplicate one. The consent C2 lives in the consent ledger (`ListMyConsents`); this setting refers to it. Publishing requires an active, unrevoked C2 record of the account and binds the publication to that record, so a client sends no consent identifier and cannot forge one. Without one the server answers 409 state_conflict with the entry `{in: body, pointer: /state, code: consent_required}` in `errors`, which tells it apart from every other conflict, and changes nothing: the client gives C2 first (planned in the consent settings, TASK-063) and then publishes. The server takes the C2 record under a share lock in the transaction that writes the publication, so a revocation that races with a publication either commits first (the publication is refused) or closes the card right after. A revocation of C2 closes the card at once, because `state` is computed from the unrevoked record; a later C2 grant never reopens it, and the candidate publishes again under the new record. The revocation path itself (TASK-064) closes the stored publication and revokes the contact grants in its own transaction. A closing sent over a stored publication whose C2 was revoked is a real change: it stores the closing, records `publication_closed`, and revokes the grants as any closing does. Publishing, like every visibility change, needs a verified email (a usecase requirement; the unverified account cleanup deletes only accounts without such records). Publishing never adds a field that the body did not name, and a new `CardField` value is never published for a candidate who did not choose it.
|
||||
|
||||
The field set contains only the groups of `CardField`. The full name, contacts, and the lowest salary have no value there, so no body can publish them. Only values that the candidate confirmed ever reach the card. Contacts reach an organization only through the contact grant (C4), and a profile that is published or closed changes none of the grants that exist; closing the publication, and hiding an organization that holds a grant, revoke the contact grants concerned with the reason `visibility_closed` in the same transaction as the change (planned together with the operations, see the invitation contract).
|
||||
|
||||
Optimistic concurrency uses `expected_version` in the body: the client sends the `version` it read, 0 for the first publication. If it is not the current version the server answers 412 version_conflict and changes nothing. The version travels in the body rather than in If-Match because the generated client cannot read the ETag header yet. A body that equals the stored setting changes nothing, keeps the version, and answers 200 even when `expected_version` is older, so a retry after a lost response succeeds without an Idempotency-Key. A version above the current one never existed and always answers 412. Every change is recorded in the settings history with its time, the fields, and the C2 record.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), rules that depend on the body alone (400), an unchanged body (200), a stale version (412), then the active C2 for a publication (409 state_conflict). The schema rejects an unknown field, a repeated or unknown card field, and more fields than there are groups; a published state with no field, and a closed state with a field, answer 400 validation_failed with the pointer `/fields`. Error bodies never repeat a submitted value.
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- privacy
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/PublicationUpdate
|
||||
examples:
|
||||
publish:
|
||||
$ref: ../components/examples.yml#/PublicationUpdatePublish
|
||||
close:
|
||||
$ref: ../components/examples.yml#/PublicationUpdateClose
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The saved publication with its new version, or the current one when
|
||||
the body changes nothing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/Publication
|
||||
examples:
|
||||
published:
|
||||
$ref: ../components/examples.yml#/PublishedPublication
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/PrivacyValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"409":
|
||||
$ref: ../components/responses.yml#/PublicationConsentRequired
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/PrivacyVersionConflict
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
@@ -0,0 +1,54 @@
|
||||
put:
|
||||
operationId: SetMySearchStatus
|
||||
summary: Set or confirm the search status of the current candidate.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new status: `looking` ("Ищу") or `not_looking`. The status is a statement of the candidate and never a consent. It changes neither the C2 consent, nor the publication, nor the hidden organizations, and it does not close or open any contact grant; a candidate whose profile is closed who sets `looking` becomes visible to no one.
|
||||
|
||||
`looking` stores the moment of the confirmation and a lapse time. The server takes the interval from the `search_status` section of the effective product policy (30 days in the demo policy, `searching_confirmation_interval_days`), stores the policy version it used, and fixes the lapse time then, so a later policy change moves no stored time. Setting `looking` again is the confirmation: it replaces the confirmation time with now and advances the version, also after a lapse. The body carries no time, interval, or policy version.
|
||||
|
||||
After the lapse time the status holds as `not_looking` with `lapsed` true on the next read. The lapse is computed and written nowhere, so it needs no job, it can never make the candidate more visible, and it never touches the publication or the hidden organizations. A reminder before the lapse is a planned notification, not a part of this operation.
|
||||
|
||||
Optimistic concurrency uses `expected_version` in the body, 0 for a candidate who never set the status; a stale or non-existent version answers 412 version_conflict and changes nothing. `not_looking` over a stored `not_looking` changes nothing and answers 200 even with a stale version. `looking` always changes the stored confirmation, so a retry of a confirmation whose response was lost with the old version answers 412 and the client reads the status again.
|
||||
|
||||
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), an unchanged `not_looking` (200), then a stale version (412).
|
||||
security:
|
||||
- sessionCookie: []
|
||||
sessionCsrf: []
|
||||
tags:
|
||||
- privacy
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/SearchStatusUpdate
|
||||
examples:
|
||||
looking:
|
||||
$ref: ../components/examples.yml#/SearchStatusUpdateLooking
|
||||
responses:
|
||||
"200":
|
||||
description: >-
|
||||
The saved search status with its new version, or the current one
|
||||
when the body changes nothing.
|
||||
headers:
|
||||
Cache-Control:
|
||||
$ref: ../components/headers.yml#/CacheControlNoStore
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../components/schemas.yml#/SearchStatus
|
||||
examples:
|
||||
looking:
|
||||
$ref: ../components/examples.yml#/LookingSearchStatus
|
||||
lapsed:
|
||||
$ref: ../components/examples.yml#/LapsedSearchStatus
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/PrivacyValidationFailed
|
||||
"401":
|
||||
$ref: ../components/responses.yml#/Unauthenticated
|
||||
"403":
|
||||
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
||||
"412":
|
||||
$ref: ../components/responses.yml#/PrivacyVersionConflict
|
||||
default:
|
||||
$ref: ../components/responses.yml#/Problem
|
||||
Vendored
+2
-2
@@ -224,7 +224,7 @@ components:
|
||||
errors:
|
||||
type: array
|
||||
maxItems: 100
|
||||
description: Field-level reasons for validation_failed. Other codes omit it.
|
||||
description: Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.
|
||||
items:
|
||||
$ref: "#/components/schemas/ProblemFieldError"
|
||||
ProblemCode:
|
||||
@@ -295,7 +295,7 @@ components:
|
||||
minLength: 1
|
||||
maxLength: 64
|
||||
pattern: ^[a-z][a-z0-9_]*$
|
||||
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.
|
||||
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema), and, on a state_conflict, `consent_required` (the operation needs a consent that is not active) and `limit_reached` (a per-account bound is reached). Clients must tolerate new values.
|
||||
message:
|
||||
type: string
|
||||
minLength: 1
|
||||
|
||||
Reference in new issue
Block a user