feat(evidence): project skill evidence from confirmed assessments
This commit is contained in:
1 parent
4761508f13
commit
c2a8d17195
94 files changed
+10077
-151
No files matched your search
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
faker
|
||||
} from '@faker-js/faker';
|
||||
|
||||
import {
|
||||
fakeFromPattern
|
||||
} from '../../mock-pattern';
|
||||
|
||||
import {
|
||||
HttpResponse,
|
||||
http
|
||||
} from 'msw';
|
||||
import type {
|
||||
RequestHandlerOptions
|
||||
} from 'msw';
|
||||
|
||||
import type {
|
||||
EvidenceFactList,
|
||||
OrganizationEvidence
|
||||
} from '../../schemas';
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateEvidenceResponseMock = (overrideResponse: Partial<Extract<OrganizationEvidence, object>> = {}): 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})
|
||||
|
||||
export const getListMyEvidenceResponseMock = (overrideResponse: Partial<Extract<EvidenceFactList, object>> = {}): EvidenceFactList => ({items: Array.from({ length: faker.number.int({min: 1, max: 100}) }, (_, i) => i + 1).map(() => ({id: faker.string.uuid(), kind: faker.helpers.arrayElement(['claim','measurement'] as const), source: {type: faker.helpers.arrayElement(['assessment_result'] as const), event_id: faker.string.uuid(), result_id: faker.string.uuid()}, skills: faker.helpers.arrayElements(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa','go','postgresql','kafka','docker'] as const), result: {grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const), basis: faker.helpers.arrayElement(['synthetic_demo'] as const), calibration_status: faker.helpers.arrayElement(['uncalibrated'] as const)}, attribution: faker.helpers.arrayElement(['personal','team_role','team_unattributed'] as const), trust: faker.number.int({min: 0, max: 3}), occurred_at: faker.date.past().toISOString().slice(0, 19) + 'Z', visibility: faker.helpers.arrayElement(['visible','hidden'] as const)})), page: {has_more: faker.datatype.boolean(), next_cursor: faker.helpers.arrayElement([fakeFromPattern("^[A-Za-z0-9_-]+$", {minLength: 1, maxLength: 512}), null])}, ...overrideResponse})
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateEvidenceMockHandler = (overrideResponse?: OrganizationEvidence | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<OrganizationEvidence> | OrganizationEvidence), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/organizations/:orgId/candidate-cards/:candidateHandle/evidence', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getGetOrganizationCandidateEvidenceResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
|
||||
export const getListMyEvidenceMockHandler = (overrideResponse?: EvidenceFactList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<EvidenceFactList> | EvidenceFactList), options?: RequestHandlerOptions) => {
|
||||
return http.get('*/api/v1/me/evidence', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
|
||||
|
||||
|
||||
return HttpResponse.json(overrideResponse !== undefined
|
||||
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
|
||||
: getListMyEvidenceResponseMock(),
|
||||
{ status: 200
|
||||
})
|
||||
}, options)
|
||||
}
|
||||
export const getEvidenceMock = () => [
|
||||
getGetOrganizationCandidateEvidenceMockHandler(),
|
||||
getListMyEvidenceMockHandler()
|
||||
]
|
||||
@@ -0,0 +1,282 @@
|
||||
/**
|
||||
* Generated by orval 🍺
|
||||
* Do not edit manually.
|
||||
* Lincodex API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
EvidenceFactList,
|
||||
ListMyEvidenceParams,
|
||||
OrganizationEvidence,
|
||||
Problem
|
||||
} from '../../schemas';
|
||||
|
||||
import { apiRequest } from '../../client';
|
||||
import type { ErrorType } from '../../client';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {
|
||||
const result = { queryKey } as T & { queryKey: K };
|
||||
for (const key of Object.keys(query)) {
|
||||
// The explicit queryKey always wins, matching the previous
|
||||
// `{ ...query, queryKey }` spread where it was set last.
|
||||
if (key === 'queryKey') continue;
|
||||
Object.defineProperty(result, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: () => (query as Record<string, unknown>)[key],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export const getGetOrganizationCandidateEvidenceUrl = (orgId: string,
|
||||
candidateHandle: string,) => {
|
||||
|
||||
|
||||
|
||||
|
||||
return `/api/v1/organizations/${orgId}/candidate-cards/${candidateHandle}/evidence`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of an employer account with an active membership in `org_id`. The organization and membership come from the current server-side session and path, never from cached search data.
|
||||
*
|
||||
* `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card projection. The server runs the same checks as the card read on every request: active membership, effective C2 publication, the candidate's hiding of this organization, and the minimum cohort. In addition the card must publish the `categories` field and show at least one category after the cohort rules, because the evidence explains those categories and discloses nothing beyond them. An unknown handle, a handle of another organization, a closed or revoked publication, a profile hidden from this organization, a profile suppressed by the minimum cohort, and a card without categories all answer the same 404 not_found. Closing C2 or hiding the organization blocks this read immediately, and a cached response proves nothing.
|
||||
*
|
||||
* The response lists, for each category of the card, the one visible fact that supports its confirmed grade: the earliest assessment that passed exactly that grade, so a lower grade or a retake adds nothing. A fact the candidate hid is absent. Each fact carries only the skill, the passed grade, the trust level, the year of the assessment, and the basis and calibration of the method (`synthetic_demo`, `uncalibrated`), which are the same for every candidate and say that the fact is a demonstration, not a validated measurement. It carries no identifier of the fact, event, result, or candidate, no month or exact time, and never an answer, item, score, failed attempt, review band, or anti-cheat signal. An express training run and a failed attempt create no fact. The answer has no key that joins it to a person, but it is not unlinkable: with the other values of the card it can narrow a small pool of candidates.
|
||||
*
|
||||
* Reading the evidence is a view of the candidate card: it consumes the organization's current card-view quota with the same distinct-card rule and is recorded in the access history with the `categories` field. When the quota is exhausted the operation answers 429 with Retry-After. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account answers 403 forbidden; an unknown organization or account without an active membership answers 404 not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400 validation_failed.
|
||||
* @summary Read the permitted skill evidence of one currently visible candidate card.
|
||||
*/
|
||||
export const getOrganizationCandidateEvidence = async (orgId: string,
|
||||
candidateHandle: string, options?: Parameters<typeof apiRequest>[1]): Promise<OrganizationEvidence> => {
|
||||
|
||||
return apiRequest<OrganizationEvidence>(getGetOrganizationCandidateEvidenceUrl(orgId,candidateHandle),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateEvidenceQueryKey = (orgId: string,
|
||||
candidateHandle: string,) => {
|
||||
return [
|
||||
`/api/v1/organizations/${orgId}/candidate-cards/${candidateHandle}/evidence`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetOrganizationCandidateEvidenceQueryOptions = <TData = Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError = ErrorType<Problem>>(orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetOrganizationCandidateEvidenceQueryKey(orgId,candidateHandle);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>> = ({ signal }) => getOrganizationCandidateEvidence(orgId,candidateHandle, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: orgId !== null && orgId !== undefined && candidateHandle !== null && candidateHandle !== undefined, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetOrganizationCandidateEvidenceQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>>
|
||||
export type GetOrganizationCandidateEvidenceQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useGetOrganizationCandidateEvidence<TData = Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetOrganizationCandidateEvidence<TData = Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetOrganizationCandidateEvidence<TData = Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary Read the permitted skill evidence of one currently visible candidate card.
|
||||
*/
|
||||
|
||||
export function useGetOrganizationCandidateEvidence<TData = Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError = ErrorType<Problem>>(
|
||||
orgId: string,
|
||||
candidateHandle: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganizationCandidateEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetOrganizationCandidateEvidenceQueryOptions(orgId,candidateHandle,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyEvidenceUrl = (params?: ListMyEvidenceParams,) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? 'null' : String(value))
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0 ? `/api/v1/me/evidence?${stringifiedParams}` : `/api/v1/me/evidence`
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own facts. Returns a page, newest event first with the fact identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
|
||||
*
|
||||
* A fact is derived from the immutable result of a confirmed real assessment (root or corrective), in the same transaction that stores the result. Each fact names its source (the event and the result, which the candidate can open at `GetMyAssessmentResult`), the skills of the event, the grade that was passed with its basis and calibration, the attribution, the date, the visibility, and the trust level. An online assessment without a reliable confirmation of the identity has trust 1. One source event is one fact: its skills are tags of that fact, so several tags never make several facts.
|
||||
*
|
||||
* The list never carries raw answers, items, scores, failed attempts, or anti-cheat data. A failed attempt, a result without a reviewed category source, and an express training run (`demo_express`) create no fact, so reading the list before and after an express run shows no new fact. The list includes facts the candidate hid, with `visibility` `hidden`.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account, or a candidate with an unverified email, answers 403 forbidden. A malformed `limit` or `cursor`, or a cursor of another candidate, answers 400 validation_failed.
|
||||
* @summary List the skill evidence of the current candidate.
|
||||
*/
|
||||
export const listMyEvidence = async (params?: ListMyEvidenceParams, options?: Parameters<typeof apiRequest>[1]): Promise<EvidenceFactList> => {
|
||||
|
||||
return apiRequest<EvidenceFactList>(getListMyEvidenceUrl(params),
|
||||
{
|
||||
...options,
|
||||
method: 'GET'
|
||||
|
||||
|
||||
}
|
||||
);}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListMyEvidenceQueryKey = (params?: ListMyEvidenceParams,) => {
|
||||
return [
|
||||
`/api/v1/me/evidence`, ...(params ? [params] : [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListMyEvidenceQueryOptions = <TData = Awaited<ReturnType<typeof listMyEvidence>>, TError = ErrorType<Problem>>(params?: ListMyEvidenceParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListMyEvidenceQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listMyEvidence>>> = ({ signal }) => listMyEvidence(params, { signal, ...requestOptions });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListMyEvidenceQueryResult = NonNullable<Awaited<ReturnType<typeof listMyEvidence>>>
|
||||
export type ListMyEvidenceQueryError = ErrorType<Problem>
|
||||
|
||||
|
||||
export function useListMyEvidence<TData = Awaited<ReturnType<typeof listMyEvidence>>, TError = ErrorType<Problem>>(
|
||||
params: undefined | ListMyEvidenceParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyEvidence>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyEvidence>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyEvidence<TData = Awaited<ReturnType<typeof listMyEvidence>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyEvidenceParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listMyEvidence>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listMyEvidence>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListMyEvidence<TData = Awaited<ReturnType<typeof listMyEvidence>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyEvidenceParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List the skill evidence of the current candidate.
|
||||
*/
|
||||
|
||||
export function useListMyEvidence<TData = Awaited<ReturnType<typeof listMyEvidence>>, TError = ErrorType<Problem>>(
|
||||
params?: ListMyEvidenceParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listMyEvidence>>, TError, TData>>, request?: SecondParameter<typeof apiRequest>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListMyEvidenceQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
return withQueryKey(query, queryOptions.queryKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ export { getAssessmentMock } from './assessment/assessment.msw'
|
||||
export { getCandidateMock } from './candidate/candidate.msw'
|
||||
export { getCatalogMock } from './catalog/catalog.msw'
|
||||
export { getConsentMock } from './consent/consent.msw'
|
||||
export { getEvidenceMock } from './evidence/evidence.msw'
|
||||
export { getHealthMock } from './health/health.msw'
|
||||
export { getIdentityMock } from './identity/identity.msw'
|
||||
export { getInvitationMock } from './invitation/invitation.msw'
|
||||
|
||||
@@ -2,6 +2,7 @@ export * from './assessment/assessment';
|
||||
export * from './candidate/candidate';
|
||||
export * from './catalog/catalog';
|
||||
export * from './consent/consent';
|
||||
export * from './evidence/evidence';
|
||||
export * from './health/health';
|
||||
export * from './identity/identity';
|
||||
export * from './invitation/invitation';
|
||||
|
||||
@@ -26,6 +26,7 @@ import type {
|
||||
CardPreview,
|
||||
HiddenOrganization,
|
||||
HiddenOrganizationList,
|
||||
OrganizationEvidence,
|
||||
PrivacyEventList,
|
||||
PrivacyOrganization,
|
||||
PrivacySettings,
|
||||
@@ -42,7 +43,9 @@ export const getSetMyPublicationResponseMock = (overrideResponse: Partial<Extrac
|
||||
|
||||
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 getGetMyCardPreviewResponseMock = (overrideResponse: Partial<Extract<CardPreview, object>> = {}): CardPreview => ({state: faker.helpers.arrayElement(['closed','published'] as const), fields: faker.helpers.arrayElements(['categories','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] as const), card: faker.helpers.arrayElement([{...getGetMyCardPreviewResponseAnonymousCardContentMock()},null,]), generated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...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});
|
||||
|
||||
export const getGetMyCardPreviewResponseMock = (overrideResponse: Partial<Extract<CardPreview, object>> = {}): CardPreview => ({state: faker.helpers.arrayElement(['closed','published'] as const), fields: faker.helpers.arrayElements(['categories','salary_compatibility','self_assessment','stack','experience','soft_skills','location','relocation','work_formats'] as const), card: faker.helpers.arrayElement([{...getGetMyCardPreviewResponseAnonymousCardContentMock()},null,]), evidence: faker.helpers.arrayElement([{...getGetMyCardPreviewResponseOrganizationEvidenceMock()},null,]), generated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
|
||||
|
||||
export const getSetMySearchStatusResponseMock = (overrideResponse: Partial<Extract<SearchStatus, object>> = {}): SearchStatus => ({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}), ...overrideResponse})
|
||||
|
||||
|
||||
@@ -397,6 +397,8 @@ export const useSetMyPublication = <TError = ErrorType<Problem>,
|
||||
*
|
||||
* `card` is the closed `AnonymousCardContent` projection. It reaches no private profile or contact schema and contains no name, email, phone, Telegram name, employer, salary figure, account identifier, or profile identifier. Unpublished or unknown values are null. Only allowed canonical skills and generalized experience are exposed; arbitrary profile text and imported excerpts never appear. `categories` contains only confirmed assessment results. Self-assessed grades and work formats appear only through their separate explicit publication choices, and self-assessment never becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
|
||||
*
|
||||
* `evidence` shows what an organization would read in the evidence section of the card (`GetOrganizationCandidateEvidence`): for each category of the card, the one assessment fact that supports its confirmed grade, with its skill, the passed grade, the trust level, the year, and the basis and calibration (`synthetic_demo`, `uncalibrated`). It is null while `card` is null, and an empty list when the card shows no category or no visible fact supports one. The preview applies no organization or cohort, so an organization can still receive less.
|
||||
*
|
||||
* A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
|
||||
* @summary Preview the anonymous card that organizations would read.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user