using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using RecruitmentDAL.DTO.Candidate; using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace RecruitmentDAL.CustomeCode.Candidate { public interface ICandidateDAL { Task GetCandidate(int CandidateId, LoginDTO LoginDTO, CancellationToken ct); // Paged — the candidate pool is expected to grow large and is never manually pruned // (unlike most GetSelectList master-data lists in this module), so this always goes // through IQueryExecutor.QueryPagedAsync rather than an unbounded QueryAsync. // FirstNumber/MaxResult follow the same naming as GetSelectListMeter/GetSelectListAction/ // GetSelectListProblem elsewhere in the repo (1-based row start, page row count). Task GetSelectListCandidate(int FirstNumber, int MaxResult, CriteriaDTO CriteriaDTO, LoginDTO LoginDTO, CancellationToken ct); // Bridge query for gb4.7mfe's legacy Applicant dashboard — see CandidateQB.GET_CURRENT_STAGE_BY_EMAIL. Task GetCurrentStageByEmail(IEnumerable Emails, LoginDTO LoginDTO, CancellationToken ct); // Duplicate-applicant lookup for the public career-site apply flow — see // CandidateQB.GET_CANDIDATE_BY_EMAIL. Returns JSON "null" when no active Candidate // exists for this email/tenant. Task GetCandidateByEmail(string Email, LoginDTO LoginDTO, CancellationToken ct); // Internal-mobility dedup lookup for RecruitmentBLL.CandidateConversion. // EmployeeToInternalCandidateBLL — see CandidateQB.GET_CANDIDATE_BY_EMPLOYEEID. Returns // JSON "null" when no active InternalEmployee-type Candidate exists for this employee/tenant. Task GetCandidateByEmployeeId(int EmployeeId, LoginDTO LoginDTO, CancellationToken ct); // Transactional write overloads — called from BaseEntityAppService.ExecuteSaveAsync's // persistFunc so the save participates in the single pipeline transaction. Task SaveCandidate(CandidateDTO CandidateDTO, LoginDTO LoginDTO, DbTransaction tx, CancellationToken ct); Task UpdateCandidate(CandidateDTO CandidateDTO, LoginDTO LoginDTO, DbTransaction tx, CancellationToken ct); Task DeleteCandidate(int CandidateId, LoginDTO LoginDTO, CancellationToken ct); // Standalone, non-transactional follow-up update — see CandidateQB.UPDATE_CANDIDATE_EMPLOYEEID // doc comment. Called from CandidateConversionBLL once the Candidate->Employee conversion's // SaveEmployee call has committed, independent of both the Candidate entity's own // ExecuteSaveAsync transaction and PayRoll's own Employee-save transaction. Task UpdateCandidateEmployeeId(int CandidateId, int EmployeeId, LoginDTO LoginDTO, CancellationToken ct); } }