chore: remove backlog references from code and documentation

This commit is contained in:
TakuyaYagam1 committed 2026-10-07 01:38:49 +03:00
1 parent 0529601021
commit 8e7ce8d71c
129 files changed
+699 -701

No files matched your search

@@ -3,7 +3,7 @@ import { listMyConsents } from "./endpoints/consent/consent";
import { ConsentRecord, ConsentRecordList, ListMyConsentsParams } from "./schemas";
// These tests pin the generated consent ledger contract that the consent
// screen (TASK-065) consumes. They fail when regeneration lets a record lose
// screen consumes. They fail when regeneration lets a record lose
// its purpose, text version, state, or revocation, accepts a C4 scope
// without fields, or adds a field that would carry the text hash, another
// subject, or a contact value into the read model.
@@ -68,9 +68,9 @@ export const getListMyConsentsUrl = (params?: ListMyConsentsParams,) => {
*
* The ledger is append-only. Every grant is a record with its purpose, the accepted text version, the source, and the grant time; the server also stores the hash of exactly the text the subject saw. A newer text version of the same purpose is a new record, and the earlier one becomes `superseded` without any change. A revocation stamps every unrevoked record of the purpose, and for c4 of one organization, once; a later grant is a new record. Purposes are independent.
*
* Without `state` the page lists the whole history; `state=active` lists the consents that hold now, one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the organization with the name its consent text showed (a snapshot that a later rename does not change), the selected contact fields, and the invitation with its terms version; it never carries a contact value. A c2 record proves the consent to the publication text; the published field set and its changes are evidence of the publication history (TASK-088).
* Without `state` the page lists the whole history; `state=active` lists the consents that hold now, one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the organization with the name its consent text showed (a snapshot that a later rename does not change), the selected contact fields, and the invitation with its terms version; it never carries a contact value. A c2 record proves the consent to the publication text; the published field set and its changes are evidence of the publication history.
*
* Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations of this tag (TASK-063 and TASK-064); c1 is given at registration and c4 only in AcceptMyInvitation.
* Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations of this tag; c1 is given at registration and c4 only in AcceptMyInvitation.
*
* Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed `limit`, `cursor`, or `state` answers 400 validation_failed.
* @summary List the consents of the current account with their history.
@@ -205,7 +205,7 @@ export const getCreateOrganizationInvitationUrl = (orgId: string,) => {
*
* The terms are complete from the start (PRD FR12): the role, the specialization and the grade, the offer type, the tasks, the team, the technology stack, the work formats and the place of work, the communication method, the salary range in RUB with its tax basis, and the package. Each package condition is either `provided` with a description or explicitly `not_provided`; leaving one out fails validation. A draft without the tax basis or the communication method therefore cannot exist. The draft is created as version 1 with terms version 1, and the candidate does not see it until SendOrganizationInvitation.
*
* Salary: SalaryRange applies the same rules as for a need: whole rubles, positive multiples of 1000, `salary_from < salary_to`, and a width from 10% to 40% of the midpoint, checked by the server in integer arithmetic. The response carries `salary_fit`, the coarse indicator of PRD FR13 against the candidate's hidden minimum; the exact minimum appears in no response. The server never rejects a range because of the minimum, since a rejection would reveal it. Creating a draft is an indicator-relevant setting: it counts against the limit shared by the whole organization with the ranges of needs, at most three settings a day, and against the withheld counter, after five settings within seven days the indicator is `withheld` for seven days from the fifth, on every draft and invitation of the organization (PRD FR13, planned in TASK-211; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and creates nothing.
* Salary: SalaryRange applies the same rules as for a need: whole rubles, positive multiples of 1000, `salary_from < salary_to`, and a width from 10% to 40% of the midpoint, checked by the server in integer arithmetic. The response carries `salary_fit`, the coarse indicator of PRD FR13 against the candidate's hidden minimum; the exact minimum appears in no response. The server never rejects a range because of the minimum, since a rejection would reveal it. Creating a draft is an indicator-relevant setting: it counts against the limit shared by the whole organization with the ranges of needs, at most three settings a day, and against the withheld counter, after five settings within seven days the indicator is `withheld` for seven days from the fifth, on every draft and invitation of the organization (PRD FR13, enforcement planned; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and creates nothing.
*
* Idempotency: a retry with the same key and body within 24 hours replays the stored 201 and creates nothing, so a lost response never creates a second draft. A different body with the same key answers 422 idempotency_key_reused. 400 and 429 are never stored.
*
@@ -421,7 +421,7 @@ export const getUpdateOrganizationInvitationUrl = (orgId: string,
*
* Versions: every committed change creates version `expected_version + 1`; a change of the terms also creates the next terms version, an immutable snapshot, and a change of anything else keeps the terms version. `expected_version` is the `version` the client read; when it is not current, the server answers 412 version_conflict and changes nothing, and the client reads the invitation again. The version travels in the body because the generated client cannot read the ETag response header yet. The operation needs no Idempotency-Key: a body that changes nothing when applied to the current version, such as a retry of a change that already succeeded, keeps the version and answers 200 with the current invitation even when `expected_version` is older.
*
* Salary limit: every change that can move `salary_fit` is an indicator-relevant setting: a change of either salary bound, of the tax basis, or of `work_formats`, because the indicator compares with the candidate's minimum for the offered formats, and switching formats or the basis would otherwise probe the minimum for free. Such a change counts against the limit shared by the organization with needs and other drafts, at most three settings a day, and against the withheld counter, which withholds `salary_fit` for seven days from the fifth setting within seven days (PRD FR13, planned in TASK-211; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and changes nothing. A change that keeps the range, the basis, and the formats does not count. The operation follows the convention of UpdateOrganizationNeed: no Idempotency-Key, and a body that changes nothing answers 200.
* Salary limit: every change that can move `salary_fit` is an indicator-relevant setting: a change of either salary bound, of the tax basis, or of `work_formats`, because the indicator compares with the candidate's minimum for the offered formats, and switching formats or the basis would otherwise probe the minimum for free. Such a change counts against the limit shared by the organization with needs and other drafts, at most three settings a day, and against the withheld counter, which withholds `salary_fit` for seven days from the fifth setting within seven days (PRD FR13, enforcement planned; see InvitationSalaryFit). Over the limit the server answers 429 with Retry-After and changes nothing. A change that keeps the range, the basis, and the formats does not count. The operation follows the convention of UpdateOrganizationNeed: no Idempotency-Key, and a body that changes nothing answers 200.
*
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for a candidate), membership (404 not_found) and role (403 forbidden), the invitation (404 not_found), a body that changes nothing (200), the version (412), the state (409 state_conflict), domain rules (400 with the pointers of CreateOrganizationInvitation), then the salary limit (429).
* @summary Change the terms, the need link, or the response period of a draft.
@@ -516,9 +516,9 @@ export const useUpdateOrganizationInvitation = <TError = ErrorType<Problem>,
/**
* Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. In the MVP only the owner of the organization sends invitations.
*
* Sends the current terms version of a `draft`. Sending is internal and never visible as a state: in one transaction the server records the delivery, creates the candidate's inbox entry, starts the deadline `response_deadline_at = delivered_at + response_period_days`, spends one invitation of the weekly organization quota, and writes the outbox event for the notification (TASK-199), then answers 200 with the state `delivered`. A successful answer therefore means the candidate can already read the invitation; an email is a separate notification that never blocks or delays it, and its retries never move the deadline. No contact of the candidate is disclosed by sending.
* Sends the current terms version of a `draft`. Sending is internal and never visible as a state: in one transaction the server records the delivery, creates the candidate's inbox entry, starts the deadline `response_deadline_at = delivered_at + response_period_days`, spends one invitation of the weekly organization quota, and writes the outbox event for the notification, then answers 200 with the state `delivered`. A successful answer therefore means the candidate can already read the invitation; an email is a separate notification that never blocks or delays it, and its retries never move the deadline. No contact of the candidate is disclosed by sending.
*
* The server checks again that the candidate is still visible to the organization: a revoked publication C2 or a profile hidden from the organization answers 409 state_conflict without telling which. It also enforces the limits of the product policy: at most 20 invitations waiting for an answer per need (`delivered`, `viewed`, `counter`) and the 30-day pause for the pair of the organization and the candidate after a decline or a no deal, regardless of the member or the need, both with 409 state_conflict; and the rolling weekly quota of the organization (TASK-087), with 429 and Retry-After. The pending limit and the quota are planned in TASK-205 and TASK-087.
* The server checks again that the candidate is still visible to the organization: a revoked publication C2 or a profile hidden from the organization answers 409 state_conflict without telling which. It also enforces the limits of the product policy: at most 20 invitations waiting for an answer per need (`delivered`, `viewed`, `counter`) and the 30-day pause for the pair of the organization and the candidate after a decline or a no deal, regardless of the member or the need, both with 409 state_conflict; and the rolling weekly quota of the organization, with 429 and Retry-After. Enforcement of the pending limit and the organization quota is planned.
*
* Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and a send of an invitation that was already sent answers 200 with the invitation in its current state even with a new key or an older `expected_version`; the quota is spent once. A stale `expected_version` on a draft answers 412 version_conflict, so the organization never sends terms it did not read.
*
@@ -814,13 +814,13 @@ export const useWithdrawOrganizationInvitation = <TError = ErrorType<Problem>,
}
/**
* Requires the session cookie of an employer account with an active membership in `org_id`. In the MVP only the owner of the organization reads contacts (TASK-202); the other roles of PRD FR07 are planned.
* Requires the session cookie of an employer account with an active membership in `org_id`. In the MVP only the owner of the organization reads contacts; the other roles of PRD FR07 are planned.
*
* This is the only operation that returns contact values, and its response is separate from the terms and from the invitation. It answers only while a grant created by the acceptance of this invitation is active and the read is allowed now: on every request the server checks the membership, the consent C4 for this organization, the grant and its fields, and the current visibility of the profile (C2 and the organizations the candidate hid the profile from), with no cache in between, so a revocation closes the next read at once. The response holds exactly the fields that the grant covers; every other field is null. A grant of organization A never answers for organization B.
*
* Without such a grant the contacts do not exist for the caller, and the operation answers 404 not_found, the same as for an unknown invitation: before an acceptance, after a decline or an expiry, after the candidate revoked C4 or cancelled the participation, after the candidate closed the visibility, and while a grant created when the profile was not published or was hidden from the organization stays blocked. The answer does not tell which applies; `contact_access` of GetOrganizationInvitation tells the organization whether access is `not_granted`, `available`, or `closed`, without the reason, and the candidate sees `readable` and `blocked_by` on the grant. Withdrawing the invitation keeps an existing grant. A later publication of the profile never reopens a closed grant; only a new explicit C4 creates a new one.
*
* Every successful read is recorded in the access audit (planned in TASK-090 and TASK-202), and the response has `Cache-Control: no-store`.
* Every successful read is recorded in the access audit (planned with the contact access history), and the response has `Cache-Control: no-store`.
*
* Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an account without an active membership in the organization, an unknown organization, an unknown invitation, an invitation of another organization, and an invitation without an active readable grant all answer 404 not_found; a member whose role does not allow reading contacts answers 403 forbidden. An `org_id` or `invitation_id` that is not a UUID answers 400 validation_failed with the path pointer.
* @summary Read the contacts that the candidate disclosed to the organization.
@@ -1151,7 +1151,7 @@ export const getViewMyInvitationUrl = (invitationId: string,) => {
/**
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The candidate comes from the session. The request has no body.
*
* The view transition of PRD FR12 (TASK-200) is an explicit command, so reading the invitation with GetMyInvitation stays free of side effects. The client sends it when the candidate opens the terms screen. For a `delivered` invitation the server moves it to `viewed`, sets `viewed_at`, advances `version`, and keeps the deadline. In any other state, including `viewed`, `accepted`, and the terminal states, it changes nothing and answers 200 with the current invitation. A view never reopens, extends, or answers an invitation, and the organization sees only the state `viewed` and `viewed_at`.
* The view transition of PRD FR12 is an explicit command, so reading the invitation with GetMyInvitation stays free of side effects. The client sends it when the candidate opens the terms screen. For a `delivered` invitation the server moves it to `viewed`, sets `viewed_at`, advances `version`, and keeps the deadline. In any other state, including `viewed`, `accepted`, and the terminal states, it changes nothing and answers 200 with the current invitation. A view never reopens, extends, or answers an invitation, and the organization sees only the state `viewed` and `viewed_at`.
*
* The command is idempotent by its effect: the first view wins and every repeat returns the current invitation. It therefore needs no Idempotency-Key and no `expected_version`: a view must never fail because the invitation changed after the client read it, for example after a salary raise. A view at the deadline or later first applies the due expiry and answers 200 with `expired`.
*
@@ -1235,11 +1235,11 @@ export const useViewMyInvitation = <TError = ErrorType<Problem>,
*
* Only an acceptance of the current terms version with the consent C4 creates access to contacts (PRD FR12). The body names the `terms_version` the candidate read and accepts, the `expected_version` of the invitation, and `consent_c4`: the C4 text version that the candidate saw, `accepted: true`, and the contact fields the candidate selected. At least one field is required and nothing is preselected or defaulted, so a grant never covers a field the candidate did not choose. The fields come only from the candidate's profile; the request never carries contact values.
*
* Allowed in `delivered` and `viewed` before `response_deadline_at`; accepting directly from `delivered` is allowed, as in the PRD FR12 transition table. In one transaction the server moves the invitation to `accepted`, records the consent C4 in the consent ledger with the organization, the fields, the invitation, the terms version, and the text version and its hash (TASK-062), creates the contact grant for exactly those fields, and writes the audit event (TASK-201). The response is the invitation with `contact_grant`. The acceptance never publishes the profile (C2) and never bypasses a profile hidden from the organization: the grant alone does not guarantee a read, and the organization reads only while the visibility allows it.
* Allowed in `delivered` and `viewed` before `response_deadline_at`; accepting directly from `delivered` is allowed, as in the PRD FR12 transition table. In one transaction the server moves the invitation to `accepted`, records the consent C4 in the consent ledger with the organization, the fields, the invitation, the terms version, and the text version and its hash, creates the contact grant for exactly those fields, and writes the audit event. The response is the invitation with `contact_grant`. The acceptance never publishes the profile (C2) and never bypasses a profile hidden from the organization: the grant alone does not guarantee a read, and the organization reads only while the visibility allows it.
*
* 412 or 409: a `terms_version` or `expected_version` that is not current answers 412 version_conflict, the repository status for a stale version, and records nothing; this is the stale terms case, for example after the organization raised the salary, and the client reads the invitation again and shows the new terms for a new decision. A state that does not allow an acceptance answers 409 state_conflict: `withdrawn`, `expired`, `declined`, `cancelled_by_candidate`, the planned `counter`, or a command received at the deadline or later, which is late. A terminal state and a passed deadline are checked before the versions: the server first applies the due expiry, and the client then gets 409 for a withdrawn, expired, or late invitation even when its versions are stale, so it shows the final state instead of rereading and retrying. TASK-197, TASK-201, and TASK-204 say 409 for stale terms; the repository rule keeps 412 for any stale version, so clients branch on `version_conflict` to reread and on `state_conflict` to show the final state.
* 412 or 409: a `terms_version` or `expected_version` that is not current answers 412 version_conflict, the repository status for a stale version, and records nothing; this is the stale terms case, for example after the organization raised the salary, and the client reads the invitation again and shows the new terms for a new decision. A state that does not allow an acceptance answers 409 state_conflict: `withdrawn`, `expired`, `declined`, `cancelled_by_candidate`, the planned `counter`, or a command received at the deadline or later, which is late. A terminal state and a passed deadline are checked before the versions: the server first applies the due expiry, and the client then gets 409 for a withdrawn, expired, or late invitation even when its versions are stale, so it shows the final state instead of rereading and retrying. The repository rule keeps 412 for any stale version, so clients branch on `version_conflict` to reread and on `state_conflict` to show the final state.
*
* Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and an acceptance of an invitation that is already `accepted` whose `terms_version` and set of fields equal those of its `contact_grant`, the terms version and fields that the candidate accepted, answers 200 with it even with a new key, an older `expected_version`, or a current `terms_version` that a later raise advanced; no second consent, grant, or audit event is created. A different terms version or field set on an accepted invitation answers 409 state_conflict; changing the disclosed fields is a matter of the consent operations (TASK-064). Of two concurrent acceptances only one makes the transition.
* Repeats return the same result: a retry with the same Idempotency-Key replays the stored response, and an acceptance of an invitation that is already `accepted` whose `terms_version` and set of fields equal those of its `contact_grant`, the terms version and fields that the candidate accepted, answers 200 with it even with a new key, an older `expected_version`, or a current `terms_version` that a later raise advanced; no second consent, grant, or audit event is created. A different terms version or field set on an accepted invitation answers 409 state_conflict; changing the disclosed fields is a matter of the consent operations. Of two concurrent acceptances only one makes the transition.
*
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), the Idempotency-Key (422, 409 idempotency_in_progress, replay), the invitation (404 not_found, after any due expiry), the repeat on an accepted invitation (200), a terminal state or a passed deadline (409 state_conflict, whatever the versions), the versions (412), any other state that does not allow an acceptance (409 state_conflict), then the consent rules (400 with the pointer `/consent_c4/text_version` for a text version that is not the published one, or `/consent_c4/fields/0` for a field that the profile does not hold). The schema rejects a missing `terms_version`, an empty or repeated field list, an unknown field kind, `accepted` other than true, and unknown fields such as `email` or `phone`. The general rate limit can answer 429 with Retry-After before any check. 404 and 409 state_conflict are stored under the key; 400, 412, and 429 are not.
* @summary Accept the current terms and disclose the selected contacts.
@@ -1431,7 +1431,7 @@ export const useDeclineMyInvitation = <TError = ErrorType<Problem>,
/**
* Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The candidate comes from the session.
*
* Moves an unfinished invitation to the terminal state `cancelled_by_candidate` (PRD FR12): `delivered`, `viewed`, `accepted`, and the planned stages up to `negotiation`. The process closes. In the same transaction the server revokes the contact grant that the acceptance of this invitation created, with the reason `participation_cancelled`, so the next contact read of the organization answers 404. Grants of other invitations or applications stay; revoking the consent C4 for the organization as a whole, which closes all of them, belongs to the consent operations (TASK-064).
* Moves an unfinished invitation to the terminal state `cancelled_by_candidate` (PRD FR12): `delivered`, `viewed`, `accepted`, and the planned stages up to `negotiation`. The process closes. In the same transaction the server revokes the contact grant that the acceptance of this invitation created, with the reason `participation_cancelled`, so the next contact read of the organization answers 404. Grants of other invitations or applications stay; revoking the consent C4 for the organization as a whole, which closes all of them, belongs to the consent operations.
*
* Cancel differs from decline and withdraw: a decline is the structured answer before an acceptance and counts as a response; a cancellation leaves the process at any unfinished stage, mostly after an acceptance, and carries no reason; a withdrawal is the organization's command and keeps the grant. Before an answer the client offers the decline.
*
@@ -193,7 +193,7 @@ export const getCreateOrganizationNeedUrl = (orgId: string,) => {
*
* The need is saved even when critical fields are missing: the response is 201 with version 1, and `readiness.missing_fields` names each critical field without a confirmed value with a specific question. `recommendations` is computed by the server from the confirmed requirements only; the request cannot set a recommendation, its score, or its components. Creating a need never contacts a candidate or sends an invitation.
*
* Salary limit: setting a salary range counts against a limit shared by the whole organization, every member and every need, on creation as on a change: at most three range settings a day (PRD FR13, planned in TASK-211). Over the limit the server answers 429 with Retry-After and creates nothing. After five settings within seven days the money component of the recommendations is `withheld` for seven days. The limit keeps an organization from probing hidden candidate minimums with new needs instead of edits; repeated range changes also feed the private risk signals of TASK-319.
* Salary limit: setting a salary range counts against a limit shared by the whole organization, every member and every need, on creation as on a change: at most three range settings a day (PRD FR13, enforcement planned). Over the limit the server answers 429 with Retry-After and creates nothing. After five settings within seven days the money component of the recommendations is `withheld` for seven days. The limit keeps an organization from probing hidden candidate minimums with new needs instead of edits; repeated range changes also feed the private organization risk signals.
*
* Idempotency: a retry with the same key and body within 24 hours replays the stored 201 and creates nothing, so a lost response never creates a second need. A different body with the same key answers 422 idempotency_key_reused. 400 is never stored, so a corrected retry is evaluated again.
*
@@ -418,7 +418,7 @@ export const getUpdateOrganizationNeedUrl = (orgId: string,
*
* The operation needs no Idempotency-Key: a body that changes nothing when applied to the current version, such as a retry of a change that already succeeded, keeps the version and answers 200 with the current need even when `expected_version` is older. An incomplete need is a valid result; `readiness.missing_fields` tells what remains.
*
* Salary limit: the recommendations aggregate candidates' minimums against the upper bound, so setting or changing a confirmed salary range counts against a limit shared by the whole organization, every member and every need, together with ranges set on creation: at most three a day (PRD FR13, planned in TASK-211). Over the limit the server answers 429 with Retry-After and changes nothing. After five settings within seven days the money component is `withheld` for seven days. Repeated range changes also feed the private risk signals of TASK-319.
* Salary limit: the recommendations aggregate candidates' minimums against the upper bound, so setting or changing a confirmed salary range counts against a limit shared by the whole organization, every member and every need, together with ranges set on creation: at most three a day (PRD FR13, enforcement planned). Over the limit the server answers 429 with Retry-After and changes nothing. After five settings within seven days the money component is `withheld` for seven days. Repeated range changes also feed the private organization risk signals.
*
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for a candidate), membership (404 not_found) and role (403 forbidden), the need (404 not_found), a body that changes nothing (200), the version (412), domain rules (400 with a pointer such as `/salary/value/salary_to` for a range whose lower bound is not below the upper one or whose width is outside 10-40%, `/desired_skills/0/name` for a skill that is also in the required list, `/grade/status` or `/required_skills/2/status` for `extracted` with a value that is not the stored suggestion, or `/vacancy_id`), then the salary change limit (429). The schema rejects a missing or non-positive `expected_version`, unknown fields such as `rec_score`, `members`, `candidate_minimum`, or `version`, a field sent as a bare value instead of `{value, status}`, a list sent as null, a salary bound that is not a positive multiple of 1000, and an unknown currency, period, or tax basis.
* @summary Confirm, change, or delete requirements of a need.
@@ -179,7 +179,7 @@ export const getSetMyPublicationUrl = () => {
/**
* 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.
* 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) 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 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).
*
@@ -871,7 +871,7 @@ export const getListMyCardAccessHistoryUrl = (params?: ListMyCardAccessHistoryPa
*
* 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.
* The storage of accesses is planned with the card and contact operations of the organization side (anonymous card reads and contact reads under 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.
* @summary List the accesses of organizations to the card of the current candidate.
@@ -188,7 +188,7 @@ export const getCreateMySupportCaseUrl = () => {
* | `anticheat_appeal` | candidate | required; `assessment_attempt` of the caller with an anti-cheat review decision | none |
* | `manual_assessment` | candidate | optional; a prior `assessment_attempt` of the caller in the same specialization | required `assessment_target` |
*
* An organization is visible to a candidate when it sent the candidate an invitation or when the organization contract (TASK-077) shows the candidate its profile, and to an employer account when the account has an active membership in it. Invitations are in the contract (TASK-196) but not implemented yet, so until they are, every `invitation` reference answers 404 not_found; anti-cheat review decisions are not either, so until TASK-173 every anti-cheat appeal answers 409 state_conflict. The schema rejects an object type that the case type does not accept, for example an organization in a grade appeal.
* An organization is visible to a candidate when it sent the candidate an invitation or when the organization contract shows the candidate its profile, and to an employer account when the account has an active membership in it. Invitations are in the contract but not implemented yet, so until they are, every `invitation` reference answers 404 not_found; anti-cheat review decisions are not either, so until review decisions are implemented, every anti-cheat appeal answers 409 state_conflict. The schema rejects an object type that the case type does not accept, for example an organization in a grade appeal.
*
* Ownership of the reference: the server checks the object against the session account on every create. An unknown object and an object of someone else, such as another candidate's attempt, another account's case, or an invitation addressed to another person, both answer 404 not_found, so a reference never reveals whether a foreign object exists. An own case that a grade appeal cannot dispute, because it is not a manual assessment, is not resolved yet, or was resolved with another outcome, answers 409 state_conflict. An identifier that is not a UUID fails validation with the pointer `/object/id`. The case stores only the type and the identifier of the object.
*
@@ -297,7 +297,7 @@ export const useCreateMySupportCase = <TError = ErrorType<Problem>,
*
* The history lists every public event and is never truncated: the server keeps a case within 200 events by rejecting a staff event that would leave no room for the terminal one.
*
* The case must belong to the account of the session: a case of another account, including another member of the same organization, answers 404 not_found, the same as an unknown identifier, so identifiers cannot be probed. TASK-314 says forbidden for a foreign case URL; the contract answers 404 instead, so the client shows the same "not found" state for a foreign and an unknown case. A malformed `case_id` answers 400 validation_failed with the path pointer.
* The case must belong to the account of the session: a case of another account, including another member of the same organization, answers 404 not_found, the same as an unknown identifier, so identifiers cannot be probed. The contract answers 404, so the client shows the same "not found" state for a foreign and an unknown case. A malformed `case_id` answers 400 validation_failed with the path pointer.
* @summary Read a support case of the current account.
*/
export const getMySupportCase = async (caseId: string, options?: Parameters<typeof apiRequest>[1]): Promise<SupportCase> => {
@@ -15,7 +15,7 @@ import {
} from "./schemas";
// These tests pin the generated organization contract that the employer
// cabinet (TASK-080) and the organization switcher consume. They fail when
// cabinet and the organization switcher consume. They fail when
// regeneration drops a limit of the profile, loses a level, role, or state of
// the PRD, lets a request carry a role or a verification level, or lets a
// response name a member or an account.
@@ -15,7 +15,7 @@ import {
SearchStatusUpdate,
} from "./schemas";
// These tests pin the generated visibility contract (TASK-088) that the
// These tests pin the generated visibility contract that the
// privacy settings screen consumes. They fail when regeneration lets a
// request name a consent or a time, lets a card field name a name, a contact,
// or the salary, lets the anonymous card gain a contact, mixes the search
@@ -248,7 +248,9 @@ describe("generated AnonymousCardContent", () => {
};
expect(CardPreview.parse(closed)).toEqual(closed);
expect(CardPreview.parse({ ...closed, state: "published", fields: ["stack"], card })).toMatchObject({
expect(
CardPreview.parse({ ...closed, state: "published", fields: ["stack"], card }),
).toMatchObject({
card: { stack: ["PostgreSQL", "Kafka"] },
});
});
@@ -268,10 +270,9 @@ describe("privacy schemas", () => {
}));
const privacySide = [...sourcesIn(join("schemas", "privacy"))];
const otherSide = ["organization", "invitation", "need", "candidate", "consent"].flatMap((tag) => [
...sourcesIn(join("schemas", tag)),
...sourcesIn(join("endpoints", tag)),
]);
const otherSide = ["organization", "invitation", "need", "candidate", "consent"].flatMap(
(tag) => [...sourcesIn(join("schemas", tag)), ...sourcesIn(join("endpoints", tag))],
);
// Generated object keys that only the visibility settings have, matched as
// quoted keys because endpoint comments quote contract prose.
@@ -293,7 +294,7 @@ describe("privacy schemas", () => {
'"confirmed_categories":',
'"text_version":',
'"invitation_id":',
'"fields": zod.array(zod.enum([\'email\'',
"\"fields\": zod.array(zod.enum(['email'",
];
it("finds the generated files of both sides", () => {
@@ -13,7 +13,7 @@ import {
SaveMyProfileBody,
} from "./schemas";
// These tests pin the generated candidate profile contract (TASK-066) that
// These tests pin the generated candidate profile contract that
// the profile form consumes. They fail when regeneration drops a limit, lets a
// request carry a confirmed grade, a category, or provenance, loses the trust
// level of a claim, or mixes the private profile with organization DTOs.
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const ConsentPurposeCode = zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history (TASK-088), not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.')
export const ConsentPurposeCode = zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history, not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.')
export type ConsentPurposeCode = zod.input<typeof ConsentPurposeCode>;
export type ConsentPurposeCodeOutput = zod.output<typeof ConsentPurposeCode>;
@@ -18,10 +18,10 @@ export const consentRecordFieldsMax = 4;
export const ConsentRecord = zod.object({
"id": zod.uuid().describe('Identifier of the record.'),
"purpose": zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history (TASK-088), not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.'),
"purpose": zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history, not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.'),
"state": zod.enum(['active', 'superseded', 'revoked']).describe('State of a consent record, computed from the ledger.\n\n- active: the consent holds. For c1, c2, c3, and c5 it is the newest unrevoked record of its purpose; every unrevoked c4 record is active, one per accepted invitation.\n- superseded: the subject later accepted another text version of the same purpose and has not revoked either. The record stays as evidence for its own time; it never applies to c4.\n- revoked: the consent was revoked. The record keeps its grant and its one revocation time; a later grant is a new record and never reopens it.'),
"text_version": zod.string().min(1).max(consentRecordTextVersionOneMax).regex(consentRecordTextVersionOneRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.').describe('Version of the consent text that the subject accepted.'),
"source": zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned, TASK-063 and TASK-064).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.'),
"source": zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.'),
"granted_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"revoked_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the revocation, or null unless `state` is `revoked`.'),
"revocation_source": zod.union([zod.enum(['consent_settings', 'support_request']).describe('Who recorded a revocation.\n\n- consent_settings: the subject revoked the consent in the product.\n- support_request: an operator recorded a revocation that the subject requested through support.'),zod.null()]).describe('Who recorded the revocation, or null unless `state` is `revoked`.'),
@@ -29,7 +29,7 @@ export const ConsentRecord = zod.object({
"id": zod.uuid().describe('Identifier of the organization.'),
"name": zod.string().min(1).max(consentRecordOrganizationOneNameMax).describe('Name of the organization in the consent text at the time of the consent. Plain text; clients show it as text, never as HTML.')
}).describe('Organization of a c4 consent as the consent recorded it. `name` is a snapshot of the name that the shown consent text carried at the time of the consent, and the stored text hash proves that text with this name; a later rename of the organization does not change it, so it can differ from the current name.'),zod.null()]).describe('Organization that a c4 consent allows to read the fields, with the name the consent text showed, or null for every other purpose.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(consentRecordFieldsMax).nullable().describe('Contact fields that a c4 consent covers, or null for every other purpose. One kind never implies another.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(consentRecordFieldsMax).nullable().describe('Contact fields that a c4 consent covers, or null for every other purpose. One kind never implies another.'),
"invitation_id": zod.uuid().nullable().describe('Invitation whose acceptance gave a c4 consent, or null for every other purpose.'),
"invitation_terms_version": zod.union([zod.int().min(1).describe('Version of the terms of an invitation. The terms of a version are an immutable snapshot: every committed change of the terms, in the draft or by the one raise of the upper salary bound after sending, creates the next terms version, and a change of anything else keeps it. An acceptance names the terms version it accepts, and the consent C4 and the contact grant record it.'),zod.null()]).describe('Terms version that the acceptance accepted, or null for every other purpose.')
}).describe('One record of the consent ledger as its subject reads it: the purpose, the text version the subject accepted, where and when the consent was given, its state, and the revocation. A c4 record also names the organization, the contact fields, and the invitation with its terms version; these fields are null for every other purpose. The server also stores the SHA-256 hash of exactly the text the subject saw, which a client never sends or receives.')
@@ -25,10 +25,10 @@ export const consentRecordListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+
export const ConsentRecordList = zod.object({
"items": zod.array(zod.object({
"id": zod.uuid().describe('Identifier of the record.'),
"purpose": zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history (TASK-088), not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.'),
"purpose": zod.enum(['c1', 'c2', 'c3', 'c4', 'c5']).describe('One of the independent consents of PRD FR01. A grant or a revocation of one purpose never changes another.\n\n- c1: processing of personal data, given at registration.\n- c2: publication of the candidate card. The record proves the consent to the published text; which fields were published and when is evidence of the publication history, not of this record. Adding a field scope to c2 records later is an additive change.\n- c3: automatic categorization. Without it the candidate can request a manual assessment by the same rubric.\n- c4: transfer of the selected contact data to one organization, currently given only in an invitation acceptance.\n- c5: import of FSP results.\n\nConsentPurpose lists the subset whose text the client may read before an account exists.'),
"state": zod.enum(['active', 'superseded', 'revoked']).describe('State of a consent record, computed from the ledger.\n\n- active: the consent holds. For c1, c2, c3, and c5 it is the newest unrevoked record of its purpose; every unrevoked c4 record is active, one per accepted invitation.\n- superseded: the subject later accepted another text version of the same purpose and has not revoked either. The record stays as evidence for its own time; it never applies to c4.\n- revoked: the consent was revoked. The record keeps its grant and its one revocation time; a later grant is a new record and never reopens it.'),
"text_version": zod.string().min(1).max(consentRecordListItemsItemTextVersionOneMax).regex(consentRecordListItemsItemTextVersionOneRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.').describe('Version of the consent text that the subject accepted.'),
"source": zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned, TASK-063 and TASK-064).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.'),
"source": zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.'),
"granted_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"revoked_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment of the revocation, or null unless `state` is `revoked`.'),
"revocation_source": zod.union([zod.enum(['consent_settings', 'support_request']).describe('Who recorded a revocation.\n\n- consent_settings: the subject revoked the consent in the product.\n- support_request: an operator recorded a revocation that the subject requested through support.'),zod.null()]).describe('Who recorded the revocation, or null unless `state` is `revoked`.'),
@@ -36,7 +36,7 @@ export const ConsentRecordList = zod.object({
"id": zod.uuid().describe('Identifier of the organization.'),
"name": zod.string().min(1).max(consentRecordListItemsItemOrganizationOneNameMax).describe('Name of the organization in the consent text at the time of the consent. Plain text; clients show it as text, never as HTML.')
}).describe('Organization of a c4 consent as the consent recorded it. `name` is a snapshot of the name that the shown consent text carried at the time of the consent, and the stored text hash proves that text with this name; a later rename of the organization does not change it, so it can differ from the current name.'),zod.null()]).describe('Organization that a c4 consent allows to read the fields, with the name the consent text showed, or null for every other purpose.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(consentRecordListItemsItemFieldsMax).nullable().describe('Contact fields that a c4 consent covers, or null for every other purpose. One kind never implies another.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(consentRecordListItemsItemFieldsMax).nullable().describe('Contact fields that a c4 consent covers, or null for every other purpose. One kind never implies another.'),
"invitation_id": zod.uuid().nullable().describe('Invitation whose acceptance gave a c4 consent, or null for every other purpose.'),
"invitation_terms_version": zod.union([zod.int().min(1).describe('Version of the terms of an invitation. The terms of a version are an immutable snapshot: every committed change of the terms, in the draft or by the one raise of the upper salary bound after sending, creates the next terms version, and a change of anything else keeps it. An acceptance names the terms version it accepts, and the consent C4 and the contact grant record it.'),zod.null()]).describe('Terms version that the acceptance accepted, or null for every other purpose.')
}).describe('One record of the consent ledger as its subject reads it: the purpose, the text version the subject accepted, where and when the consent was given, its state, and the revocation. A c4 record also names the organization, the contact fields, and the invitation with its terms version; these fields are null for every other purpose. The server also stores the SHA-256 hash of exactly the text the subject saw, which a client never sends or receives.')).max(consentRecordListItemsMax).describe('Records of the page.'),
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const ConsentSource = zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned, TASK-063 and TASK-064).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.')
export const ConsentSource = zod.enum(['registration', 'consent_settings', 'invitation_acceptance']).describe('Where the subject gave the consent.\n\n- registration: the c1 acceptance of RegisterAccount.\n- consent_settings: the consent settings of the account, for c1, c2, c3, and c5 (planned).\n- invitation_acceptance: the c4 acceptance of AcceptMyInvitation.\n\nA c4 given when sending an application (PRD Q9) is planned as an additional value.')
export type ConsentSource = zod.input<typeof ConsentSource>;
export type ConsentSourceOutput = zod.output<typeof ConsentSource>;
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const ContactFieldKind = zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')
export const ContactFieldKind = zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')
export type ContactFieldKind = zod.input<typeof ContactFieldKind>;
export type ContactFieldKindOutput = zod.output<typeof ContactFieldKind>;
@@ -21,7 +21,7 @@ export const AcceptMyInvitationBody = zod.object({
"consent_c4": zod.object({
"text_version": zod.string().min(1).max(acceptMyInvitationBodyConsentC4TextVersionMax).regex(acceptMyInvitationBodyConsentC4TextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"accepted": zod.literal(true).describe('Explicit consent. Only true is valid.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(acceptMyInvitationBodyConsentC4FieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(acceptMyInvitationBodyConsentC4FieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
}).describe('Consent C4 given in an acceptance: the text version the candidate saw, an explicit `accepted`, and the contact fields the candidate selected. At least one field is required, so a hidden default or an empty choice never creates a grant. A text version that is not the currently published one answers 400 validation_failed with the pointer `/consent_c4/text_version`, and a field that the profile does not hold answers 400 with the pointer of that item, such as `/consent_c4/fields/1`. C4 is given only here, never at registration. The permission to pass the selected data on to the organization\'s ATS (PRD C4 and FR19) is planned as an additive optional flag that defaults to no transfer.')
}).describe('Acceptance of the current terms with the consent C4. The client sends the `version` and the `terms_version` it read and the contact fields the candidate selected; nothing is preselected or defaulted. Unknown fields are rejected, so a request cannot carry contact values, a grant, or another consent.')
@@ -11,7 +11,7 @@ export const CandidateHandleMax = 128;
export const CandidateHandleRegExp = new RegExp('^[A-Za-z0-9_-]+$');
export const CandidateHandle = zod.string().min(1).max(CandidateHandleMax).regex(CandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.')
export const CandidateHandle = zod.string().min(1).max(CandidateHandleMax).regex(CandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.')
export type CandidateHandle = zod.input<typeof CandidateHandle>;
export type CandidateHandleOutput = zod.output<typeof CandidateHandle>;
@@ -151,8 +151,8 @@ export const CandidateInvitation = zod.object({
"text": zod.object({
"text_version": zod.string().min(1).max(candidateInvitationContactConsentOneTextTextVersionMax).regex(candidateInvitationContactConsentOneTextTextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"text": zod.string().min(1).max(candidateInvitationContactConsentOneTextTextMax).describe('Full consent text in plain UTF-8 with the name of the organization; paragraphs are separated by an empty line. The client shows it as text, never as HTML, next to the field choice.')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the ledger of TASK-062).'),
"available_fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(candidateInvitationContactConsentOneAvailableFieldsMax).describe('Kinds of contact that the profile holds and that an acceptance may select. A kind outside this list answers 400 in an acceptance.')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the consent ledger).'),
"available_fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(candidateInvitationContactConsentOneAvailableFieldsMax).describe('Kinds of contact that the profile holds and that an acceptance may select. A kind outside this list answers 400 in an acceptance.')
}).describe('What the candidate can consent to in an acceptance: the consent text and the kinds of contact that the candidate\'s profile holds now. It holds kinds only, never contact values, and nothing is preselected.'),zod.null()]).describe('Text and choice of the consent C4 for an acceptance, or null when an acceptance is impossible now: the state does not allow it, the deadline has passed, or the profile holds no contact to disclose. In the last case the client tells the candidate to add a contact to the profile first, because a grant must cover at least one field.'),
"decline": zod.union([zod.object({
"reason": zod.enum(['salary', 'tasks', 'stack', 'work_format', 'package', 'company', 'not_looking', 'other_offer', 'other']).describe('Structured reason of a decline. Every reason is neutral and none requires a comment.\n\n- salary: the salary range does not fit.\n- tasks: the role or the tasks do not fit.\n- stack: the technologies do not fit.\n- work_format: the work format or the place of work does not fit.\n- package: the package does not fit.\n- company: the company or its domain does not fit.\n- not_looking: the candidate is not looking for a job now.\n- other_offer: the candidate accepted another offer.\n- other: another reason ("Другое"); a comment stays optional.\n\nThe organization never sees the reason of an individual decline: a reason such as `salary` would tell it that the hidden minimum is above the range. Reasons feed only the aggregates of FR12 with a minimum group size (planned). Adding a value is a contract change.'),
@@ -161,7 +161,7 @@ export const CandidateInvitation = zod.object({
}).describe('The candidate\'s own decline, as the candidate reads it back.'),zod.null()]).describe('The candidate\'s decline, or null unless `state` is `declined`.'),
"contact_grant": zod.union([zod.object({
"id": zod.uuid().describe('Identifier of the grant.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(candidateInvitationContactGrantOneFieldsMax).describe('Contact fields that the grant covers.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(candidateInvitationContactGrantOneFieldsMax).describe('Contact fields that the grant covers.'),
"status": zod.enum(['active', 'revoked']).describe('State of a contact grant.\n\n- active: the grant exists. Each read by the organization still checks the consent C4, the grant, and the current visibility of the profile.\n- revoked: the grant is closed for good; the organization reads no contact through it. A later publication of the profile or a new acceptance never reopens it; only a new explicit C4 creates a new grant.'),
"readable": zod.boolean().describe('Whether the organization can read the covered fields now: true only for an active grant whose current consent and visibility allow the read. The organization sees the same fact as `contact_access.status` `available`, without the reason.'),
"blocked_by": zod.union([zod.enum(['visibility']).describe('Why an active grant does not allow a read now, shown only to the candidate.\n\n- visibility: the profile was not published (C2) or was hidden from the organization when the candidate accepted, and it still is. The acceptance never publishes the profile or lifts the hiding by itself (PRD FR12); the grant becomes readable once the candidate publishes the profile or unhides it for the organization.'),zod.null()]).describe('Why an active grant is not readable now, or null when it is readable or revoked; a revoked grant has `revocation_reason` instead.'),
@@ -16,7 +16,7 @@ export const contactConsentAcceptanceFieldsMax = 4;
export const ContactConsentAcceptance = zod.object({
"text_version": zod.string().min(1).max(contactConsentAcceptanceTextVersionMax).regex(contactConsentAcceptanceTextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"accepted": zod.literal(true).describe('Explicit consent. Only true is valid.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactConsentAcceptanceFieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactConsentAcceptanceFieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
}).describe('Consent C4 given in an acceptance: the text version the candidate saw, an explicit `accepted`, and the contact fields the candidate selected. At least one field is required, so a hidden default or an empty choice never creates a grant. A text version that is not the currently published one answers 400 validation_failed with the pointer `/consent_c4/text_version`, and a field that the profile does not hold answers 400 with the pointer of that item, such as `/consent_c4/fields/1`. C4 is given only here, never at registration. The permission to pass the selected data on to the organization\'s ATS (PRD C4 and FR19) is planned as an additive optional flag that defaults to no transfer.')
export type ContactConsentAcceptance = zod.input<typeof ContactConsentAcceptance>;
@@ -19,8 +19,8 @@ export const ContactConsentOffer = zod.object({
"text": zod.object({
"text_version": zod.string().min(1).max(contactConsentOfferTextTextVersionMax).regex(contactConsentOfferTextTextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"text": zod.string().min(1).max(contactConsentOfferTextTextMax).describe('Full consent text in plain UTF-8 with the name of the organization; paragraphs are separated by an empty line. The client shows it as text, never as HTML, next to the field choice.')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the ledger of TASK-062).'),
"available_fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactConsentOfferAvailableFieldsMax).describe('Kinds of contact that the profile holds and that an acceptance may select. A kind outside this list answers 400 in an acceptance.')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the consent ledger).'),
"available_fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactConsentOfferAvailableFieldsMax).describe('Kinds of contact that the profile holds and that an acceptance may select. A kind outside this list answers 400 in an acceptance.')
}).describe('What the candidate can consent to in an acceptance: the consent text and the kinds of contact that the candidate\'s profile holds now. It holds kinds only, never contact values, and nothing is preselected.')
export type ContactConsentOffer = zod.input<typeof ContactConsentOffer>;
@@ -16,7 +16,7 @@ export const contactConsentTextTextMax = 100000;
export const ContactConsentText = zod.object({
"text_version": zod.string().min(1).max(contactConsentTextTextVersionMax).regex(contactConsentTextTextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"text": zod.string().min(1).max(contactConsentTextTextMax).describe('Full consent text in plain UTF-8 with the name of the organization; paragraphs are separated by an empty line. The client shows it as text, never as HTML, next to the field choice.')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the ledger of TASK-062).')
}).describe('Currently published text of the consent C4 for this invitation. The server stores an acceptance with `text_version` and the hash of exactly this text, together with the organization, the selected fields, the invitation, and its terms version (the consent ledger).')
export type ContactConsentText = zod.input<typeof ContactConsentText>;
export type ContactConsentTextOutput = zod.output<typeof ContactConsentText>;
@@ -29,13 +29,13 @@ export const contactDisclosureTelegramOneRegExp = new RegExp('^@[A-Za-z0-9_]{5,3
export const ContactDisclosure = zod.object({
"invitation_id": zod.uuid().describe('Invitation whose acceptance created the grant.'),
"grant_id": zod.uuid().describe('Grant that allows the read.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactDisclosureFieldsMax).describe('Contact fields that the grant covers.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactDisclosureFieldsMax).describe('Contact fields that the grant covers.'),
"granted_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"full_name": zod.union([zod.string().min(1).max(contactDisclosureFullNameOneMax).regex(contactDisclosureFullNameOneRegExp).describe('Full name as the candidate wrote it in the profile. Plain text without line breaks; clients show it as text, never as HTML.'),zod.null()]),
"email": zod.union([zod.email().min(contactDisclosureEmailOneMin).max(contactDisclosureEmailOneMax).describe('Account email address. The server compares addresses without regard to letter case and never reveals in a response whether an address belongs to an account.'),zod.null()]),
"phone": zod.union([zod.string().min(contactDisclosurePhoneOneMin).max(contactDisclosurePhoneOneMax).regex(contactDisclosurePhoneOneRegExp).describe('Phone number in the E.164 format, for example +70000000000.'),zod.null()]),
"telegram": zod.union([zod.string().min(contactDisclosureTelegramOneMin).max(contactDisclosureTelegramOneMax).regex(contactDisclosureTelegramOneRegExp).describe('Telegram username with the leading @.'),zod.null()])
}).describe('Contacts of the candidate that the organization may read through an active grant of this invitation. This is the only response that carries contact values, and it is separate from the terms and from the invitation. Each field the grant does not cover is null, and so is a covered field that the profile no longer holds. The response is never cached or stored by the server for later reads, so a revocation closes the next read at once. The value formats depend on the profile contract (FR02, TASK-066), which must store the same formats; see ContactFieldKind.')
}).describe('Contacts of the candidate that the organization may read through an active grant of this invitation. This is the only response that carries contact values, and it is separate from the terms and from the invitation. Each field the grant does not cover is null, and so is a covered field that the profile no longer holds. The response is never cached or stored by the server for later reads, so a revocation closes the next read at once. The value formats depend on the profile contract (FR02), which must store the same formats; see ContactFieldKind.')
export type ContactDisclosure = zod.input<typeof ContactDisclosure>;
export type ContactDisclosureOutput = zod.output<typeof ContactDisclosure>;
@@ -16,7 +16,7 @@ export const contactGrantConsentTextVersionOneRegExp = new RegExp('^[A-Za-z0-9._
export const ContactGrant = zod.object({
"id": zod.uuid().describe('Identifier of the grant.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactGrantFieldsMax).describe('Contact fields that the grant covers.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(contactGrantFieldsMax).describe('Contact fields that the grant covers.'),
"status": zod.enum(['active', 'revoked']).describe('State of a contact grant.\n\n- active: the grant exists. Each read by the organization still checks the consent C4, the grant, and the current visibility of the profile.\n- revoked: the grant is closed for good; the organization reads no contact through it. A later publication of the profile or a new acceptance never reopens it; only a new explicit C4 creates a new grant.'),
"readable": zod.boolean().describe('Whether the organization can read the covered fields now: true only for an active grant whose current consent and visibility allow the read. The organization sees the same fact as `contact_access.status` `available`, without the reason.'),
"blocked_by": zod.union([zod.enum(['visibility']).describe('Why an active grant does not allow a read now, shown only to the candidate.\n\n- visibility: the profile was not published (C2) or was hidden from the organization when the candidate accepted, and it still is. The acceptance never publishes the profile or lifts the hiding by itself (PRD FR12); the grant becomes readable once the candidate publishes the profile or unhides it for the organization.'),zod.null()]).describe('Why an active grant is not readable now, or null when it is readable or revoked; a revoked grant has `revocation_reason` instead.'),
@@ -67,7 +67,7 @@ export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescr
export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const CreateOrganizationInvitationBody = zod.object({
"candidate_handle": zod.string().min(1).max(createOrganizationInvitationBodyCandidateHandleMax).regex(createOrganizationInvitationBodyCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.'),
"candidate_handle": zod.string().min(1).max(createOrganizationInvitationBodyCandidateHandleMax).regex(createOrganizationInvitationBodyCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
"need": zod.union([zod.object({
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
@@ -21,7 +21,7 @@ export const InvitationAcceptance = zod.object({
"consent_c4": zod.object({
"text_version": zod.string().min(1).max(invitationAcceptanceConsentC4TextVersionMax).regex(invitationAcceptanceConsentC4TextVersionRegExp).describe('Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.'),
"accepted": zod.literal(true).describe('Explicit consent. Only true is valid.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(invitationAcceptanceConsentC4FieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).min(1).max(invitationAcceptanceConsentC4FieldsMax).describe('Contact fields the organization may read after the acceptance. The grant covers exactly these fields and no other.')
}).describe('Consent C4 given in an acceptance: the text version the candidate saw, an explicit `accepted`, and the contact fields the candidate selected. At least one field is required, so a hidden default or an empty choice never creates a grant. A text version that is not the currently published one answers 400 validation_failed with the pointer `/consent_c4/text_version`, and a field that the profile does not hold answers 400 with the pointer of that item, such as `/consent_c4/fields/1`. C4 is given only here, never at registration. The permission to pass the selected data on to the organization\'s ATS (PRD C4 and FR19) is planned as an additive optional flag that defaults to no transfer.')
}).describe('Acceptance of the current terms with the consent C4. The client sends the `version` and the `terms_version` it read and the contact fields the candidate selected; nothing is preselected or defaulted. Unknown fields are rejected, so a request cannot carry contact values, a grant, or another consent.')
@@ -11,7 +11,7 @@ export const invitationContactAccessFieldsMax = 4;
export const InvitationContactAccess = zod.object({
"status": zod.enum(['not_granted', 'available', 'closed']).describe('Whether the organization may read the candidate\'s contacts through GetOrganizationInvitationContacts now.\n\n- not_granted: the candidate has not accepted this invitation, so no grant exists.\n- available: a grant from this invitation is active and the current consent and visibility allow the read.\n- closed: a grant from this invitation exists but does not allow the read now: it was revoked (the candidate revoked C4, cancelled the participation, or revoked the publication C2 or hid the profile after the acceptance), or it was created while the visibility already did not allow the read. The organization is not told which. A revoked grant never becomes `available` again; a grant blocked from the start becomes `available` once the candidate\'s visibility allows the read, which only follows the candidate\'s own choice to publish the profile or unhide it for the organization. Since every visibility change after a grant exists revokes the grant, a later toggle is never visible to the organization.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(invitationContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(invitationContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
}).describe('Contact access of the organization through this invitation, without any contact value. The values come only from GetOrganizationInvitationContacts.')
export type InvitationContactAccess = zod.input<typeof InvitationContactAccess>;
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const InvitationSalaryFit = zod.enum(['within_range', 'up_to_10_percent_above', 'above', 'withheld', 'not_available']).describe('Coarse indicator for the organization of how the salary range relates to the candidate\'s hidden minimum (PRD FR13). It is the only information about the minimum that the organization receives; the exact minimum never appears in any response, log, or problem. The server compares the upper bound `B` with the lowest minimum the candidate set for the offered work formats, in integer arithmetic and only in the same tax basis.\n\n- within_range: the minimum is not above `B`.\n- up_to_10_percent_above: the minimum is above `B` by at most 10%, that is `10 * minimum <= 11 * B`.\n- above: the minimum is more than 10% above `B`.\n- withheld: the organization made five indicator-relevant settings within seven days, so the indicator is off for seven days from the fifth (the limit of TASK-211). The response to the fifth setting already carries `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.\n- not_available: the candidate set no minimum for the offered formats, or set it in the other tax basis.\n\nEvery change that can move this indicator is an indicator-relevant setting: the range set on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, since the minimum depends on the format. Each counts against the organization-wide limit of three settings a day (429) and against the withheld counter of five settings within seven days, together with the ranges of needs. The one raise of the upper bound of a sent invitation counts against the withheld counter but not against the daily limit, because FR13 gives it its own once-only rule. Switching the tax basis turns `not_available` into a band or back and so tells the organization the basis of the minimum; this is accepted, and the switch counts against the limit like any other setting.\n\nThe server never rejects or changes a range because of the minimum: a rejection would itself reveal it.')
export const InvitationSalaryFit = zod.enum(['within_range', 'up_to_10_percent_above', 'above', 'withheld', 'not_available']).describe('Coarse indicator for the organization of how the salary range relates to the candidate\'s hidden minimum (PRD FR13). It is the only information about the minimum that the organization receives; the exact minimum never appears in any response, log, or problem. The server compares the upper bound `B` with the lowest minimum the candidate set for the offered work formats, in integer arithmetic and only in the same tax basis.\n\n- within_range: the minimum is not above `B`.\n- up_to_10_percent_above: the minimum is above `B` by at most 10%, that is `10 * minimum <= 11 * B`.\n- above: the minimum is more than 10% above `B`.\n- withheld: the organization made five indicator-relevant settings within seven days, so the indicator is off for seven days from the fifth. The response to the fifth setting already carries `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.\n- not_available: the candidate set no minimum for the offered formats, or set it in the other tax basis.\n\nEvery change that can move this indicator is an indicator-relevant setting: the range set on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, since the minimum depends on the format. Each counts against the organization-wide limit of three settings a day (429) and against the withheld counter of five settings within seven days, together with the ranges of needs. The one raise of the upper bound of a sent invitation counts against the withheld counter but not against the daily limit, because FR13 gives it its own once-only rule. Switching the tax basis turns `not_available` into a band or back and so tells the organization the basis of the minimum; this is accepted, and the switch counts against the limit like any other setting.\n\nThe server never rejects or changes a range because of the minimum: a rejection would itself reveal it.')
export type InvitationSalaryFit = zod.input<typeof InvitationSalaryFit>;
export type InvitationSalaryFitOutput = zod.output<typeof InvitationSalaryFit>;
@@ -73,7 +73,7 @@ export const organizationInvitationContactAccessFieldsMax = 4;
export const OrganizationInvitation = zod.object({
"id": zod.uuid().describe('Identifier of the invitation.'),
"organization_id": zod.uuid().describe('Organization that owns the invitation, equal to `org_id` of the path. It never changes.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationCandidateHandleMax).regex(organizationInvitationCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationCandidateHandleMax).regex(organizationInvitationCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
"need": zod.union([zod.object({
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
@@ -133,10 +133,10 @@ export const OrganizationInvitation = zod.object({
"response_period_days": zod.union([zod.literal(3),zod.literal(7),zod.literal(14)]).describe('Days the candidate has to answer, chosen by the organization in the draft from the product policy: 3, 7, or 14. The deadline starts at the first delivery and is never reset by an email, a view, or a counter offer.'),
"response_deadline_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Moment when the candidate\'s time to answer ends, set at the first delivery to `delivered_at` plus `response_period_days`, or null for a draft. A command received at this moment or later is late. After an acceptance the deadline no longer applies.'),
"salary_raise_used": zod.boolean().describe('Whether the one raise of the upper salary bound after sending (PRD FR13) has been used. It counts the whole history of the invitation.'),
"salary_fit": zod.enum(['within_range', 'up_to_10_percent_above', 'above', 'withheld', 'not_available']).describe('Coarse indicator for the organization of how the salary range relates to the candidate\'s hidden minimum (PRD FR13). It is the only information about the minimum that the organization receives; the exact minimum never appears in any response, log, or problem. The server compares the upper bound `B` with the lowest minimum the candidate set for the offered work formats, in integer arithmetic and only in the same tax basis.\n\n- within_range: the minimum is not above `B`.\n- up_to_10_percent_above: the minimum is above `B` by at most 10%, that is `10 * minimum <= 11 * B`.\n- above: the minimum is more than 10% above `B`.\n- withheld: the organization made five indicator-relevant settings within seven days, so the indicator is off for seven days from the fifth (the limit of TASK-211). The response to the fifth setting already carries `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.\n- not_available: the candidate set no minimum for the offered formats, or set it in the other tax basis.\n\nEvery change that can move this indicator is an indicator-relevant setting: the range set on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, since the minimum depends on the format. Each counts against the organization-wide limit of three settings a day (429) and against the withheld counter of five settings within seven days, together with the ranges of needs. The one raise of the upper bound of a sent invitation counts against the withheld counter but not against the daily limit, because FR13 gives it its own once-only rule. Switching the tax basis turns `not_available` into a band or back and so tells the organization the basis of the minimum; this is accepted, and the switch counts against the limit like any other setting.\n\nThe server never rejects or changes a range because of the minimum: a rejection would itself reveal it.'),
"salary_fit": zod.enum(['within_range', 'up_to_10_percent_above', 'above', 'withheld', 'not_available']).describe('Coarse indicator for the organization of how the salary range relates to the candidate\'s hidden minimum (PRD FR13). It is the only information about the minimum that the organization receives; the exact minimum never appears in any response, log, or problem. The server compares the upper bound `B` with the lowest minimum the candidate set for the offered work formats, in integer arithmetic and only in the same tax basis.\n\n- within_range: the minimum is not above `B`.\n- up_to_10_percent_above: the minimum is above `B` by at most 10%, that is `10 * minimum <= 11 * B`.\n- above: the minimum is more than 10% above `B`.\n- withheld: the organization made five indicator-relevant settings within seven days, so the indicator is off for seven days from the fifth. The response to the fifth setting already carries `withheld`, and so does every draft and invitation of the organization, existing ones included, until the period ends.\n- not_available: the candidate set no minimum for the offered formats, or set it in the other tax basis.\n\nEvery change that can move this indicator is an indicator-relevant setting: the range set on creation, and in a draft a change of either bound, of the tax basis, or of `work_formats`, since the minimum depends on the format. Each counts against the organization-wide limit of three settings a day (429) and against the withheld counter of five settings within seven days, together with the ranges of needs. The one raise of the upper bound of a sent invitation counts against the withheld counter but not against the daily limit, because FR13 gives it its own once-only rule. Switching the tax basis turns `not_available` into a band or back and so tells the organization the basis of the minimum; this is accepted, and the switch counts against the limit like any other setting.\n\nThe server never rejects or changes a range because of the minimum: a rejection would itself reveal it.'),
"contact_access": zod.object({
"status": zod.enum(['not_granted', 'available', 'closed']).describe('Whether the organization may read the candidate\'s contacts through GetOrganizationInvitationContacts now.\n\n- not_granted: the candidate has not accepted this invitation, so no grant exists.\n- available: a grant from this invitation is active and the current consent and visibility allow the read.\n- closed: a grant from this invitation exists but does not allow the read now: it was revoked (the candidate revoked C4, cancelled the participation, or revoked the publication C2 or hid the profile after the acceptance), or it was created while the visibility already did not allow the read. The organization is not told which. A revoked grant never becomes `available` again; a grant blocked from the start becomes `available` once the candidate\'s visibility allows the read, which only follows the candidate\'s own choice to publish the profile or unhide it for the organization. Since every visibility change after a grant exists revokes the grant, a later toggle is never visible to the organization.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
}).describe('Contact access of the organization through this invitation, without any contact value. The values come only from GetOrganizationInvitationContacts.'),
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
@@ -67,7 +67,7 @@ export const organizationInvitationCreateTermsPackageHealthInsuranceOneDescripti
export const organizationInvitationCreateTermsPackageHealthInsuranceOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const OrganizationInvitationCreate = zod.object({
"candidate_handle": zod.string().min(1).max(organizationInvitationCreateCandidateHandleMax).regex(organizationInvitationCreateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationCreateCandidateHandleMax).regex(organizationInvitationCreateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
"need": zod.union([zod.object({
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
@@ -37,7 +37,7 @@ export const organizationInvitationListPageNextCursorRegExp = new RegExp('^[A-Za
export const OrganizationInvitationList = zod.object({
"items": zod.array(zod.object({
"id": zod.uuid().describe('Identifier of the invitation.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationListItemsItemCandidateHandleMax).regex(organizationInvitationListItemsItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationListItemsItemCandidateHandleMax).regex(organizationInvitationListItemsItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
"need": zod.union([zod.object({
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
@@ -57,7 +57,7 @@ export const OrganizationInvitationList = zod.object({
"response_deadline_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]),
"contact_access": zod.object({
"status": zod.enum(['not_granted', 'available', 'closed']).describe('Whether the organization may read the candidate\'s contacts through GetOrganizationInvitationContacts now.\n\n- not_granted: the candidate has not accepted this invitation, so no grant exists.\n- available: a grant from this invitation is active and the current consent and visibility allow the read.\n- closed: a grant from this invitation exists but does not allow the read now: it was revoked (the candidate revoked C4, cancelled the participation, or revoked the publication C2 or hid the profile after the acceptance), or it was created while the visibility already did not allow the read. The organization is not told which. A revoked grant never becomes `available` again; a grant blocked from the start becomes `available` once the candidate\'s visibility allows the read, which only follows the candidate\'s own choice to publish the profile or unhide it for the organization. Since every visibility change after a grant exists revokes the grant, a later toggle is never visible to the organization.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationListItemsItemContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationListItemsItemContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
}).describe('Contact access of the organization through this invitation, without any contact value. The values come only from GetOrganizationInvitationContacts.'),
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
@@ -30,7 +30,7 @@ export const organizationInvitationSummaryContactAccessFieldsMax = 4;
export const OrganizationInvitationSummary = zod.object({
"id": zod.uuid().describe('Identifier of the invitation.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationSummaryCandidateHandleMax).regex(organizationInvitationSummaryCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11 (TASK-185), which issue it.'),
"candidate_handle": zod.string().min(1).max(organizationInvitationSummaryCandidateHandleMax).regex(organizationInvitationSummaryCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from a search result card of that organization. It is not the candidate\'s account or profile identifier, it never contains an email address or a phone number, and it means nothing to another organization. The server resolves it only for the organization in the path. Clients never parse it. It is shared by the invitations of FR12 and the search results of FR11, which issue it.'),
"need": zod.union([zod.object({
"need_id": zod.uuid().describe('Identifier of a need of the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('`requirements_version` of the need that the invitation refers to; it must be a version that the need has had.')
@@ -50,7 +50,7 @@ export const OrganizationInvitationSummary = zod.object({
"response_deadline_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]),
"contact_access": zod.object({
"status": zod.enum(['not_granted', 'available', 'closed']).describe('Whether the organization may read the candidate\'s contacts through GetOrganizationInvitationContacts now.\n\n- not_granted: the candidate has not accepted this invitation, so no grant exists.\n- available: a grant from this invitation is active and the current consent and visibility allow the read.\n- closed: a grant from this invitation exists but does not allow the read now: it was revoked (the candidate revoked C4, cancelled the participation, or revoked the publication C2 or hid the profile after the acceptance), or it was created while the visibility already did not allow the read. The organization is not told which. A revoked grant never becomes `available` again; a grant blocked from the start becomes `available` once the candidate\'s visibility allows the read, which only follows the candidate\'s own choice to publish the profile or unhide it for the organization. Since every visibility change after a grant exists revokes the grant, a later toggle is never visible to the organization.'),
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02, TASK-066) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationSummaryContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
"fields": zod.array(zod.enum(['full_name', 'email', 'phone', 'telegram']).describe('Kind of personal data that the consent C4 can disclose to one organization (PRD FR01 and FR12). The candidate selects each kind separately; one kind never implies another.\n\n- full_name: the full name from the profile.\n- email: the contact email address from the profile.\n- phone: the contact phone number from the profile.\n- telegram: the Telegram username from the profile.\n\nThe value formats are those of ContactDisclosure: a single-line full name of up to 200 characters, an E.164 phone number, and a Telegram username with the leading @. The profile contract (FR02) must store contacts in the same formats, so a disclosure never has to convert or drop a stored value. The FSP results of FR14, which need their own explicit permission, are planned as additional kinds. Adding a value is a contract change.')).max(organizationInvitationSummaryContactAccessFieldsMax).describe('Kinds of contact that the read returns while `status` is `available`; empty otherwise.')
}).describe('Contact access of the organization through this invitation, without any contact value. The values come only from GetOrganizationInvitationContacts.'),
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
@@ -52,7 +52,7 @@ export const createOrganizationNeedBodySalaryOneValueSalaryToMultipleOf = 1000;
export const CreateOrganizationNeedBody = zod.object({
"title": zod.string().min(1).max(createOrganizationNeedBodyTitleMax).regex(createOrganizationNeedBodyTitleRegExp).describe('Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"vacancy_id": zod.uuid().nullish().describe('Vacancy of the same organization to link, or null or absent for a need without a vacancy.'),
"source_text": zod.union([zod.string().min(1).max(createOrganizationNeedBodySourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'),zod.null()]).exactOptional(),
"source_text": zod.union([zod.string().min(1).max(createOrganizationNeedBodySourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.'),zod.null()]).exactOptional(),
"specialization": zod.union([zod.object({
"value": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a list item, and the decision that a request sends for a field or an item: `confirmed` or `extracted`, with the meaning of NeedValueStatus. A request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value. An item is never `unknown`; a list with no confirmed item is what readiness reports as missing.')
@@ -160,7 +160,7 @@ export const Need = zod.object({
"organization_id": zod.uuid().describe('Organization that owns the need, equal to `org_id` of the path. It never changes.'),
"vacancy_id": zod.uuid().nullable().describe('Linked vacancy of the same organization, or null. A need never requires a vacancy.'),
"title": zod.string().min(1).max(needTitleMax).regex(needTitleRegExp).describe('Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"source_text": zod.union([zod.string().min(1).max(needSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'),zod.null()]).describe('Text the requirements were extracted from, or null.'),
"source_text": zod.union([zod.string().min(1).max(needSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.'),zod.null()]).describe('Text the requirements were extracted from, or null.'),
"version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.').describe('Need version in which the current confirmed requirements were last changed, at most `version`. A change that confirms, changes, or removes a requirement makes it equal to the new `version`. A change of the title, the vacancy link, or the text, or of suggestions only, creates a new `version` but keeps `requirements_version`, so it invalidates neither the recommendations nor search results and selection snapshots. Search runs and selection snapshots (PRD FR10) refer to `(need id, requirements_version)`, and a new selection snapshot is due only when it changes.'),
"requirements": zod.object({
@@ -287,7 +287,7 @@ export const Need = zod.object({
"uncovered_skills": zod.array(zod.string().min(1).max(needRecommendationsCategoriesItemSkillOverlapUncoveredSkillsItemMax).regex(needRecommendationsCategoriesItemSkillOverlapUncoveredSkillsItemRegExp).describe('Name of a skill or technology as the employer gave it, for example Go, PostgreSQL, or Temporal. It has no leading or trailing whitespace and no line breaks. The server compares names without regard to letter case. Plain text; clients show it as text, never as HTML.')).max(needRecommendationsCategoriesItemSkillOverlapUncoveredSkillsMax).describe('Confirmed skills of the need that the category does not cover, including skills without a taxonomy code.')
}).describe('Skill coverage of a category: the weighted share of the confirmed skills of the need that the category taxonomy covers, with weight 2 for a required and 1 for a desired skill.'),
"money": zod.object({
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, enforcement planned); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"share": zod.number().min(needRecommendationsCategoriesItemMoneyShareMin).max(needRecommendationsCategoriesItemMoneyShareMax).nullable().describe('Share of those candidates whose minimum is not above the upper bound of the range, rounded down to a multiple of 0.25 (one of 0, 0.25, 0.5, 0.75, 1), or null unless `status` is `computed`. The score and the ranking use this rounded value, never the exact share. A quarter step gives five levels: each probe of a new upper bound tells at most which quarter of the group accepts it, and in the smallest allowed group of five candidates a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.')
}).describe('Salary component of a recommendation. It is an aggregate over at least five candidates and never reveals a minimum of any candidate.'),
"supply": zod.enum(['fewer_than_5', 'from_5_to_29', '30_or_more']).describe('Number of available candidates of the category in the allowed detail: `fewer_than_5`, `from_5_to_29`, or `30_or_more`. Smaller groups are never counted exactly.')
@@ -38,7 +38,7 @@ export const NeedCategoryRecommendation = zod.object({
"uncovered_skills": zod.array(zod.string().min(1).max(needCategoryRecommendationSkillOverlapUncoveredSkillsItemMax).regex(needCategoryRecommendationSkillOverlapUncoveredSkillsItemRegExp).describe('Name of a skill or technology as the employer gave it, for example Go, PostgreSQL, or Temporal. It has no leading or trailing whitespace and no line breaks. The server compares names without regard to letter case. Plain text; clients show it as text, never as HTML.')).max(needCategoryRecommendationSkillOverlapUncoveredSkillsMax).describe('Confirmed skills of the need that the category does not cover, including skills without a taxonomy code.')
}).describe('Skill coverage of a category: the weighted share of the confirmed skills of the need that the category taxonomy covers, with weight 2 for a required and 1 for a desired skill.'),
"money": zod.object({
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, enforcement planned); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"share": zod.number().min(needCategoryRecommendationMoneyShareMin).max(needCategoryRecommendationMoneyShareMax).nullable().describe('Share of those candidates whose minimum is not above the upper bound of the range, rounded down to a multiple of 0.25 (one of 0, 0.25, 0.5, 0.75, 1), or null unless `status` is `computed`. The score and the ranking use this rounded value, never the exact share. A quarter step gives five levels: each probe of a new upper bound tells at most which quarter of the group accepts it, and in the smallest allowed group of five candidates a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.')
}).describe('Salary component of a recommendation. It is an aggregate over at least five candidates and never reveals a minimum of any candidate.'),
"supply": zod.enum(['fewer_than_5', 'from_5_to_29', '30_or_more']).describe('Number of available candidates of the category in the allowed detail: `fewer_than_5`, `from_5_to_29`, or `30_or_more`. Smaller groups are never counted exactly.')
@@ -52,7 +52,7 @@ export const NeedCategoryRecommendations = zod.object({
"uncovered_skills": zod.array(zod.string().min(1).max(needCategoryRecommendationsCategoriesItemSkillOverlapUncoveredSkillsItemMax).regex(needCategoryRecommendationsCategoriesItemSkillOverlapUncoveredSkillsItemRegExp).describe('Name of a skill or technology as the employer gave it, for example Go, PostgreSQL, or Temporal. It has no leading or trailing whitespace and no line breaks. The server compares names without regard to letter case. Plain text; clients show it as text, never as HTML.')).max(needCategoryRecommendationsCategoriesItemSkillOverlapUncoveredSkillsMax).describe('Confirmed skills of the need that the category does not cover, including skills without a taxonomy code.')
}).describe('Skill coverage of a category: the weighted share of the confirmed skills of the need that the category taxonomy covers, with weight 2 for a required and 1 for a desired skill.'),
"money": zod.object({
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, enforcement planned); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"share": zod.number().min(needCategoryRecommendationsCategoriesItemMoneyShareMin).max(needCategoryRecommendationsCategoriesItemMoneyShareMax).nullable().describe('Share of those candidates whose minimum is not above the upper bound of the range, rounded down to a multiple of 0.25 (one of 0, 0.25, 0.5, 0.75, 1), or null unless `status` is `computed`. The score and the ranking use this rounded value, never the exact share. A quarter step gives five levels: each probe of a new upper bound tells at most which quarter of the group accepts it, and in the smallest allowed group of five candidates a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.')
}).describe('Salary component of a recommendation. It is an aggregate over at least five candidates and never reveals a minimum of any candidate.'),
"supply": zod.enum(['fewer_than_5', 'from_5_to_29', '30_or_more']).describe('Number of available candidates of the category in the allowed detail: `fewer_than_5`, `from_5_to_29`, or `30_or_more`. Smaller groups are never counted exactly.')
@@ -52,7 +52,7 @@ export const needCreateSalaryOneValueSalaryToMultipleOf = 1000;
export const NeedCreate = zod.object({
"title": zod.string().min(1).max(needCreateTitleMax).regex(needCreateTitleRegExp).describe('Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"vacancy_id": zod.uuid().nullish().describe('Vacancy of the same organization to link, or null or absent for a need without a vacancy.'),
"source_text": zod.union([zod.string().min(1).max(needCreateSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'),zod.null()]).exactOptional(),
"source_text": zod.union([zod.string().min(1).max(needCreateSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.'),zod.null()]).exactOptional(),
"specialization": zod.union([zod.object({
"value": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a list item, and the decision that a request sends for a field or an item: `confirmed` or `extracted`, with the meaning of NeedValueStatus. A request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value. An item is never `unknown`; a list with no confirmed item is what readiness reports as missing.')
@@ -11,7 +11,7 @@ export const needMoneyFitShareMax = 1;
export const NeedMoneyFit = zod.object({
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"status": zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, enforcement planned); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.'),
"share": zod.number().min(needMoneyFitShareMin).max(needMoneyFitShareMax).nullable().describe('Share of those candidates whose minimum is not above the upper bound of the range, rounded down to a multiple of 0.25 (one of 0, 0.25, 0.5, 0.75, 1), or null unless `status` is `computed`. The score and the ranking use this rounded value, never the exact share. A quarter step gives five levels: each probe of a new upper bound tells at most which quarter of the group accepts it, and in the smallest allowed group of five candidates a single minimum often does not move the value, while the share still separates a range that most candidates accept from one that few accept.')
}).describe('Salary component of a recommendation. It is an aggregate over at least five candidates and never reveals a minimum of any candidate.')
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const NeedMoneyStatus = zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, planned in TASK-211); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.')
export const NeedMoneyStatus = zod.enum(['computed', 'insufficient_data', 'no_salary', 'withheld']).describe('How the salary component of a recommendation was obtained.\n\n- computed: at least five available candidates of the category have a known minimum comparable with the confirmed range; `share` is given.\n- insufficient_data: fewer than five such candidates; the policy uses the neutral value 0.5 and `share` is null.\n- no_salary: the need has no confirmed salary range; the policy uses the neutral value 0.5 and `share` is null.\n- withheld: the organization changed salary ranges five times within seven days, so salary aggregates are withheld for seven days (PRD FR13, enforcement planned); the policy uses the neutral value 0.5 and `share` is null.\n\nAn unknown candidate minimum never counts as zero.')
export type NeedMoneyStatus = zod.input<typeof NeedMoneyStatus>;
export type NeedMoneyStatusOutput = zod.output<typeof NeedMoneyStatus>;
@@ -9,7 +9,7 @@ import * as zod from 'zod';
export const NeedSourceTextMax = 10000;
export const NeedSourceText = zod.string().min(1).max(NeedSourceTextMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).')
export const NeedSourceText = zod.string().min(1).max(NeedSourceTextMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.')
export type NeedSourceText = zod.input<typeof NeedSourceText>;
export type NeedSourceTextOutput = zod.output<typeof NeedSourceText>;
@@ -54,7 +54,7 @@ export const NeedUpdate = zod.object({
"expected_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"title": zod.string().min(1).max(needUpdateTitleMax).regex(needUpdateTitleRegExp).exactOptional().describe('Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"vacancy_id": zod.uuid().nullish().describe('Vacancy of the same organization to link, or null to unlink.'),
"source_text": zod.union([zod.string().min(1).max(needUpdateSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'),zod.null()]).exactOptional(),
"source_text": zod.union([zod.string().min(1).max(needUpdateSourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.'),zod.null()]).exactOptional(),
"specialization": zod.union([zod.object({
"value": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a list item, and the decision that a request sends for a field or an item: `confirmed` or `extracted`, with the meaning of NeedValueStatus. A request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value. An item is never `unknown`; a list with no confirmed item is what readiness reports as missing.')
@@ -54,7 +54,7 @@ export const UpdateOrganizationNeedBody = zod.object({
"expected_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"title": zod.string().min(1).max(updateOrganizationNeedBodyTitleMax).regex(updateOrganizationNeedBodyTitleRegExp).exactOptional().describe('Short name of the need inside the organization, for example "Backend for the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"vacancy_id": zod.uuid().nullish().describe('Vacancy of the same organization to link, or null to unlink.'),
"source_text": zod.union([zod.string().min(1).max(updateOrganizationNeedBodySourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check (TASK-182).'),zod.null()]).exactOptional(),
"source_text": zod.union([zod.string().min(1).max(updateOrganizationNeedBodySourceTextOneMax).describe('Free description of the team\'s tasks as the employer wrote or pasted it. The server extracts proposed requirements from it; the text itself is never a requirement. It may contain line breaks. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of candidates. The server stores it as written: it may contain requirements that discriminate by a protected characteristic, and the extractor never turns such a requirement into a need field. Exclusions, the requirements that a candidate must not meet, are planned as a separate additive field with the Labor Code article 64 check.'),zod.null()]).exactOptional(),
"specialization": zod.union([zod.object({
"value": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a list item, and the decision that a request sends for a field or an item: `confirmed` or `extracted`, with the meaning of NeedValueStatus. A request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value. An item is never `unknown`; a list with no confirmed item is what readiness reports as missing.')
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const MembershipState = zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management (TASK-082, TASK-084) must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.')
export const MembershipState = zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.')
export type MembershipState = zod.input<typeof MembershipState>;
export type MembershipStateOutput = zod.output<typeof MembershipState>;
@@ -20,8 +20,8 @@ export const MyOrganization = zod.object({
"membership": zod.object({
"organization_id": zod.uuid().describe('Identifier of the organization.'),
"role": zod.enum(['owner', 'recruiter', 'hiring_manager', 'technical_expert']).describe('Role of a member in an organization (PRD 2.2 and the FR07 matrix). The role belongs to the membership, never to the organization or to any editable profile.\n\n- owner: manages the organization and its members, and acts on behalf of the company.\n- recruiter: leads the selection of candidates for all needs.\n- hiring_manager: acts on the needs assigned to the member.\n- technical_expert: refines the requirements of the assigned needs; reads no contacts and sends no invitations.\n\nIn the MVP only the owner acts, so the other roles grant nothing yet: an operation that is not open to a role answers 403 `forbidden`. The full matrix is planned, and applying it changes no field of this contract. Adding a role is a contract change.'),
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management (TASK-082, TASK-084) must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`, TASK-082).')
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`).')
}).describe('The membership of the caller in one organization. The caller is the account of the session, so the object holds no account identifier. Only the server sets the role and the state, through the operations that manage members, which are planned; no operation of this contract changes them.')
}).describe('An organization available to the caller together with the caller\'s membership in it.')
@@ -27,8 +27,8 @@ export const MyOrganizationList = zod.object({
"membership": zod.object({
"organization_id": zod.uuid().describe('Identifier of the organization.'),
"role": zod.enum(['owner', 'recruiter', 'hiring_manager', 'technical_expert']).describe('Role of a member in an organization (PRD 2.2 and the FR07 matrix). The role belongs to the membership, never to the organization or to any editable profile.\n\n- owner: manages the organization and its members, and acts on behalf of the company.\n- recruiter: leads the selection of candidates for all needs.\n- hiring_manager: acts on the needs assigned to the member.\n- technical_expert: refines the requirements of the assigned needs; reads no contacts and sends no invitations.\n\nIn the MVP only the owner acts, so the other roles grant nothing yet: an operation that is not open to a role answers 403 `forbidden`. The full matrix is planned, and applying it changes no field of this contract. Adding a role is a contract change.'),
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management (TASK-082, TASK-084) must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`, TASK-082).')
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`).')
}).describe('The membership of the caller in one organization. The caller is the account of the session, so the object holds no account identifier. Only the server sets the role and the state, through the operations that manage members, which are planned; no operation of this contract changes them.')
}).describe('An organization available to the caller together with the caller\'s membership in it.')).max(myOrganizationListItemsMax).describe('Organizations of the page.'),
"page": zod.object({
@@ -9,8 +9,8 @@ import * as zod from 'zod';
export const OrganizationMembership = zod.object({
"organization_id": zod.uuid().describe('Identifier of the organization.'),
"role": zod.enum(['owner', 'recruiter', 'hiring_manager', 'technical_expert']).describe('Role of a member in an organization (PRD 2.2 and the FR07 matrix). The role belongs to the membership, never to the organization or to any editable profile.\n\n- owner: manages the organization and its members, and acts on behalf of the company.\n- recruiter: leads the selection of candidates for all needs.\n- hiring_manager: acts on the needs assigned to the member.\n- technical_expert: refines the requirements of the assigned needs; reads no contacts and sends no invitations.\n\nIn the MVP only the owner acts, so the other roles grant nothing yet: an operation that is not open to a role answers 403 `forbidden`. The full matrix is planned, and applying it changes no field of this contract. Adding a role is a contract change.'),
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management (TASK-082, TASK-084) must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`, TASK-082).')
"state": zod.enum(['active', 'suspended', 'removed', 'left']).describe('State of a membership. Only `active` gives access: every other state answers as if the account were no member.\n\n- active: the member works in the organization with the role.\n- suspended: access is stopped, and the owner or the platform may restore it.\n- removed: the owner or the platform ended the membership. A removal by the platform is not undone by the owner or by an invitation: the acceptance of an employee invitation and the member management must not reactivate it on their own. Who removed the member and why become additive fields of the member management.\n- left: the member ended the membership.\n\nOne account has at most one membership per organization, so a former member who returns gets the same membership back in `active`, and the history of the pair is the history of its audit events (planned). The listing of this contract returns only `active` memberships; the other states are listed now so that generated clients accept them when the member management reads them. Adding a state is a contract change.'),
"joined_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.').describe('Moment the membership was first created. A member who left and returns keeps the same value, because the pair has one membership; the moment of the latest activation is a planned additive field (`activated_at`).')
}).describe('The membership of the caller in one organization. The caller is the account of the session, so the object holds no account identifier. Only the server sets the role and the state, through the operations that manage members, which are planned; no operation of this contract changes them.')
export type OrganizationMembership = zod.input<typeof OrganizationMembership>;
@@ -38,7 +38,7 @@ export const AnonymousCardContent = zod.object({
"soft_skills": zod.array(zod.string().min(1).max(anonymousCardContentSoftSkillsItemMax).regex(anonymousCardContentSoftSkillsItemRegExp).describe('Plain text; clients show it as text, never as HTML.')).max(anonymousCardContentSoftSkillsMax).nullable().describe('Soft skills of the candidate, or null.'),
"location": zod.string().min(1).max(anonymousCardContentLocationMax).regex(anonymousCardContentLocationRegExp).nullable().describe('City or region as free text, never a street address, or null. Plain text; clients show it as text, never as HTML.'),
"relocation": zod.boolean().nullable().describe('Whether the candidate is ready to relocate, or null.')
}).describe('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.')
}).describe('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.')
export type AnonymousCardContent = zod.input<typeof AnonymousCardContent>;
export type AnonymousCardContentOutput = zod.output<typeof AnonymousCardContent>;
@@ -44,7 +44,7 @@ export const CardPreview = zod.object({
"soft_skills": zod.array(zod.string().min(1).max(cardPreviewCardOneSoftSkillsItemMax).regex(cardPreviewCardOneSoftSkillsItemRegExp).describe('Plain text; clients show it as text, never as HTML.')).max(cardPreviewCardOneSoftSkillsMax).nullable().describe('Soft skills of the candidate, or null.'),
"location": zod.string().min(1).max(cardPreviewCardOneLocationMax).regex(cardPreviewCardOneLocationRegExp).nullable().describe('City or region as free text, never a street address, or null. Plain text; clients show it as text, never as HTML.'),
"relocation": zod.boolean().nullable().describe('Whether the candidate is ready to relocate, or null.')
}).describe('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.'),zod.null()]),
}).describe('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.'),zod.null()]),
"generated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
}).describe('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.')
@@ -31,7 +31,7 @@ export const CreateMySupportCaseBody = zod.union([zod.object({
"type": zod.enum(['support']),
"description": zod.string().min(1).max(createMySupportCaseBodyOneDescriptionMax).regex(createMySupportCaseBodyOneDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
"object": zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
"assessment_target": zod.object({
@@ -34,7 +34,7 @@ export const SupportCase = zod.object({
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
"description": zod.string().min(1).max(supportCaseDescriptionMax).regex(supportCaseDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
"object": zod.union([zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, as sent on creation, or null when the case has none.'),
"assessment_target": zod.union([zod.object({
@@ -58,8 +58,8 @@ export const SupportCase = zod.object({
}).describe('Decision visible to the user. It exists only once the case is `resolved`. It holds the outcome and the public reason; it never names the moderator or the expert and never contains internal notes, evidence, sanctions against another party, or risk signals. An upheld grade appeal never rewrites the original result: the corrected result is a separate decision of the assessment, and both stay in the history of that attempt.'),zod.null()]).describe('Decision once the case is `resolved`, otherwise null.'),
"history": zod.array(zod.object({
"sequence": zod.int().min(1).describe('Position of the event in the history, starting at 1 and increasing by one.'),
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; assessment experts and appeal moderators are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"status": zod.union([zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),zod.null()]).describe('Status of the case after the event, or null for a reply.'),
"message": zod.union([zod.string().min(1).max(supportCaseHistoryItemMessageOneMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),zod.null()]).describe('Public text of the event, or null.')
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const SupportCaseActorKind = zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.')
export const SupportCaseActorKind = zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; assessment experts and appeal moderators are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.')
export type SupportCaseActorKind = zod.input<typeof SupportCaseActorKind>;
export type SupportCaseActorKindOutput = zod.output<typeof SupportCaseActorKind>;
@@ -31,7 +31,7 @@ export const SupportCaseCreate = zod.union([zod.object({
"type": zod.enum(['support']),
"description": zod.string().min(1).max(supportCaseCreateOneDescriptionMax).regex(supportCaseCreateOneDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
"object": zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
"assessment_target": zod.object({
@@ -15,7 +15,7 @@ export const SupportCaseCreateSupport = zod.object({
"type": zod.enum(['support']),
"description": zod.string().min(1).max(supportCaseCreateSupportDescriptionMax).regex(supportCaseCreateSupportDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
"object": zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
"assessment_target": zod.object({
@@ -12,8 +12,8 @@ export const supportCaseEventMessageOneMax = 4000;
export const SupportCaseEvent = zod.object({
"sequence": zod.int().min(1).describe('Position of the event in the history, starting at 1 and increasing by one.'),
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; assessment experts and appeal moderators are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
"status": zod.union([zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),zod.null()]).describe('Status of the case after the event, or null for a reply.'),
"message": zod.union([zod.string().min(1).max(supportCaseEventMessageOneMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),zod.null()]).describe('Public text of the event, or null.')
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const SupportCaseEventKind = zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.')
export const SupportCaseEventKind = zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.')
export type SupportCaseEventKind = zod.input<typeof SupportCaseEventKind>;
export type SupportCaseEventKindOutput = zod.output<typeof SupportCaseEventKind>;
@@ -28,7 +28,7 @@ export const SupportCaseList = zod.object({
"type": zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'),
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
"object": zod.union([zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, or null.'),
"assessment_target": zod.union([zod.object({
@@ -7,7 +7,7 @@
import * as zod from 'zod';
export const SupportCaseObjectReference = zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.')
@@ -6,7 +6,7 @@
*/
import * as zod from 'zod';
export const SupportCaseObjectType = zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.')
export const SupportCaseObjectType = zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.')
export type SupportCaseObjectType = zod.input<typeof SupportCaseObjectType>;
export type SupportCaseObjectTypeOutput = zod.output<typeof SupportCaseObjectType>;
@@ -21,7 +21,7 @@ export const SupportCaseSummary = zod.object({
"type": zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'),
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
"object": zod.union([zod.object({
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract (TASK-196) but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with profile analysis.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are in the contract but not implemented yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
"id": zod.uuid().describe('Identifier of the object.')
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, or null.'),
"assessment_target": zod.union([zod.object({