Recruitment and staffing
Recruitment and staffing is the HR workflow for turning an approved workforce need into a filled role. It connects capacity and budget planning with requisitions, public or internal job openings, applicant review, interviews, offers, appointment letters, and the later employee record described in Employee lifecycle and HR records. It also records where candidates came from so hiring results can be assessed.
Workforce demand
Workforce demand is expressed as a time-bounded plan for a company and its department. A staffing plan records the desired number of vacancies and the estimated cost for each designation. It also compares planned vacancies with active employees and open job openings. The plan is checked against overlapping plans and company hierarchies so subsidiary plans do not exceed the capacity or budget set by a parent plan. (hrms/…/staffing_plan.json• L8-91, hrms/…/staffing_plan.py• L42-224)
The plan can take positions and expected compensation from job requisitions. This makes the requisition a practical request for a hiring need while the staffing plan remains the control point for the total number of roles and planned cost. Requisitions accept only non-negative position counts and expected compensation. (hrms/…/staffing_plan.py• L226-248, hrms/…/job_requisition.json• L37-200)
Staffing plan
The staffing plan is the approved capacity view for a company, date range, designation, vacancies, and budget. A staffing plan detail is one designation line within that plan. Openings and offers can use the active plan to prevent hiring beyond the planned positions. (hrms/…/staffing_plan.json• L23-91, hrms/…/staffing_plan_detail.json• L17-70, hrms/…/job_offer.py• L207-217)
References: hrms/…/staffing_plan.json• L23-91 hrms/…/staffing_plan_detail.json• L17-70 hrms/…/job_offer.py• L207-217
Job requisition
A job requisition is a request to fill one or more positions. It identifies the requesting employee, company, department, designation, expected compensation, job description, reason, and target date. Its status shows whether the request is pending, approved, rejected, filled, on hold, or cancelled. A filled requisition records the time from posting to completion. (hrms/…/job_requisition.json• L38-200, hrms/…/job_requisition.py• L39-57)
The requisition can be converted into a job opening. That relationship carries the designation, department, position count, description, and expected compensation into the opening. An existing opening can also be associated with the requisition, which links the records and aligns the opening's vacancy count with the requested positions. (hrms/…/job_requisition.py• L59-98)
References: hrms/…/job_requisition.json• L38-200 hrms/…/job_requisition.py• L39-119
Job openings
A job opening is the active hiring demand that candidates can apply for. It defines the role, company, department, employment type, location, description, pay range, and number of vacancies. It can be tied to a staffing plan or job requisition, which lets the system compare open demand with planned capacity. (hrms/…/job_opening.json• L50-284)
An opening has an open or closed state. When it is published, the public jobs area exposes only open openings and supports search, filters, sorting, pagination, and optional display of application counts, salary ranges, and closing dates. An opening can close on its closing date, and closing it can complete its linked requisition. (hrms/…/job_opening.py• L65-92, hrms/…/job_opening.py• L152-180, hrms/…/index.py• L25-71)
Job opening templates provide reusable role and pay details. They help create consistent postings without changing the meaning of the opening itself. (hrms/…/job_opening_template.json• L27-113)
The relationship between demand planning and hiring is shown below.
flowchart LR
SP[Staffing plan] --> JR[Job requisition]
JR --> JO[Job opening]
SP --> JO
JO --> JA[Job applicant]
JO --> WEB[Published jobs page]
WEB --> JA
JO -->|closed| FILLED[Requisition marked filled]
References: hrms/…/job_opening.json• L50-284 hrms/…/job_opening.py• L65-180 hrms/…/job_opening_template.json• L27-113 hrms/…/index.py• L25-109
Applicant evaluation
Applicant evaluation tracks a person against a specific opening. A job applicant record holds contact details, the applied opening, designation, resume or resume link, cover letter, salary expectation, rating, status, source, and any employee referral. The main statuses move from open or replied through shortlisted or hold to accepted or rejected. The applicant record also acts as the starting point for interview scheduling and interview progress review. (hrms/…/job_applicant.json• L43-214, hrms/…/job_applicant.js• L66-143)
Applications may come from the published jobs page or from an employee referral. Web applications without a source receive the website listing source. The system can block applications for closed openings and can block a second application for the same opening when that opening enables duplicate prevention. (hrms/…/job_applicant.py• L67-108)
Interview rounds
An interview is a scheduled evaluation round for one applicant. An interview type defines the round, its expected rating, its expected skills, its designation scope, and its usual interviewers. The applicant record can create or schedule a round with its date, time, and interviewers, while the selected interview type supplies the usual interviewer group. Interview feedback records the result and skill ratings from an assigned interviewer. Submitted feedback updates the interview's average rating. (hrms/…/interview_type.json• L23-69, hrms/…/interview.json• L35-194, hrms/…/interview_feedback.json• L25-123, hrms/…/interview_feedback.py• L34-100, hrms/…/job_applicant.py• L188-259)
An interview must end in a cleared or rejected result before it can be submitted. A submitted result can prompt an update of the applicant to accepted or rejected. The workflow prevents the same applicant from completing the same interview type twice and prevents duplicate feedback from one interviewer for one interview. (hrms/…/interview.py• L46-108, hrms/…/interview_feedback.py• L46-75)
The interview flow also keeps participants informed when schedules change or when feedback is due. Reschedule notices go to the interview participants, while scheduled reminders and feedback reminders use the hiring notification settings. Interviews are also available as calendar events for planning. The applicant-status action handles missing or invalid applicant references as a user-facing failure instead of exposing a low-level error. (hrms/…/interview.py• L110-151, hrms/…/interview.py• L228-249, hrms/…/interview.py• L252-341, hrms/…/interview.py• L408-474)
The applicant form also shows a summary of scheduled and completed interviews. When an applicant is evaluated, the records relate in this order:
- The applicant supplies the opening and role context.
- An interview type supplies the expected skills and interviewer group.
- The interview records the time, status, and assigned interviewers.
- Interviewers submit feedback with a result and skill ratings.
- The interview average and, when selected, the applicant status reflect the result.
References: hrms/…/job_applicant.js• L119-143 hrms/…/job_applicant.py• L188-282 hrms/…/interview.json• L35-194 hrms/…/interview.py• L46-108 hrms/…/interview.py• L110-176 hrms/…/interview.py• L179-221 hrms/…/interview.py• L224-249 hrms/…/interview.py• L252-341 hrms/…/interview.py• L344-375 hrms/…/interview.py• L408-474 hrms/…/interview_feedback.json• L25-123 hrms/…/interview_feedback.py• L34-106 hrms/…/test_interview.py• L35-119 hrms/…/test_interview.py• L220-248
Offers and appointment letters
A job offer turns a hiring decision into a formal offer for a candidate. It can link to a job applicant, or it can be created directly with the candidate's name and email when no applicant record exists. It records the role, joining date, compensation, leave and holiday details, employment policy, response status, and offer terms. An active offer is unique by applicant email, while rejected or cancelled offers do not block a later offer. (hrms/…/job_offer.json• L81-142, hrms/…/job_offer.json• L198-417, hrms/…/job_offer.py• L151-166)
The offer uses a salary structure to present a compensation plan when one is selected. Its component rows show the per-cycle and yearly amounts, while summary rows show gross pay, total cost to company, and take-home pay. The same calculation builds a prospective employee and salary assignment, so the formal offer can agree with the payroll setup that will support the employee later. The offer can calculate from base and variable pay or solve for a base pay that reaches a target total cost to company; if the structure cannot produce the exact target, the offer records the closest result. (hrms/…/job_offer.py• L296-322, hrms/…/job_offer.py• L367-467, hrms/…/job_offer.js• L263-334, hrms/…/job_offer.js• L368-397, hrms/…/job_offer.json• L213-295)
The offer also derives leave allocations from a leave policy and summarizes weekly offs and public holidays from a holiday list. Working hours are calculated from the offer's start and end times, including shifts that cross midnight. These values carry the planned work conditions into the candidate's offer and later appointment document. (hrms/…/job_offer.py• L118-149, hrms/…/job_offer.py• L504-546, hrms/…/job_offer.js• L399-455, hrms/…/test_job_offer.py• L731-826)
The offer can retain a total cost to company value without a salary structure, but it cannot calculate a component break-up until the structure and calculation basis are available. Regional rules can also leave selected employer contributions out of the candidate-facing break-up while marking the total as including statutory contributions. (hrms/…/job_offer.json• L243-295, hrms/…/job_offer.py• L367-406)
When the submitted offer is sent to the applicant, its status moves to awaiting response. Accepted or rejected offer status updates the linked applicant. An accepted offer can map to an employee even when the offer was created without a job applicant. The employee handoff carries the candidate's identity and keeps the offer as the hiring source. (hrms/…/job_offer.py• L96-116, hrms/…/job_offer.py• L219-241, hrms/…/job_offer.py• L274-293, hrms/…/job_offer.js• L150-207, hrms/…/test_job_offer.py• L97-259)
Offer term templates provide reusable sets of offer terms. The offer still carries the terms used for that specific candidate, so a later template change does not define the candidate's record. (hrms/…/job_offer.js• L56-67, hrms/…/job_offer.json• L418-434, hrms/…/job_offer_term_template.json• L9-25)
An appointment letter is the formal joining document based on a job offer. It takes the offer's role, pay, leave, probation, notice, and other terms into a letter body, then adds the company, joining date, address, employee, shift, and working hours as available. A template supplies the body and placeholders are replaced when the letter is printed. Placeholder values are escaped, and template code is treated as text rather than executed. The letter can be previewed and emailed to the candidate, which makes it the bridge from recruitment records to the employee record and onboarding work described in Employee lifecycle and HR records. (hrms/…/appointment_letter.json• L46-210, hrms/…/appointment_letter.py• L57-139, hrms/…/appointment_letter.js• L20-124, hrms/…/test_appointment_letter.py• L94-152)
The offer and appointment stage connects the hiring decision to employee creation.
sequenceDiagram
participant A as Job applicant or candidate
participant O as Job offer
participant L as Appointment letter
participant E as Employee record
A->>O: Offer prepared
O->>O: Terms and response status recorded
O->>A: Accepted or rejected status applied when linked
O->>E: Accepted offer mapped to employee
O->>L: Appointment letter prepared from offer
L->>E: Appointment details support onboarding
References: hrms/…/job_applicant.js• L87-115 hrms/…/job_applicant.py• L119-160 hrms/…/job_offer.py• L84-166 hrms/…/job_offer.py• L168-241 hrms/…/job_offer.py• L274-293 hrms/…/job_offer.py• L296-467 hrms/…/job_offer.js• L150-207 hrms/…/job_offer.js• L208-334 hrms/…/job_offer.json• L213-295 hrms/…/job_offer.json• L418-434 hrms/…/test_job_offer.py• L97-259 hrms/…/appointment_letter.json• L46-210 hrms/…/appointment_letter.py• L57-139 hrms/…/appointment_letter.js• L20-124 hrms/…/test_appointment_letter.py• L94-152
Referrals and applicant sources
Applicant sources explain how a candidate entered the hiring process. A job applicant source is a named channel such as a website listing, walk-in, campaign, or employee referral. The applicant stores the source and can store the referring employee when the source is an employee referral. (hrms/…/job_applicant_source.json• L14-27, hrms/…/job_applicant.json• L83-94, hrms/setup.py• L458-462)
An employee referral is a candidate recommendation made by an active employee. It records the candidate, target designation, contact and resume details, the referrer, qualification notes, referral bonus eligibility, and payment state. Each non-cancelled referral must use a distinct candidate email. The referral moves to in process when it creates an applicant, and later applicant acceptance or rejection updates the referral status. For a submitted pending referral, the form offers actions to reject it or create the job applicant. (hrms/…/employee_referral.json• L36-202, hrms/…/employee_referral.py• L44-109, hrms/…/employee_referral.js• L4-29, hrms/…/job_applicant.py• L67-108)
Referral tracking also connects a successful referral to an additional salary record for the referrer. This keeps the hiring decision and bonus payment reference tied to the original referral. When an accepted referral is eligible for a bonus and has no submitted additional salary record, the form offers the action to create that salary record. (hrms/…/employee_referral.py• L112-124, hrms/…/employee_referral.js• L31-54, hrms/…/employee_referral.js• L66-76)
References: hrms/…/job_applicant_source.json• L14-27 hrms/…/job_applicant.json• L83-94 hrms/…/job_applicant.py• L67-108 hrms/…/employee_referral.py• L44-124 hrms/…/employee_referral.js• L4-76
Recruitment reporting
Recruitment reporting follows a hiring need from its staffing plan to job openings, applicants, and offers. Recruitment Analytics presents those relationships as a nested view with application and offer status, designation, and offer date. It can be filtered by company and an as-of date so managers can compare planned demand with current hiring progress. (hrms/…/recruitment_analytics.py• L9-18, hrms/…/recruitment_analytics.py• L69-116, hrms/…/recruitment_analytics.py• L119-204)
The recruitment area also exposes measures such as applicant-to-hire percentage, average time to fill, offer acceptance rate, open openings, and applicant counts. These measures describe movement through the funnel rather than replacing the source records. (hrms/…/job_applicant.py• L285-295, hrms/…/job_requisition.py• L101-119, hrms/…/job_offer.py• L483-501, hrms/…/recruitment_analytics.json• L7-25)
References: hrms/…/recruitment_analytics.py• L9-18 hrms/…/recruitment_analytics.py• L69-204 hrms/…/job_applicant.py• L285-295 hrms/…/job_requisition.py• L101-119 hrms/…/job_offer.py• L483-501
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the links between staffing plan capacity, requisition positions, opening vacancies, and offer vacancy checks aligned. A change in one count can silently allow hiring beyond the approved plan.
- Keep applicant status changes from interview results and offer responses aligned with referral status changes. These records represent one candidate decision in separate workflows.
- Keep published opening fields aligned with the public jobs page. Changes to visibility, filters, salary display, application counts, or routes affect the external application path.
- Keep offer compensation inputs aligned with salary structure assignment inputs. A change can make the offer's cost, gross pay, or pay break-up differ from the employee's later salary setup.
- Keep compensation display rules aligned with regional contribution rules. A hidden component must not make the displayed CTC label misstate what the total includes.
- Keep offer leave, holiday, shift, and working-hour inputs aligned with the appointment letter fields copied into candidate documents and later employee creation.
- Keep offer and appointment templates aligned with the fields copied into candidate documents and later employee creation. Template changes can change formal hiring output.
- Keep appointment letter placeholder names aligned with offer, employee, shift, and HR settings fields. A missing value changes the printed document without changing the stored letter body.
- Keep recruitment analytics joins aligned when link fields or lifecycle statuses change. The report depends on the chain from staffing plan to opening to applicant to offer.
- Keep applicant review actions aligned with interview creation, interview summaries, offer creation, and employee mapping. Changes to applicant status or linked records can leave the applicant workspace out of sync with the hiring state.
- Keep the optional applicant path in job offers aligned with email uniqueness, applicant status updates, and employee mapping. Direct offers must remain traceable even when no applicant record exists.
- Keep referral email uniqueness and active-referrer checks aligned with referral creation and applicant conversion. A referral can otherwise enter the hiring flow without a valid source record.
- Keep referral status and bonus eligibility aligned with the referral form actions. The form only exposes applicant creation for submitted pending referrals and salary creation for accepted eligible referrals without a submitted salary record.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A new opening exceeds the active staffing plan positions | The opening can represent hiring demand that the approved plan cannot support | Opening validation compares active employees and open openings with planned positions. (hrms/…/job_opening.py• L110-144) |
| A job requisition has a negative position count or expected compensation | The demand plan can contain invalid capacity or cost values | Requisition fields reject negative values. (hrms/…/job_requisition.json• L48-62) |
| A job applicant targets a closed opening | The application is rejected | Applicant creation checks the opening state before insert. (hrms/…/job_applicant.py• L78-98) |
| A duplicate application uses an opening that prevents duplicates | The second application is rejected for the same email and opening | The opening's duplicate-prevention setting is checked before insert. (hrms/…/job_applicant.py• L79-97) |
| Two submitted interviews use the same applicant and interview type | The applicant can be assessed twice for one round | Interview validation rejects a duplicate submitted round. (hrms/…/interview.py• L58-71) |
| Feedback is submitted by an unassigned interviewer or before the interview date | The feedback is rejected | Feedback validation checks interviewer assignment and scheduled date. (hrms/…/interview_feedback.py• L46-63) |
| An interview is submitted without a cleared or rejected result | The interview cannot close the evaluation round | Interview submission permits only cleared or rejected statuses. (hrms/…/interview.py• L50-56) |
| An interview-result action has no valid applicant reference | The applicant status remains unchanged and the action reports a failure | The status action checks the reference and catches update errors. (hrms/…/interview.py• L228-249) |
| A second active job offer uses the same applicant email | The candidate has conflicting live offers | Job offer validation permits only one non-rejected and non-cancelled offer for an email. (hrms/…/job_offer.py• L151-166) |
| An offer uses a staffing plan with no available vacancy while vacancy checks are enabled | The offer cannot be submitted against the approved plan | Offer validation counts submitted offers for the designation and plan period. (hrms/…/job_offer.py• L207-217) |
| An interview type does not match the applicant's designation | The interview cannot be created or scheduled | Applicant interview actions check the designation scope of the interview type. (hrms/…/job_applicant.py• L195-202, hrms/…/job_applicant.py• L232-237) |
| A referral uses an email already used by another non-cancelled referral or names an inactive referrer | The referral cannot be saved, so the candidate cannot enter the referral path | Referral validation checks candidate email uniqueness and referrer activity. (hrms/…/employee_referral.py• L44-60) |
| An accepted bonus-eligible referral already has a submitted additional salary record | The form does not offer another salary record for the same referral | The referral form checks for a submitted linked additional salary before showing the creation action. (hrms/…/employee_referral.js• L31-54) |
| A compensation target cannot be produced exactly by the selected salary structure | The offer's displayed CTC differs from the requested target | Compensation calculation resolves the nearest supported base and marks the CTC as adjusted. (hrms/…/job_offer.py• L429-467, hrms/…/job_offer.js• L311-334) |
| An offer email is not addressed to the applicant | The submitted offer remains ready to send instead of awaiting response | Communication handling checks the recipient email before changing the status. (hrms/…/job_offer.py• L102-116) |
| A letter body contains template code or an unsafe placeholder value | The printed letter could execute code or show unescaped content | Appointment-letter rendering replaces escaped placeholders as text and does not execute template code. (hrms/…/appointment_letter.py• L86-94, hrms/…/test_appointment_letter.py• L142-152) |
| A selected shift crosses midnight or the employee has a dated shift assignment | The appointment letter can show incorrect working hours or schedule details | Working-hour calculation wraps across midnight and shift lookup selects the active assignment for the appointment date. (hrms/…/job_offer.py• L128-144, hrms/…/appointment_letter.py• L74-84, hrms/…/appointment_letter.py• L142-158) |
Key files
| File | Why to read it |
|---|---|
| hrms/…/staffing_plan.py | Shows how approved vacancies and budget relate to company hierarchy, current employees, openings, and requisitions. |
| hrms/…/job_requisition.py | Shows the request-to-opening transition, opening association, and time-to-fill measure. |
| hrms/…/job_opening.py | Shows opening lifecycle, staffing-plan checks, public posting behavior, and requisition completion. |
| hrms/…/index.py | Shows the public job search and application entry surface. |
| hrms/…/job_applicant.py | Shows applicant validation, interview scheduling, employee mapping, and applicant status measures. |
| hrms/…/job_applicant.js | Shows the applicant workspace actions for review, interview scheduling, offer creation, and employee handoff. |
| hrms/…/interview.py | Shows interview rounds, results, schedule notices, reminders, feedback, and applicant status updates. |
| hrms/…/test_interview.py | Shows the guarantees around interview scheduling, notifications, feedback summaries, status updates, and invalid status-update input. |
| hrms/…/interview_feedback.py | Shows interviewer checks and how feedback ratings roll up to the interview. |
| hrms/…/job_offer.py | Shows offer status, vacancy checks, compensation calculation, leave and holiday setup, working hours, regional contribution display, applicant updates, duplicate-offer rules, and employee creation handoff. |
| hrms/…/job_offer.js | Shows offer letter actions, compensation presentation, candidate-facing email, leave and holiday details, working-hour calculation, and employee mapping. |
| hrms/…/job_offer.json | Shows the role, compensation, work conditions, terms, and offer-letter fields captured for each offer. |
| hrms/…/test_job_offer.py | Shows coverage for direct offers, compensation, work conditions, rejected and re-offered candidates, and offer-to-employee mapping. |
| hrms/…/appointment_letter.py | Shows how an appointment letter obtains offer details, shift details, template content, and safe placeholder output. |
| hrms/…/appointment_letter.js | Shows appointment letter preview, template selection, and email actions. |
| hrms/…/test_appointment_letter.py | Shows guarantees for template selection, placeholder rendering, escaped output, and working-hour text. |
| hrms/…/employee_referral.py | Shows the referral-to-applicant path, referral validation, and referral bonus handoff. |
| hrms/…/employee_referral.js | Shows when the referral form exposes applicant creation, rejection, and additional-salary actions. |
| hrms/…/recruitment_analytics.py | Shows how the hiring funnel is joined for management reporting. |