Skip to main content

Talent Activity System

Overview

The talent activity system provides an audit trail of all talent lifecycle events. Activities are logged automatically via backend domain events and can also be created manually (e.g., recruiter notes).

Activity Types (22)

TypeCategoryDescription
TALENT_CREATEDTalentNew talent profile created
TALENT_UPDATEDTalentProfile fields modified
TALENT_DELETEDTalentTalent removed
TALENT_VIEWEDTalentProfile viewed by a user
CV_UPLOADEDCVCV file uploaded
CV_UPDATEDCVCV replaced or edited
CV_DELETEDCVCV removed
CV_PARSEDCVAI parsing completed
ADDED_TO_POOLPoolTalent added to a pool
REMOVED_FROM_POOLPoolTalent removed from a pool
POOL_CHANGEDPoolTalent moved between pools
TALENT_SHAREDSharingShared with user or company
TALENT_SHARE_REVOKEDSharingShare access revoked
CANDIDATE_CREATEDCandidateAdded as job candidate
CANDIDATE_STATUS_CHANGEDCandidateCandidate status updated
CANDIDATE_STAGE_CHANGEDCandidateMoved to different pipeline stage
NOTE_ADDEDManualRecruiter note added
SKILL_ADDEDSkillSkill added to talent
SKILL_REMOVEDSkillSkill removed from talent
EXTERNAL_SHARE_CREATEDSharingExternal share link generated
EXTERNAL_SHARE_ACCESSEDSharingExternal share link viewed
HIGH_MATCH_DETECTEDMatchingHigh job match score detected

Frontend Architecture

Files

FilePurpose
graphql/operations/schema/talent/fragments.tsTALENT_ACTIVITY_FIELDS fragment
graphql/operations/talents/queries.tsGET_TALENT_ACTIVITY_HISTORY query
graphql/operations/talents/mutations.tsCREATE_TALENT_ACTIVITY, DELETE_TALENT_ACTIVITY mutations
lib/types/talent.tsTalentActivity, TalentActivityType, TalentActivityHistory, CreateTalentActivityInput types
app/company/resume/talents/_components/TalentActivityTab.tsxMain UI component

Component: TalentActivityTab

Props: { talentId: string }

Features:

  • Timeline view with date grouping (Today, Yesterday, specific dates)
  • 22 color-coded activity type indicators with icons
  • Client-side multi-select filter by activity type
  • Manual note creation via modal (NOTE_ADDED type)
  • Activity deletion with confirmation dialog (NOTE_ADDED only)
  • "Load More" pagination (20 items per page, offset-based)
  • Empty state for talents with no activities

Data Flow:

  1. useQuery(GET_TALENT_ACTIVITY_HISTORY) fetches paginated activities
  2. Client-side filter applied via selectedActivityTypes state
  3. Activities grouped by date using groupActivitiesByDate()
  4. fetchMore() loads additional pages, merged into existing list
  5. CREATE_TALENT_ACTIVITY mutation refetches first page on success
  6. DELETE_TALENT_ACTIVITY mutation updates Apollo cache directly

GraphQL Operations

Query - talentActivityHistory:

query GetTalentActivityHistory($talentId: ID!, $skip: Int, $take: Int) {
talentActivityHistory(talentId: $talentId, pagination: { skip: $skip, take: $take }) {
activities { ...TalentActivityFields }
totalCount
hasMore
}
}

Mutation - createTalentActivity:

mutation CreateTalentActivity($input: CreateTalentActivityInput!) {
createTalentActivity(input: $input) { ...TalentActivityFields }
}

Mutation - deleteTalentActivity:

mutation DeleteTalentActivity($id: ID!) {
deleteTalentActivity(id: $id)
}

Activity Type Color/Icon Mapping

Each activity type has a background color, icon color, and icon component:

  • Green: Created, Added, Applied (UserIcon, PlusIcon, BriefcaseIcon)
  • Blue: Updated, Changed (EditIcon, StatusIcon)
  • Red: Deleted (TrashIcon)
  • Purple: CV operations, Stage changes (UploadIcon, EditIcon, FlowIcon)
  • Orange: Removed, Revoked (MinusIcon, BlockIcon)
  • Yellow: Notes (NoteIcon)
  • Teal: Skills (PlusIcon, MinusIcon)
  • Emerald: High match (StarIcon)
  • Cyan: Shared (ShareIcon)
  • Pink: External share (LinkIcon)

Design Decisions

  1. Primary query: Uses talentActivityHistory (simpler, talent-scoped) instead of talentActivities (company-scoped with filters)
  2. Filtering: Client-side for instant response (22 types is small enough)
  3. Pagination: "Load More" pattern suits chronological timeline UX better than page-based navigation
  4. Manual creation: Only NOTE_ADDED type supported (other types are system-generated)
  5. Delete scope: Only NOTE_ADDED activities are deletable (system events are immutable)