feat(profile): persist candidate edits and enforce company access

This commit is contained in:
TakuyaYagam1 committed 2026-10-07 14:15:16 +03:00
1 parent 3ab6bd91a3
commit 73c7caa225
67 files changed
+5286 -229

No files matched your search

@@ -114,6 +114,13 @@ export const candidateProfileExperienceItemSourceExtractionVersionOneMax = 64;
export const candidateProfileExperienceItemSourceExtractionVersionOneRegExp = new RegExp('^[A-Za-z0-9._-]+$');
export const candidateProfileExperienceMax = 20;
export const candidateProfileExperienceOverlapsItemFirstIndexMin = 0;
export const candidateProfileExperienceOverlapsItemFirstIndexMax = 19;
export const candidateProfileExperienceOverlapsItemSecondIndexMax = 19;
export const candidateProfileExperienceOverlapsMax = 190;
export const candidateProfileSoftSkillsItemSkillMax = 50;
@@ -253,6 +260,11 @@ export const CandidateProfile = zod.object({
"confirmed_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('Time the candidate typed or confirmed the value, or null while the value is an unconfirmed suggestion.')
}).describe('Provenance and confirmation of one profile value: its origin, the trust level, the excerpt it was extracted from, the extractor version, and the time the candidate confirmed it. Read-only; the server derives it and a request cannot set it. The imported document or source itself is not referenced: the profile never requires a file, the ML service, or an FSP account, and a later link to them is an additive field.')
}).describe('One entry of the candidate\'s work history with its confirmation state and provenance. An entry describes the work by its specialization and tasks rather than by a job title, and it is a claim of trust level 0. It is different from the `CandidateExperience` of the questionnaire, which holds only the total months of commercial and academic experience of a chosen specialization as a hint for the assessment: the two are saved separately, and the server neither adds the entries up for the questionnaire nor fills the entries from it. An entry is personal data.')).max(candidateProfileExperienceMax).describe('Work history entries in the order the candidate gave them.'),
"experience_overlaps": zod.array(zod.object({
"first_index": zod.int().min(candidateProfileExperienceOverlapsItemFirstIndexMin).max(candidateProfileExperienceOverlapsItemFirstIndexMax),
"second_index": zod.int().min(1).max(candidateProfileExperienceOverlapsItemSecondIndexMax),
"status": zod.enum(['needs_confirmation', 'confirmed']).describe('Whether the candidate confirmed that two overlapping periods are genuine parallel work.')
}).describe('One pair of work history entries whose inclusive month ranges overlap. The indices refer to the experience array in this profile version. `confirmed` records an explicit acknowledgement for this pair of dates; otherwise the pair needs confirmation before a changed profile can be saved.')).max(candidateProfileExperienceOverlapsMax).describe('Every pair of overlapping experience periods, with its confirmation status. The indices refer to this version\'s experience array.'),
"soft_skills": zod.array(zod.object({
"skill": zod.string().min(1).max(candidateProfileSoftSkillsItemSkillMax).regex(candidateProfileSoftSkillsItemSkillRegExp).describe('Soft skill as the candidate wrote it, for example "Mentoring" or "Negotiation". The platform has no soft skill taxonomy, so the text is free; it never changes a category or a grade. It has no leading or trailing whitespace and no line breaks. The server compares skills without regard to letter case. Plain text; clients show it as text, never as HTML.'),
"status": zod.enum(['confirmed', 'extracted']).describe('Confirmation state of a profile list item, and the decision that a request sends for a field or an item.\n\n- confirmed: the candidate typed the value or confirmed a suggestion. Only confirmed values leave the profile, for example into a disclosure.\n- extracted: a suggestion that the server took from an imported document or source. Nobody has confirmed it yet, so it is a claim of trust level 0 that no other feature uses.\n\nA request sends `confirmed` to confirm a suggestion or to set a manual value, and `extracted` only to keep a stored suggestion unconfirmed with exactly its stored value; a client that submits an unchanged form therefore confirms nothing by accident. An item is never `unknown`: a missing item is simply absent from the list.'),