fix(assessment): return confirmed categories with their basis and label demonstration categories
This commit is contained in:
1 parent
623d41b969
commit
d4903a3796
77 files changed
+1441
-288
No files matched your search
@@ -24,7 +24,14 @@ describe("candidate card presentation", () => {
|
||||
const result = presentCandidatePreview(
|
||||
preview({
|
||||
pseudonym: `cv1_${"a".repeat(43)}`,
|
||||
categories: [{ specialization: "backend", grade: "junior", strength: "standard" }],
|
||||
categories: [
|
||||
{
|
||||
specialization: "backend",
|
||||
grade: "junior",
|
||||
strength: "standard",
|
||||
basis: "synthetic_demo",
|
||||
},
|
||||
],
|
||||
stack: ["go"],
|
||||
self_assessment: [
|
||||
{
|
||||
@@ -43,7 +50,7 @@ describe("candidate card presentation", () => {
|
||||
{
|
||||
specialization: "Backend",
|
||||
grade: "Junior",
|
||||
strength: "Стандартное подтверждение",
|
||||
strength: "Демонстрационное подтверждение",
|
||||
},
|
||||
]);
|
||||
expect(result?.selfAssessments).toEqual([
|
||||
@@ -60,7 +67,14 @@ describe("candidate card presentation", () => {
|
||||
const result = presentCandidatePreview(
|
||||
preview({
|
||||
pseudonym: `cv1_${"b".repeat(43)}`,
|
||||
categories: [{ specialization: "backend", grade: "middle", strength: "strong" }],
|
||||
categories: [
|
||||
{
|
||||
specialization: "backend",
|
||||
grade: "middle",
|
||||
strength: "strong",
|
||||
basis: "synthetic_demo",
|
||||
},
|
||||
],
|
||||
stack: null,
|
||||
self_assessment: [
|
||||
{ specialization: "backend", confirmation_status: "confirmed", declared_grade: "middle" },
|
||||
@@ -95,7 +109,14 @@ describe("candidate card presentation", () => {
|
||||
const result = presentCandidatePreview({
|
||||
...preview({
|
||||
pseudonym: `cv1_${"c".repeat(43)}`,
|
||||
categories: [{ specialization: "backend", grade: "middle", strength: "standard" }],
|
||||
categories: [
|
||||
{
|
||||
specialization: "backend",
|
||||
grade: "middle",
|
||||
strength: "standard",
|
||||
basis: "synthetic_demo",
|
||||
},
|
||||
],
|
||||
stack: null,
|
||||
self_assessment: null,
|
||||
experience_band: null,
|
||||
|
||||
@@ -232,12 +232,17 @@ export type CandidateViewPresentation = {
|
||||
evidence: readonly EvidencePresentation[] | null;
|
||||
};
|
||||
|
||||
// A demonstration basis is named as one, never as a standard confirmation.
|
||||
function confirmationLabelOf(category: CardCategory): string {
|
||||
if (category.basis === "synthetic_demo") return "Демонстрационное подтверждение";
|
||||
return category.strength === "strong" ? "Сильное подтверждение" : "Стандартное подтверждение";
|
||||
}
|
||||
|
||||
function categoryPresentation(category: CardCategory): CategoryPresentation {
|
||||
return {
|
||||
specialization: specializationLabels[category.specialization],
|
||||
grade: gradeLabels[category.grade],
|
||||
strength:
|
||||
category.strength === "strong" ? "Сильное подтверждение" : "Стандартное подтверждение",
|
||||
strength: confirmationLabelOf(category),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,14 @@ function published(overrides: Partial<CardPreview> = {}): CardPreview {
|
||||
fields: ["categories", "self_assessment"],
|
||||
card: {
|
||||
pseudonym,
|
||||
categories: [{ specialization: "backend", grade: "middle", strength: "standard" }],
|
||||
categories: [
|
||||
{
|
||||
specialization: "backend",
|
||||
grade: "middle",
|
||||
strength: "standard",
|
||||
basis: "synthetic_demo",
|
||||
},
|
||||
],
|
||||
stack: null,
|
||||
self_assessment: [
|
||||
{ specialization: "backend", confirmation_status: "confirmed", declared_grade: "middle" },
|
||||
@@ -69,7 +76,7 @@ describe("employer card preview", () => {
|
||||
it("states the confirmation of each specialization separately", () => {
|
||||
const markup = render(published());
|
||||
|
||||
expect(markup).toContain("Backend: Middle, стандартное подтверждение");
|
||||
expect(markup).toContain("Backend: Middle, демонстрационное подтверждение");
|
||||
expect(markup.match(/Грейд подтвержден/g)).toHaveLength(1);
|
||||
expect(markup.match(/Грейд не подтвержден/g)).toHaveLength(2);
|
||||
expect(markup).toContain("Заявлено: Junior");
|
||||
|
||||
@@ -17,7 +17,9 @@ function read<T>(
|
||||
return { status, data, error, isRefetching: false, refetch };
|
||||
}
|
||||
|
||||
const profile = { version: 1 } as CandidateProfile;
|
||||
// The home reads only the version and the confirmed categories of the profile.
|
||||
type ProfileHome = Pick<CandidateProfile, "version" | "confirmed_categories">;
|
||||
const profile: ProfileHome = { version: 1, confirmed_categories: [] };
|
||||
const questionnaire = {
|
||||
version: 1,
|
||||
specializations: [
|
||||
@@ -34,7 +36,13 @@ const questionnaire = {
|
||||
} as CandidateQuestionnaire;
|
||||
const availability = {
|
||||
specializations: [
|
||||
{ specialization: "backend", confirmed_grade: null, active_attempt_id: null, grades: [] },
|
||||
{
|
||||
specialization: "backend",
|
||||
confirmed_grade: null,
|
||||
confirmed_basis: null,
|
||||
active_attempt_id: null,
|
||||
grades: [],
|
||||
},
|
||||
],
|
||||
} as AssessmentAvailability;
|
||||
const results = {
|
||||
@@ -75,6 +83,33 @@ describe("combineJourneyReads", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("passes the profile categories into the journey", () => {
|
||||
const state = combineJourneyReads(
|
||||
"candidate_assessment",
|
||||
read("success", {
|
||||
version: 1,
|
||||
confirmed_categories: [
|
||||
{
|
||||
specialization: "qa",
|
||||
grade: "junior",
|
||||
basis: "synthetic_demo",
|
||||
confirmed_at: "2026-10-08T10:00:00Z",
|
||||
attempt_id: "0199b4f2-7c1e-7d3a-9f00-aabbccddee10",
|
||||
},
|
||||
],
|
||||
}),
|
||||
read("success", questionnaire),
|
||||
read("success", availability),
|
||||
read("success", results),
|
||||
);
|
||||
|
||||
expect(state.status).toBe("success");
|
||||
if (state.status === "success") {
|
||||
expect(state.journey.confirmed.map((standing) => standing.specialization)).toEqual(["qa"]);
|
||||
expect(state.journey.nextStep).toEqual({ kind: "result" });
|
||||
}
|
||||
});
|
||||
|
||||
it("fails as a whole instead of guessing a step from partial data", () => {
|
||||
const failure = apiError(500);
|
||||
const state = combineJourneyReads(
|
||||
|
||||
@@ -21,10 +21,10 @@ import {
|
||||
} from "../../../shared/api/schemas";
|
||||
import { buildCandidateJourney, type CandidateJourney } from "../model/home";
|
||||
|
||||
// The home needs only the version of the profile: 0 means it was never saved.
|
||||
// The profile form validates the rest of the document itself.
|
||||
const profileVersionSchema = CandidateProfile.pick({ version: true });
|
||||
type CandidateProfileVersion = Pick<CandidateProfile, "version">;
|
||||
// The home reads the version of the profile (0 means it was never saved) and
|
||||
// its confirmed categories. The profile form validates the rest of the document.
|
||||
const profileHomeSchema = CandidateProfile.pick({ version: true, confirmed_categories: true });
|
||||
type CandidateProfileHome = Pick<CandidateProfile, "version" | "confirmed_categories">;
|
||||
|
||||
const homeQueryPrefix = ["candidate-home"] as const;
|
||||
|
||||
@@ -94,11 +94,11 @@ function useHomeQuery<T>(
|
||||
}
|
||||
|
||||
export function useCandidateProfileRead(session: Session | undefined) {
|
||||
return useHomeQuery<CandidateProfileVersion>(
|
||||
return useHomeQuery<CandidateProfileHome>(
|
||||
session,
|
||||
candidateHomeQueryKeys.profile,
|
||||
(signal) => getMyProfile({ signal }),
|
||||
profileVersionSchema,
|
||||
profileHomeSchema,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -122,9 +122,10 @@ export function useCandidateAvailabilityRead(session: Session | undefined) {
|
||||
|
||||
/**
|
||||
* The first page of real results, newest first. The home screen shows its
|
||||
* first item as the last result and reads the current category of each
|
||||
* specialization from the newest decision in the same page. The page size is
|
||||
* the maximum of the list endpoint; the full history stays on the results page.
|
||||
* first item as the last result and uses the page only to tell whether the
|
||||
* candidate has a result; the confirmed categories come from the availability
|
||||
* and profile reads. The page size is the maximum of the list endpoint; the
|
||||
* full history stays on the results page.
|
||||
*/
|
||||
export function useCandidateLatestResultRead(session: Session | undefined) {
|
||||
return useHomeQuery<AssessmentResultHistoryPage>(
|
||||
@@ -162,16 +163,16 @@ function isAccessError(error: unknown): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins the four reads that the next step depends on: the profile version,
|
||||
* the questionnaire, the assessment availability, and the first page of
|
||||
* results. One failed read fails the whole state, because a step chosen from
|
||||
* partial data could send the candidate to a form they already completed, or
|
||||
* hide a confirmed category. A denied read wins over other failures so that
|
||||
* the forbidden state is shown instead of a retry.
|
||||
* Joins the four reads that the next step depends on: the profile (its version
|
||||
* and confirmed categories), the questionnaire, the assessment availability,
|
||||
* and the first page of results. One failed read fails the whole state, because
|
||||
* a step chosen from partial data could send the candidate to a form they
|
||||
* already completed, or hide a confirmed category. A denied read wins over
|
||||
* other failures so that the forbidden state is shown instead of a retry.
|
||||
*/
|
||||
export function combineJourneyReads(
|
||||
savedStep: CandidateJourney["savedStep"],
|
||||
profile: ReadResult<CandidateProfileVersion>,
|
||||
profile: ReadResult<CandidateProfileHome>,
|
||||
questionnaire: ReadResult<CandidateQuestionnaire>,
|
||||
availability: ReadResult<AssessmentAvailability>,
|
||||
results: ReadResult<AssessmentResultHistoryPage>,
|
||||
@@ -202,6 +203,7 @@ export function combineJourneyReads(
|
||||
journey: buildCandidateJourney({
|
||||
savedStep,
|
||||
profileVersion: profile.data.version,
|
||||
profileCategories: profile.data.confirmed_categories,
|
||||
questionnaire: questionnaire.data,
|
||||
availability: availability.data,
|
||||
results: results.data,
|
||||
|
||||
@@ -7,6 +7,8 @@ import type {
|
||||
} from "../../../shared/api/schemas";
|
||||
import { buildCandidateJourney, summarizeVisibility, type CandidateJourneyInput } from "./home";
|
||||
|
||||
type ProfileCategory = CandidateJourneyInput["profileCategories"][number];
|
||||
|
||||
type Availability = AssessmentAvailability["specializations"][number];
|
||||
|
||||
function gradeRows(status: "available" | "cooldown"): Availability["grades"] {
|
||||
@@ -33,6 +35,7 @@ function availabilityRow(
|
||||
return {
|
||||
specialization,
|
||||
confirmed_grade: options.confirmed ?? null,
|
||||
confirmed_basis: options.confirmed ? "synthetic_demo" : null,
|
||||
active_attempt_id: options.attemptId ?? null,
|
||||
grades: gradeRows(options.status ?? "available"),
|
||||
};
|
||||
@@ -57,27 +60,11 @@ function questionnaire(
|
||||
type ResultRow = CandidateJourneyInput["results"]["items"][number];
|
||||
|
||||
/**
|
||||
* One real result as the results list returns it. A v2 result carries the
|
||||
* category decision with the grade in force when the attempt ended; a legacy
|
||||
* result carries none.
|
||||
* One real result as the results list returns it, with the category decision
|
||||
* that was in force when the attempt ended. The home screen reads the result
|
||||
* list only to tell whether a result exists, so this row never sets a grade.
|
||||
*/
|
||||
function resultRow(
|
||||
specialization: SpecializationCode,
|
||||
options: { grade?: GradeCode | null; decidedAt?: string; legacy?: boolean } = {},
|
||||
): ResultRow {
|
||||
const grade = options.grade ?? null;
|
||||
const decision = options.legacy
|
||||
? {}
|
||||
: {
|
||||
category_decision: {
|
||||
status: grade ? "assigned" : "not_eligible",
|
||||
previous_confirmed_grade: null,
|
||||
current_confirmed_grade: grade,
|
||||
method: grade ? "demo_basic_pass_mark" : null,
|
||||
source: grade ? "synthetic_demo" : null,
|
||||
calibration_status: "uncalibrated",
|
||||
},
|
||||
};
|
||||
function resultRow(specialization: SpecializationCode, grade: GradeCode | null = null): ResultRow {
|
||||
return {
|
||||
kind: "root",
|
||||
attempt_id: "0199b4f2-7c1e-7d3a-9f00-aabbccddee10",
|
||||
@@ -85,15 +72,34 @@ function resultRow(
|
||||
outcome: grade ? "confirmed" : "not_confirmed",
|
||||
confirmed_grade: grade,
|
||||
previous_confirmed_grade: null,
|
||||
decided_at: options.decidedAt ?? "2026-10-08T10:00:00Z",
|
||||
...decision,
|
||||
decided_at: "2026-10-08T10:00:00Z",
|
||||
category_decision: {
|
||||
status: grade ? "assigned" : "not_eligible",
|
||||
previous_confirmed_grade: null,
|
||||
current_confirmed_grade: grade,
|
||||
method: grade ? "demo_basic_pass_mark" : null,
|
||||
source: grade ? "synthetic_demo" : null,
|
||||
calibration_status: "uncalibrated",
|
||||
},
|
||||
} as unknown as ResultRow;
|
||||
}
|
||||
|
||||
/** One confirmed category of the profile read, as the server returns it. */
|
||||
function profileCategory(specialization: SpecializationCode, grade: GradeCode): ProfileCategory {
|
||||
return {
|
||||
specialization,
|
||||
grade,
|
||||
basis: "synthetic_demo",
|
||||
confirmed_at: "2026-10-08T10:00:00Z",
|
||||
attempt_id: "0199b4f2-7c1e-7d3a-9f00-aabbccddee10",
|
||||
};
|
||||
}
|
||||
|
||||
function input(overrides: Partial<CandidateJourneyInput> = {}): CandidateJourneyInput {
|
||||
return {
|
||||
savedStep: "candidate_consents",
|
||||
profileVersion: 0,
|
||||
profileCategories: [],
|
||||
questionnaire: questionnaire([]),
|
||||
availability: { specializations: [] },
|
||||
results: { items: [] },
|
||||
@@ -234,18 +240,18 @@ describe("buildCandidateJourney next step", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// Regression: the availability read reported no confirmed grade for a candidate
|
||||
// whose newest result confirmed Junior, so the next step said "take the test"
|
||||
// while the result block said the category was confirmed.
|
||||
// The confirmed category comes from the availability read and, for a
|
||||
// specialization the questionnaire no longer lists, from the profile read.
|
||||
// A result never sets a grade: the results list only tells whether one exists.
|
||||
describe("buildCandidateJourney confirmed category", () => {
|
||||
it("confirms the category from the newest result when the availability read has none", () => {
|
||||
it("confirms the category from the availability read", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
savedStep: "candidate_consents",
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "junior"]]),
|
||||
availability: { specializations: [availabilityRow("backend")] },
|
||||
results: { items: [resultRow("backend", { grade: "junior" })] },
|
||||
availability: { specializations: [availabilityRow("backend", { confirmed: "junior" })] },
|
||||
results: { items: [resultRow("backend", "junior")] },
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -258,61 +264,13 @@ describe("buildCandidateJourney confirmed category", () => {
|
||||
expect(journey.hasResults).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps the grade of the availability read when both sources name one", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "middle"]]),
|
||||
availability: { specializations: [availabilityRow("backend", { confirmed: "middle" })] },
|
||||
results: { items: [resultRow("backend", { grade: "junior" })] },
|
||||
}),
|
||||
);
|
||||
|
||||
expect(journey.standings[0]?.confirmedGrade).toBe("middle");
|
||||
});
|
||||
|
||||
it("takes the grade in force from the newest decision, whatever the order of the page", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "senior"]]),
|
||||
results: {
|
||||
items: [
|
||||
resultRow("backend", { grade: "junior", decidedAt: "2026-10-01T10:00:00Z" }),
|
||||
resultRow("backend", { grade: "senior", decidedAt: "2026-10-08T10:00:00Z" }),
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
expect(journey.standings[0]?.confirmedGrade).toBe("senior");
|
||||
});
|
||||
|
||||
it("does not revive an older grade behind a newer decision that confirms none", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "junior"]]),
|
||||
results: {
|
||||
items: [
|
||||
resultRow("backend", { grade: "junior", decidedAt: "2026-10-01T10:00:00Z" }),
|
||||
resultRow("backend", { grade: null, decidedAt: "2026-10-08T10:00:00Z" }),
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
expect(journey.confirmed).toEqual([]);
|
||||
expect(journey.nextStep).toEqual({ kind: "assessment" });
|
||||
});
|
||||
|
||||
it("ignores legacy results that carry no category decision", () => {
|
||||
it("takes no grade from a result when the availability read confirms none", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "junior"]]),
|
||||
availability: { specializations: [availabilityRow("backend")] },
|
||||
results: { items: [resultRow("backend", { grade: "junior", legacy: true })] },
|
||||
results: { items: [resultRow("backend", "junior")] },
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -321,12 +279,25 @@ describe("buildCandidateJourney confirmed category", () => {
|
||||
expect(journey.nextStep).toEqual({ kind: "assessment" });
|
||||
});
|
||||
|
||||
it("keeps the availability grade when the profile names another one", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([["backend", "middle"]]),
|
||||
availability: { specializations: [availabilityRow("backend", { confirmed: "middle" })] },
|
||||
profileCategories: [profileCategory("backend", "junior")],
|
||||
}),
|
||||
);
|
||||
|
||||
expect(journey.standings[0]?.confirmedGrade).toBe("middle");
|
||||
});
|
||||
|
||||
it("keeps a confirmed category visible when the questionnaire no longer lists it", () => {
|
||||
const journey = buildCandidateJourney(
|
||||
input({
|
||||
profileVersion: 1,
|
||||
questionnaire: questionnaire([]),
|
||||
results: { items: [resultRow("qa", { grade: "junior" })] },
|
||||
profileCategories: [profileCategory("qa", "junior")],
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import type {
|
||||
Account,
|
||||
AssessmentAvailability,
|
||||
AssessmentResultHistoryPage,
|
||||
CandidateProfile,
|
||||
CandidateQuestionnaire,
|
||||
GradeCode,
|
||||
PrivacySettings,
|
||||
@@ -49,6 +50,8 @@ export type CandidateJourneyInput = {
|
||||
savedStep: OnboardingStep;
|
||||
/** `version` of the profile read; 0 means it was never saved. */
|
||||
profileVersion: number;
|
||||
/** `confirmed_categories` of the profile read, in catalog order. */
|
||||
profileCategories: CandidateProfile["confirmed_categories"];
|
||||
questionnaire: Pick<CandidateQuestionnaire, "version" | "specializations">;
|
||||
availability: Pick<AssessmentAvailability, "specializations">;
|
||||
/** The first page of the candidate's real results, newest first. */
|
||||
@@ -67,48 +70,25 @@ export type CandidateJourney = {
|
||||
nextStep: CandidateNextStep;
|
||||
};
|
||||
|
||||
type ResultItem = AssessmentResultHistoryPage["items"][number];
|
||||
|
||||
/**
|
||||
* Grade in force for each specialization, read from the newest result of that
|
||||
* specialization. A v2 result records the grade in force when its attempt
|
||||
* ended, so the newest decision is the current category. A legacy result has
|
||||
* no decision and yields no grade; a result that confirms no grade leaves the
|
||||
* specialization unconfirmed. Older results never override a newer decision.
|
||||
* Standings of the questionnaire specializations and of the confirmed
|
||||
* categories. The confirmed grade comes from the availability read, which
|
||||
* answers for every questionnaire specialization. A category whose
|
||||
* specialization the questionnaire no longer lists comes from the profile read,
|
||||
* so a confirmed grade never disappears from the home screen. Results are not a
|
||||
* source of the grade: the home takes the category from the server's current
|
||||
* state only.
|
||||
*/
|
||||
export function currentGradesFromResults(
|
||||
results: readonly ResultItem[],
|
||||
): Map<SpecializationCode, GradeCode> {
|
||||
// The server lists results newest first; sorting here keeps the rule local.
|
||||
const newestFirst = [...results].sort((left, right) =>
|
||||
right.decided_at.localeCompare(left.decided_at),
|
||||
);
|
||||
const grades = new Map<SpecializationCode, GradeCode>();
|
||||
const decided = new Set<SpecializationCode>();
|
||||
for (const result of newestFirst) {
|
||||
if (decided.has(result.specialization)) continue;
|
||||
decided.add(result.specialization);
|
||||
const grade = result.category_decision?.current_confirmed_grade ?? null;
|
||||
if (grade !== null) grades.set(result.specialization, grade);
|
||||
}
|
||||
return grades;
|
||||
}
|
||||
|
||||
function buildStandings(
|
||||
input: CandidateJourneyInput,
|
||||
resultGrades: ReadonlyMap<SpecializationCode, GradeCode>,
|
||||
): SpecializationStanding[] {
|
||||
function buildStandings(input: CandidateJourneyInput): SpecializationStanding[] {
|
||||
const standings = new Map<SpecializationCode, SpecializationStanding>();
|
||||
const listedByAvailability = new Set<SpecializationCode>();
|
||||
|
||||
// The availability list is the server's view of the questionnaire
|
||||
// specializations; the questionnaire adds the declared grade. The current
|
||||
// confirmed grade comes from the availability read when it has one, and from
|
||||
// the newest result of the specialization otherwise.
|
||||
for (const item of input.availability.specializations) {
|
||||
listedByAvailability.add(item.specialization);
|
||||
standings.set(item.specialization, {
|
||||
specialization: item.specialization,
|
||||
declaredGrade: null,
|
||||
confirmedGrade: item.confirmed_grade ?? resultGrades.get(item.specialization) ?? null,
|
||||
confirmedGrade: item.confirmed_grade ?? null,
|
||||
activeAttemptId: item.active_attempt_id,
|
||||
canStartAttempt: item.grades.some((grade) => grade.status === "available"),
|
||||
});
|
||||
@@ -118,21 +98,20 @@ function buildStandings(
|
||||
standings.set(item.specialization, {
|
||||
specialization: item.specialization,
|
||||
declaredGrade: item.self_assessed_grade,
|
||||
confirmedGrade: existing?.confirmedGrade ?? resultGrades.get(item.specialization) ?? null,
|
||||
confirmedGrade: existing?.confirmedGrade ?? null,
|
||||
activeAttemptId: existing?.activeAttemptId ?? null,
|
||||
canStartAttempt: existing?.canStartAttempt ?? false,
|
||||
});
|
||||
}
|
||||
// A result can name a specialization that the current questionnaire no
|
||||
// longer lists. Its confirmed grade is still a fact, so it stays visible.
|
||||
for (const [specialization, grade] of resultGrades) {
|
||||
if (standings.has(specialization)) continue;
|
||||
standings.set(specialization, {
|
||||
specialization,
|
||||
declaredGrade: null,
|
||||
confirmedGrade: grade,
|
||||
activeAttemptId: null,
|
||||
canStartAttempt: false,
|
||||
for (const category of input.profileCategories) {
|
||||
if (listedByAvailability.has(category.specialization)) continue;
|
||||
const existing = standings.get(category.specialization);
|
||||
standings.set(category.specialization, {
|
||||
specialization: category.specialization,
|
||||
declaredGrade: existing?.declaredGrade ?? null,
|
||||
confirmedGrade: category.grade,
|
||||
activeAttemptId: existing?.activeAttemptId ?? null,
|
||||
canStartAttempt: existing?.canStartAttempt ?? false,
|
||||
});
|
||||
}
|
||||
return [...standings.values()];
|
||||
@@ -145,14 +124,14 @@ function buildStandings(
|
||||
* questionnaire is saved from the matching step, so a saved profile can sit
|
||||
* behind an earlier stored step. Presence of saved data therefore decides
|
||||
* between the profile, the questionnaire, and the test. Facts about the
|
||||
* category and the test come only from the availability and results reads.
|
||||
* category and the test come only from the availability, profile, and results
|
||||
* reads.
|
||||
*
|
||||
* The client invents no category, grade, or threshold: a category exists only
|
||||
* when the availability read or the newest result returns a confirmed grade.
|
||||
* when the availability read or the profile read returns a confirmed grade.
|
||||
*/
|
||||
export function buildCandidateJourney(input: CandidateJourneyInput): CandidateJourney {
|
||||
const resultGrades = currentGradesFromResults(input.results.items);
|
||||
const standings = buildStandings(input, resultGrades);
|
||||
const standings = buildStandings(input);
|
||||
const confirmed = standings.filter((standing) => standing.confirmedGrade !== null);
|
||||
const profileSaved = input.profileVersion > 0;
|
||||
const questionnaireSaved =
|
||||
|
||||
@@ -34,7 +34,7 @@ function matchResponseFixture(): MatchSearchResponseOutput {
|
||||
specialization: "backend",
|
||||
confirmation_status: "confirmed",
|
||||
declared_grade: "middle",
|
||||
category: { specialization: "backend", grade: "middle" },
|
||||
category: { specialization: "backend", grade: "middle", basis: "synthetic_demo" },
|
||||
strength: "strong",
|
||||
public_context: {
|
||||
stack: ["go"],
|
||||
@@ -66,7 +66,7 @@ function matchResponseFixture(): MatchSearchResponseOutput {
|
||||
specialization: "frontend",
|
||||
confirmation_status: "confirmed",
|
||||
declared_grade: "junior",
|
||||
category: { specialization: "frontend", grade: "junior" },
|
||||
category: { specialization: "frontend", grade: "junior", basis: "synthetic_demo" },
|
||||
strength: "standard",
|
||||
public_context: {
|
||||
stack: null,
|
||||
@@ -184,7 +184,11 @@ describe("match response adapter", () => {
|
||||
if (!backend || !near || !network) throw new Error("Fixture match cards are missing.");
|
||||
|
||||
expect(backend.candidateHandle).toBe(network.candidateHandle);
|
||||
expect(backend.category).toEqual({ specialization: "backend", grade: "middle" });
|
||||
expect(backend.category).toEqual({
|
||||
specialization: "backend",
|
||||
grade: "middle",
|
||||
basis: "synthetic_demo",
|
||||
});
|
||||
expect(network.category).toBeNull();
|
||||
expect(network.strength).toBeNull();
|
||||
expect(network.components).toEqual({ fit: 0.51, coverage: 0.38 });
|
||||
|
||||
@@ -5,12 +5,12 @@ import type {
|
||||
} from "../../../shared/api/schemas";
|
||||
import type { TrustLevelValue } from "../../../shared/ui";
|
||||
import {
|
||||
confirmationLabel,
|
||||
experienceBandLabels,
|
||||
gradeLabels,
|
||||
salaryCompatibilityLabels,
|
||||
specializationLabels,
|
||||
stackLabels,
|
||||
strengthLabels,
|
||||
workFormatLabels,
|
||||
} from "./labels";
|
||||
|
||||
@@ -40,7 +40,7 @@ export function presentCard(card: AnonymousCardContent): CardDetails {
|
||||
card.categories?.map((category) => ({
|
||||
specialization: specializationLabels[category.specialization],
|
||||
grade: gradeLabels[category.grade],
|
||||
strength: strengthLabels[category.strength],
|
||||
strength: confirmationLabel(category.basis, category.strength),
|
||||
})) ?? null,
|
||||
selfAssessments:
|
||||
card.self_assessment?.map((item) => ({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type {
|
||||
CandidateExperienceBand,
|
||||
CandidateSalaryCompatibility,
|
||||
EvidenceBasis,
|
||||
GradeCode,
|
||||
MatchEvidenceCode,
|
||||
MatchEvidenceState,
|
||||
@@ -58,6 +59,16 @@ export const strengthLabels: Readonly<Record<MatchStrength, string>> = {
|
||||
strong: "Сильное подтверждение",
|
||||
};
|
||||
|
||||
/**
|
||||
* Words for how a confirmed category was established. A demonstration basis is
|
||||
* named as one, because it is not a measurement and never a standard
|
||||
* confirmation; only a category with another basis gets its strength label.
|
||||
*/
|
||||
export function confirmationLabel(basis: EvidenceBasis, strength: MatchStrength): string {
|
||||
if (basis === "synthetic_demo") return "Демонстрационное подтверждение";
|
||||
return strengthLabels[strength];
|
||||
}
|
||||
|
||||
export const stackLabels: Readonly<Record<MatchSearchStackTag, string>> = {
|
||||
go: "Go",
|
||||
postgresql: "PostgreSQL",
|
||||
|
||||
@@ -37,7 +37,7 @@ export function matchResponseFixture(
|
||||
specialization: "backend",
|
||||
confirmation_status: "confirmed",
|
||||
declared_grade: "senior",
|
||||
category: { specialization: "backend", grade: "middle" },
|
||||
category: { specialization: "backend", grade: "middle", basis: "synthetic_demo" },
|
||||
strength: "strong",
|
||||
public_context: {
|
||||
stack: ["go", "postgresql"],
|
||||
@@ -76,7 +76,7 @@ export function matchResponseFixture(
|
||||
specialization: "backend",
|
||||
confirmation_status: "confirmed",
|
||||
declared_grade: null,
|
||||
category: { specialization: "backend", grade: "junior" },
|
||||
category: { specialization: "backend", grade: "junior", basis: "synthetic_demo" },
|
||||
strength: "standard",
|
||||
public_context: {
|
||||
stack: null,
|
||||
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
experienceBandLabels,
|
||||
gradeLabels,
|
||||
salaryCompatibilityLabels,
|
||||
confirmationLabel,
|
||||
specializationLabels,
|
||||
stackLabels,
|
||||
strengthLabels,
|
||||
workFormatLabels,
|
||||
} from "../model/labels";
|
||||
import { shortHandle } from "../model/views";
|
||||
@@ -72,7 +72,7 @@ export function MatchCardView({ card, headingId, actions, children }: MatchCardV
|
||||
<dt>Подтвержденная категория</dt>
|
||||
<dd>
|
||||
{card.category && card.strength
|
||||
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${strengthLabels[card.strength]}`
|
||||
? `${specializationLabels[card.category.specialization]}, ${gradeLabels[card.category.grade]}. ${confirmationLabel(card.category.basis, card.strength)}`
|
||||
: "Нет"}
|
||||
</dd>
|
||||
<dt>Заявленный кандидатом грейд</dt>
|
||||
|
||||
@@ -59,6 +59,7 @@ function render(seed: Seed = {}): string {
|
||||
});
|
||||
queryClient.setQueryData(candidateHomeQueryKeys.profile(accountId), {
|
||||
version: seed.profileVersion ?? 0,
|
||||
confirmed_categories: [],
|
||||
});
|
||||
queryClient.setQueryData(candidateHomeQueryKeys.questionnaire(accountId), {
|
||||
version: seed.declared ? 1 : 0,
|
||||
@@ -82,6 +83,7 @@ function render(seed: Seed = {}): string {
|
||||
{
|
||||
specialization: seed.declared.specialization,
|
||||
confirmed_grade: seed.confirmed ?? null,
|
||||
confirmed_basis: seed.confirmed ? "synthetic_demo" : null,
|
||||
active_attempt_id: seed.activeAttempt ?? null,
|
||||
grades: [
|
||||
{
|
||||
@@ -254,13 +256,14 @@ describe("candidate home", () => {
|
||||
expect(html).toContain("Пока не подтверждена");
|
||||
});
|
||||
|
||||
// Regression: the availability read had no confirmed grade while the newest
|
||||
// result confirmed Junior. Every block must then state the same category.
|
||||
it("states one confirmed category in every block when the availability read has none", () => {
|
||||
// The availability read confirms the grade that the newest result also
|
||||
// records. Every block must then state the same category.
|
||||
it("states one confirmed category in every block from the availability read", () => {
|
||||
const html = render({
|
||||
step: "candidate_consents",
|
||||
profileVersion: 1,
|
||||
declared: { specialization: "backend", grade: "junior" },
|
||||
confirmed: "junior",
|
||||
results: [
|
||||
{
|
||||
attempt_id: attemptId,
|
||||
|
||||
@@ -48,7 +48,7 @@ import type {
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getGetMyAssessmentAvailabilityResponseMock = (overrideResponse: Partial<Extract<AssessmentAvailability, object>> = {}): AssessmentAvailability => ({specializations: Array.from({ length: faker.number.int({min: 1, max: 2}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), active_attempt_id: faker.helpers.arrayElement([faker.string.uuid(), null]), grades: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), status: faker.helpers.arrayElement(['available','active_attempt','cooldown','insufficient_bank'] as const), mode: faker.helpers.arrayElement([faker.helpers.arrayElement(['demo_basic','adaptive'] as const),null,]), available_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), time_limit_seconds: faker.helpers.arrayElement([faker.number.int({min: 1}), null]), max_sessions: faker.helpers.arrayElement([faker.number.int({min: 1, max: 10}), null]), max_items: faker.helpers.arrayElement([faker.number.int({min: 1, max: 100}), null]), practice_required: faker.helpers.arrayElement([faker.datatype.boolean(), null])}))})), ...overrideResponse})
|
||||
export const getGetMyAssessmentAvailabilityResponseMock = (overrideResponse: Partial<Extract<AssessmentAvailability, object>> = {}): AssessmentAvailability => ({specializations: Array.from({ length: faker.number.int({min: 1, max: 2}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), confirmed_basis: faker.helpers.arrayElement([faker.helpers.arrayElement(['synthetic_demo'] as const),null,]), active_attempt_id: faker.helpers.arrayElement([faker.string.uuid(), null]), grades: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), status: faker.helpers.arrayElement(['available','active_attempt','cooldown','insufficient_bank'] as const), mode: faker.helpers.arrayElement([faker.helpers.arrayElement(['demo_basic','adaptive'] as const),null,]), available_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), time_limit_seconds: faker.helpers.arrayElement([faker.number.int({min: 1}), null]), max_sessions: faker.helpers.arrayElement([faker.number.int({min: 1, max: 10}), null]), max_items: faker.helpers.arrayElement([faker.number.int({min: 1, max: 100}), null]), practice_required: faker.helpers.arrayElement([faker.datatype.boolean(), null])}))})), ...overrideResponse})
|
||||
|
||||
export const getListMyAssessmentResultsResponseAssessmentUncertaintyMock = (overrideResponse: Partial<AssessmentUncertainty> = {}): AssessmentUncertainty => ({...{theta: faker.number.float({fractionDigits: 2}), standard_error: faker.number.float({min: 0, fractionDigits: 2}), interval_95: {low: faker.number.float({fractionDigits: 2}), high: faker.number.float({fractionDigits: 2})}, p_grade: faker.number.float({min: 0, max: 1, fractionDigits: 2})}, ...overrideResponse});
|
||||
|
||||
|
||||
@@ -46,13 +46,13 @@ export const getGetMyProfileResponseProfileClaimSourceMock = (overrideResponse:
|
||||
|
||||
export const getGetMyProfileResponseProfileSalaryMinimumMock = (overrideResponse: Partial<ProfileSalaryMinimum> = {}): ProfileSalaryMinimum => ({...{amount: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getGetMyProfileResponseMock = (overrideResponse: Partial<Extract<CandidateProfile, object>> = {}): CandidateProfile => ({version: faker.number.int({min: 0}), full_name: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, contacts: {email: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([faker.internet.email(),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, phone: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, telegram: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}}, stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => ({tag: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), roles: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), self_assessed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => ({employer_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), started_on: fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}), ended_on: faker.helpers.arrayElement([fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}),null,]), summary: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 1000}}),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience_overlaps: Array.from({ length: faker.number.int({min: 1, max: 190}) }, (_, i) => i + 1).map(() => ({first_index: faker.number.int({min: 0, max: 19}), second_index: faker.number.int({min: 1, max: 19}), status: faker.helpers.arrayElement(['needs_confirmation','confirmed'] as const)})), soft_skills: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({skill: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.aLine truncated
|
||||
export const getGetMyProfileResponseMock = (overrideResponse: Partial<Extract<CandidateProfile, object>> = {}): CandidateProfile => ({version: faker.number.int({min: 0}), full_name: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, contacts: {email: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([faker.internet.email(),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, phone: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}, telegram: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), source: faker.helpers.arrayElement([{...getGetMyProfileResponseProfileClaimSourceMock()},null,])}}, stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => ({tag: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), roles: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), self_assessed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => ({employer_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), started_on: fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}), ended_on: faker.helpers.arrayElement([fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}),null,]), summary: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 1000}}),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience_overlaps: Array.from({ length: faker.number.int({min: 1, max: 190}) }, (_, i) => i + 1).map(() => ({first_index: faker.number.int({min: 0, max: 19}), second_index: faker.number.int({min: 1, max: 19}), status: faker.helpers.arrayElement(['needs_confirmation','confirmed'] as const)})), soft_skills: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({skill: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.aLine truncated
|
||||
|
||||
export const getSaveMyProfileResponseProfileClaimSourceMock = (overrideResponse: Partial<ProfileClaimSource> = {}): ProfileClaimSource => ({...{origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}, ...overrideResponse});
|
||||
|
||||
export const getSaveMyProfileResponseProfileSalaryMinimumMock = (overrideResponse: Partial<ProfileSalaryMinimum> = {}): ProfileSalaryMinimum => ({...{amount: faker.number.int({min: 1000, max: 100000000, multipleOf: 1000}), currency: faker.helpers.arrayElement(['RUB'] as const), period: faker.helpers.arrayElement(['month'] as const), tax_basis: faker.helpers.arrayElement(['net','gross'] as const)}, ...overrideResponse});
|
||||
|
||||
export const getSaveMyProfileResponseMock = (overrideResponse: Partial<Extract<CandidateProfile, object>> = {}): CandidateProfile => ({version: faker.number.int({min: 0}), full_name: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, contacts: {email: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([faker.internet.email(),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, phone: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, telegram: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}}, stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => ({tag: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), roles: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), self_assessed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => ({employer_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), started_on: fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}), ended_on: faker.helpers.arrayElement([fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}),null,]), summary: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 1000}}),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience_overlaps: Array.from({ length: faker.number.int({min: 1, max: 190}) }, (_, i) => i + 1).map(() => ({first_index: faker.number.int({min: 0, max: 19}), second_index: faker.number.int({min: 1, max: 19}), status: faker.helpers.arrayElement(['needs_confirmation','confirmed'] as const)})), soft_skills: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({skill: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.strLine truncated
|
||||
export const getSaveMyProfileResponseMock = (overrideResponse: Partial<Extract<CandidateProfile, object>> = {}): CandidateProfile => ({version: faker.number.int({min: 0}), full_name: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, contacts: {email: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([faker.internet.email(),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, phone: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}, telegram: {status: faker.helpers.arrayElement(['confirmed','extracted','unknown'] as const), value: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,]), source: faker.helpers.arrayElement([{...getSaveMyProfileResponseProfileClaimSourceMock()},null,])}}, stack: Array.from({ length: faker.number.int({min: 1, max: 30}) }, (_, i) => i + 1).map(() => ({tag: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), roles: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), self_assessed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience: Array.from({ length: faker.number.int({min: 1, max: 20}) }, (_, i) => i + 1).map(() => ({employer_name: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 200}),null,]), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), started_on: fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}), ended_on: faker.helpers.arrayElement([fakeFromPattern("^[0-9]{4}-(0[1-9]|1[0-2])$", {minLength: 7, maxLength: 7}),null,]), summary: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 1000}}),null,]), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 300}}),null,]), extraction_version: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9._-]+$", {minLength: 1, maxLength: 64}),null,]), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,])}})), experience_overlaps: Array.from({ length: faker.number.int({min: 1, max: 190}) }, (_, i) => i + 1).map(() => ({first_index: faker.number.int({min: 0, max: 19}), second_index: faker.number.int({min: 1, max: 19}), status: faker.helpers.arrayElement(['needs_confirmation','confirmed'] as const)})), soft_skills: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({skill: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 50}), status: faker.helpers.arrayElement(['confirmed','extracted'] as const), source: {origin: faker.helpers.arrayElement(['manual','extracted_from_resume','imported'] as const), trust_level: faker.number.int({min: 0, max: 0}), quote: faker.helpers.arrayElement([faker.strLine truncated
|
||||
|
||||
|
||||
export const getGetMyQuestionnaireMockHandler = (overrideResponse?: CandidateQuestionnaire | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<CandidateQuestionnaire> | CandidateQuestionnaire), options?: RequestHandlerOptions) => {
|
||||
|
||||
@@ -47,7 +47,7 @@ export const getSearchOrganizationMatchesResponseMatchAppliedConditionsMock = (o
|
||||
|
||||
export const getSearchOrganizationMatchesResponseMatchSearchBankSourceMock = (overrideResponse: Partial<MatchSearchBankSource> = {}): MatchSearchBankSource => ({...{kind: faker.helpers.arrayElement(['bank'] as const), filters: {specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), confirmed_category: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchGradeFilterMock()},null,]), confirmation_status: faker.helpers.arrayElement([faker.helpers.arrayElement(['confirmed','unconfirmed'] as const),null,]), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), conditions: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchAppliedConditionsMock()},null,])}}, ...overrideResponse});
|
||||
|
||||
export const getSearchOrganizationMatchesResponseMock = (overrideResponse: Partial<Extract<MatchSearchResponse, object>> = {}): MatchSearchResponse => ({source: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchSearchNeedSourceMock()},{...getSearchOrganizationMatchesResponseMatchSearchBankSourceMock()},]), groups: {main: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(() => ({code: faker.helpers.arrayElement(['confirmed_category','required_skill_evidence','desired_skill_evidence','domain_alignment','task_alignment','work_conditions_match','salary_compatibility','declared_grade'] as const), state: faker.helpers.arrayElement(['supports','partial','gap','declared_only'] as const)})), components: {fit: faker.number.float({min: 0, max: 1, fractionDigits: 2}), coverage: faker.number.float({min: 0, max: 1, fractionDigits: 2}), domain: faker.number.float({min: 0, max: 1, fractionDigits: 2}), semantics: faker.number.float({min: 0, max: 1, fractionDigits: 2}), percentile: faker.helpers.arrayElement([faker.number.float({min: 0, max: 1, fractionDigits: 2}),null,]), competition: faker.number.float({min: 0, max: 1, fractionDigits: 2}), freshness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), responsiveness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), rank_score: faker.number.float({min: 0, max: 1, fractionDigits: 2})}, unknown_flags: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({component: faker.helpers.arrayElement(['semantics','percentile','assessment','freshness','responsiveness','experience_band','work_formats','salary_compatibility','domain'] as const), reason: faker.helpers.arrayElement(['ml_unavailable','cohort_below_30','no_confirmation_for_specialization','not_in_public_card','need_field_unconfirmed','no_freshness_history','no_response_history','percentile_not_computed'] as const)}))})), near: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(() => ({code: faker.helpers.arrayElement(['confirmed_category','required_skill_evidence','desired_skill_evidence','domain_alignmenLine truncated
|
||||
export const getSearchOrganizationMatchesResponseMock = (overrideResponse: Partial<Extract<MatchSearchResponse, object>> = {}): MatchSearchResponse => ({source: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchSearchNeedSourceMock()},{...getSearchOrganizationMatchesResponseMatchSearchBankSourceMock()},]), groups: {main: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), basis: faker.helpers.arrayElement(['synthetic_demo'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(() => ({code: faker.helpers.arrayElement(['confirmed_category','required_skill_evidence','desired_skill_evidence','domain_alignment','task_alignment','work_conditions_match','salary_compatibility','declared_grade'] as const), state: faker.helpers.arrayElement(['supports','partial','gap','declared_only'] as const)})), components: {fit: faker.number.float({min: 0, max: 1, fractionDigits: 2}), coverage: faker.number.float({min: 0, max: 1, fractionDigits: 2}), domain: faker.number.float({min: 0, max: 1, fractionDigits: 2}), semantics: faker.number.float({min: 0, max: 1, fractionDigits: 2}), percentile: faker.helpers.arrayElement([faker.number.float({min: 0, max: 1, fractionDigits: 2}),null,]), competition: faker.number.float({min: 0, max: 1, fractionDigits: 2}), freshness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), responsiveness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), rank_score: faker.number.float({min: 0, max: 1, fractionDigits: 2})}, unknown_flags: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({component: faker.helpers.arrayElement(['semantics','percentile','assessment','freshness','responsiveness','experience_band','work_formats','salary_compatibility','domain'] as const), reason: faker.helpers.arrayElement(['ml_unavailable','cohort_below_30','no_confirmation_for_specialization','not_in_public_card','need_field_unconfirmed','no_freshness_history','no_response_history','percentile_not_computed'] as const)}))})), near: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), basis: faker.helpers.arrayElement(['synthetic_demo'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(()Line truncated
|
||||
|
||||
|
||||
export const getListMyOrganizationsMockHandler = (overrideResponse?: MyOrganizationList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<MyOrganizationList> | MyOrganizationList), options?: RequestHandlerOptions) => {
|
||||
|
||||
@@ -35,13 +35,13 @@ import type {
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateCardResponseMock = (overrideResponse: Partial<Extract<AnonymousCardContent, object>> = {}): AnonymousCardContent => ({pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), categories: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), strength: faker.helpers.arrayElement(['standard','strong'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,]), ...overrideResponse})
|
||||
export const getGetOrganizationCandidateCardResponseMock = (overrideResponse: Partial<Extract<AnonymousCardContent, object>> = {}): AnonymousCardContent => ({pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), categories: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), strength: faker.helpers.arrayElement(['standard','strong'] as const), basis: faker.helpers.arrayElement(['synthetic_demo'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,]), ...overrideResponse})
|
||||
|
||||
export const getGetMyPrivacySettingsResponseMock = (overrideResponse: Partial<Extract<PrivacySettings, object>> = {}): PrivacySettings => ({publication: {state: faker.helpers.arrayElement(['closed','published'] as const), closed_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['never_published','closed_by_candidate','consent_revoked'] as const),null,]), fields: faker.helpers.arrayElements(['categories','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] as const), consent_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0})}, search_status: {value: faker.helpers.arrayElement(['looking','not_looking'] as const), lapsed: faker.datatype.boolean(), confirmed_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), lapses_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0})}, hidden_organizations_total: faker.number.int({min: 0, max: 1000}), ...overrideResponse})
|
||||
|
||||
export const getSetMyPublicationResponseMock = (overrideResponse: Partial<Extract<Publication, object>> = {}): Publication => ({state: faker.helpers.arrayElement(['closed','published'] as const), closed_reason: faker.helpers.arrayElement([faker.helpers.arrayElement(['never_published','closed_by_candidate','consent_revoked'] as const),null,]), fields: faker.helpers.arrayElements(['categories','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] as const), consent_id: faker.helpers.arrayElement([faker.string.uuid(),null,]), published_at: faker.helpers.arrayElement([faker.date.past().toISOString().slice(0, 19) + 'Z',null,]), version: faker.number.int({min: 0}), ...overrideResponse})
|
||||
|
||||
export const getGetMyCardPreviewResponseAnonymousCardContentMock = (overrideResponse: Partial<AnonymousCardContent> = {}): AnonymousCardContent => ({...{pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), categories: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), strength: faker.helpers.arrayElement(['standard','strong'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, ...overrideResponse});
|
||||
export const getGetMyCardPreviewResponseAnonymousCardContentMock = (overrideResponse: Partial<AnonymousCardContent> = {}): AnonymousCardContent => ({...{pseudonym: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), categories: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), strength: faker.helpers.arrayElement(['standard','strong'] as const), basis: faker.helpers.arrayElement(['synthetic_demo'] as const)})), null]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const), null]), self_assessment: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed','unconfirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,])})), null]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const), null]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, ...overrideResponse});
|
||||
|
||||
export const getGetMyCardPreviewResponseOrganizationEvidenceMock = (overrideResponse: Partial<OrganizationEvidence> = {}): OrganizationEvidence => ({...{items: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({skill: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa','go','postgresql','kafka','docker'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), trust: faker.number.int({min: 0, max: 3}), basis: faker.helpers.arrayElement(['synthetic_demo'] as const), calibration_status: faker.helpers.arrayElement(['uncalibrated'] as const), observed_year: faker.number.int({min: 2000, max: 9999})}))}, ...overrideResponse});
|
||||
|
||||
|
||||
@@ -214,7 +214,9 @@ describe("generated HiddenOrganization", () => {
|
||||
describe("generated AnonymousCardContent", () => {
|
||||
const card = {
|
||||
pseudonym: `cv1_${"a".repeat(43)}`,
|
||||
categories: [{ specialization: "backend", grade: "middle", strength: "standard" }],
|
||||
categories: [
|
||||
{ specialization: "backend", grade: "middle", strength: "standard", basis: "synthetic_demo" },
|
||||
],
|
||||
stack: ["postgresql", "kafka"],
|
||||
self_assessment: [
|
||||
{
|
||||
|
||||
@@ -113,6 +113,7 @@ const profile = {
|
||||
{
|
||||
specialization: "backend",
|
||||
grade: "junior",
|
||||
basis: "synthetic_demo",
|
||||
confirmed_at: "2026-10-04T18:10:00Z",
|
||||
attempt_id: "0192b3c4-d5e6-7f80-9a1b-2c3d4e5f6a7b",
|
||||
},
|
||||
@@ -326,6 +327,16 @@ describe("generated CandidateProfile", () => {
|
||||
expect(ProfileConfirmedCategory.safeParse(profile.confirmed_categories[0]).success).toBe(true);
|
||||
expect(ProfileConfirmedCategory.safeParse(withoutAttempt).success).toBe(false);
|
||||
});
|
||||
|
||||
it("requires a confirmed category to state its basis, so a demonstration never reads as a measurement", () => {
|
||||
const withoutBasis = without(profile.confirmed_categories[0] ?? {}, "basis");
|
||||
|
||||
expect(ProfileConfirmedCategory.safeParse(withoutBasis).success).toBe(false);
|
||||
expect(
|
||||
ProfileConfirmedCategory.safeParse({ ...profile.confirmed_categories[0], basis: "measured" })
|
||||
.success,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
it("exposes the profile DTOs without a confirmed grade or a category in requests", () => {
|
||||
|
||||
@@ -20,6 +20,7 @@ export const AssessmentAvailability = zod.object({
|
||||
"specializations": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Currently confirmed grade of the specialization, or null.'),
|
||||
"confirmed_basis": zod.union([zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.'),zod.null()]).describe('What the confirmed grade rests on, or null exactly when `confirmed_grade` is null. `synthetic_demo` marks a demonstration category, which is not a validated measurement and must not be shown as a real confirmation.'),
|
||||
"active_attempt_id": zod.uuid().nullable().describe('Identifier of the active attempt of the specialization, or null.'),
|
||||
"grades": zod.array(zod.object({
|
||||
"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.'),
|
||||
|
||||
@@ -17,6 +17,7 @@ export const assessmentSpecializationAvailabilityGradesMax = 10;
|
||||
export const AssessmentSpecializationAvailability = 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.'),
|
||||
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Currently confirmed grade of the specialization, or null.'),
|
||||
"confirmed_basis": zod.union([zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.'),zod.null()]).describe('What the confirmed grade rests on, or null exactly when `confirmed_grade` is null. `synthetic_demo` marks a demonstration category, which is not a validated measurement and must not be shown as a real confirmation.'),
|
||||
"active_attempt_id": zod.uuid().nullable().describe('Identifier of the active attempt of the specialization, or null.'),
|
||||
"grades": zod.array(zod.object({
|
||||
"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.'),
|
||||
|
||||
@@ -319,9 +319,10 @@ export const CandidateProfile = zod.object({
|
||||
"confirmed_categories": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.'),
|
||||
"confirmed_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"attempt_id": zod.uuid().describe('Assessment attempt whose result confirmed the grade. The attempt belongs to the candidate.')
|
||||
}).describe('A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`.')).max(candidateProfileConfirmedCategoriesMax).describe('Categories that assessment results confirmed, at most one per specialization, in catalog order. Read-only and empty until an assessment confirms a grade.'),
|
||||
}).describe('A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category that is not a validated measurement.')).max(candidateProfileConfirmedCategoriesMax).describe('Categories that assessment results confirmed, at most one per specialization, in catalog order. Read-only and empty until an assessment confirms a grade.'),
|
||||
"updated_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time of the last change, or null before the first save.')
|
||||
}).describe('The private profile of the current candidate: full name and contacts, stack, roles, work experience, soft skills, and desired terms, each value with its confirmation state and provenance. It is personal data that only the candidate reads. It is never an organization-visible schema: an organization sees a candidate only through the anonymous card and, after an accepted invitation, through the contact grant, and no organization schema refers to this one.\nEvery value is a claim of trust level 0. The `self_assessed_grade` of a role is what the candidate says; the `confirmed_categories` list is what assessment results established, and the two are never mixed. A candidate who has not saved the profile gets version 0, every single field `unknown`, empty lists, and null `updated_at`.\nThe profile is manual by nature and complete without a file: no field requires a resume, the ML service, or an FSP account, and a candidate with none of them has the same fields. Work formats live in the questionnaire; a candidate\'s assessment starts from the questionnaire, not from this profile.')
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@ import * as zod from 'zod';
|
||||
export const ProfileConfirmedCategory = 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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.'),
|
||||
"confirmed_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
||||
"attempt_id": zod.uuid().describe('Assessment attempt whose result confirmed the grade. The attempt belongs to the candidate.')
|
||||
}).describe('A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`.')
|
||||
}).describe('A category that an assessment result confirmed: the specialization with the confirmed grade. It is read-only and derived by the server from the assessment results of the candidate; no request carries it and the profile storage holds no such column, so neither a form nor an import can write a confirmed grade. It is separate from the claims of the profile and from the self-assessed grades in `roles`. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category that is not a validated measurement.')
|
||||
|
||||
export type ProfileConfirmedCategory = zod.input<typeof ProfileConfirmedCategory>;
|
||||
export type ProfileConfirmedCategoryOutput = zod.output<typeof ProfileConfirmedCategory>;
|
||||
@@ -8,8 +8,9 @@ import * as zod from 'zod';
|
||||
|
||||
export const MatchCategory = 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.')
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.')
|
||||
|
||||
export type MatchCategory = zod.input<typeof MatchCategory>;
|
||||
export type MatchCategoryOutput = zod.output<typeof MatchCategory>;
|
||||
@@ -54,8 +54,9 @@ export const MatchConfirmedCandidate = zod.object({
|
||||
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
|
||||
"category": 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
|
||||
"public_context": zod.object({
|
||||
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchConfirmedCandidatePublicContextStackOneMax),zod.null()]),
|
||||
|
||||
@@ -114,8 +114,9 @@ export const MatchSearchGroups = zod.object({
|
||||
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
|
||||
"category": 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
|
||||
"public_context": zod.object({
|
||||
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchGroupsMainItemPublicContextStackOneMax),zod.null()]),
|
||||
@@ -150,8 +151,9 @@ export const MatchSearchGroups = zod.object({
|
||||
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
|
||||
"category": 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
|
||||
"public_context": zod.object({
|
||||
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchGroupsNearItemPublicContextStackOneMax),zod.null()]),
|
||||
|
||||
@@ -142,8 +142,9 @@ export const MatchSearchResponse = zod.object({
|
||||
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
|
||||
"category": 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
|
||||
"public_context": zod.object({
|
||||
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchResponseGroupsMainItemPublicContextStackOneMax),zod.null()]),
|
||||
@@ -178,8 +179,9 @@ export const MatchSearchResponse = zod.object({
|
||||
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
|
||||
"category": 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('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
|
||||
"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.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which an organization must read as one and never as a standard confirmation.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
|
||||
"public_context": zod.object({
|
||||
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchResponseGroupsNearItemPublicContextStackOneMax),zod.null()]),
|
||||
|
||||
@@ -25,8 +25,9 @@ export const AnonymousCardContent = zod.object({
|
||||
"categories": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')).max(anonymousCardContentCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which is never a standard confirmation.')).max(anonymousCardContentCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker'])).max(anonymousCardContentStackMax).nullable().describe('Recognized confirmed technology codes only, or null.'),
|
||||
"self_assessment": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
|
||||
@@ -9,8 +9,9 @@ import * as zod from 'zod';
|
||||
export const CardCategory = 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.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which is never a standard confirmation.')
|
||||
|
||||
export type CardCategory = zod.input<typeof CardCategory>;
|
||||
export type CardCategoryOutput = zod.output<typeof CardCategory>;
|
||||
@@ -39,8 +39,9 @@ export const CardPreview = zod.object({
|
||||
"categories": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it.')).max(cardPreviewCardOneCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of the authoritative confirmation.'),
|
||||
"basis": zod.enum(['synthetic_demo']).describe('What the measurement rests on.\n\n- synthetic_demo: a demonstration category from a synthetic reviewed bank. It shows the mechanics and is not a validated measurement.')
|
||||
}).describe('A category confirmed by assessment results, as the card shows it. `basis` says what the grade rests on; `synthetic_demo` marks a demonstration category, which is never a standard confirmation.')).max(cardPreviewCardOneCategoriesMax).nullable().describe('Categories confirmed by assessment results, or null.'),
|
||||
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker'])).max(cardPreviewCardOneStackMax).nullable().describe('Recognized confirmed technology codes only, or null.'),
|
||||
"self_assessment": zod.array(zod.object({
|
||||
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
|
||||
|
||||
@@ -47,7 +47,7 @@ describe("match list", () => {
|
||||
expect(html).toContain("Подтвержденная категория");
|
||||
expect(html).toContain("Заявленный кандидатом грейд");
|
||||
expect(html).toContain("Грейд подтвержден: Middle");
|
||||
expect(html).toContain("Backend, Middle. Сильное подтверждение");
|
||||
expect(html).toContain("Backend, Middle. Демонстрационное подтверждение");
|
||||
});
|
||||
|
||||
it("offers a specialization switch when the result holds several specializations", () => {
|
||||
|
||||
Reference in new issue
Block a user