Files
lincodex/api/core/components/schemas/privacy_schemas.yml
T

575 lines
21 KiB
YAML

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
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, 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"