using GB5Shared.DTO.Framework.Login; using RecruitmentDAL.DTO.Referral; using System.Threading; using System.Threading.Tasks; namespace RecruitmentBLL.Referral { public interface IReferralBLL { Task GetReferral(int ReferralId, LoginDTO LoginDTO, CancellationToken ct); // "My referrals" — one referring employee's own referral history, newest first. Task GetSelectListReferral(int ReferringEmployeeId, LoginDTO LoginDTO, CancellationToken ct); // Full entity save (create/update). CandidateId must already resolve to an existing, // active Candidate — see ReferralDTO's class doc comment for why this BLL does not create // the Candidate inline (mirrors BgVerificationBLL taking an existing ApplicationId rather // than creating an Application inline). The caller (an employee submitting a referral) // resolves/creates the Candidate first via the existing Candidate/GetCandidateByEmail + // Candidate/SaveCandidate endpoints. Task SaveReferral(ReferralDTO ReferralDTO, LoginDTO LoginDTO, CancellationToken ct); Task DeleteReferral(int ReferralId, LoginDTO LoginDTO, CancellationToken ct); // Manual admin action — moves BonusStatus Eligible -> Paid (stamps PayoutDate) or -> // Forfeited (or any other explicit admin-driven transition). No payroll integration here; // out of scope for this pass (see IReferralBLL's own class-level scope note in // ReferralBLL.cs). Task UpdateReferralBonusStatus(UpdateReferralBonusStatusDTO UpdateReferralBonusStatusDTO, LoginDTO LoginDTO, CancellationToken ct); // The Recruitment Phase 6 "genuine Hired" hook — called from // ApplicationBLL.SaveApplicationStageHistory when the stage a candidate just entered is // the module's Terminal+Hired category (see CandidateConversionBLL's class doc comment for // that structural signal) AND this specific stage-history row's Outcome is Passed. Looks // up the Candidate's still-Pending Referral row (if any) and flips it to Eligible. A // no-op (not an error) when the Candidate has no Referral row, or its Referral is already // past Pending (Eligible/Paid/Forfeited) — this hook can legitimately run more than once // for the same Application (e.g. a stage-history correction) and must stay idempotent. Task MarkEligibleOnHireAsync(int CandidateId, LoginDTO LoginDTO, CancellationToken ct); } }