feat(api): add invitation, terms version, acceptance, and contact grant contract
This commit is contained in:
1 parent
b856d4ff54
commit
d2c6f1375a
140 files changed
+39767
-303
No files matched your search
@@ -3,5 +3,6 @@ export { getCandidateMock } from './candidate/candidate.msw'
|
||||
export { getCatalogMock } from './catalog/catalog.msw'
|
||||
export { getHealthMock } from './health/health.msw'
|
||||
export { getIdentityMock } from './identity/identity.msw'
|
||||
export { getInvitationMock } from './invitation/invitation.msw'
|
||||
export { getNeedMock } from './need/need.msw'
|
||||
export { getSupportMock } from './support/support.msw'
|
||||
@@ -3,5 +3,6 @@ export * from './candidate/candidate';
|
||||
export * from './catalog/catalog';
|
||||
export * from './health/health';
|
||||
export * from './identity/identity';
|
||||
export * from './invitation/invitation';
|
||||
export * from './need/need';
|
||||
export * from './support/support';
|
||||
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
faker
|
||||
} from '@faker-js/faker';
|
||||
|
||||
import {
|
||||
fakeFromPattern
|
||||
} from '../../mock-pattern';
|
||||
|
||||
import {
|
||||
HttpResponse,
|
||||
http
|
||||
} from 'msw';
|
||||
import type {
|
||||
RequestHandlerOptions
|
||||
} from 'msw';
|
||||
|
||||
import type {
|
||||
CandidateInvitation,
|
||||
CandidateInvitationList,
|
||||
ContactConsentOffer,
|
||||
ContactDisclosure,
|
||||
ContactGrant,
|
||||
InvitationDeclineRecord,
|
||||
InvitationNeedReference,
|
||||
InvitationPackageItemNotProvided,
|
||||
InvitationPackageItemProvided,
|
||||
OrganizationInvitation,
|
||||
OrganizationInvitationList
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getListOrganizationInvitationsResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getListOrganizationInvitationsResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitationList, object>> = {}): OrganizationInvitationList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getListOrganizationInvitationsResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z'})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
export const getCreateOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getCreateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getCreateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getCreateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getGetOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getGetOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getGetOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getGetOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getUpdateOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getUpdateOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getUpdateOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getSendOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getSendOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getSendOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getSendOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemProvidedMock()},{...getRaiseOrganizationInvitationSalaryResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseInvitationNeedReferenceMock = (overrideResponse: Partial<InvitationNeedReference> = {}): InvitationNeedReference => ({...{need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getWithdrawOrganizationInvitationResponseMock = (overrideResponse: Partial<Extract<OrganizationInvitation, object>> = {}): OrganizationInvitation => ({id: faker.string.uuid(), organization_id: faker.string.uuid(), candidate_handle: fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 128}), need: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationNeedReferenceMock()},null,]), state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getWithdrawOrganizationInvitationResponseInvitationPackageItemProvidedMock()},{...getWithdrawOrganizationInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_period_days: faker.helpers.arrayElement([3,7,14] as const), response_deadline_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), salary_raise_used: faker.datatype.boolean(), salary_fit: faker.helpers.arrayElement(['within_range','up_to_10_percent_above','above','withheld','not_available'] as const), contact_access: {status: faker.helpers.arrayElement(['not_granted','available','closed'] as const), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), ...overrideResponse})
|
||||
|
||||
export const getGetOrganizationInvitationContactsResponseMock = (overrideResponse: Partial<Extract<ContactDisclosure, object>> = {}): ContactDisclosure => ({invitation_id: faker.string.uuid(), grant_id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', full_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), email: faker.helpers.arrayElement([faker.internet.email(),null,]), phone: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), telegram: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), ...overrideResponse})
|
||||
|
||||
export const getListMyInvitationsResponseMock = (overrideResponse: Partial<Extract<CandidateInvitationList, object>> = {}): CandidateInvitationList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z'})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
export const getGetMyInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getGetMyInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getGetMyInvitationResponseContactConsentOfferMock = (overrideResponse: Partial<ContactConsentOffer> = {}): ContactConsentOffer => ({...{text: {text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), text: faker.string.alpha({length: {min: 1, max: 100000}})}, available_fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getGetMyInvitationResponseInvitationDeclineRecordMock = (overrideResponse: Partial<InvitationDeclineRecord> = {}): InvitationDeclineRecord => ({...{reason: faker.helpers.arrayElement(['salary','tasks','stack','work_format','package','company','not_looking','other_offer','other'] as const), comment: faker.helpers.arrayElement([fakeFromPattern("\\S", {minLength: 1, maxLength: 500}),null,]), declined_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getGetMyInvitationResponseContactGrantMock = (overrideResponse: Partial<ContactGrant> = {}): ContactGrant => ({...{id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), status: faker.helpers.arrayElement(['active','revoked'] as const), readable: faker.datatype.boolean(), blocked_by: faker.helpers.arrayElement([faker.helpers.arrayElement(['visibility'] as const),null,]), terms_version: faker.number.int({min: 1}), consent_text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', revoked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), revocation_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['consent_revoked','participation_cancelled','visibility_closed'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyInvitationResponseMock = (overrideResponse: Partial<Extract<CandidateInvitation, object>> = {}): CandidateInvitation => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getGetMyInvitationResponseInvitationPackageItemProvidedMock()},{...getGetMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getGetMyInvitationResponseInvitationPackageItemProvidedMock()},{...getGetMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getGetMyInvitationResponseInvitationPackageItemProvidedMock()},{...getGetMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getGetMyInvitationResponseInvitationPackageItemProvidedMock()},{...getGetMyInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', contact_consent: faker.helpers.arrayElement([{...getGetMyInvitationResponseContactConsentOfferMock()},null,]), decline: faker.helpers.arrayElement([{...getGetMyInvitationResponseInvitationDeclineRecordMock()},null,]), contact_grant: faker.helpers.arrayElement([{...getGetMyInvitationResponseContactGrantMock()},null,]), ...overrideResponse})
|
||||
|
||||
export const getViewMyInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getViewMyInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getViewMyInvitationResponseContactConsentOfferMock = (overrideResponse: Partial<ContactConsentOffer> = {}): ContactConsentOffer => ({...{text: {text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), text: faker.string.alpha({length: {min: 1, max: 100000}})}, available_fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getViewMyInvitationResponseInvitationDeclineRecordMock = (overrideResponse: Partial<InvitationDeclineRecord> = {}): InvitationDeclineRecord => ({...{reason: faker.helpers.arrayElement(['salary','tasks','stack','work_format','package','company','not_looking','other_offer','other'] as const), comment: faker.helpers.arrayElement([fakeFromPattern("\\S", {minLength: 1, maxLength: 500}),null,]), declined_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getViewMyInvitationResponseContactGrantMock = (overrideResponse: Partial<ContactGrant> = {}): ContactGrant => ({...{id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), status: faker.helpers.arrayElement(['active','revoked'] as const), readable: faker.datatype.boolean(), blocked_by: faker.helpers.arrayElement([faker.helpers.arrayElement(['visibility'] as const),null,]), terms_version: faker.number.int({min: 1}), consent_text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', revoked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), revocation_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['consent_revoked','participation_cancelled','visibility_closed'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getViewMyInvitationResponseMock = (overrideResponse: Partial<Extract<CandidateInvitation, object>> = {}): CandidateInvitation => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getViewMyInvitationResponseInvitationPackageItemProvidedMock()},{...getViewMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getViewMyInvitationResponseInvitationPackageItemProvidedMock()},{...getViewMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getViewMyInvitationResponseInvitationPackageItemProvidedMock()},{...getViewMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getViewMyInvitationResponseInvitationPackageItemProvidedMock()},{...getViewMyInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', contact_consent: faker.helpers.arrayElement([{...getViewMyInvitationResponseContactConsentOfferMock()},null,]), decline: faker.helpers.arrayElement([{...getViewMyInvitationResponseInvitationDeclineRecordMock()},null,]), contact_grant: faker.helpers.arrayElement([{...getViewMyInvitationResponseContactGrantMock()},null,]), ...overrideResponse})
|
||||
|
||||
export const getAcceptMyInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getAcceptMyInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getAcceptMyInvitationResponseContactConsentOfferMock = (overrideResponse: Partial<ContactConsentOffer> = {}): ContactConsentOffer => ({...{text: {text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), text: faker.string.alpha({length: {min: 1, max: 100000}})}, available_fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getAcceptMyInvitationResponseInvitationDeclineRecordMock = (overrideResponse: Partial<InvitationDeclineRecord> = {}): InvitationDeclineRecord => ({...{reason: faker.helpers.arrayElement(['salary','tasks','stack','work_format','package','company','not_looking','other_offer','other'] as const), comment: faker.helpers.arrayElement([fakeFromPattern("\\S", {minLength: 1, maxLength: 500}),null,]), declined_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getAcceptMyInvitationResponseContactGrantMock = (overrideResponse: Partial<ContactGrant> = {}): ContactGrant => ({...{id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), status: faker.helpers.arrayElement(['active','revoked'] as const), readable: faker.datatype.boolean(), blocked_by: faker.helpers.arrayElement([faker.helpers.arrayElement(['visibility'] as const),null,]), terms_version: faker.number.int({min: 1}), consent_text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', revoked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), revocation_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['consent_revoked','participation_cancelled','visibility_closed'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getAcceptMyInvitationResponseMock = (overrideResponse: Partial<Extract<CandidateInvitation, object>> = {}): CandidateInvitation => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseInvitationPackageItemProvidedMock()},{...getAcceptMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseInvitationPackageItemProvidedMock()},{...getAcceptMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseInvitationPackageItemProvidedMock()},{...getAcceptMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseInvitationPackageItemProvidedMock()},{...getAcceptMyInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', contact_consent: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseContactConsentOfferMock()},null,]), decline: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseInvitationDeclineRecordMock()},null,]), contact_grant: faker.helpers.arrayElement([{...getAcceptMyInvitationResponseContactGrantMock()},null,]), ...overrideResponse})
|
||||
|
||||
export const getDeclineMyInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getDeclineMyInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getDeclineMyInvitationResponseContactConsentOfferMock = (overrideResponse: Partial<ContactConsentOffer> = {}): ContactConsentOffer => ({...{text: {text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), text: faker.string.alpha({length: {min: 1, max: 100000}})}, available_fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getDeclineMyInvitationResponseInvitationDeclineRecordMock = (overrideResponse: Partial<InvitationDeclineRecord> = {}): InvitationDeclineRecord => ({...{reason: faker.helpers.arrayElement(['salary','tasks','stack','work_format','package','company','not_looking','other_offer','other'] as const), comment: faker.helpers.arrayElement([fakeFromPattern("\\S", {minLength: 1, maxLength: 500}),null,]), declined_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getDeclineMyInvitationResponseContactGrantMock = (overrideResponse: Partial<ContactGrant> = {}): ContactGrant => ({...{id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), status: faker.helpers.arrayElement(['active','revoked'] as const), readable: faker.datatype.boolean(), blocked_by: faker.helpers.arrayElement([faker.helpers.arrayElement(['visibility'] as const),null,]), terms_version: faker.number.int({min: 1}), consent_text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', revoked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), revocation_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['consent_revoked','participation_cancelled','visibility_closed'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getDeclineMyInvitationResponseMock = (overrideResponse: Partial<Extract<CandidateInvitation, object>> = {}): CandidateInvitation => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseInvitationPackageItemProvidedMock()},{...getDeclineMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseInvitationPackageItemProvidedMock()},{...getDeclineMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseInvitationPackageItemProvidedMock()},{...getDeclineMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseInvitationPackageItemProvidedMock()},{...getDeclineMyInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', contact_consent: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseContactConsentOfferMock()},null,]), decline: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseInvitationDeclineRecordMock()},null,]), contact_grant: faker.helpers.arrayElement([{...getDeclineMyInvitationResponseContactGrantMock()},null,]), ...overrideResponse})
|
||||
|
||||
export const getCancelMyInvitationResponseInvitationPackageItemProvidedMock = (overrideResponse: Partial<InvitationPackageItemProvided> = {}): InvitationPackageItemProvided => ({...{status: faker.helpers.arrayElement(['provided'] as const), description: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300})}, ...overrideResponse});
|
||||
|
||||
export const getCancelMyInvitationResponseInvitationPackageItemNotProvidedMock = (overrideResponse: Partial<InvitationPackageItemNotProvided> = {}): InvitationPackageItemNotProvided => ({...{status: faker.helpers.arrayElement(['not_provided'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getCancelMyInvitationResponseContactConsentOfferMock = (overrideResponse: Partial<ContactConsentOffer> = {}): ContactConsentOffer => ({...{text: {text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), text: faker.string.alpha({length: {min: 1, max: 100000}})}, available_fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getCancelMyInvitationResponseInvitationDeclineRecordMock = (overrideResponse: Partial<InvitationDeclineRecord> = {}): InvitationDeclineRecord => ({...{reason: faker.helpers.arrayElement(['salary','tasks','stack','work_format','package','company','not_looking','other_offer','other'] as const), comment: faker.helpers.arrayElement([fakeFromPattern("\\S", {minLength: 1, maxLength: 500}),null,]), declined_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getCancelMyInvitationResponseContactGrantMock = (overrideResponse: Partial<ContactGrant> = {}): ContactGrant => ({...{id: faker.string.uuid(), fields: faker.helpers.arrayElements(['full_name','email','phone','telegram'] as const), status: faker.helpers.arrayElement(['active','revoked'] as const), readable: faker.datatype.boolean(), blocked_by: faker.helpers.arrayElement([faker.helpers.arrayElement(['visibility'] as const),null,]), terms_version: faker.number.int({min: 1}), consent_text_version: fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}), granted_at: faker.date.past().toISOString().slice(0, 19) + 'Z', revoked_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), revocation_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['consent_revoked','participation_cancelled','visibility_closed'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getCancelMyInvitationResponseMock = (overrideResponse: Partial<Extract<CandidateInvitation, object>> = {}): CandidateInvitation => ({id: faker.string.uuid(), organization: {id: faker.string.uuid(), name: faker.string.alpha({length: {min: 1, max: 200}})}, state: faker.helpers.arrayElement(['draft','delivered','viewed','counter','accepted','interview_scheduled','interviewed','negotiation','terms_agreed','no_deal','declined','expired','withdrawn','cancelled_by_candidate'] as const), expiry_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['invitation_timeout','negotiation_timeout'] as const),null,]), version: faker.number.int({min: 1}), terms_version: faker.number.int({min: 1}), terms: {role_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), offer_type: faker.helpers.arrayElement(['full_time','part_time','contract','internship'] as const), tasks: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}))), team: fakeFromPattern("\\S", {minLength: 1, maxLength: 1000}), tech_stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => (fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}))), work_formats: faker.helpers.arrayElements(['remote','office','hybrid'] as const), location: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), communication_method: {channel: faker.helpers.arrayElement(['email','phone','telegram','video_call'] as const), details: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 300}),null,])}, salary: {salary_from: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), salary_to: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, package: {bonus: faker.helpers.arrayElement([{...getCancelMyInvitationResponseInvitationPackageItemProvidedMock()},{...getCancelMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), equipment: faker.helpers.arrayElement([{...getCancelMyInvitationResponseInvitationPackageItemProvidedMock()},{...getCancelMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), training: faker.helpers.arrayElement([{...getCancelMyInvitationResponseInvitationPackageItemProvidedMock()},{...getCancelMyInvitationResponseInvitationPackageItemNotProvidedMock()},]), health_insurance: faker.helpers.arrayElement([{...getCancelMyInvitationResponseInvitationPackageItemProvidedMock()},{...getCancelMyInvitationResponseInvitationPackageItemNotProvidedMock()},])}}, response_deadline_at: faker.date.past().toISOString().slice(0, 19) + 'Z', delivered_at: faker.date.past().toISOString().slice(0, 19) + 'Z', viewed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), responded_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', contact_consent: faker.helpers.arrayElement([{...getCancelMyInvitationResponseContactConsentOfferMock()},null,]), decline: faker.helpers.arrayElement([{...getCancelMyInvitationResponseInvitationDeclineRecordMock()},null,]), contact_grant: faker.helpers.arrayElement([{...getCancelMyInvitationResponseContactGrantMock()},null,]), ...overrideResponse})
|
||||
|
||||
|
||||
export const getListOrganizationInvitationsMockHandler = (overrideResponse?: OrganizationInvitationList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<OrganizationInvitationList> | OrganizationInvitationList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/organizations/:orgId/invitations', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListOrganizationInvitationsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getCreateOrganizationInvitationMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/organizations/:orgId/invitations', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getCreateOrganizationInvitationResponseMock(),
|
||||
{ status: 201
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetOrganizationInvitationMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/organizations/:orgId/invitations/:invitationId', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetOrganizationInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getUpdateOrganizationInvitationMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.patch>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.patch('*/api/v1/organizations/:orgId/invitations/:invitationId', async (info: Parameters<Parameters<typeof http.patch>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getUpdateOrganizationInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getSendOrganizationInvitationMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/organizations/:orgId/invitations/:invitationId/send', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getSendOrganizationInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getRaiseOrganizationInvitationSalaryMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/organizations/:orgId/invitations/:invitationId/salary-raise', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getRaiseOrganizationInvitationSalaryResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getWithdrawOrganizationInvitationMockHandler = (overrideResponse?: OrganizationInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<OrganizationInvitation> | OrganizationInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/organizations/:orgId/invitations/:invitationId/withdraw', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getWithdrawOrganizationInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetOrganizationInvitationContactsMockHandler = (overrideResponse?: ContactDisclosure | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<ContactDisclosure> | ContactDisclosure), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/organizations/:orgId/invitations/:invitationId/contacts', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetOrganizationInvitationContactsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getListMyInvitationsMockHandler = (overrideResponse?: CandidateInvitationList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<CandidateInvitationList> | CandidateInvitationList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/invitations', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMyInvitationsResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetMyInvitationMockHandler = (overrideResponse?: CandidateInvitation | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<CandidateInvitation> | CandidateInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/invitations/:invitationId', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMyInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getViewMyInvitationMockHandler = (overrideResponse?: CandidateInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<CandidateInvitation> | CandidateInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/invitations/:invitationId/view', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getViewMyInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getAcceptMyInvitationMockHandler = (overrideResponse?: CandidateInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<CandidateInvitation> | CandidateInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/invitations/:invitationId/accept', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getAcceptMyInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getDeclineMyInvitationMockHandler = (overrideResponse?: CandidateInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<CandidateInvitation> | CandidateInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/invitations/:invitationId/decline', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getDeclineMyInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getCancelMyInvitationMockHandler = (overrideResponse?: CandidateInvitation | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<CandidateInvitation> | CandidateInvitation), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/invitations/:invitationId/cancel', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getCancelMyInvitationResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
export const getInvitationMock = () => [
|
||||
getListOrganizationInvitationsMockHandler(),
|
||||
getCreateOrganizationInvitationMockHandler(),
|
||||
getGetOrganizationInvitationMockHandler(),
|
||||
getUpdateOrganizationInvitationMockHandler(),
|
||||
getSendOrganizationInvitationMockHandler(),
|
||||
getRaiseOrganizationInvitationSalaryMockHandler(),
|
||||
getWithdrawOrganizationInvitationMockHandler(),
|
||||
getGetOrganizationInvitationContactsMockHandler(),
|
||||
getListMyInvitationsMockHandler(),
|
||||
getGetMyInvitationMockHandler(),
|
||||
getViewMyInvitationMockHandler(),
|
||||
getAcceptMyInvitationMockHandler(),
|
||||
getDeclineMyInvitationMockHandler(),
|
||||
getCancelMyInvitationMockHandler()
|
||||
]
|
||||
File diff suppressed because it is too large.
Load diff
@@ -188,9 +188,9 @@ 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 not in the contract 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 (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.
|
||||
*
|
||||
* 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 whole-body pointer, because the decoder does not record the path inside the selected variant. The case stores only the type and the identifier of the object.
|
||||
* 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.
|
||||
*
|
||||
* Limits: an attempt and a resolved manual assessment each accept at most one grade appeal, and an attempt at most one anti-cheat appeal, in any status; a disagreement with the decision goes into a support case that references the appeal as `support_case`. A specialization accepts one open manual assessment, and an object accepts one open complaint; open means not `resolved` or `closed`. A second one answers 409 state_conflict. A grade appeal of an attempt that is still active also answers 409. Every create that passed authentication, validation, and the account scenario counts against a per-account limit from the product policy, including replays, 404, and 409, so the limit also bounds probing of references; over the limit the server answers 429 with Retry-After and creates nothing.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user