feat(profile): add the manual candidate profile contract and storage

This commit is contained in:
shira committed 2026-10-06 21:10:04 +03:00
1 parent d21fd49a42
commit e52ffe7bcb
97 files changed
+20442 -63

No files matched your search

@@ -0,0 +1,317 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const candidateProfileVersionMin = 0;
export const candidateProfileFullNameValueOneMax = 200;
export const candidateProfileFullNameValueOneRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const candidateProfileFullNameSourceOneTrustLevelMin = 0;
export const candidateProfileFullNameSourceOneTrustLevelMax = 0;
export const candidateProfileFullNameSourceOneQuoteOneMax = 300;
export const candidateProfileFullNameSourceOneExtractionVersionOneMax = 64;
export const candidateProfileFullNameSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileContactsEmailValueOneMin = 3;
export const candidateProfileContactsEmailValueOneMax = 254;
export const candidateProfileContactsEmailSourceOneTrustLevelMin = 0;
export const candidateProfileContactsEmailSourceOneTrustLevelMax = 0;
export const candidateProfileContactsEmailSourceOneQuoteOneMax = 300;
export const candidateProfileContactsEmailSourceOneExtractionVersionOneMax = 64;
export const candidateProfileContactsEmailSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileContactsPhoneValueOneMin = 8;
export const candidateProfileContactsPhoneValueOneMax = 16;
export const candidateProfileContactsPhoneValueOneRegExp = new RegExp('^\\+[1-9][0-9]{6,14}$');
export const candidateProfileContactsPhoneSourceOneTrustLevelMin = 0;
export const candidateProfileContactsPhoneSourceOneTrustLevelMax = 0;
export const candidateProfileContactsPhoneSourceOneQuoteOneMax = 300;
export const candidateProfileContactsPhoneSourceOneExtractionVersionOneMax = 64;
export const candidateProfileContactsPhoneSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileContactsTelegramValueOneMin = 6;
export const candidateProfileContactsTelegramValueOneMax = 33;
export const candidateProfileContactsTelegramValueOneRegExp = new RegExp('^@[A-Za-z0-9_]{5,32}$');
export const candidateProfileContactsTelegramSourceOneTrustLevelMin = 0;
export const candidateProfileContactsTelegramSourceOneTrustLevelMax = 0;
export const candidateProfileContactsTelegramSourceOneQuoteOneMax = 300;
export const candidateProfileContactsTelegramSourceOneExtractionVersionOneMax = 64;
export const candidateProfileContactsTelegramSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileStackItemTagMax = 50;
export const candidateProfileStackItemTagRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const candidateProfileStackItemSourceTrustLevelMin = 0;
export const candidateProfileStackItemSourceTrustLevelMax = 0;
export const candidateProfileStackItemSourceQuoteOneMax = 300;
export const candidateProfileStackItemSourceExtractionVersionOneMax = 64;
export const candidateProfileStackItemSourceExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileStackMax = 30;
export const candidateProfileRolesItemSourceTrustLevelMin = 0;
export const candidateProfileRolesItemSourceTrustLevelMax = 0;
export const candidateProfileRolesItemSourceQuoteOneMax = 300;
export const candidateProfileRolesItemSourceExtractionVersionOneMax = 64;
export const candidateProfileRolesItemSourceExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileRolesMax = 9;
export const candidateProfileExperienceItemEmployerNameOneMax = 200;
export const candidateProfileExperienceItemEmployerNameOneRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const candidateProfileExperienceItemStartedOnMin = 7;
export const candidateProfileExperienceItemStartedOnMax = 7;
export const candidateProfileExperienceItemStartedOnRegExp = new RegExp('^[0-9]{4}-(0[1-9]|1[0-2])$');
export const candidateProfileExperienceItemEndedOnOneMin = 7;
export const candidateProfileExperienceItemEndedOnOneMax = 7;
export const candidateProfileExperienceItemEndedOnOneRegExp = new RegExp('^[0-9]{4}-(0[1-9]|1[0-2])$');
export const candidateProfileExperienceItemSummaryOneMax = 1000;
export const candidateProfileExperienceItemSourceTrustLevelMin = 0;
export const candidateProfileExperienceItemSourceTrustLevelMax = 0;
export const candidateProfileExperienceItemSourceQuoteOneMax = 300;
export const candidateProfileExperienceItemSourceExtractionVersionOneMax = 64;
export const candidateProfileExperienceItemSourceExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileExperienceMax = 20;
export const candidateProfileSoftSkillsItemSkillMax = 50;
export const candidateProfileSoftSkillsItemSkillRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const candidateProfileSoftSkillsItemSourceTrustLevelMin = 0;
export const candidateProfileSoftSkillsItemSourceTrustLevelMax = 0;
export const candidateProfileSoftSkillsItemSourceQuoteOneMax = 300;
export const candidateProfileSoftSkillsItemSourceExtractionVersionOneMax = 64;
export const candidateProfileSoftSkillsItemSourceExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileSoftSkillsMax = 10;
export const candidateProfileTermsLocationValueOneMax = 100;
export const candidateProfileTermsLocationValueOneRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const candidateProfileTermsLocationSourceOneTrustLevelMin = 0;
export const candidateProfileTermsLocationSourceOneTrustLevelMax = 0;
export const candidateProfileTermsLocationSourceOneQuoteOneMax = 300;
export const candidateProfileTermsLocationSourceOneExtractionVersionOneMax = 64;
export const candidateProfileTermsLocationSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileTermsRelocationSourceOneTrustLevelMin = 0;
export const candidateProfileTermsRelocationSourceOneTrustLevelMax = 0;
export const candidateProfileTermsRelocationSourceOneQuoteOneMax = 300;
export const candidateProfileTermsRelocationSourceOneExtractionVersionOneMax = 64;
export const candidateProfileTermsRelocationSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileTermsSalaryMinimumValueOneAmountMin = 1000;
export const candidateProfileTermsSalaryMinimumValueOneAmountMax = 100000000;
export const candidateProfileTermsSalaryMinimumValueOneAmountMultipleOf = 1000;
export const candidateProfileTermsSalaryMinimumSourceOneTrustLevelMin = 0;
export const candidateProfileTermsSalaryMinimumSourceOneTrustLevelMax = 0;
export const candidateProfileTermsSalaryMinimumSourceOneQuoteOneMax = 300;
export const candidateProfileTermsSalaryMinimumSourceOneExtractionVersionOneMax = 64;
export const candidateProfileTermsSalaryMinimumSourceOneExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileConfirmedCategoriesMax = 9;
export const CandidateProfile = zod.object({
"version": zod.int().min(candidateProfileVersionMin).describe('Version of the candidate profile. A candidate who has not saved the profile has version 0; every save that changes the profile advances it by one. The client sends the version it read as `expected_version`.'),
"full_name": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.string().min(1).max(candidateProfileFullNameValueOneMax).regex(candidateProfileFullNameValueOneRegExp).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()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileFullNameSourceOneTrustLevelMin).max(candidateProfileFullNameSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileFullNameSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileFullNameSourceOneExtractionVersionOneMax).regex(candidateProfileFullNameSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Full name of the candidate with its confirmation state and provenance. The value is personal data. It is disclosed to one organization only through the contact grant of the consent C4 and never appears in an organization-visible schema. `value` and `source` are null exactly when `status` is `unknown`.'),
"contacts": zod.object({
"email": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.email().min(candidateProfileContactsEmailValueOneMin).max(candidateProfileContactsEmailValueOneMax).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()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileContactsEmailSourceOneTrustLevelMin).max(candidateProfileContactsEmailSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileContactsEmailSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileContactsEmailSourceOneExtractionVersionOneMax).regex(candidateProfileContactsEmailSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Contact email of the candidate with its confirmation state and provenance. It is personal data. It is a contact channel that the candidate gives, not the login of the account: the two may differ, the server never sends mail to it and never verifies it. `value` and `source` are null exactly when `status` is `unknown`.'),
"phone": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.string().min(candidateProfileContactsPhoneValueOneMin).max(candidateProfileContactsPhoneValueOneMax).regex(candidateProfileContactsPhoneValueOneRegExp).describe('Phone number in the E.164 format, for example +70000000000.'),zod.null()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileContactsPhoneSourceOneTrustLevelMin).max(candidateProfileContactsPhoneSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileContactsPhoneSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileContactsPhoneSourceOneExtractionVersionOneMax).regex(candidateProfileContactsPhoneSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Contact phone number of the candidate with its confirmation state and provenance. It is personal data, stored in the E.164 format of the contact disclosure. `value` and `source` are null exactly when `status` is `unknown`.'),
"telegram": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.string().min(candidateProfileContactsTelegramValueOneMin).max(candidateProfileContactsTelegramValueOneMax).regex(candidateProfileContactsTelegramValueOneRegExp).describe('Telegram username with the leading @.'),zod.null()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileContactsTelegramSourceOneTrustLevelMin).max(candidateProfileContactsTelegramSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileContactsTelegramSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileContactsTelegramSourceOneExtractionVersionOneMax).regex(candidateProfileContactsTelegramSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Telegram username of the candidate with its confirmation state and provenance. It is personal data, stored with the leading @ of the contact disclosure. `value` and `source` are null exactly when `status` is `unknown`.')
}).describe('Contact channels of the candidate. Each channel is a claim of its own, and the candidate fills in any subset. The kinds are the ones that the contact disclosure (consent C4) can pass on, with the same value formats, so a disclosure never has to convert or drop a stored value; adding a kind, such as a link to a code repository, is a contract change in both places. Contacts leave the profile only through a contact grant, never in a card or a search result. All values are personal data.'),
"stack": zod.array(zod.object({
"tag": zod.string().min(1).max(candidateProfileStackItemTagMax).regex(candidateProfileStackItemTagRegExp).describe('Free technology tag of the candidate\'s stack, for example PostgreSQL, Kubernetes, or Django. A tag is a descriptive attribute: it never forms a category, never selects the task language, and never changes a grade, so a tag such as "Senior" has no effect on any category. It has no leading or trailing whitespace and no line breaks. The server compares tags without regard to letter case. Clients show tags as text, never as HTML.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a profile list item, and the decision that a request sends for a field or an item.\n\n- confirmed: the candidate typed the value or confirmed a suggestion. Only confirmed values leave the profile, for example into a disclosure.\n- extracted: a suggestion that the server took from an imported document or source. Nobody has confirmed it yet, so it is a claim of trust level 0 that no other feature uses.\n\nA 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; a client that submits an unchanged form therefore confirms nothing by accident. An item is never `unknown`: a missing item is simply absent from the list.'),
"source": zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileStackItemSourceTrustLevelMin).max(candidateProfileStackItemSourceTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileStackItemSourceQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileStackItemSourceExtractionVersionOneMax).regex(candidateProfileStackItemSourceExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.')
}).describe('One technology tag of the candidate\'s stack with its confirmation state and provenance. The profile stack is one list for the whole profile; the questionnaire holds the tags of each chosen specialization with the same `StackTag` meaning, and the two lists are independent: the server never copies one into the other. A tag is a descriptive attribute and never forms a category.')).max(candidateProfileStackMax).describe('Technology tags in the order the candidate gave them, each tag at most once without regard to letter case.'),
"roles": zod.array(zod.object({
"specialization": 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.'),
"self_assessed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Grade that the candidate claims in the specialization, or null when the candidate names none.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a profile list item, and the decision that a request sends for a field or an item.\n\n- confirmed: the candidate typed the value or confirmed a suggestion. Only confirmed values leave the profile, for example into a disclosure.\n- extracted: a suggestion that the server took from an imported document or source. Nobody has confirmed it yet, so it is a claim of trust level 0 that no other feature uses.\n\nA 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; a client that submits an unchanged form therefore confirms nothing by accident. An item is never `unknown`: a missing item is simply absent from the list.'),
"source": zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileRolesItemSourceTrustLevelMin).max(candidateProfileRolesItemSourceTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileRolesItemSourceQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileRolesItemSourceExtractionVersionOneMax).regex(candidateProfileRolesItemSourceExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.')
}).describe('One role of the candidate: a specialization of the catalog with the grade that the candidate claims for it. `self_assessed_grade` is a claim, the same one that the questionnaire calls `self_assessed_grade` for its at most two chosen specializations: it influences nothing but the display and never becomes a confirmed grade or a category. The questionnaire value starts the assessment and the profile value is what the profile shows; the two are saved separately and the server never copies one into the other. A confirmed grade comes only from an assessment result and appears in `confirmed_categories` of the profile, never in a role; unknown fields such as `confirmed_grade` or `category` are rejected.')).max(candidateProfileRolesMax).describe('Roles in the order the candidate gave them, each specialization at most once.'),
"experience": zod.array(zod.object({
"employer_name": zod.union([zod.string().min(1).max(candidateProfileExperienceItemEmployerNameOneMax).regex(candidateProfileExperienceItemEmployerNameOneRegExp).describe('Name of the employer in one experience entry, as the candidate wrote it. It is personal data of the candidate\'s career. It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Employer of the entry, or null when the candidate gives none.'),
"specialization": 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.'),
"started_on": zod.string().min(candidateProfileExperienceItemStartedOnMin).max(candidateProfileExperienceItemStartedOnMax).regex(candidateProfileExperienceItemStartedOnRegExp).describe('Calendar month in the `YYYY-MM` format, for example 2024-03. An experience period has month precision only, so the contract holds no exact date of employment. The server rejects a month that lies in the future.'),
"ended_on": zod.union([zod.string().min(candidateProfileExperienceItemEndedOnOneMin).max(candidateProfileExperienceItemEndedOnOneMax).regex(candidateProfileExperienceItemEndedOnOneRegExp).describe('Calendar month in the `YYYY-MM` format, for example 2024-03. An experience period has month precision only, so the contract holds no exact date of employment. The server rejects a month that lies in the future.'),zod.null()]).describe('Last month of the work, or null when the candidate still works there. It is not earlier than `started_on`.'),
"summary": zod.union([zod.string().min(1).max(candidateProfileExperienceItemSummaryOneMax).describe('Tasks and results of the candidate in one experience entry. It describes the work rather than a job title. It may contain line breaks and personal data of the candidate; it must not contain personal data of other people. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Tasks and results of the entry, or null when the candidate gives none.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a profile list item, and the decision that a request sends for a field or an item.\n\n- confirmed: the candidate typed the value or confirmed a suggestion. Only confirmed values leave the profile, for example into a disclosure.\n- extracted: a suggestion that the server took from an imported document or source. Nobody has confirmed it yet, so it is a claim of trust level 0 that no other feature uses.\n\nA 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; a client that submits an unchanged form therefore confirms nothing by accident. An item is never `unknown`: a missing item is simply absent from the list.'),
"source": zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileExperienceItemSourceTrustLevelMin).max(candidateProfileExperienceItemSourceTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileExperienceItemSourceQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileExperienceItemSourceExtractionVersionOneMax).regex(candidateProfileExperienceItemSourceExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.')
}).describe('One entry of the candidate\'s work history with its confirmation state and provenance. An entry describes the work by its specialization and tasks rather than by a job title, and it is a claim of trust level 0. It is different from the `CandidateExperience` of the questionnaire, which holds only the total months of commercial and academic experience of a chosen specialization as a hint for the assessment: the two are saved separately, and the server neither adds the entries up for the questionnaire nor fills the entries from it. An entry is personal data.')).max(candidateProfileExperienceMax).describe('Work history entries in the order the candidate gave them.'),
"soft_skills": zod.array(zod.object({
"skill": zod.string().min(1).max(candidateProfileSoftSkillsItemSkillMax).regex(candidateProfileSoftSkillsItemSkillRegExp).describe('Soft skill as the candidate wrote it, for example "Mentoring" or "Negotiation". The platform has no soft skill taxonomy, so the text is free; it never changes a category or a grade. It has no leading or trailing whitespace and no line breaks. The server compares skills without regard to letter case. Plain text; clients show it as text, never as HTML.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a profile list item, and the decision that a request sends for a field or an item.\n\n- confirmed: the candidate typed the value or confirmed a suggestion. Only confirmed values leave the profile, for example into a disclosure.\n- extracted: a suggestion that the server took from an imported document or source. Nobody has confirmed it yet, so it is a claim of trust level 0 that no other feature uses.\n\nA 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; a client that submits an unchanged form therefore confirms nothing by accident. An item is never `unknown`: a missing item is simply absent from the list.'),
"source": zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileSoftSkillsItemSourceTrustLevelMin).max(candidateProfileSoftSkillsItemSourceTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileSoftSkillsItemSourceQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileSoftSkillsItemSourceExtractionVersionOneMax).regex(candidateProfileSoftSkillsItemSourceExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.')
}).describe('One soft skill of the candidate with its confirmation state and provenance. It is a claim; no assessment checks it.')).max(candidateProfileSoftSkillsMax).describe('Soft skills in the order the candidate gave them, each skill at most once without regard to letter case.'),
"terms": zod.object({
"location": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.string().min(1).max(candidateProfileTermsLocationValueOneMax).regex(candidateProfileTermsLocationValueOneRegExp).describe('City or region where the candidate lives or wants to work, as free text. It is personal data of the candidate and never a street address. It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileTermsLocationSourceOneTrustLevelMin).max(candidateProfileTermsLocationSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileTermsLocationSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileTermsLocationSourceOneExtractionVersionOneMax).regex(candidateProfileTermsLocationSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Place of the candidate with its confirmation state and provenance. It is personal data. `value` and `source` are null exactly when `status` is `unknown`.'),
"relocation": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.boolean().nullable(),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileTermsRelocationSourceOneTrustLevelMin).max(candidateProfileTermsRelocationSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileTermsRelocationSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileTermsRelocationSourceOneExtractionVersionOneMax).regex(candidateProfileTermsRelocationSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Whether the candidate is ready to relocate, with its confirmation state and provenance. `value` and `source` are null exactly when `status` is `unknown`; the server never assumes an answer.'),
"salary_minimum": zod.object({
"status": zod.enum(['confirmed', 'extracted', 'unknown']).describe('Confirmation state of a single profile field.\n\n- confirmed: the candidate typed the value or confirmed a suggestion.\n- extracted: the server proposed the value from an imported document or source and the candidate has not confirmed it. It is a claim of trust level 0.\n- unknown: the field has no value. `value` and `source` are null. The server never fills an unknown field with a default or a guess, such as a zero salary or a relocation answer.'),
"value": zod.union([zod.object({
"amount": zod.int().min(candidateProfileTermsSalaryMinimumValueOneAmountMin).max(candidateProfileTermsSalaryMinimumValueOneAmountMax).multipleOf(candidateProfileTermsSalaryMinimumValueOneAmountMultipleOf).describe('Amount of money in whole rubles. A salary bound is positive and a multiple of 1000, the step that PRD FR13 sets for the bounds of a salary range and for the bids of the sealed final.'),
"currency": zod.enum(['RUB']).describe('ISO 4217 currency code. The MVP accepts only RUB; adding a value is a contract change.'),
"period": zod.enum(['month']).describe('Pay period of a salary amount. The MVP uses only `month`; adding a value is a contract change.'),
"tax_basis": zod.enum(['net', 'gross']).describe('Tax basis of a salary amount: `net`, the amount paid out after personal income tax, or `gross`, the amount before it. The basis is always explicit; amounts in different bases are never compared directly.')
}).describe('The lowest salary that the candidate accepts, in whole rubles with its base: the currency, the pay period, and the tax basis. It is private to the candidate: no organization reads it, and the invitation only shows a compatibility indicator that the server derives from it. It is personal data. The amount is a positive multiple of 1000.'),zod.null()]),
"source": zod.union([zod.object({
"origin": zod.enum(['manual', 'extracted_from_resume', 'imported']).describe('Where the value of a profile field or item came from. The server sets it; a request never sends it.\n\n- manual: the candidate typed the value in the form. `quote` and `extraction_version` are null.\n- extracted_from_resume: planned; the server extracted the value from an uploaded resume with the deterministic rules or the ML service. No MVP operation produces it, and no profile requires a resume.\n- imported: planned; the value was copied from an external source such as the FSP account of the candidate. No MVP operation produces it, and no profile requires such a link.\n\nConfirming an extracted value keeps its origin and quote; changing the value makes it `manual`. Adding a value is a contract change.'),
"trust_level": zod.int().min(candidateProfileTermsSalaryMinimumSourceOneTrustLevelMin).max(candidateProfileTermsSalaryMinimumSourceOneTrustLevelMax).describe('Trust level of a profile claim. Every claim of the profile has trust level 0, whatever its origin: a manual value, an imported value, and a value that the candidate confirmed are all unverified statements. Confirming a suggestion changes its status, never its trust level. Higher levels belong to evidence, such as an assessment result or a confirmation by a third party, which are separate resources and never write a level into a profile claim.'),
"quote": zod.union([zod.string().min(1).max(candidateProfileTermsSalaryMinimumSourceOneQuoteOneMax).describe('Exact excerpt of the imported document that the value was extracted from, so the candidate can check it. It may contain personal data of the candidate. It may contain line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Excerpt of the imported document that supports the value, or null for a manual value and for an extracted value that the extractor did not tie to one excerpt.'),
"extraction_version": zod.union([zod.string().min(1).max(candidateProfileTermsSalaryMinimumSourceOneExtractionVersionOneMax).regex(candidateProfileTermsSalaryMinimumSourceOneExtractionVersionOneRegExp).describe('Opaque identifier of a published extractor or algorithm version, for example `need-rules.2026-10.1`. Clients show it as text and never parse it.'),zod.null()]).describe('Extractor version for an extracted or imported value, or null for a manual value.'),
"confirmed_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('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.'),zod.null()])
}).describe('Lowest acceptable salary with its confirmation state and provenance. It is personal data that no organization reads. `value` and `source` are null exactly when `status` is `unknown`; the server never substitutes zero or a market estimate.')
}).describe('Conditions that the candidate wants: the place, readiness to relocate, and the lowest salary. Acceptable work formats are not repeated here; they are the `work_formats` of the questionnaire `WorkContext`, the only place that holds them. These are the candidate\'s wishes, never the terms of an invitation, which an organization offers and which the invitation contract describes.'),
"confirmed_categories": zod.array(zod.object({
"specialization": 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.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
"confirmed_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.'),
"attempt_id": zod.uuid().describe('Assessment attempt whose result confirmed the grade. The attempt belongs to the candidate.')
}).describe('A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`.')).max(candidateProfileConfirmedCategoriesMax).describe('Categories that assessment results confirmed, at most one per specialization, in catalog order. Read-only and empty until an assessment confirms a grade.'),
"updated_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('Time of the last change, or null before the first save.')
}).describe('The private profile of the current candidate: full name and contacts, stack, roles, work experience, soft skills, and desired terms, each value with its confirmation state and provenance. It is personal data that only the candidate reads. It is never an organization-visible schema: an organization sees a candidate only through the anonymous card and, after an accepted invitation, through the contact grant, and no organization schema refers to this one.\nEvery value is a claim of trust level 0. The `self_assessed_grade` of a role is what the candidate says; the `confirmed_categories` list is what assessment results established, and the two are never mixed. A candidate who has not saved the profile gets version 0, every single field `unknown`, empty lists, and null `updated_at`.\nThe profile is manual by nature and complete without a file: no field requires a resume, the ML service, or an FSP account, and a candidate with none of them has the same fields. Work formats live in the questionnaire; a candidate\'s assessment starts from the questionnaire, not from this profile.')
export type CandidateProfile = zod.input<typeof CandidateProfile>;
export type CandidateProfileOutput = zod.output<typeof CandidateProfile>;