CV parsing integration¶
Overview¶
Mysolution currently supports CV parsing integration with Salesforce using a custom Apex REST endpoint. This enables users to upload CVs directly to Salesforce, where relevant information is extracted and stored in the appropriate fields.
Pre-requisites¶
- The Contact must exist in Salesforce (
salesforce_refis set on the Worker model). - The uploaded CV should be in a supported format (e.g., PDF).
Error Handling¶
- If parsing fails, an appropriate error response is returned to Cruits.
Sequence Diagram¶
sequenceDiagram
autonumber
participant Worker
participant Cruits
participant SF as Salesforce
Worker->>Cruits: Upload CV
Cruits->>SF: POST /services/apexrest/msf/api/document/parse/{ContactId} with CV file
alt ContactId valid
SF->>SF: Parse CV and extract data
SF->>SF: Insert msf__Document__c with type 'CV' and extracted data
SF-->>SF: Insert msf__Contact_Skill__c records for skills
SF-->>SF: Insert msf__Education__c records for education
SF-->>SF: Insert msf__Work_Experience__c records for work experience
SF-->>Cruits: 204 No Content
Cruits-->>SF: Request document id `service.client.query_all(f"SELECT FIELDS(ALL) FROM msf__Document__c WHERE msf__Contact__c= '{target_contact_id}' LIMIT 200")`
SF-->>Cruits: Return document records
Cruits-->>Cruits: Update Worker profile with document info(add sf_ref)
Cruits-->>SF: Request skills `service.client.query_all(f"SELECT FIELDS(ALL) FROM msf__Contact_Skill__c WHERE msf__Contact__c= '{target_contact_id}' LIMIT 200")`
SF-->>Cruits: Return skill records
Cruits-->>Cruits: Update Worker profile with skills
Cruits-->>SF: Request education `service.client.query_all(f"SELECT FIELDS(ALL) FROM msf__Education__c WHERE msf__Contact__c= '{target_contact_id}' LIMIT 200")`
SF-->>Cruits: Return education records
Cruits-->>Cruits: Update Worker profile with education
Cruits-->>SF: Request work experience `service.client.query_all(f"SELECT FIELDS(ALL) FROM msf__Work_Experience__c WHERE msf__Contact__c= '{target_contact_id}' LIMIT 200")`
SF-->>Cruits: Return work experience records
Cruits-->>Cruits: Update Worker profile with work experience
Cruits-->>Worker: Return success response
else ContactId missing/invalid
SF-->>Cruits: 400/404 Error
Cruits-->>Worker: Return error response
end