97 lines
8.3 KiB
YAML
97 lines
8.3 KiB
YAML
get:
|
|
operationId: GetMyProfile
|
|
summary: Read the private profile of the current candidate.
|
|
description: |-
|
|
Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. A candidate who has not saved the profile yet gets 200 with version 0, every single field `unknown`, and empty lists rather than 404, so the client reads the version for the first save in the same way as for later ones and a missing profile is not an error state.
|
|
|
|
The profile is personal data that only its owner reads: full name, contacts, work history, and the lowest salary. It is a private resource and never an organization-visible one; organizations see a candidate through the anonymous card and, after an accepted invitation, through the contact grant, and no organization contract refers to this schema. The response is `Cache-Control: no-store`, and the server never writes its values to logs, metrics, URLs, or events.
|
|
|
|
Every value carries its confirmation state and provenance, and every claim has trust level 0. The self-assessed grade of a role is separate from `confirmed_categories`, which only assessment results establish and which no request writes. The profile needs no file, no ML extraction, and no FSP account.
|
|
|
|
`experience_overlaps` lists every pair of entries whose inclusive month ranges overlap. Its indices refer to this response's `experience` array and are scoped to the same `version`; each pair is either `needs_confirmation` or `confirmed`.
|
|
|
|
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
|
security:
|
|
- sessionCookie: []
|
|
tags:
|
|
- candidate
|
|
responses:
|
|
"200":
|
|
description: The private profile of the current candidate.
|
|
headers:
|
|
Cache-Control:
|
|
$ref: ../components/headers.yml#/CacheControlNoStore
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/CandidateProfile
|
|
examples:
|
|
new_candidate:
|
|
$ref: ../components/examples.yml#/NewCandidateProfile
|
|
backend_manual_with_suggestion:
|
|
$ref: ../components/examples.yml#/BackendCandidateProfile
|
|
"401":
|
|
$ref: ../components/responses.yml#/Unauthenticated
|
|
"403":
|
|
$ref: ../components/responses.yml#/Forbidden
|
|
default:
|
|
$ref: ../components/responses.yml#/Problem
|
|
put:
|
|
operationId: SaveMyProfile
|
|
summary: Replace the private profile 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 state of every field and list; see CandidateProfileUpdate for the decisions that it carries. It replaces the stored profile as a whole.
|
|
|
|
Every field is optional in substance: a profile can be saved with any subset filled and the rest null or empty, so no value requires a resume, the ML service, an FSP account, or any other file or link. A successful save advances an account whose current onboarding step is candidate_profile to candidate_questionnaire, including a no-op save; it never moves a later step backwards. This update is atomic with the profile and its history.
|
|
|
|
Provenance is the server's: a value typed in the form is `manual`, confirming a stored suggestion keeps its origin, and every claim keeps trust level 0. The body has no origin, trust level, confirmation time, confirmed grade, or category, and unknown fields are rejected. A self-assessed grade never becomes a confirmed grade or a category.
|
|
|
|
Optimistic concurrency uses `expected_version` in the body: the client sends the `version` it read, 0 for the first save. If it is not the current version, the server answers 412 version_conflict and changes nothing, and the client reads the profile again and reapplies its edits, so a concurrent edit from another tab or device is never lost silently. The version travels in the body rather than in If-Match because the generated client cannot read the ETag response header yet, as for the questionnaire; the status and code are the same as for a failed If-Match.
|
|
|
|
The operation needs no Idempotency-Key: it replaces the whole state and is idempotent. A body whose values equal the stored ones, with the same decisions, changes nothing, keeps the version, and answers 200 with the current profile even when `expected_version` is older, so a retry after a lost response of a successful save succeeds instead of failing with 412. A version above the current one never existed and always answers 412 version_conflict, even for an unchanged body.
|
|
|
|
The save replaces the stored claims as a whole. A suggestion that an import stored and that the client did not render and send back with the decision `extracted` is dropped by the save; a client therefore sends every suggestion that it received, and a client that read an older version gets 412 instead of silently dropping a suggestion it never saw.
|
|
|
|
Experience periods use inclusive calendar months. An overlap is allowed only when `confirmed_parallel_periods` explicitly acknowledges that the two date ranges are genuine parallel work. Each acknowledgement names two distinct experience indices and repeats their exact normalized `started_on` and `ended_on` values; both indices and periods must match the submitted array and `expected_version`. A new or changed period needs an acknowledgement in that PUT. The server carries an earlier acknowledgement only when the same two indices still contain the same dates; reordering or changing either date requires a new acknowledgement. Editing other experience fields does not invalidate a matching date-pair acknowledgement. A missing acknowledgement answers 400 with pointers to the period fields and changes nothing. Duplicate, out-of-range, self, and non-overlapping acknowledgements are invalid.
|
|
|
|
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), domain rules that depend on the body alone (400), then the rules that depend on the stored claims against the version: a decision `extracted` for a value that is not a stored suggestion answers 412 when `expected_version` is stale, because another save may have confirmed that value, and 400 when it is current; an unchanged body (200); any other change over a stale version (412). The schema rejects an unknown field, an unknown specialization or grade, a phone number outside E.164, a Telegram username without the leading @, an email that is not an address, a month outside `YYYY-MM`, a salary that is not a positive multiple of 1000, and more items than a list allows. The server also rejects a repeated tag, skill, or role specialization, a period that ends before it starts or lies in the future, a changed overlap without explicit confirmation, and a decision `extracted` for a value that is not a stored suggestion, with 400 validation_failed and pointers to the items, for example `/roles/1/specialization` or `/stack/1/status`. Error bodies never repeat a submitted value.
|
|
security:
|
|
- sessionCookie: []
|
|
sessionCsrf: []
|
|
tags:
|
|
- candidate
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/CandidateProfileUpdate
|
|
examples:
|
|
backend_manual:
|
|
$ref: ../components/examples.yml#/BackendCandidateProfileUpdate
|
|
responses:
|
|
"200":
|
|
description: >-
|
|
The saved profile with its new version, or the current profile when
|
|
the body changes nothing.
|
|
headers:
|
|
Cache-Control:
|
|
$ref: ../components/headers.yml#/CacheControlNoStore
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/CandidateProfile
|
|
examples:
|
|
backend_manual_with_suggestion:
|
|
$ref: ../components/examples.yml#/BackendCandidateProfile
|
|
"400":
|
|
$ref: ../components/responses.yml#/ProfileValidationFailed
|
|
"401":
|
|
$ref: ../components/responses.yml#/Unauthenticated
|
|
"403":
|
|
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
|
|
"412":
|
|
$ref: ../components/responses.yml#/ProfileVersionConflict
|
|
default:
|
|
$ref: ../components/responses.yml#/Problem
|