Files
lincodex/frontend/src/shared/api/schemas/invitation/createOrganizationInvitationBody.zod.ts
T

129 lines
21 KiB
TypeScript

/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const createOrganizationInvitationBodyCandidateHandleMin = 47;
export const createOrganizationInvitationBodyCandidateHandleMax = 47;
export const createOrganizationInvitationBodyCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const createOrganizationInvitationBodyTermsRoleTitleMax = 200;
export const createOrganizationInvitationBodyTermsRoleTitleRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsTasksItemMax = 300;
export const createOrganizationInvitationBodyTermsTasksItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsTasksMax = 20;
export const createOrganizationInvitationBodyTermsTeamMax = 1000;
export const createOrganizationInvitationBodyTermsTeamRegExp = new RegExp('\\S');
export const createOrganizationInvitationBodyTermsTechStackItemMax = 100;
export const createOrganizationInvitationBodyTermsTechStackItemRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsTechStackMax = 30;
export const createOrganizationInvitationBodyTermsWorkFormatsMax = 3;
export const createOrganizationInvitationBodyTermsLocationOneMax = 100;
export const createOrganizationInvitationBodyTermsLocationOneRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsCommunicationMethodDetailsOneMax = 300;
export const createOrganizationInvitationBodyTermsCommunicationMethodDetailsOneRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsSalarySalaryFromMin = 1000;
export const createOrganizationInvitationBodyTermsSalarySalaryFromMax = 100000000;
export const createOrganizationInvitationBodyTermsSalarySalaryFromMultipleOf = 1000;
export const createOrganizationInvitationBodyTermsSalarySalaryToMin = 1000;
export const createOrganizationInvitationBodyTermsSalarySalaryToMax = 100000000;
export const createOrganizationInvitationBodyTermsSalarySalaryToMultipleOf = 1000;
export const createOrganizationInvitationBodyTermsPackageBonusOneDescriptionMax = 300;
export const createOrganizationInvitationBodyTermsPackageBonusOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsPackageEquipmentOneDescriptionMax = 300;
export const createOrganizationInvitationBodyTermsPackageEquipmentOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsPackageTrainingOneDescriptionMax = 300;
export const createOrganizationInvitationBodyTermsPackageTrainingOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionMax = 300;
export const createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionRegExp = new RegExp('^\\S(?:.*\\S)?$');
export const CreateOrganizationInvitationBody = zod.object({
"candidate_handle": zod.string().min(createOrganizationInvitationBodyCandidateHandleMin).max(createOrganizationInvitationBodyCandidateHandleMax).regex(createOrganizationInvitationBodyCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"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.')
}).describe('Need of the same organization that the invitation was built from, with the requirements version used. A direct invitation has no need. The link is informational: the invitation keeps its own terms, which may differ from the need, and a later change of the need never changes them.'),zod.null()]).exactOptional().describe('Need of the organization the invitation is built from, or null or absent for a direct invitation.'),
"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.').exactOptional().describe('Days to answer; absent means 7, the default of the product policy.'),
"terms": zod.object({
"role_title": zod.string().min(1).max(createOrganizationInvitationBodyTermsRoleTitleMax).regex(createOrganizationInvitationBodyTermsRoleTitleRegExp).describe('Name of the offered role, for example "Middle Go developer in the payments team". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),
"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.'),
"offer_type": zod.enum(['full_time', 'part_time', 'contract', 'internship']).describe('Type of the offer.\n\n- full_time: employment with a full working week.\n- part_time: employment with a part-time working week.\n- contract: a fixed-term or project contract outside employment.\n- internship: an internship.\n\nAdding a value is a contract change.'),
"tasks": zod.array(zod.string().min(1).max(createOrganizationInvitationBodyTermsTasksItemMax).regex(createOrganizationInvitationBodyTermsTasksItemRegExp).describe('One work task of the team, for example "Move the payout service to an event model". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.')).min(1).max(createOrganizationInvitationBodyTermsTasksMax).describe('Work tasks of the role in the order given.'),
"team": zod.string().min(1).max(createOrganizationInvitationBodyTermsTeamMax).regex(createOrganizationInvitationBodyTermsTeamRegExp).describe('Description of the team the candidate would join, such as its size, roles, and way of working. It may contain line breaks and has at least one character that is not white space. Plain text; clients show it as text, never as HTML. It describes the job and must not contain personal data of employees or candidates.'),
"tech_stack": zod.array(zod.string().min(1).max(createOrganizationInvitationBodyTermsTechStackItemMax).regex(createOrganizationInvitationBodyTermsTechStackItemRegExp).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.')).min(1).max(createOrganizationInvitationBodyTermsTechStackMax).describe('Technologies of the role. The server compares names without regard to letter case.'),
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(createOrganizationInvitationBodyTermsWorkFormatsMax).describe('Work formats the organization offers; the candidate may choose any of them.'),
"location": zod.union([zod.string().min(1).max(createOrganizationInvitationBodyTermsLocationOneMax).regex(createOrganizationInvitationBodyTermsLocationOneRegExp).describe('Place of work for the office or hybrid format, for example a city, as free text. It describes the employer\'s office, never a candidate\'s address. Plain text without line breaks; clients show it as text, never as HTML.'),zod.null()]).describe('Place of work for the `office` or `hybrid` format, or null when the only format is `remote`. It is required with either of those formats.'),
"communication_method": zod.object({
"channel": zod.enum(['email', 'phone', 'telegram', 'video_call']).describe('Channel through which the organization will contact the candidate after an acceptance.\n\n- email: a letter to the email address the candidate disclosed.\n- phone: a call or a text to the phone number the candidate disclosed.\n- telegram: a message to the Telegram username the candidate disclosed.\n- video_call: an invitation to a video call, sent through one of the disclosed contacts.\n\nThe channel describes the organization\'s plan; the candidate decides which contacts to disclose, and the server never requires that the disclosed fields include the channel.'),
"details": zod.union([zod.string().min(1).max(createOrganizationInvitationBodyTermsCommunicationMethodDetailsOneMax).regex(createOrganizationInvitationBodyTermsCommunicationMethodDetailsOneRegExp).describe('Short note on the communication method, for example "A 30-minute call with the team lead within three working days". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.'),zod.null()]).describe('Optional short note, for example the first step or the expected time of the first contact, or null. Plain text without line breaks; it never contains a link or a contact of an employee.')
}).describe('How the organization will contact the candidate after an acceptance. It is part of the terms, so the candidate sees it before choosing which contacts to disclose. An invitation without it cannot exist, because the terms require it.'),
"salary": zod.object({
"salary_from": zod.int().min(createOrganizationInvitationBodyTermsSalarySalaryFromMin).max(createOrganizationInvitationBodyTermsSalarySalaryFromMax).multipleOf(createOrganizationInvitationBodyTermsSalarySalaryFromMultipleOf).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.'),
"salary_to": zod.int().min(createOrganizationInvitationBodyTermsSalarySalaryToMin).max(createOrganizationInvitationBodyTermsSalarySalaryToMax).multipleOf(createOrganizationInvitationBodyTermsSalarySalaryToMultipleOf).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('Salary range `[A; B]` in whole rubles with its base: the currency, the pay period, and the tax basis (PRD FR13). The schema requires every field, bounds that are positive multiples of 1000, and the known currency, period, and basis. The server checks the cross-field rules in integer arithmetic: `salary_from < salary_to`, and a width `(B - A) / ((A + B) / 2)` from 10% to 40% inclusive, that is `20 * (B - A) >= A + B` and `5 * (B - A) <= A + B`. A violation answers 400 validation_failed with the pointer of `salary_to` in the request, for example `/salary/value/salary_to`. For example, `[95000; 105000]` has a width of exactly 10% and `[80000; 120000]` exactly 40%; both are accepted. The rules are the same for a need and an invitation.'),
"package": zod.object({
"bonus": zod.union([zod.object({
"status": zod.enum(['provided']),
"description": zod.string().min(1).max(createOrganizationInvitationBodyTermsPackageBonusOneDescriptionMax).regex(createOrganizationInvitationBodyTermsPackageBonusOneDescriptionRegExp).describe('Short description of a condition, for example "Quarterly bonus up to 20% of the salary". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.')
}).describe('The condition is part of the offer, with its description.'),zod.object({
"status": zod.enum(['not_provided'])
}).describe('The organization states explicitly that the offer does not include the condition ("Не предусмотрено" in the interface). It has no description.')]).describe('One required condition of the package, selected by `status`: `provided` with a description, or `not_provided` without one. Not providing a condition is an explicit choice: the field is required in the package, so an absent field fails validation instead of meaning "not provided": it answers 400 `required` with its pointer, such as `/terms/package/training`. A `provided` item without a description answers `required` with the pointer of the description, and a `not_provided` item with a description answers `invalid` with the pointer of the item. ogen selects the variant by the value of `status`.'),
"equipment": zod.union([zod.object({
"status": zod.enum(['provided']),
"description": zod.string().min(1).max(createOrganizationInvitationBodyTermsPackageEquipmentOneDescriptionMax).regex(createOrganizationInvitationBodyTermsPackageEquipmentOneDescriptionRegExp).describe('Short description of a condition, for example "Quarterly bonus up to 20% of the salary". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.')
}).describe('The condition is part of the offer, with its description.'),zod.object({
"status": zod.enum(['not_provided'])
}).describe('The organization states explicitly that the offer does not include the condition ("Не предусмотрено" in the interface). It has no description.')]).describe('One required condition of the package, selected by `status`: `provided` with a description, or `not_provided` without one. Not providing a condition is an explicit choice: the field is required in the package, so an absent field fails validation instead of meaning "not provided": it answers 400 `required` with its pointer, such as `/terms/package/training`. A `provided` item without a description answers `required` with the pointer of the description, and a `not_provided` item with a description answers `invalid` with the pointer of the item. ogen selects the variant by the value of `status`.'),
"training": zod.union([zod.object({
"status": zod.enum(['provided']),
"description": zod.string().min(1).max(createOrganizationInvitationBodyTermsPackageTrainingOneDescriptionMax).regex(createOrganizationInvitationBodyTermsPackageTrainingOneDescriptionRegExp).describe('Short description of a condition, for example "Quarterly bonus up to 20% of the salary". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.')
}).describe('The condition is part of the offer, with its description.'),zod.object({
"status": zod.enum(['not_provided'])
}).describe('The organization states explicitly that the offer does not include the condition ("Не предусмотрено" in the interface). It has no description.')]).describe('One required condition of the package, selected by `status`: `provided` with a description, or `not_provided` without one. Not providing a condition is an explicit choice: the field is required in the package, so an absent field fails validation instead of meaning "not provided": it answers 400 `required` with its pointer, such as `/terms/package/training`. A `provided` item without a description answers `required` with the pointer of the description, and a `not_provided` item with a description answers `invalid` with the pointer of the item. ogen selects the variant by the value of `status`.'),
"health_insurance": zod.union([zod.object({
"status": zod.enum(['provided']),
"description": zod.string().min(1).max(createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionMax).regex(createOrganizationInvitationBodyTermsPackageHealthInsuranceOneDescriptionRegExp).describe('Short description of a condition, for example "Quarterly bonus up to 20% of the salary". It has no leading or trailing whitespace and no line breaks. Plain text; clients show it as text, never as HTML.')
}).describe('The condition is part of the offer, with its description.'),zod.object({
"status": zod.enum(['not_provided'])
}).describe('The organization states explicitly that the offer does not include the condition ("Не предусмотрено" in the interface). It has no description.')]).describe('One required condition of the package, selected by `status`: `provided` with a description, or `not_provided` without one. Not providing a condition is an explicit choice: the field is required in the package, so an absent field fails validation instead of meaning "not provided": it answers 400 `required` with its pointer, such as `/terms/package/training`. A `provided` item without a description answers `required` with the pointer of the description, and a `not_provided` item with a description answers `invalid` with the pointer of the item. ogen selects the variant by the value of `status`.')
}).describe('Required section of the package (PRD FR12): the bonus, the equipment, the training, and the voluntary health insurance (ДМС). Every field is required and is either provided with a description or explicitly not provided. The work format of the package is the required `work_formats` term, which has no "not provided" variant. Adding a required condition is a breaking change; an optional one is additive.')
}).describe('Terms of an invitation: everything the candidate sees before deciding and before any contact is disclosed. The same schema is the request field of a draft and the stored snapshot of a terms version, so a response can be sent back unchanged. Every field is required; a field that may have no value says so with an explicit variant (`location` null for a remote role, a package item `not_provided`). The terms never contain data of the candidate: no contact, no salary minimum, and no indicator derived from it. The server checks the cross-field rules after the schema and answers 400 validation_failed with the pointer of the field: the salary rules of SalaryRange with `/terms/salary/salary_to`, a missing place of work for the `office` or `hybrid` format with `/terms/location`, and a repeated technology in `tech_stack` with the pointer of the later item.')
}).describe('New draft for one candidate. The candidate is named only by the handle from a search result of this organization, never by an email address, a phone number, or an account identifier. The terms are complete from the start, so a draft without the tax basis or the communication method cannot exist. Unknown fields are rejected, so a request cannot set the state, a version, a deadline, the salary indicator, contact access, or a candidate\'s minimum or contact.')
export type CreateOrganizationInvitationBody = zod.input<typeof CreateOrganizationInvitationBody>;
export type CreateOrganizationInvitationBodyOutput = zod.output<typeof CreateOrganizationInvitationBody>;