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

@@ -5097,6 +5097,9 @@ type CandidateProfile struct {
Roles []ProfileRoleItem `json:"roles"`
// Work history entries in the order the candidate gave them.
Experience []ProfileExperienceItem `json:"experience"`
// Every pair of overlapping experience periods, with its confirmation status. The indices refer to
// this version's experience array.
ExperienceOverlaps []ProfileExperienceOverlap `json:"experience_overlaps"`
// Soft skills in the order the candidate gave them, each skill at most once without regard to letter
// case.
SoftSkills []ProfileSoftSkillItem `json:"soft_skills"`
@@ -5138,6 +5141,11 @@ func (s *CandidateProfile) GetExperience() []ProfileExperienceItem {
return s.Experience
}
// GetExperienceOverlaps returns the value of ExperienceOverlaps.
func (s *CandidateProfile) GetExperienceOverlaps() []ProfileExperienceOverlap {
return s.ExperienceOverlaps
}
// GetSoftSkills returns the value of SoftSkills.
func (s *CandidateProfile) GetSoftSkills() []ProfileSoftSkillItem {
return s.SoftSkills
@@ -5188,6 +5196,11 @@ func (s *CandidateProfile) SetExperience(val []ProfileExperienceItem) {
s.Experience = val
}
// SetExperienceOverlaps sets the value of ExperienceOverlaps.
func (s *CandidateProfile) SetExperienceOverlaps(val []ProfileExperienceOverlap) {
s.ExperienceOverlaps = val
}
// SetSoftSkills sets the value of SoftSkills.
func (s *CandidateProfile) SetSoftSkills(val []ProfileSoftSkillItem) {
s.SoftSkills = val
@@ -5259,6 +5272,11 @@ type CandidateProfileUpdate struct {
Roles []ProfileRoleItemInput `json:"roles"`
// Work history entries.
Experience []ProfileExperienceItemInput `json:"experience"`
// Explicit acknowledgements for overlapping periods. Each pair must use distinct in-range indices and
// repeat the exact normalized started_on and ended_on values of those entries in this body. A changed
// or reordered period needs a new acknowledgement. The server retains a previous acknowledgement only
// for the same indices and dates. Duplicate pairs and pairs that do not overlap are rejected.
ConfirmedParallelPeriods []ProfileParallelPeriodConfirmation `json:"confirmed_parallel_periods"`
// Soft skills. The server answers 400 with the pointer of a skill that repeats an earlier one without
// regard to letter case.
SoftSkills []ProfileSoftSkillItemInput `json:"soft_skills"`
@@ -5295,6 +5313,11 @@ func (s *CandidateProfileUpdate) GetExperience() []ProfileExperienceItemInput {
return s.Experience
}
// GetConfirmedParallelPeriods returns the value of ConfirmedParallelPeriods.
func (s *CandidateProfileUpdate) GetConfirmedParallelPeriods() []ProfileParallelPeriodConfirmation {
return s.ConfirmedParallelPeriods
}
// GetSoftSkills returns the value of SoftSkills.
func (s *CandidateProfileUpdate) GetSoftSkills() []ProfileSoftSkillItemInput {
return s.SoftSkills
@@ -5335,6 +5358,11 @@ func (s *CandidateProfileUpdate) SetExperience(val []ProfileExperienceItemInput)
s.Experience = val
}
// SetConfirmedParallelPeriods sets the value of ConfirmedParallelPeriods.
func (s *CandidateProfileUpdate) SetConfirmedParallelPeriods(val []ProfileParallelPeriodConfirmation) {
s.ConfirmedParallelPeriods = val
}
// SetSoftSkills sets the value of SoftSkills.
func (s *CandidateProfileUpdate) SetSoftSkills(val []ProfileSoftSkillItemInput) {
s.SoftSkills = val
@@ -21066,6 +21094,117 @@ func (s *ProfileExperienceItemInput) SetStatus(val ProfileItemStatus) {
s.Status = val
}
// 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.
// Ref: #/components/schemas/ProfileExperienceOverlap
type ProfileExperienceOverlap struct {
FirstIndex int `json:"first_index"`
SecondIndex int `json:"second_index"`
Status ProfileExperienceOverlapStatus `json:"status"`
}
// GetFirstIndex returns the value of FirstIndex.
func (s *ProfileExperienceOverlap) GetFirstIndex() int {
return s.FirstIndex
}
// GetSecondIndex returns the value of SecondIndex.
func (s *ProfileExperienceOverlap) GetSecondIndex() int {
return s.SecondIndex
}
// GetStatus returns the value of Status.
func (s *ProfileExperienceOverlap) GetStatus() ProfileExperienceOverlapStatus {
return s.Status
}
// SetFirstIndex sets the value of FirstIndex.
func (s *ProfileExperienceOverlap) SetFirstIndex(val int) {
s.FirstIndex = val
}
// SetSecondIndex sets the value of SecondIndex.
func (s *ProfileExperienceOverlap) SetSecondIndex(val int) {
s.SecondIndex = val
}
// SetStatus sets the value of Status.
func (s *ProfileExperienceOverlap) SetStatus(val ProfileExperienceOverlapStatus) {
s.Status = val
}
// Whether the candidate confirmed that two overlapping periods are genuine parallel work.
// Ref: #/components/schemas/ProfileExperienceOverlapStatus
type ProfileExperienceOverlapStatus string
const (
ProfileExperienceOverlapStatusNeedsConfirmation ProfileExperienceOverlapStatus = "needs_confirmation"
ProfileExperienceOverlapStatusConfirmed ProfileExperienceOverlapStatus = "confirmed"
)
// AllValues returns all ProfileExperienceOverlapStatus values.
func (ProfileExperienceOverlapStatus) AllValues() []ProfileExperienceOverlapStatus {
return []ProfileExperienceOverlapStatus{
ProfileExperienceOverlapStatusNeedsConfirmation,
ProfileExperienceOverlapStatusConfirmed,
}
}
// MarshalText implements encoding.TextMarshaler.
func (s ProfileExperienceOverlapStatus) MarshalText() ([]byte, error) {
switch s {
case ProfileExperienceOverlapStatusNeedsConfirmation:
return []byte(s), nil
case ProfileExperienceOverlapStatusConfirmed:
return []byte(s), nil
default:
return nil, errors.Errorf("invalid value: %q", s)
}
}
// UnmarshalText implements encoding.TextUnmarshaler.
func (s *ProfileExperienceOverlapStatus) UnmarshalText(data []byte) error {
switch ProfileExperienceOverlapStatus(data) {
case ProfileExperienceOverlapStatusNeedsConfirmation:
*s = ProfileExperienceOverlapStatusNeedsConfirmation
return nil
case ProfileExperienceOverlapStatusConfirmed:
*s = ProfileExperienceOverlapStatusConfirmed
return nil
default:
return errors.Errorf("invalid value: %q", data)
}
}
// The exact month range of an experience entry, copied into a confirmation.
// Ref: #/components/schemas/ProfileExperiencePeriod
type ProfileExperiencePeriod struct {
StartedOn ProfileYearMonth `json:"started_on"`
// Last month of work, or null when the period is open-ended.
EndedOn NilProfileYearMonth `json:"ended_on"`
}
// GetStartedOn returns the value of StartedOn.
func (s *ProfileExperiencePeriod) GetStartedOn() ProfileYearMonth {
return s.StartedOn
}
// GetEndedOn returns the value of EndedOn.
func (s *ProfileExperiencePeriod) GetEndedOn() NilProfileYearMonth {
return s.EndedOn
}
// SetStartedOn sets the value of StartedOn.
func (s *ProfileExperiencePeriod) SetStartedOn(val ProfileYearMonth) {
s.StartedOn = val
}
// SetEndedOn sets the value of EndedOn.
func (s *ProfileExperiencePeriod) SetEndedOn(val NilProfileYearMonth) {
s.EndedOn = val
}
type ProfileExperienceSummary string
// Full name of the candidate with its confirmation state and provenance. The value is personal data.
@@ -21260,6 +21399,57 @@ func (s *ProfileLocationInput) SetStatus(val ProfileItemStatus) {
type ProfileLocationName string
// Explicit acknowledgement that the two indexed experience periods are genuine parallel work. The
// indices and exact ranges must match the submitted experience array; expected_version binds the
// acknowledgement to the profile version the candidate read.
// Ref: #/components/schemas/ProfileParallelPeriodConfirmation
type ProfileParallelPeriodConfirmation struct {
FirstIndex int `json:"first_index"`
SecondIndex int `json:"second_index"`
FirstPeriod ProfileExperiencePeriod `json:"first_period"`
SecondPeriod ProfileExperiencePeriod `json:"second_period"`
}
// GetFirstIndex returns the value of FirstIndex.
func (s *ProfileParallelPeriodConfirmation) GetFirstIndex() int {
return s.FirstIndex
}
// GetSecondIndex returns the value of SecondIndex.
func (s *ProfileParallelPeriodConfirmation) GetSecondIndex() int {
return s.SecondIndex
}
// GetFirstPeriod returns the value of FirstPeriod.
func (s *ProfileParallelPeriodConfirmation) GetFirstPeriod() ProfileExperiencePeriod {
return s.FirstPeriod
}
// GetSecondPeriod returns the value of SecondPeriod.
func (s *ProfileParallelPeriodConfirmation) GetSecondPeriod() ProfileExperiencePeriod {
return s.SecondPeriod
}
// SetFirstIndex sets the value of FirstIndex.
func (s *ProfileParallelPeriodConfirmation) SetFirstIndex(val int) {
s.FirstIndex = val
}
// SetSecondIndex sets the value of SecondIndex.
func (s *ProfileParallelPeriodConfirmation) SetSecondIndex(val int) {
s.SecondIndex = val
}
// SetFirstPeriod sets the value of FirstPeriod.
func (s *ProfileParallelPeriodConfirmation) SetFirstPeriod(val ProfileExperiencePeriod) {
s.FirstPeriod = val
}
// SetSecondPeriod sets the value of SecondPeriod.
func (s *ProfileParallelPeriodConfirmation) SetSecondPeriod(val ProfileExperiencePeriod) {
s.SecondPeriod = val
}
// Contact phone number of the candidate with its confirmation state and provenance. It is personal
// data, stored in the E.164 format of the contact disclosure. `value` and `source` are null exactly
// when `status` is `unknown`.