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
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user