feat(api): add support case and manual assessment request contract
This commit is contained in:
1 parent
2db585fbff
commit
ad4bb94426
65 files changed
+14629
-23
No files matched your search
@@ -4,3 +4,4 @@ export { getCatalogMock } from './catalog/catalog.msw'
|
||||
export { getHealthMock } from './health/health.msw'
|
||||
export { getIdentityMock } from './identity/identity.msw'
|
||||
export { getNeedMock } from './need/need.msw'
|
||||
export { getSupportMock } from './support/support.msw'
|
||||
@@ -4,3 +4,4 @@ export * from './catalog/catalog';
|
||||
export * from './health/health';
|
||||
export * from './identity/identity';
|
||||
export * from './need/need';
|
||||
export * from './support/support';
|
||||
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
faker
|
||||
} from '@faker-js/faker';
|
||||
|
||||
import {
|
||||
HttpResponse,
|
||||
http
|
||||
} from 'msw';
|
||||
import type {
|
||||
RequestHandlerOptions
|
||||
} from 'msw';
|
||||
|
||||
import {
|
||||
GradeCode,
|
||||
SpecializationCode,
|
||||
SupportCaseActorKind,
|
||||
SupportCaseComplaintReason,
|
||||
SupportCaseDecisionOutcome,
|
||||
SupportCaseEventKind,
|
||||
SupportCaseObjectType,
|
||||
SupportCaseStatus,
|
||||
SupportCaseType
|
||||
} from '../../schemas';
|
||||
import type {
|
||||
SupportCase,
|
||||
SupportCaseAssessmentTarget,
|
||||
SupportCaseDecision,
|
||||
SupportCaseList,
|
||||
SupportCaseObjectReference
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getListMySupportCasesResponseSupportCaseObjectReferenceMock = (overrideResponse: Partial<SupportCaseObjectReference> = {}): SupportCaseObjectReference => ({...{type: faker.helpers.arrayElement(Object.values(SupportCaseObjectType)), id: faker.string.uuid()}, ...overrideResponse});
|
||||
|
||||
export const getListMySupportCasesResponseSupportCaseAssessmentTargetMock = (overrideResponse: Partial<SupportCaseAssessmentTarget> = {}): SupportCaseAssessmentTarget => ({...{specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), grade: faker.helpers.arrayElement(Object.values(GradeCode))}, ...overrideResponse});
|
||||
|
||||
export const getListMySupportCasesResponseMock = (overrideResponse: Partial<Extract<SupportCaseList, object>> = {}): SupportCaseList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), number: faker.helpers.fromRegExp("^SC-[0-9]{4}-[0-9]{6,10}$"), type: faker.helpers.arrayElement(Object.values(SupportCaseType)), status: faker.helpers.arrayElement(Object.values(SupportCaseStatus)), object: faker.helpers.arrayElement([{...getListMySupportCasesResponseSupportCaseObjectReferenceMock()},null,]), assessment_target: faker.helpers.arrayElement([{...getListMySupportCasesResponseSupportCaseAssessmentTargetMock()},null,]), response_target: {kind: faker.helpers.arrayElement(['operational_goal'] as const), business_days: faker.number.int({min: 1, max: 60}), due_at: faker.date.past().toISOString().slice(0, 19) + 'Z', answered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), late: faker.datatype.boolean(), policy_version: faker.number.int({min: 1})}, decision_outcome: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(SupportCaseDecisionOutcome)),null,]), 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([faker.helpers.fromRegExp("^[A-Za-z0-9_-]+$"), null])}, ...overrideResponse})
|
||||
|
||||
export const getCreateMySupportCaseResponseSupportCaseObjectReferenceMock = (overrideResponse: Partial<SupportCaseObjectReference> = {}): SupportCaseObjectReference => ({...{type: faker.helpers.arrayElement(Object.values(SupportCaseObjectType)), id: faker.string.uuid()}, ...overrideResponse});
|
||||
|
||||
export const getCreateMySupportCaseResponseSupportCaseAssessmentTargetMock = (overrideResponse: Partial<SupportCaseAssessmentTarget> = {}): SupportCaseAssessmentTarget => ({...{specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), grade: faker.helpers.arrayElement(Object.values(GradeCode))}, ...overrideResponse});
|
||||
|
||||
export const getCreateMySupportCaseResponseSupportCaseDecisionMock = (overrideResponse: Partial<SupportCaseDecision> = {}): SupportCaseDecision => ({...{outcome: faker.helpers.arrayElement(Object.values(SupportCaseDecisionOutcome)), reason: faker.string.alpha({length: {min: 1, max: 4000}}), decided_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getCreateMySupportCaseResponseMock = (overrideResponse: Partial<Extract<SupportCase, object>> = {}): SupportCase => ({id: faker.string.uuid(), number: faker.helpers.fromRegExp("^SC-[0-9]{4}-[0-9]{6,10}$"), type: faker.helpers.arrayElement(Object.values(SupportCaseType)), status: faker.helpers.arrayElement(Object.values(SupportCaseStatus)), description: faker.helpers.fromRegExp("\\S"), object: faker.helpers.arrayElement([{...getCreateMySupportCaseResponseSupportCaseObjectReferenceMock()},null,]), assessment_target: faker.helpers.arrayElement([{...getCreateMySupportCaseResponseSupportCaseAssessmentTargetMock()},null,]), complaint_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(SupportCaseComplaintReason)),null,]), rubric_version: faker.helpers.arrayElement([faker.number.int({min: 1}), null]), response_target: {kind: faker.helpers.arrayElement(['operational_goal'] as const), business_days: faker.number.int({min: 1, max: 60}), due_at: faker.date.past().toISOString().slice(0, 19) + 'Z', answered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), late: faker.datatype.boolean(), policy_version: faker.number.int({min: 1})}, decision: faker.helpers.arrayElement([{...getCreateMySupportCaseResponseSupportCaseDecisionMock()},null,]), history: Array.from({ length: faker.number.int({min: 1, max: 200}) }, (_, i) => i + 1).map(() => ({sequence: faker.number.int({min: 1}), kind: faker.helpers.arrayElement(Object.values(SupportCaseEventKind)), actor: faker.helpers.arrayElement(Object.values(SupportCaseActorKind)), occurred_at: faker.date.past().toISOString().slice(0, 19) + 'Z', status: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(SupportCaseStatus)),null,]), message: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 4000}}),null,])})), created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getGetMySupportCaseResponseSupportCaseObjectReferenceMock = (overrideResponse: Partial<SupportCaseObjectReference> = {}): SupportCaseObjectReference => ({...{type: faker.helpers.arrayElement(Object.values(SupportCaseObjectType)), id: faker.string.uuid()}, ...overrideResponse});
|
||||
|
||||
export const getGetMySupportCaseResponseSupportCaseAssessmentTargetMock = (overrideResponse: Partial<SupportCaseAssessmentTarget> = {}): SupportCaseAssessmentTarget => ({...{specialization: faker.helpers.arrayElement(Object.values(SpecializationCode)), grade: faker.helpers.arrayElement(Object.values(GradeCode))}, ...overrideResponse});
|
||||
|
||||
export const getGetMySupportCaseResponseSupportCaseDecisionMock = (overrideResponse: Partial<SupportCaseDecision> = {}): SupportCaseDecision => ({...{outcome: faker.helpers.arrayElement(Object.values(SupportCaseDecisionOutcome)), reason: faker.string.alpha({length: {min: 1, max: 4000}}), decided_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, ...overrideResponse});
|
||||
|
||||
export const getGetMySupportCaseResponseMock = (overrideResponse: Partial<Extract<SupportCase, object>> = {}): SupportCase => ({id: faker.string.uuid(), number: faker.helpers.fromRegExp("^SC-[0-9]{4}-[0-9]{6,10}$"), type: faker.helpers.arrayElement(Object.values(SupportCaseType)), status: faker.helpers.arrayElement(Object.values(SupportCaseStatus)), description: faker.helpers.fromRegExp("\\S"), object: faker.helpers.arrayElement([{...getGetMySupportCaseResponseSupportCaseObjectReferenceMock()},null,]), assessment_target: faker.helpers.arrayElement([{...getGetMySupportCaseResponseSupportCaseAssessmentTargetMock()},null,]), complaint_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(SupportCaseComplaintReason)),null,]), rubric_version: faker.helpers.arrayElement([faker.number.int({min: 1}), null]), response_target: {kind: faker.helpers.arrayElement(['operational_goal'] as const), business_days: faker.number.int({min: 1, max: 60}), due_at: faker.date.past().toISOString().slice(0, 19) + 'Z', answered_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), late: faker.datatype.boolean(), policy_version: faker.number.int({min: 1})}, decision: faker.helpers.arrayElement([{...getGetMySupportCaseResponseSupportCaseDecisionMock()},null,]), history: Array.from({ length: faker.number.int({min: 1, max: 200}) }, (_, i) => i + 1).map(() => ({sequence: faker.number.int({min: 1}), kind: faker.helpers.arrayElement(Object.values(SupportCaseEventKind)), actor: faker.helpers.arrayElement(Object.values(SupportCaseActorKind)), occurred_at: faker.date.past().toISOString().slice(0, 19) + 'Z', status: faker.helpers.arrayElement([faker.helpers.arrayElement(Object.values(SupportCaseStatus)),null,]), message: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 4000}}),null,])})), created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
|
||||
export const getListMySupportCasesMockHandler = (overrideResponse?: SupportCaseList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<SupportCaseList> | SupportCaseList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/support-cases', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMySupportCasesResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getCreateMySupportCaseMockHandler = (overrideResponse?: SupportCase | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<SupportCase> | SupportCase), options?: RequestHandlerOptions) => {
|
||||
return http.post('*/api/v1/me/support-cases', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getCreateMySupportCaseResponseMock(),
|
||||
{ status: 201
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getGetMySupportCaseMockHandler = (overrideResponse?: SupportCase | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<SupportCase> | SupportCase), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/support-cases/:caseId', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetMySupportCaseResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
export const getSupportMock = () => [
|
||||
getListMySupportCasesMockHandler(),
|
||||
getCreateMySupportCaseMockHandler(),
|
||||
getGetMySupportCaseMockHandler()
|
||||
]
|
||||
@@ -0,0 +1,391 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
MutationFunction,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
CreateMySupportCaseHeaders,
|
||||
ListMySupportCasesParams,
|
||||
Problem,
|
||||
SupportCase,
|
||||
SupportCaseCreate,
|
||||
SupportCaseList
|
||||
} from '../../schemas';
|
||||
|
||||
import { apiRequest } from '../../client';
|
||||
import type { ErrorType } from '../../client';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {
|
||||
const result = { queryKey } as T & { queryKey: K };
|
||||
for (const key of Object.keys(query)) {
|
||||
// The explicit queryKey always wins, matching the previous
|
||||
// `{ ...query, queryKey }` spread where it was set last.
|
||||
if (key === 'queryKey') continue;
|
||||
Object.defineProperty(result, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: () => (query as Record<string, unknown>)[key],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getListMySupportCasesUrl = (params?: ListMySupportCasesParams,) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? 'null' : String(value))
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0 ? `/api/v1/me/support-cases?${stringifiedParams}` : `/api/v1/me/support-cases`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate or an employer account. Returns a page of the cases that this account created, newest first by creation time with the identifier as the tie-breaker, with cursor pagination. Each item is a summary with the number, type, status, object reference, category, response target, and decision outcome; it has no description and no history, which GetMySupportCase returns with the full case. Cases of other accounts are never listed, including cases of other members of the same organization.
|
||||
*
|
||||
* Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed `limit` or `cursor` answers 400 validation_failed. Filters by status and type are planned and add optional parameters.
|
||||
* @summary List the support cases of the current account.
|
||||
*/
|
||||
export const listMySupportCases = async (params?: ListMySupportCasesParams, options?: Parameters<typeof apiRequest>[1]): Promise<SupportCaseList> => {
|
||||
|
||||
return apiRequest<SupportCaseList>(getListMySupportCasesUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMySupportCasesQueryKey = (params?: ListMySupportCasesParams,) => {
|
||||
return [
|
||||
`/api/v1/me/support-cases`, ...(params ? [params] : [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListMySupportCasesQueryOptions = <TData = Awaited<ReturnType<typeof listMySupportCases>>, TError = ErrorType<Problem>>(params?: ListMySupportCasesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListMySupportCasesQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listMySupportCases>>> = ({ signal }) => listMySupportCases(params, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListMySupportCasesQueryResult = NonNullable<Awaited<ReturnType<typeof listMySupportCases>>>
|
||||
export type ListMySupportCasesQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useListMySupportCases<TData = Awaited<ReturnType<typeof listMySupportCases>>, TError = ErrorType<Problem>>(
|
||||
params: undefined | ListMySupportCasesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMySupportCases>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMySupportCases>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMySupportCases<TData = Awaited<ReturnType<typeof listMySupportCases>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMySupportCasesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMySupportCases>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMySupportCases>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMySupportCases<TData = Awaited<ReturnType<typeof listMySupportCases>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMySupportCasesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List the support cases of the current account.
|
||||
*/
|
||||
|
||||
export function useListMySupportCases<TData = Awaited<ReturnType<typeof listMySupportCases>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMySupportCasesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMySupportCases>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListMySupportCasesQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getCreateMySupportCaseUrl = () => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/support-cases`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The author is the account of the session; the body has no user, account, or organization field. A case is reachable from any screen, including a screen that denies access to an assessment: being refused an action never removes the path to a case about it.
|
||||
*
|
||||
* The client sends only what the user states: `type`, a non-blank `description`, and the fields of the type. It never sets the status, the decision, the outcome, the priority, the response target, the rubric, the assignee, or the moderator: every variant has `additionalProperties: false`, so such fields answer 400. Attachments are not part of the MVP; they are planned as an optional field and change no existing one.
|
||||
*
|
||||
* Types, accounts, and allowed references:
|
||||
*
|
||||
* | Type | Accounts | Object reference | Other fields |
|
||||
* | --- | --- | --- | --- |
|
||||
* | `support` | candidate, employer | optional; `assessment_attempt` of the caller, an `organization` that the caller can see, an `invitation` addressed to the caller, or another `support_case` of the caller | optional `assessment_target` |
|
||||
* | `complaint` | candidate | required; an `organization` that the caller can see or an `invitation` addressed to the caller | required `complaint_reason`; `offer_content` and `salary_terms_violation` require an invitation |
|
||||
* | `grade_appeal` | candidate | required; `assessment_attempt` of the caller in a terminal state, so it has a result, or a `support_case` of the caller of type `manual_assessment` that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt | none |
|
||||
* | `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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Description check: the schema pattern `\S` uses the ECMAScript white space set in both generated validators (ogen converts it for Go), so a description of spaces such as U+00A0 or U+3000 already fails validation with the pointer `/description`. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes, so the server also applies a domain check: a description whose every character is `unicode.IsSpace` or U+FEFF answers 400 validation_failed with the pointer `/description`. This check comes with the implementation; generated Zod accepts a description of NEL, and the server stays authoritative.
|
||||
*
|
||||
* The new case gets a number and the status `submitted`. A grade appeal, an anti-cheat appeal, and a manual assessment are moved to `waiting_expert` by a `system` event in the same transaction, so the 201 already shows that status with both events; a support case and a complaint stay `submitted`. Each case gets a response target from the product policy version and the configured business calendar: 5 business days for a manual assessment and 10 for an appeal (PRD FR18 and C3), and a policy value for support and complaints. The target is an operational goal, not a deadline set by law. A manual assessment fixes the published rubric version of the category, or null when the category has none yet; the expert assesses with the same rubric as the automated assessment, and the request assigns no category by itself. Creating a case never grants, revokes, or changes a consent, a grade, or an attempt.
|
||||
*
|
||||
* Replies: the case itself is the channel. Support replies and decisions appear in the public `history` and `decision`. The server may also notify the verified email address of the account that the case changed, with the case number and a link, never with the description, the reply, or assessment details. No request field names another address or contact, so the operation cannot send mail to an address that the user typed.
|
||||
*
|
||||
* Idempotency: a retry with the same key and body within 24 hours replays the stored 201 with the same number and creates nothing, so a lost response never opens a second case. The replay is the snapshot stored at creation, following the repository convention; the client reads the current status and history with GetMySupportCase. 404 and 409 state_conflict are stored and replayed as well. A different body with the same key answers 422 idempotency_key_reused. 400, 403, and 429 are never stored.
|
||||
*
|
||||
* Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer account with a type other than `support`), the per-account case limit (429), the Idempotency-Key (422, 409 idempotency_in_progress, replay), domain rules (400 with the pointer `/description` for a text of only Unicode spaces or `/object/type` for a complaint reason that requires an invitation), the object reference (404 not_found), then the state of the object and the limits (409 state_conflict). The general rate limit can answer 429 with Retry-After before any check.
|
||||
* @summary Open a support case, a complaint, an appeal, or a manual assessment request.
|
||||
*/
|
||||
export const createMySupportCase = async (supportCaseCreate: SupportCaseCreate,
|
||||
headers: CreateMySupportCaseHeaders, options?: Parameters<typeof apiRequest>[1]): Promise<SupportCase> => {
|
||||
|
||||
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
|
||||
if (!h) return {};
|
||||
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
||||
if (Symbol.iterator in h) {
|
||||
return Object.fromEntries(
|
||||
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
|
||||
);
|
||||
}
|
||||
const headers: Record<string, string | readonly string[]> = {};
|
||||
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
|
||||
if (value !== undefined) headers[name] = value;
|
||||
}
|
||||
return headers;
|
||||
};
|
||||
return apiRequest<SupportCase>(getCreateMySupportCaseUrl(),
|
||||
{
|
||||
...options,
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json',...headers, ...getHeaders(options?.headers) },
|
||||
body: JSON.stringify(supportCaseCreate)
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getCreateMySupportCaseMutationKey = () => ['createMySupportCase'] as const;
|
||||
|
||||
export const getCreateMySupportCaseMutationOptions = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createMySupportCase>>, TError,CreateMySupportCaseMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof createMySupportCase>>, TError,CreateMySupportCaseMutationVariables, TContext> => {
|
||||
|
||||
const mutationKey = getCreateMySupportCaseMutationKey();
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createMySupportCase>>, CreateMySupportCaseMutationVariables> = (props) => {
|
||||
const {data,headers} = props ?? {};
|
||||
|
||||
return createMySupportCase(data,headers,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CreateMySupportCaseMutationResult = NonNullable<Awaited<ReturnType<typeof createMySupportCase>>>
|
||||
export type CreateMySupportCaseMutationBody = SupportCaseCreate
|
||||
export type CreateMySupportCaseMutationError = ErrorType<Problem>
|
||||
export type CreateMySupportCaseMutationVariables = {data: SupportCaseCreate;headers: CreateMySupportCaseHeaders}
|
||||
|
||||
/**
|
||||
* @summary Open a support case, a complaint, an appeal, or a manual assessment request.
|
||||
*/
|
||||
export const useCreateMySupportCase = <TError = ErrorType<Problem>,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createMySupportCase>>, TError,CreateMySupportCaseMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createMySupportCase>>,
|
||||
TError,
|
||||
CreateMySupportCaseMutationVariables,
|
||||
TContext
|
||||
> => {
|
||||
return useMutation(getCreateMySupportCaseMutationOptions(options), queryClient);
|
||||
}
|
||||
export const getGetMySupportCaseUrl = (caseId: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/me/support-cases/${caseId}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate or an employer account. Returns the case with its number, type, object reference, status, response target, decision, and public history. The owner reads the case whatever happened to the object since then: a revoked access, a closed invitation, or a refused test never hides the case from its author.
|
||||
*
|
||||
* The case never contains the identity of a moderator, an expert, or a support agent, internal notes, evidence, assessment answers, anti-cheat or risk signals, or contact data of another person. `decision` is null until the case is `resolved`.
|
||||
*
|
||||
* The history lists every public event and is never truncated: the server keeps a case within 200 events by rejecting a staff event that would leave no room for the terminal one.
|
||||
*
|
||||
* The case must belong to the account of the session: a case of another account, including another member of the same organization, answers 404 not_found, the same as an unknown identifier, so identifiers cannot be probed. TASK-314 says forbidden for a foreign case URL; the contract answers 404 instead, so the client shows the same "not found" state for a foreign and an unknown case. A malformed `case_id` answers 400 validation_failed with the path pointer.
|
||||
* @summary Read a support case of the current account.
|
||||
*/
|
||||
export const getMySupportCase = async (caseId: string, options?: Parameters<typeof apiRequest>[1]): Promise<SupportCase> => {
|
||||
|
||||
return apiRequest<SupportCase>(getGetMySupportCaseUrl(caseId),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetMySupportCaseQueryKey = (caseId: string,) => {
|
||||
return [
|
||||
`/api/v1/me/support-cases/${caseId}`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetMySupportCaseQueryOptions = <TData = Awaited<ReturnType<typeof getMySupportCase>>, TError = ErrorType<Problem>>(caseId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetMySupportCaseQueryKey(caseId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMySupportCase>>> = ({ signal }) => getMySupportCase(caseId, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: caseId !== null && caseId !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetMySupportCaseQueryResult = NonNullable<Awaited<ReturnType<typeof getMySupportCase>>>
|
||||
export type GetMySupportCaseQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetMySupportCase<TData = Awaited<ReturnType<typeof getMySupportCase>>, TError = ErrorType<Problem>>(
|
||||
caseId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMySupportCase>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMySupportCase>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMySupportCase<TData = Awaited<ReturnType<typeof getMySupportCase>>, TError = ErrorType<Problem>>(
|
||||
caseId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getMySupportCase>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getMySupportCase>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetMySupportCase<TData = Awaited<ReturnType<typeof getMySupportCase>>, TError = ErrorType<Problem>>(
|
||||
caseId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read a support case of the current account.
|
||||
*/
|
||||
|
||||
export function useGetMySupportCase<TData = Awaited<ReturnType<typeof getMySupportCase>>, TError = ErrorType<Problem>>(
|
||||
caseId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMySupportCase>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetMySupportCaseQueryOptions(caseId,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
export * from './gradeCode.zod';
|
||||
export * from './pageInfo.zod';
|
||||
export * from './problem.zod';
|
||||
export * from './problemCode.zod';
|
||||
export * from './problemFieldError.zod';
|
||||
@@ -20,3 +21,4 @@ export * from './catalog';
|
||||
export * from './health';
|
||||
export * from './identity';
|
||||
export * from './need';
|
||||
export * from './support';
|
||||
@@ -55,7 +55,6 @@ export * from './needVersion.zod';
|
||||
export * from './needVersionLabel.zod';
|
||||
export * from './needWorkFormats.zod';
|
||||
export * from './needWorkFormatsInput.zod';
|
||||
export * from './pageInfo.zod';
|
||||
export * from './rubAmount.zod';
|
||||
export * from './salaryPeriod.zod';
|
||||
export * from './salaryRange.zod';
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const createMySupportCaseBodyOneDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const createMySupportCaseBodyOneDescriptionRegExp = new RegExp('\\S');
|
||||
export const createMySupportCaseBodyTwoDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const createMySupportCaseBodyTwoDescriptionRegExp = new RegExp('\\S');
|
||||
export const createMySupportCaseBodyThreeDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const createMySupportCaseBodyThreeDescriptionRegExp = new RegExp('\\S');
|
||||
export const createMySupportCaseBodyFourDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const createMySupportCaseBodyFourDescriptionRegExp = new RegExp('\\S');
|
||||
export const createMySupportCaseBodyFiveDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const createMySupportCaseBodyFiveDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const CreateMySupportCaseBody = zod.union([zod.object({
|
||||
"type": zod.enum(['support']),
|
||||
"description": zod.string().min(1).max(createMySupportCaseBodyOneDescriptionMax).regex(createMySupportCaseBodyOneDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
|
||||
"assessment_target": zod.object({
|
||||
"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.')
|
||||
}).exactOptional().describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.')
|
||||
}).describe('New support case. Both the object reference and the assessment target are optional context; omit what does not apply.'),zod.object({
|
||||
"type": zod.enum(['complaint']),
|
||||
"description": zod.string().min(1).max(createMySupportCaseBodyTwoDescriptionMax).regex(createMySupportCaseBodyTwoDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"complaint_reason": zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['organization', 'invitation']),
|
||||
"id": zod.uuid().describe('Identifier of the organization or the invitation.')
|
||||
}).describe('Reference to the object of a complaint: an organization that the caller can see or an invitation addressed to the caller. Any other object type fails validation.')
|
||||
}).describe('New complaint about an organization or an offer.'),zod.object({
|
||||
"type": zod.enum(['grade_appeal']),
|
||||
"description": zod.string().min(1).max(createMySupportCaseBodyThreeDescriptionMax).regex(createMySupportCaseBodyThreeDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'support_case']),
|
||||
"id": zod.uuid().describe('Identifier of the attempt or the case.')
|
||||
}).describe('Reference to the category that a grade appeal disputes: an assessment attempt of the caller in a terminal state, or a `manual_assessment` case of the caller that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt. Any other object type fails validation.')
|
||||
}).describe('New appeal of a category the caller received: the result of an own assessment attempt, or the outcome of an own resolved manual assessment.'),zod.object({
|
||||
"type": zod.enum(['anticheat_appeal']),
|
||||
"description": zod.string().min(1).max(createMySupportCaseBodyFourDescriptionMax).regex(createMySupportCaseBodyFourDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New appeal of an anti-cheat review decision on an own assessment attempt.'),zod.object({
|
||||
"type": zod.enum(['manual_assessment']),
|
||||
"description": zod.string().min(1).max(createMySupportCaseBodyFiveDescriptionMax).regex(createMySupportCaseBodyFiveDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"assessment_target": zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).exactOptional().describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New request for a manual assessment of a category by a subject expert. A prior attempt of the same category is optional context: a failed first test or no attempt at all never blocks the request.')]).describe('New case, selected by `type`. Each type fixes its required fields and the object types it accepts. The body carries only what the user states: the request has no status, decision, outcome, priority, response target, assignee, moderator, rubric, or contact field, and every variant rejects unknown fields, so a client cannot set any of them. The user and the account come only from the session.')
|
||||
|
||||
export type CreateMySupportCaseBody = zod.input<typeof CreateMySupportCaseBody>;
|
||||
export type CreateMySupportCaseBodyOutput = zod.output<typeof CreateMySupportCaseBody>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const createMySupportCaseHeadersIdempotencyKeyMax = 255;
|
||||
|
||||
|
||||
export const createMySupportCaseHeadersIdempotencyKeyRegExp = new RegExp('^[A-Za-z0-9._:-]+$');
|
||||
|
||||
export const CreateMySupportCaseHeaders = zod.object({
|
||||
"Idempotency-Key": zod.string().min(1).max(createMySupportCaseHeadersIdempotencyKeyMax).regex(createMySupportCaseHeadersIdempotencyKeyRegExp)
|
||||
})
|
||||
|
||||
export type CreateMySupportCaseHeaders = zod.input<typeof CreateMySupportCaseHeaders>;
|
||||
export type CreateMySupportCaseHeadersOutput = zod.output<typeof CreateMySupportCaseHeaders>;
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export * from './createMySupportCaseBody.zod';
|
||||
export * from './createMySupportCaseHeaders.zod';
|
||||
export * from './listMySupportCasesParams.zod';
|
||||
export * from './supportCase.zod';
|
||||
export * from './supportCaseActorKind.zod';
|
||||
export * from './supportCaseAssessmentTarget.zod';
|
||||
export * from './supportCaseAttemptReference.zod';
|
||||
export * from './supportCaseComplaintReason.zod';
|
||||
export * from './supportCaseComplaintReference.zod';
|
||||
export * from './supportCaseCreate.zod';
|
||||
export * from './supportCaseCreateAnticheatAppeal.zod';
|
||||
export * from './supportCaseCreateComplaint.zod';
|
||||
export * from './supportCaseCreateGradeAppeal.zod';
|
||||
export * from './supportCaseCreateManualAssessment.zod';
|
||||
export * from './supportCaseCreateSupport.zod';
|
||||
export * from './supportCaseDecision.zod';
|
||||
export * from './supportCaseDecisionOutcome.zod';
|
||||
export * from './supportCaseDescription.zod';
|
||||
export * from './supportCaseEvent.zod';
|
||||
export * from './supportCaseEventKind.zod';
|
||||
export * from './supportCaseGradeAppealReference.zod';
|
||||
export * from './supportCaseList.zod';
|
||||
export * from './supportCaseNumber.zod';
|
||||
export * from './supportCaseObjectReference.zod';
|
||||
export * from './supportCaseObjectType.zod';
|
||||
export * from './supportCasePublicText.zod';
|
||||
export * from './supportCaseStatus.zod';
|
||||
export * from './supportCaseSummary.zod';
|
||||
export * from './supportCaseType.zod';
|
||||
export * from './supportResponseTarget.zod';
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const listMySupportCasesParamsLimitDefault = 20;
|
||||
export const listMySupportCasesParamsLimitMax = 100;
|
||||
|
||||
export const listMySupportCasesParamsCursorMax = 512;
|
||||
|
||||
|
||||
export const listMySupportCasesParamsCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const ListMySupportCasesParams = zod.object({
|
||||
"limit": zod.int().min(1).max(listMySupportCasesParamsLimitMax).default(listMySupportCasesParamsLimitDefault),
|
||||
"cursor": zod.string().min(1).max(listMySupportCasesParamsCursorMax).regex(listMySupportCasesParamsCursorRegExp).exactOptional()
|
||||
})
|
||||
|
||||
export type ListMySupportCasesParams = zod.input<typeof ListMySupportCasesParams>;
|
||||
export type ListMySupportCasesParamsOutput = zod.output<typeof ListMySupportCasesParams>;
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseNumberMin = 14;
|
||||
export const supportCaseNumberMax = 18;
|
||||
|
||||
|
||||
export const supportCaseNumberRegExp = new RegExp('^SC-[0-9]{4}-[0-9]{6,10}$');
|
||||
export const supportCaseDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const supportCaseResponseTargetBusinessDaysMax = 60;
|
||||
|
||||
|
||||
export const supportCaseDecisionOneReasonMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseHistoryItemMessageOneMax = 4000;
|
||||
|
||||
export const supportCaseHistoryMax = 200;
|
||||
|
||||
|
||||
export const SupportCase = zod.object({
|
||||
"id": zod.uuid().describe('Case identifier.'),
|
||||
"number": zod.string().min(supportCaseNumberMin).max(supportCaseNumberMax).regex(supportCaseNumberRegExp).describe('Human-readable case number that the server assigns on creation, for example `SC-2026-000123`: the prefix `SC`, the UTC year of creation, and a sequence number of at least six digits with leading zeros. The sequence is global and never reused, so the number is unique across every case and year and never changes. The user quotes it in letters and calls; the API addresses a case only by its `id`. Clients show the number as text and never parse it.'),
|
||||
"type": zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'),
|
||||
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
|
||||
"description": zod.string().min(1).max(supportCaseDescriptionMax).regex(supportCaseDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.union([zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, as sent on creation, or null when the case has none.'),
|
||||
"assessment_target": zod.union([zod.object({
|
||||
"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.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),zod.null()]).describe('Category of a manual assessment, the optional category of a support case, or null.'),
|
||||
"complaint_reason": zod.union([zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.'),zod.null()]).describe('Ground of a complaint, or null for other types.'),
|
||||
"rubric_version": zod.int().min(1).nullable().describe('For a manual assessment, the version of the published rubric of the category that the server fixed on creation; the expert assesses with it, the same rubric as the automated assessment. Null for other types, and null for a manual assessment whose category has no published rubric yet: the case then waits in `waiting_expert` and the client says so instead of promising a date.'),
|
||||
"response_target": zod.object({
|
||||
"kind": zod.enum(['operational_goal']).describe('Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.'),
|
||||
"business_days": zod.int().min(1).max(supportCaseResponseTargetBusinessDaysMax).describe('Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.'),
|
||||
"due_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"answered_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the target was met, or null while it is not.'),
|
||||
"late": zod.boolean().describe('Whether the target was missed: it was met after `due_at`, or it is not met and `due_at` has passed at the time of the response.'),
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version that fixed the target.')
|
||||
}).describe('Operational target for the answer to the case (PRD FR18: a case gets a number, a status, and a response deadline). The server fixes it on creation from the product policy version and the configured business calendar; it is a goal of the team, not a deadline set by law. The target is met by the first public reply, a decision, or a closure for `support` and `complaint`, and only by a decision or a closure for the appeals and `manual_assessment`. Missing the target never closes the case, never decides it, and never changes a grade.'),
|
||||
"decision": zod.union([zod.object({
|
||||
"outcome": zod.enum(['upheld', 'partially_upheld', 'not_upheld', 'answered', 'assessed']).describe('Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.\n\n- upheld: the appeal or the complaint is upheld in full.\n- partially_upheld: the appeal or the complaint is upheld in part.\n- not_upheld: the appeal or the complaint is not upheld.\n- answered: a support case was answered.\n- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.'),
|
||||
"reason": zod.string().min(1).max(supportCaseDecisionOneReasonMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),
|
||||
"decided_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Decision visible to the user. It exists only once the case is `resolved`. It holds the outcome and the public reason; it never names the moderator or the expert and never contains internal notes, evidence, sanctions against another party, or risk signals. An upheld grade appeal never rewrites the original result: the corrected result is a separate decision of the assessment, and both stay in the history of that attempt.'),zod.null()]).describe('Decision once the case is `resolved`, otherwise null.'),
|
||||
"history": zod.array(zod.object({
|
||||
"sequence": zod.int().min(1).describe('Position of the event in the history, starting at 1 and increasing by one.'),
|
||||
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
|
||||
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"status": zod.union([zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),zod.null()]).describe('Status of the case after the event, or null for a reply.'),
|
||||
"message": zod.union([zod.string().min(1).max(supportCaseHistoryItemMessageOneMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),zod.null()]).describe('Public text of the event, or null.')
|
||||
}).describe('One public event of the case history. Internal notes, assignments, evidence requests, and risk signals are never history events.')).min(1).max(supportCaseHistoryMax).describe('Every public event in the order it happened, starting with `created`; the list is never truncated. The server keeps a case within 200 events: it rejects a staff reply or status change that would leave no room for the terminal event, so a case always fits and can always be resolved or closed. Further correspondence goes into a new case that references this one as `support_case`.'),
|
||||
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Case of the current account. It contains what the author sent, the public processing state, and the public history. It never contains the identity of a moderator, an expert, or a support agent, internal notes, evidence, assessment answers or anti-cheat signals, risk signals, or contact data of another person. Fields that do not apply to the type are null.')
|
||||
|
||||
export type SupportCase = zod.input<typeof SupportCase>;
|
||||
export type SupportCaseOutput = zod.output<typeof SupportCase>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseActorKind = zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.')
|
||||
|
||||
export type SupportCaseActorKind = zod.input<typeof SupportCaseActorKind>;
|
||||
export type SupportCaseActorKindOutput = zod.output<typeof SupportCaseActorKind>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseAssessmentTarget = zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.')
|
||||
|
||||
export type SupportCaseAssessmentTarget = zod.input<typeof SupportCaseAssessmentTarget>;
|
||||
export type SupportCaseAssessmentTargetOutput = zod.output<typeof SupportCaseAssessmentTarget>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseAttemptReference = zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
|
||||
export type SupportCaseAttemptReference = zod.input<typeof SupportCaseAttemptReference>;
|
||||
export type SupportCaseAttemptReferenceOutput = zod.output<typeof SupportCaseAttemptReference>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseComplaintReason = zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.')
|
||||
|
||||
export type SupportCaseComplaintReason = zod.input<typeof SupportCaseComplaintReason>;
|
||||
export type SupportCaseComplaintReasonOutput = zod.output<typeof SupportCaseComplaintReason>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseComplaintReference = zod.object({
|
||||
"type": zod.enum(['organization', 'invitation']),
|
||||
"id": zod.uuid().describe('Identifier of the organization or the invitation.')
|
||||
}).describe('Reference to the object of a complaint: an organization that the caller can see or an invitation addressed to the caller. Any other object type fails validation.')
|
||||
|
||||
export type SupportCaseComplaintReference = zod.input<typeof SupportCaseComplaintReference>;
|
||||
export type SupportCaseComplaintReferenceOutput = zod.output<typeof SupportCaseComplaintReference>;
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateOneDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateOneDescriptionRegExp = new RegExp('\\S');
|
||||
export const supportCaseCreateTwoDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateTwoDescriptionRegExp = new RegExp('\\S');
|
||||
export const supportCaseCreateThreeDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateThreeDescriptionRegExp = new RegExp('\\S');
|
||||
export const supportCaseCreateFourDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateFourDescriptionRegExp = new RegExp('\\S');
|
||||
export const supportCaseCreateFiveDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateFiveDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreate = zod.union([zod.object({
|
||||
"type": zod.enum(['support']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateOneDescriptionMax).regex(supportCaseCreateOneDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
|
||||
"assessment_target": zod.object({
|
||||
"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.')
|
||||
}).exactOptional().describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.')
|
||||
}).describe('New support case. Both the object reference and the assessment target are optional context; omit what does not apply.'),zod.object({
|
||||
"type": zod.enum(['complaint']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateTwoDescriptionMax).regex(supportCaseCreateTwoDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"complaint_reason": zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['organization', 'invitation']),
|
||||
"id": zod.uuid().describe('Identifier of the organization or the invitation.')
|
||||
}).describe('Reference to the object of a complaint: an organization that the caller can see or an invitation addressed to the caller. Any other object type fails validation.')
|
||||
}).describe('New complaint about an organization or an offer.'),zod.object({
|
||||
"type": zod.enum(['grade_appeal']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateThreeDescriptionMax).regex(supportCaseCreateThreeDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'support_case']),
|
||||
"id": zod.uuid().describe('Identifier of the attempt or the case.')
|
||||
}).describe('Reference to the category that a grade appeal disputes: an assessment attempt of the caller in a terminal state, or a `manual_assessment` case of the caller that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt. Any other object type fails validation.')
|
||||
}).describe('New appeal of a category the caller received: the result of an own assessment attempt, or the outcome of an own resolved manual assessment.'),zod.object({
|
||||
"type": zod.enum(['anticheat_appeal']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateFourDescriptionMax).regex(supportCaseCreateFourDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New appeal of an anti-cheat review decision on an own assessment attempt.'),zod.object({
|
||||
"type": zod.enum(['manual_assessment']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateFiveDescriptionMax).regex(supportCaseCreateFiveDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"assessment_target": zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).exactOptional().describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New request for a manual assessment of a category by a subject expert. A prior attempt of the same category is optional context: a failed first test or no attempt at all never blocks the request.')]).describe('New case, selected by `type`. Each type fixes its required fields and the object types it accepts. The body carries only what the user states: the request has no status, decision, outcome, priority, response target, assignee, moderator, rubric, or contact field, and every variant rejects unknown fields, so a client cannot set any of them. The user and the account come only from the session.')
|
||||
|
||||
export type SupportCaseCreate = zod.input<typeof SupportCaseCreate>;
|
||||
export type SupportCaseCreateOutput = zod.output<typeof SupportCaseCreate>;
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateAnticheatAppealDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateAnticheatAppealDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreateAnticheatAppeal = zod.object({
|
||||
"type": zod.enum(['anticheat_appeal']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateAnticheatAppealDescriptionMax).regex(supportCaseCreateAnticheatAppealDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New appeal of an anti-cheat review decision on an own assessment attempt.')
|
||||
|
||||
export type SupportCaseCreateAnticheatAppeal = zod.input<typeof SupportCaseCreateAnticheatAppeal>;
|
||||
export type SupportCaseCreateAnticheatAppealOutput = zod.output<typeof SupportCaseCreateAnticheatAppeal>;
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateComplaintDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateComplaintDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreateComplaint = zod.object({
|
||||
"type": zod.enum(['complaint']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateComplaintDescriptionMax).regex(supportCaseCreateComplaintDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"complaint_reason": zod.enum(['organization_conduct', 'offer_content', 'salary_terms_violation', 'data_disclosure', 'other']).describe('Ground of a complaint (PRD FR18).\n\n- organization_conduct: conduct of the organization, for example fraudulent or abusive messages.\n- offer_content: misleading or discriminatory content of an offer. Requires an invitation reference.\n- salary_terms_violation: a breach of the salary terms of an offer. Requires an invitation reference.\n- data_disclosure: a disclosure of the caller\'s personal data beyond what the caller granted.\n- other: another ground, explained in the description.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['organization', 'invitation']),
|
||||
"id": zod.uuid().describe('Identifier of the organization or the invitation.')
|
||||
}).describe('Reference to the object of a complaint: an organization that the caller can see or an invitation addressed to the caller. Any other object type fails validation.')
|
||||
}).describe('New complaint about an organization or an offer.')
|
||||
|
||||
export type SupportCaseCreateComplaint = zod.input<typeof SupportCaseCreateComplaint>;
|
||||
export type SupportCaseCreateComplaintOutput = zod.output<typeof SupportCaseCreateComplaint>;
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateGradeAppealDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateGradeAppealDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreateGradeAppeal = zod.object({
|
||||
"type": zod.enum(['grade_appeal']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateGradeAppealDescriptionMax).regex(supportCaseCreateGradeAppealDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'support_case']),
|
||||
"id": zod.uuid().describe('Identifier of the attempt or the case.')
|
||||
}).describe('Reference to the category that a grade appeal disputes: an assessment attempt of the caller in a terminal state, or a `manual_assessment` case of the caller that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt. Any other object type fails validation.')
|
||||
}).describe('New appeal of a category the caller received: the result of an own assessment attempt, or the outcome of an own resolved manual assessment.')
|
||||
|
||||
export type SupportCaseCreateGradeAppeal = zod.input<typeof SupportCaseCreateGradeAppeal>;
|
||||
export type SupportCaseCreateGradeAppealOutput = zod.output<typeof SupportCaseCreateGradeAppeal>;
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateManualAssessmentDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateManualAssessmentDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreateManualAssessment = zod.object({
|
||||
"type": zod.enum(['manual_assessment']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateManualAssessmentDescriptionMax).regex(supportCaseCreateManualAssessmentDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"assessment_target": zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt']),
|
||||
"id": zod.uuid().describe('Identifier of an assessment attempt of the caller.')
|
||||
}).exactOptional().describe('Reference to an assessment attempt of the caller. Any other object type fails validation.')
|
||||
}).describe('New request for a manual assessment of a category by a subject expert. A prior attempt of the same category is optional context: a failed first test or no attempt at all never blocks the request.')
|
||||
|
||||
export type SupportCaseCreateManualAssessment = zod.input<typeof SupportCaseCreateManualAssessment>;
|
||||
export type SupportCaseCreateManualAssessmentOutput = zod.output<typeof SupportCaseCreateManualAssessment>;
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseCreateSupportDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const supportCaseCreateSupportDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseCreateSupport = zod.object({
|
||||
"type": zod.enum(['support']),
|
||||
"description": zod.string().min(1).max(supportCaseCreateSupportDescriptionMax).regex(supportCaseCreateSupportDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.'),
|
||||
"object": zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).exactOptional().describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),
|
||||
"assessment_target": zod.object({
|
||||
"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.')
|
||||
}).exactOptional().describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.')
|
||||
}).describe('New support case. Both the object reference and the assessment target are optional context; omit what does not apply.')
|
||||
|
||||
export type SupportCaseCreateSupport = zod.input<typeof SupportCaseCreateSupport>;
|
||||
export type SupportCaseCreateSupportOutput = zod.output<typeof SupportCaseCreateSupport>;
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseDecisionReasonMax = 4000;
|
||||
|
||||
|
||||
export const SupportCaseDecision = zod.object({
|
||||
"outcome": zod.enum(['upheld', 'partially_upheld', 'not_upheld', 'answered', 'assessed']).describe('Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.\n\n- upheld: the appeal or the complaint is upheld in full.\n- partially_upheld: the appeal or the complaint is upheld in part.\n- not_upheld: the appeal or the complaint is not upheld.\n- answered: a support case was answered.\n- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.'),
|
||||
"reason": zod.string().min(1).max(supportCaseDecisionReasonMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),
|
||||
"decided_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Decision visible to the user. It exists only once the case is `resolved`. It holds the outcome and the public reason; it never names the moderator or the expert and never contains internal notes, evidence, sanctions against another party, or risk signals. An upheld grade appeal never rewrites the original result: the corrected result is a separate decision of the assessment, and both stay in the history of that attempt.')
|
||||
|
||||
export type SupportCaseDecision = zod.input<typeof SupportCaseDecision>;
|
||||
export type SupportCaseDecisionOutput = zod.output<typeof SupportCaseDecision>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseDecisionOutcome = zod.enum(['upheld', 'partially_upheld', 'not_upheld', 'answered', 'assessed']).describe('Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.\n\n- upheld: the appeal or the complaint is upheld in full.\n- partially_upheld: the appeal or the complaint is upheld in part.\n- not_upheld: the appeal or the complaint is not upheld.\n- answered: a support case was answered.\n- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.')
|
||||
|
||||
export type SupportCaseDecisionOutcome = zod.input<typeof SupportCaseDecisionOutcome>;
|
||||
export type SupportCaseDecisionOutcomeOutput = zod.output<typeof SupportCaseDecisionOutcome>;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseDescriptionMax = 4000;
|
||||
|
||||
|
||||
export const SupportCaseDescriptionRegExp = new RegExp('\\S');
|
||||
|
||||
export const SupportCaseDescription = zod.string().min(1).max(SupportCaseDescriptionMax).regex(SupportCaseDescriptionRegExp).describe('What the user asks or reports, as the user wrote it. It must contain at least one character that is not whitespace, so an empty or blank text fails validation with the pointer `/description`; it may contain line breaks. The pattern `\\S` uses the ECMAScript white space set in both generated validators: ogen converts it to that set for Go, so a text made only of spaces such as U+00A0, U+2003, or U+3000 fails in the server schema and in Zod alike. ECMAScript white space omits U+0085 (NEL), which Go `unicode.IsSpace` includes; the server therefore also rejects a text whose every character is `unicode.IsSpace` or U+FEFF, with the same 400 and the pointer `/description`, while generated Zod accepts a text of NEL. Plain text; clients show it as text, never as HTML. The server stores it as written, shows it only to the author and to the staff of the queue, and never writes it to logs or notifications. Users should not put passwords or other people\'s contact data into it. Generated Zod validators count UTF-16 code units, so the server stays authoritative for the length.')
|
||||
|
||||
export type SupportCaseDescription = zod.input<typeof SupportCaseDescription>;
|
||||
export type SupportCaseDescriptionOutput = zod.output<typeof SupportCaseDescription>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
|
||||
export const supportCaseEventMessageOneMax = 4000;
|
||||
|
||||
|
||||
export const SupportCaseEvent = zod.object({
|
||||
"sequence": zod.int().min(1).describe('Position of the event in the history, starting at 1 and increasing by one.'),
|
||||
"kind": zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.'),
|
||||
"actor": zod.enum(['user', 'support', 'system']).describe('Who caused an event, by kind only. A case never names or identifies a moderator, an expert, or a support agent; experts and moderators of TASK-316 and TASK-323 are `support` too. Adding a value is a contract change.\n\n- user: the author of the case.\n- support: a person of the support, moderation, or expert staff.\n- system: the server, for example on creation or when it routes the case.'),
|
||||
"occurred_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"status": zod.union([zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),zod.null()]).describe('Status of the case after the event, or null for a reply.'),
|
||||
"message": zod.union([zod.string().min(1).max(supportCaseEventMessageOneMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.'),zod.null()]).describe('Public text of the event, or null.')
|
||||
}).describe('One public event of the case history. Internal notes, assignments, evidence requests, and risk signals are never history events.')
|
||||
|
||||
export type SupportCaseEvent = zod.input<typeof SupportCaseEvent>;
|
||||
export type SupportCaseEventOutput = zod.output<typeof SupportCaseEvent>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseEventKind = zod.enum(['created', 'status_changed', 'reply', 'decision']).describe('Kind of a public history event. Adding a value is a contract change. A reply of the author, planned with `waiting_for_user`, is a `reply` with the actor `user`, and a later revision of a decision (TASK-317) is another `decision` event, so neither needs a new value.\n\n- created: the case was created; `status` is `submitted`. For an appeal or a manual assessment, a `status_changed` event of the actor `system` to `waiting_expert` follows in the same transaction.\n- status_changed: the status changed; `status` is the new status, and `message` may explain a closure.\n- reply: support replied; `message` holds the reply and `status` is null.\n- decision: a decision was made; `status` is `resolved` and `message` holds the public reason.')
|
||||
|
||||
export type SupportCaseEventKind = zod.input<typeof SupportCaseEventKind>;
|
||||
export type SupportCaseEventKindOutput = zod.output<typeof SupportCaseEventKind>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseGradeAppealReference = zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'support_case']),
|
||||
"id": zod.uuid().describe('Identifier of the attempt or the case.')
|
||||
}).describe('Reference to the category that a grade appeal disputes: an assessment attempt of the caller in a terminal state, or a `manual_assessment` case of the caller that is `resolved` with the outcome `assessed`, for a category that an expert assigned without an attempt. Any other object type fails validation.')
|
||||
|
||||
export type SupportCaseGradeAppealReference = zod.input<typeof SupportCaseGradeAppealReference>;
|
||||
export type SupportCaseGradeAppealReferenceOutput = zod.output<typeof SupportCaseGradeAppealReference>;
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseListItemsItemNumberMin = 14;
|
||||
export const supportCaseListItemsItemNumberMax = 18;
|
||||
|
||||
|
||||
export const supportCaseListItemsItemNumberRegExp = new RegExp('^SC-[0-9]{4}-[0-9]{6,10}$');
|
||||
export const supportCaseListItemsItemResponseTargetBusinessDaysMax = 60;
|
||||
|
||||
|
||||
export const supportCaseListItemsMax = 100;
|
||||
|
||||
export const supportCaseListPageNextCursorMax = 512;
|
||||
|
||||
|
||||
export const supportCaseListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
||||
|
||||
export const SupportCaseList = zod.object({
|
||||
"items": zod.array(zod.object({
|
||||
"id": zod.uuid().describe('Case identifier.'),
|
||||
"number": zod.string().min(supportCaseListItemsItemNumberMin).max(supportCaseListItemsItemNumberMax).regex(supportCaseListItemsItemNumberRegExp).describe('Human-readable case number that the server assigns on creation, for example `SC-2026-000123`: the prefix `SC`, the UTC year of creation, and a sequence number of at least six digits with leading zeros. The sequence is global and never reused, so the number is unique across every case and year and never changes. The user quotes it in letters and calls; the API addresses a case only by its `id`. Clients show the number as text and never parse it.'),
|
||||
"type": zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'),
|
||||
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
|
||||
"object": zod.union([zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, or null.'),
|
||||
"assessment_target": zod.union([zod.object({
|
||||
"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.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),zod.null()]).describe('Category of the case, or null.'),
|
||||
"response_target": zod.object({
|
||||
"kind": zod.enum(['operational_goal']).describe('Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.'),
|
||||
"business_days": zod.int().min(1).max(supportCaseListItemsItemResponseTargetBusinessDaysMax).describe('Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.'),
|
||||
"due_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"answered_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the target was met, or null while it is not.'),
|
||||
"late": zod.boolean().describe('Whether the target was missed: it was met after `due_at`, or it is not met and `due_at` has passed at the time of the response.'),
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version that fixed the target.')
|
||||
}).describe('Operational target for the answer to the case (PRD FR18: a case gets a number, a status, and a response deadline). The server fixes it on creation from the product policy version and the configured business calendar; it is a goal of the team, not a deadline set by law. The target is met by the first public reply, a decision, or a closure for `support` and `complaint`, and only by a decision or a closure for the appeals and `manual_assessment`. Missing the target never closes the case, never decides it, and never changes a grade.'),
|
||||
"decision_outcome": zod.union([zod.enum(['upheld', 'partially_upheld', 'not_upheld', 'answered', 'assessed']).describe('Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.\n\n- upheld: the appeal or the complaint is upheld in full.\n- partially_upheld: the appeal or the complaint is upheld in part.\n- not_upheld: the appeal or the complaint is not upheld.\n- answered: a support case was answered.\n- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.'),zod.null()]).describe('Outcome of the decision once the case is `resolved`, otherwise null.'),
|
||||
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Case in a list: the fields that a list of cases shows, without the description and the history. GetMySupportCase returns the full case.')).max(supportCaseListItemsMax).describe('Case summaries of the page.'),
|
||||
"page": zod.object({
|
||||
"has_more": zod.boolean().describe('Whether another page follows this one.'),
|
||||
"next_cursor": zod.string().min(1).max(supportCaseListPageNextCursorMax).regex(supportCaseListPageNextCursorRegExp).nullable().describe('Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.')
|
||||
}).describe('Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.')
|
||||
}).describe('One page of the cases of the current account, newest first by creation time.')
|
||||
|
||||
export type SupportCaseList = zod.input<typeof SupportCaseList>;
|
||||
export type SupportCaseListOutput = zod.output<typeof SupportCaseList>;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseNumberMin = 14;
|
||||
export const SupportCaseNumberMax = 18;
|
||||
|
||||
|
||||
export const SupportCaseNumberRegExp = new RegExp('^SC-[0-9]{4}-[0-9]{6,10}$');
|
||||
|
||||
export const SupportCaseNumber = zod.string().min(SupportCaseNumberMin).max(SupportCaseNumberMax).regex(SupportCaseNumberRegExp).describe('Human-readable case number that the server assigns on creation, for example `SC-2026-000123`: the prefix `SC`, the UTC year of creation, and a sequence number of at least six digits with leading zeros. The sequence is global and never reused, so the number is unique across every case and year and never changes. The user quotes it in letters and calls; the API addresses a case only by its `id`. Clients show the number as text and never parse it.')
|
||||
|
||||
export type SupportCaseNumber = zod.input<typeof SupportCaseNumber>;
|
||||
export type SupportCaseNumberOutput = zod.output<typeof SupportCaseNumber>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseObjectReference = zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.')
|
||||
|
||||
export type SupportCaseObjectReference = zod.input<typeof SupportCaseObjectReference>;
|
||||
export type SupportCaseObjectReferenceOutput = zod.output<typeof SupportCaseObjectReference>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseObjectType = zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.')
|
||||
|
||||
export type SupportCaseObjectType = zod.input<typeof SupportCaseObjectType>;
|
||||
export type SupportCaseObjectTypeOutput = zod.output<typeof SupportCaseObjectType>;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCasePublicTextMax = 4000;
|
||||
|
||||
|
||||
export const SupportCasePublicText = zod.string().min(1).max(SupportCasePublicTextMax).describe('Text that support or a moderator wrote for the user: a public reply or the public reason of a decision. Plain text; clients show it as text, never as HTML. Internal notes of the staff are never public texts.')
|
||||
|
||||
export type SupportCasePublicText = zod.input<typeof SupportCasePublicText>;
|
||||
export type SupportCasePublicTextOutput = zod.output<typeof SupportCasePublicText>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseStatus = zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.')
|
||||
|
||||
export type SupportCaseStatus = zod.input<typeof SupportCaseStatus>;
|
||||
export type SupportCaseStatusOutput = zod.output<typeof SupportCaseStatus>;
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportCaseSummaryNumberMin = 14;
|
||||
export const supportCaseSummaryNumberMax = 18;
|
||||
|
||||
|
||||
export const supportCaseSummaryNumberRegExp = new RegExp('^SC-[0-9]{4}-[0-9]{6,10}$');
|
||||
export const supportCaseSummaryResponseTargetBusinessDaysMax = 60;
|
||||
|
||||
|
||||
|
||||
export const SupportCaseSummary = zod.object({
|
||||
"id": zod.uuid().describe('Case identifier.'),
|
||||
"number": zod.string().min(supportCaseSummaryNumberMin).max(supportCaseSummaryNumberMax).regex(supportCaseSummaryNumberRegExp).describe('Human-readable case number that the server assigns on creation, for example `SC-2026-000123`: the prefix `SC`, the UTC year of creation, and a sequence number of at least six digits with leading zeros. The sequence is global and never reused, so the number is unique across every case and year and never changes. The user quotes it in letters and calls; the API addresses a case only by its `id`. Clients show the number as text and never parse it.'),
|
||||
"type": zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.'),
|
||||
"status": zod.enum(['submitted', 'in_review', 'waiting_for_user', 'waiting_expert', 'resolved', 'closed']).describe('Processing status of a case. Only the server changes it; no request field sets it. Adding a value is a contract change: generated clients reject an unknown value.\n\n- submitted: the case was accepted and waits in its queue.\n- in_review: support or a moderator works on it.\n- waiting_for_user: support asked the author for more detail. Not set yet: it starts with the planned operation that lets the author reply, and until then no case has this status.\n- waiting_expert: a grade appeal, an anti-cheat appeal, or a manual assessment waits for a subject expert. The server sets it in the same transaction as the creation of such a case. The case stays here until a person decides; it is never resolved by the passing of time.\n- resolved: terminal; a decision was made and `decision` holds its outcome and public reason.\n- closed: terminal; the case ended without a decision on the merits, for example as a duplicate of another case. The last history event says why.'),
|
||||
"object": zod.union([zod.object({
|
||||
"type": zod.enum(['assessment_attempt', 'organization', 'invitation', 'support_case']).describe('Kind of object that a case refers to. Each case type accepts only some of them. Adding a value is a contract change: generated clients reject an unknown value. Planned values: `vacancy` and `application` with the vacancies and protected applications of PRD FR16, and a profile finding with TASK-272.\n\n- assessment_attempt: an assessment attempt of the caller.\n- organization: an organization that the caller can see.\n- invitation: an invitation addressed to the caller. Invitations are not in the contract yet; until they are, every invitation reference answers 404 not_found.\n- support_case: another case of the caller, for example the resolved manual assessment that a grade appeal disputes.'),
|
||||
"id": zod.uuid().describe('Identifier of the object.')
|
||||
}).describe('Typed reference to an object that the case is about. The server checks on creation that the caller may see the object; an unknown object and an object of someone else both answer 404 not_found, so a reference never reveals whether another person\'s object exists. The case keeps only the type and the identifier, never a copy of the object.'),zod.null()]).describe('Object that the case is about, or null.'),
|
||||
"assessment_target": zod.union([zod.object({
|
||||
"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.')
|
||||
}).describe('Category that the case is about: a specialization and a grade of the MVP scale. For a manual assessment it is the category to assess; for a support case it is optional context, for example the category whose test is not available.'),zod.null()]).describe('Category of the case, or null.'),
|
||||
"response_target": zod.object({
|
||||
"kind": zod.enum(['operational_goal']).describe('Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.'),
|
||||
"business_days": zod.int().min(1).max(supportCaseSummaryResponseTargetBusinessDaysMax).describe('Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.'),
|
||||
"due_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"answered_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the target was met, or null while it is not.'),
|
||||
"late": zod.boolean().describe('Whether the target was missed: it was met after `due_at`, or it is not met and `due_at` has passed at the time of the response.'),
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version that fixed the target.')
|
||||
}).describe('Operational target for the answer to the case (PRD FR18: a case gets a number, a status, and a response deadline). The server fixes it on creation from the product policy version and the configured business calendar; it is a goal of the team, not a deadline set by law. The target is met by the first public reply, a decision, or a closure for `support` and `complaint`, and only by a decision or a closure for the appeals and `manual_assessment`. Missing the target never closes the case, never decides it, and never changes a grade.'),
|
||||
"decision_outcome": zod.union([zod.enum(['upheld', 'partially_upheld', 'not_upheld', 'answered', 'assessed']).describe('Outcome of a decision as the user sees it. The allowed outcomes depend on the case type.\n\n- upheld: the appeal or the complaint is upheld in full.\n- partially_upheld: the appeal or the complaint is upheld in part.\n- not_upheld: the appeal or the complaint is not upheld.\n- answered: a support case was answered.\n- assessed: the expert finished a manual assessment. The resulting category is part of the assessment results, not of the case.'),zod.null()]).describe('Outcome of the decision once the case is `resolved`, otherwise null.'),
|
||||
"created_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"updated_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.')
|
||||
}).describe('Case in a list: the fields that a list of cases shows, without the description and the history. GetMySupportCase returns the full case.')
|
||||
|
||||
export type SupportCaseSummary = zod.input<typeof SupportCaseSummary>;
|
||||
export type SupportCaseSummaryOutput = zod.output<typeof SupportCaseSummary>;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const SupportCaseType = zod.enum(['support', 'complaint', 'grade_appeal', 'anticheat_appeal', 'manual_assessment']).describe('Kind of the case. It fixes the allowed object reference, the type-specific fields, the response target, and the queue that handles the case.\n\n- support: a question or a problem, for example an assessment that is not available or a failed sandbox run. Candidate and employer accounts.\n- complaint: a complaint about an organization or an offer, including a breach of the salary terms or a disclosure of personal data (PRD FR18). Candidate accounts.\n- grade_appeal: an appeal of a category the caller received: the result of one own assessment attempt, or the outcome of one own resolved manual assessment case. An expert reviews it, and the original result stays in the history. Candidate accounts.\n- anticheat_appeal: an appeal of an anti-cheat review decision on one own assessment attempt. Candidate accounts.\n- manual_assessment: a request for a manual assessment of a category by a subject expert with the same rubric, the alternative to automated categorization (consent C3). Candidate accounts.')
|
||||
|
||||
export type SupportCaseType = zod.input<typeof SupportCaseType>;
|
||||
export type SupportCaseTypeOutput = zod.output<typeof SupportCaseType>;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import * as zod from 'zod';
|
||||
|
||||
export const supportResponseTargetBusinessDaysMax = 60;
|
||||
|
||||
|
||||
|
||||
export const SupportResponseTarget = zod.object({
|
||||
"kind": zod.enum(['operational_goal']).describe('Nature of the target. `operational_goal` is a goal of the team that clients label as such, never as a legal deadline.'),
|
||||
"business_days": zod.int().min(1).max(supportResponseTargetBusinessDaysMax).describe('Length of the target in business days of the policy version, for example 5 for a manual assessment and 10 for an appeal.'),
|
||||
"due_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"answered_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the target was met, or null while it is not.'),
|
||||
"late": zod.boolean().describe('Whether the target was missed: it was met after `due_at`, or it is not met and `due_at` has passed at the time of the response.'),
|
||||
"policy_version": zod.int().min(1).describe('Number of the `product` policy version that fixed the target.')
|
||||
}).describe('Operational target for the answer to the case (PRD FR18: a case gets a number, a status, and a response deadline). The server fixes it on creation from the product policy version and the configured business calendar; it is a goal of the team, not a deadline set by law. The target is met by the first public reply, a decision, or a closure for `support` and `complaint`, and only by a decision or a closure for the appeals and `manual_assessment`. Missing the target never closes the case, never decides it, and never changes a grade.')
|
||||
|
||||
export type SupportResponseTarget = zod.input<typeof SupportResponseTarget>;
|
||||
export type SupportResponseTargetOutput = zod.output<typeof SupportResponseTarget>;
|
||||
@@ -0,0 +1,311 @@
|
||||
import { describe, expect, expectTypeOf, it } from "vitest";
|
||||
import { createMySupportCase } from "./endpoints/support/support";
|
||||
import {
|
||||
CreateMySupportCaseBody,
|
||||
SupportCase,
|
||||
SupportCaseCreate,
|
||||
SupportCaseDecision,
|
||||
SupportCaseEvent,
|
||||
SupportCaseList,
|
||||
SupportCaseSummary,
|
||||
} from "./schemas";
|
||||
|
||||
// These tests pin the generated support case contract that the FSD adapters
|
||||
// consume. They fail when regeneration drops a case type, accepts a blank
|
||||
// description or an object type that the case type does not allow, or adds a
|
||||
// request field that would let the client set the status, the decision, the
|
||||
// moderator, the response target, or a reply address.
|
||||
|
||||
const attempt = { type: "assessment_attempt", id: "01928f7a-3c4d-7e5f-8a9b-0c1d2e3f4a5b" } as const;
|
||||
const organization = { type: "organization", id: "01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01" } as const;
|
||||
const invitation = { type: "invitation", id: "01928f7a-7f8a-7b9c-8d0e-1f2a3b4c5d6e" } as const;
|
||||
const manualCase = { type: "support_case", id: "01928f7a-6e7f-7a8b-9c0d-1e2f3a4b5c6d" } as const;
|
||||
const description = "Практика не засчитана, хотя решение проходит публичные примеры.";
|
||||
|
||||
const validCases = {
|
||||
support: { type: "support", description },
|
||||
test_unavailable: {
|
||||
type: "support",
|
||||
description,
|
||||
assessment_target: { specialization: "backend", grade: "senior" },
|
||||
},
|
||||
complaint: {
|
||||
type: "complaint",
|
||||
description,
|
||||
complaint_reason: "salary_terms_violation",
|
||||
object: invitation,
|
||||
},
|
||||
grade_appeal: { type: "grade_appeal", description, object: attempt },
|
||||
category_appeal: { type: "grade_appeal", description, object: manualCase },
|
||||
follow_up: { type: "support", description, object: manualCase },
|
||||
anticheat_appeal: { type: "anticheat_appeal", description, object: attempt },
|
||||
manual_assessment: {
|
||||
type: "manual_assessment",
|
||||
description,
|
||||
assessment_target: { specialization: "backend", grade: "middle" },
|
||||
},
|
||||
} as const;
|
||||
|
||||
const bodySchemas = [
|
||||
["SupportCaseCreate", SupportCaseCreate],
|
||||
["CreateMySupportCaseBody", CreateMySupportCaseBody],
|
||||
] as const;
|
||||
|
||||
describe.each(bodySchemas)("generated %s", (_name, schema) => {
|
||||
it.each(Object.entries(validCases))("accepts a %s case", (_case, body) => {
|
||||
expect(schema.parse(body)).toEqual(body);
|
||||
});
|
||||
|
||||
it("accepts a manual assessment with a prior attempt and a multi-line text", () => {
|
||||
const body = {
|
||||
...validCases.manual_assessment,
|
||||
description: "Строка 1\nСтрока 2",
|
||||
object: attempt,
|
||||
};
|
||||
|
||||
expect(schema.parse(body)).toEqual(body);
|
||||
});
|
||||
|
||||
it.each([["feedback"], ["SUPPORT"], [""], [null]])("rejects the case type %j", (type) => {
|
||||
expect(schema.safeParse({ ...validCases.support, type }).success).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["an empty", ""],
|
||||
["a blank", " \n\t "],
|
||||
["a too long", "a".repeat(4001)],
|
||||
["a Unicode-space", "\u00a0\u3000\u2003"],
|
||||
])("rejects %s description", (_case, text) => {
|
||||
for (const body of Object.values(validCases)) {
|
||||
expect(schema.safeParse({ ...body, description: text }).success).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it("leaves a description of NEL to the server", () => {
|
||||
// U+0085 is not ECMAScript white space; the server rejects it with a
|
||||
// unicode.IsSpace domain check and the pointer /description.
|
||||
expect(schema.safeParse({ ...validCases.support, description: "\u0085" }).success).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a missing description", () => {
|
||||
expect(schema.safeParse({ type: "support" }).success).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a grade appeal of an organization", { ...validCases.grade_appeal, object: organization }],
|
||||
[
|
||||
"an anti-cheat appeal of an invitation",
|
||||
{ ...validCases.anticheat_appeal, object: invitation },
|
||||
],
|
||||
["a complaint about an attempt", { ...validCases.complaint, object: attempt }],
|
||||
["a complaint about a case", { ...validCases.complaint, object: manualCase }],
|
||||
["an anti-cheat appeal of a case", { ...validCases.anticheat_appeal, object: manualCase }],
|
||||
[
|
||||
"a manual assessment based on a case",
|
||||
{ ...validCases.manual_assessment, object: manualCase },
|
||||
],
|
||||
[
|
||||
"a manual assessment of an organization",
|
||||
{ ...validCases.manual_assessment, object: organization },
|
||||
],
|
||||
[
|
||||
"a support case about an unknown object",
|
||||
{ ...validCases.support, object: { type: "user", id: attempt.id } },
|
||||
],
|
||||
[
|
||||
"a reference that is not a UUID",
|
||||
{ ...validCases.grade_appeal, object: { ...attempt, id: "42" } },
|
||||
],
|
||||
])("rejects %s", (_case, body) => {
|
||||
expect(schema.safeParse(body).success).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["a grade appeal without an attempt", { type: "grade_appeal", description }],
|
||||
["a complaint without a reason", { type: "complaint", description, object: invitation }],
|
||||
[
|
||||
"a complaint without an object",
|
||||
{ type: "complaint", description, complaint_reason: "other" },
|
||||
],
|
||||
["a manual assessment without a category", { type: "manual_assessment", description }],
|
||||
[
|
||||
"a manual assessment for a grade outside the MVP scale",
|
||||
{
|
||||
...validCases.manual_assessment,
|
||||
assessment_target: { specialization: "backend", grade: "lead" },
|
||||
},
|
||||
],
|
||||
])("rejects %s", (_case, body) => {
|
||||
expect(schema.safeParse(body).success).toBe(false);
|
||||
});
|
||||
|
||||
it("never carries a status, a decision, a moderator, or a reply address in the parsed body", () => {
|
||||
const parsed = schema.parse({
|
||||
...validCases.grade_appeal,
|
||||
status: "resolved",
|
||||
decision: { outcome: "upheld", reason: "ok" },
|
||||
moderator_id: organization.id,
|
||||
priority: "high",
|
||||
response_target: { due_at: "2026-10-07T09:00:00Z" },
|
||||
reply_to: "other@example.com",
|
||||
});
|
||||
|
||||
// Generated Zod strips unknown keys; the server rejects them with 400.
|
||||
expect(parsed).toEqual(validCases.grade_appeal);
|
||||
});
|
||||
});
|
||||
|
||||
const created = {
|
||||
id: "01928f7a-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
|
||||
number: "SC-2026-000123",
|
||||
type: "manual_assessment",
|
||||
status: "waiting_expert",
|
||||
description: validCases.manual_assessment.description,
|
||||
object: null,
|
||||
assessment_target: { specialization: "backend", grade: "middle" },
|
||||
complaint_reason: null,
|
||||
rubric_version: 3,
|
||||
response_target: {
|
||||
kind: "operational_goal",
|
||||
business_days: 5,
|
||||
due_at: "2026-10-13T09:00:00Z",
|
||||
answered_at: null,
|
||||
late: false,
|
||||
policy_version: 1,
|
||||
},
|
||||
decision: null,
|
||||
history: [
|
||||
{
|
||||
sequence: 1,
|
||||
kind: "created",
|
||||
actor: "user",
|
||||
occurred_at: "2026-10-06T09:00:00Z",
|
||||
status: "submitted",
|
||||
message: null,
|
||||
},
|
||||
{
|
||||
sequence: 2,
|
||||
kind: "status_changed",
|
||||
actor: "system",
|
||||
occurred_at: "2026-10-06T09:00:00Z",
|
||||
status: "waiting_expert",
|
||||
message: null,
|
||||
},
|
||||
],
|
||||
created_at: "2026-10-06T09:00:00Z",
|
||||
updated_at: "2026-10-06T09:00:00Z",
|
||||
} as const;
|
||||
|
||||
it("parses an own case with its number, status, target, and history", () => {
|
||||
const parsed = SupportCase.parse(created);
|
||||
|
||||
expect(parsed.number).toBe("SC-2026-000123");
|
||||
expect(parsed.response_target.due_at).toBe("2026-10-13T09:00:00Z");
|
||||
expect(parsed.decision).toBeNull();
|
||||
expect(parsed.history).toHaveLength(2);
|
||||
});
|
||||
|
||||
const summary = {
|
||||
id: created.id,
|
||||
number: created.number,
|
||||
type: created.type,
|
||||
status: "waiting_expert",
|
||||
object: null,
|
||||
assessment_target: created.assessment_target,
|
||||
response_target: created.response_target,
|
||||
decision_outcome: null,
|
||||
created_at: created.created_at,
|
||||
updated_at: created.updated_at,
|
||||
} as const;
|
||||
|
||||
it("parses a list of summaries without descriptions or histories", () => {
|
||||
const parsed = SupportCaseList.parse({
|
||||
items: [summary, { ...summary, status: "resolved", decision_outcome: "assessed" }],
|
||||
page: { has_more: false, next_cursor: null },
|
||||
});
|
||||
|
||||
expect(parsed.items[1]?.decision_outcome).toBe("assessed");
|
||||
expect(parsed.items[0]).not.toHaveProperty("history");
|
||||
expect(SupportCaseSummary.parse({ ...summary, history: [], description })).toEqual(summary);
|
||||
expect(SupportCaseSummary.safeParse({ ...summary, status: "waiting_for_user" }).success).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects a case without a history, with a malformed number, or with an unknown actor", () => {
|
||||
expect(SupportCase.safeParse({ ...created, history: [] }).success).toBe(false);
|
||||
expect(SupportCase.safeParse({ ...created, number: "123" }).success).toBe(false);
|
||||
expect(
|
||||
SupportCase.safeParse({
|
||||
...created,
|
||||
history: [{ ...created.history[0], actor: "moderator:alice" }],
|
||||
}).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
// Every key of every variant of a union.
|
||||
type KeysOf<T> = T extends unknown ? keyof T : never;
|
||||
|
||||
type ForbiddenRequestKey =
|
||||
| "status"
|
||||
| "decision"
|
||||
| "outcome"
|
||||
| "moderator"
|
||||
| "moderator_id"
|
||||
| "assignee"
|
||||
| "assignee_id"
|
||||
| "priority"
|
||||
| "response_target"
|
||||
| "due_at"
|
||||
| "rubric_version"
|
||||
| "number"
|
||||
| "history"
|
||||
| "user_id"
|
||||
| "account_id"
|
||||
| "organization_id"
|
||||
| "email"
|
||||
| "reply_to"
|
||||
| "contact";
|
||||
|
||||
type ForbiddenResponseKey =
|
||||
| "moderator"
|
||||
| "moderator_id"
|
||||
| "moderator_name"
|
||||
| "assignee"
|
||||
| "assignee_id"
|
||||
| "actor_id"
|
||||
| "actor_name"
|
||||
| "internal_note"
|
||||
| "internal_notes"
|
||||
| "internal_comment"
|
||||
| "evidence"
|
||||
| "risk_signals"
|
||||
| "answers"
|
||||
| "raw_answers"
|
||||
| "contacts"
|
||||
| "email"
|
||||
| "phone";
|
||||
|
||||
it("exposes a request DTO without decision, status, moderator, or contact fields", () => {
|
||||
expectTypeOf<Extract<KeysOf<SupportCaseCreate>, ForbiddenRequestKey>>().toEqualTypeOf<never>();
|
||||
// A reference carries only its type and identifier, never a copy of the
|
||||
// object or an owner chosen by the client.
|
||||
expectTypeOf<
|
||||
KeysOf<NonNullable<Extract<SupportCaseCreate, { object?: unknown }>["object"]>>
|
||||
>().toEqualTypeOf<"type" | "id">();
|
||||
expectTypeOf<SupportCaseCreate["type"]>().toEqualTypeOf<
|
||||
"support" | "complaint" | "grade_appeal" | "anticheat_appeal" | "manual_assessment"
|
||||
>();
|
||||
expectTypeOf(createMySupportCase).parameter(0).toEqualTypeOf<SupportCaseCreate>();
|
||||
});
|
||||
|
||||
it("exposes a case without moderator identity, internal notes, answers, or contacts", () => {
|
||||
expectTypeOf<Extract<keyof SupportCase, ForbiddenResponseKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<Extract<keyof SupportCaseEvent, ForbiddenResponseKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<Extract<keyof SupportCaseDecision, ForbiddenResponseKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<Extract<keyof SupportCaseSummary, ForbiddenResponseKey>>().toEqualTypeOf<never>();
|
||||
expectTypeOf<
|
||||
Extract<keyof SupportCaseSummary, "description" | "history" | "decision">
|
||||
>().toEqualTypeOf<never>();
|
||||
expectTypeOf<SupportCaseEvent["actor"]>().toEqualTypeOf<"user" | "support" | "system">();
|
||||
});
|
||||
Reference in new issue
Block a user