| | | 1 | | using RoleRadar.Domain.Audit; |
| | | 2 | | using RoleRadar.Domain.Tracking; |
| | | 3 | | |
| | | 4 | | namespace RoleRadar.Application.Abstractions; |
| | | 5 | | |
| | | 6 | | public interface ITrackingTransactionContext |
| | | 7 | | { |
| | | 8 | | ICompanyRepository Companies { get; } |
| | | 9 | | IPostingRepository Postings { get; } |
| | | 10 | | ICriterionRepository Criteria { get; } |
| | | 11 | | IApplicationRepository Applications { get; } |
| | | 12 | | IContactRepository Contacts { get; } |
| | | 13 | | ISearchRunRepository SearchRuns { get; } |
| | | 14 | | Task AppendAuditEntryAsync(AuditLogEntry entry, CancellationToken cancellationToken = default); |
| | | 15 | | Task<Result<bool>> UpsertNoteAsync(RoleRadar.Domain.Notes.Note note, CancellationToken cancellationToken = default) |
| | 0 | 16 | | Task.FromResult(Result<bool>.Success(true)); |
| | | 17 | | Task<Result<bool>> NoteExistsAsync(string ownerId, string title, string area, CancellationToken cancellationToken = |
| | 0 | 18 | | Task.FromResult(Result<bool>.Success(false)); |
| | | 19 | | Task<Result<Guid?>> GetNoteIdByTitleAndAreaAsync(string ownerId, string title, string area, CancellationToken cancel |
| | 0 | 20 | | Task.FromResult(Result<Guid?>.Success(null)); |
| | | 21 | | Task<Result<TResponse>> ExecuteInTransactionAsync<TResponse>( |
| | | 22 | | Func<ITrackingTransactionContext, CancellationToken, Task<Result<TResponse>>> work, |
| | | 23 | | CancellationToken cancellationToken = default) => |
| | 166 | 24 | | work(this, cancellationToken); |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | public interface ICompanyRepository |
| | | 28 | | { |
| | | 29 | | Task<Result<Company?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken = default); |
| | | 30 | | Task<Result<Company?>> GetByNormalizedNameAsync(string ownerId, string normalizedName, CancellationToken cancellatio |
| | | 31 | | Task<Result<IReadOnlyList<Company>>> ListAsync(string ownerId, CompanyStatus? status = null, CancellationToken cance |
| | | 32 | | Task<Result<IReadOnlyList<CareerSource>>> GetCareerSourcesAsync(string ownerId, Guid companyId, bool includeInactive |
| | | 33 | | Task<Result<CareerSource?>> GetCareerSourceByCompositeKeyAsync(string ownerId, Guid companyId, string atsType, strin |
| | | 34 | | Task<Result<bool>> UpsertCompanyAsync(Company company, CancellationToken cancellationToken = default); |
| | | 35 | | Task<Result<bool>> UpsertCareerSourceAsync(CareerSource careerSource, CancellationToken cancellationToken = default) |
| | | 36 | | Task<Result<TResponse>> ExecuteInTransactionAsync<TResponse>( |
| | | 37 | | Func<ITrackingTransactionContext, CancellationToken, Task<Result<TResponse>>> work, |
| | | 38 | | CancellationToken cancellationToken = default); |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | public interface IPostingRepository |
| | | 42 | | { |
| | | 43 | | Task<Result<Posting?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken = default); |
| | | 44 | | Task<Result<Posting?>> GetByDedupKeyAAsync(string ownerId, string dedupKeyA, CancellationToken cancellationToken = d |
| | | 45 | | Task<Result<Posting?>> GetByDedupKeyBAsync(string ownerId, string dedupKeyB, CancellationToken cancellationToken = d |
| | | 46 | | Task<Result<Posting?>> GetByDedupKeyCAsync(string ownerId, string dedupKeyC, CancellationToken cancellationToken = d |
| | | 47 | | Task<Result<IReadOnlyList<PostingCandidate>>> FindCandidatesByCompanyAndTitleAsync(string ownerId, Guid companyId, s |
| | | 48 | | Task<Result<IReadOnlyList<Posting>>> ListPostingsAsync(string ownerId, Guid? companyId = null, PostingDisposition? d |
| | | 49 | | Task<Result<IReadOnlyList<Posting>>> ListDecidedPostingsAsync(string ownerId, int page = 1, int pageSize = 50, Cance |
| | | 50 | | Task<Result<int>> CountPostingsAsync(string ownerId, Guid? companyId = null, PostingDisposition? disposition = null, |
| | | 51 | | Task<Result<int>> CountDecidedPostingsAsync(string ownerId, CancellationToken cancellationToken = default); |
| | | 52 | | Task<Result<bool>> UpsertPostingAsync(Posting posting, CancellationToken cancellationToken = default); |
| | | 53 | | Task<Result<bool>> AppendSignalAsync(PostingSignal signal, CancellationToken cancellationToken = default); |
| | | 54 | | Task<Result<IReadOnlyList<PostingSignal>>> GetSignalsAsync(string ownerId, Guid postingId, CancellationToken cancell |
| | | 55 | | Task<Result<ILookup<Guid, PostingSignal>>> GetSignalsForPostingsAsync(string ownerId, IEnumerable<Guid> postingIds, |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | public interface ICriterionRepository |
| | | 59 | | { |
| | | 60 | | Task<Result<Criterion?>> GetActiveByKeyAsync(string ownerId, string key, CancellationToken cancellationToken = defau |
| | | 61 | | Task<Result<Criterion?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken = default); |
| | | 62 | | Task<Result<IReadOnlyList<Criterion>>> GetEffectiveAtAsync(string ownerId, DateTimeOffset effectiveDate, Cancellatio |
| | | 63 | | Task<Result<IReadOnlyList<Criterion>>> ListActiveAsync(string ownerId, CancellationToken cancellationToken = default |
| | | 64 | | Task<Result<bool>> UpsertCriterionAsync(Criterion criterion, CancellationToken cancellationToken = default); |
| | | 65 | | } |
| | | 66 | | |
| | | 67 | | public interface IApplicationRepository |
| | | 68 | | { |
| | | 69 | | Task<Result<Domain.Tracking.Application?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken |
| | | 70 | | Task<Result<Domain.Tracking.Application?>> GetByPostingIdAsync(string ownerId, Guid postingId, CancellationToken can |
| | | 71 | | Task<Result<bool>> UpsertApplicationAsync(Domain.Tracking.Application application, CancellationToken cancellationTok |
| | | 72 | | Task<Result<bool>> AppendEventAsync(ApplicationEvent appEvent, CancellationToken cancellationToken = default); |
| | | 73 | | Task<Result<IReadOnlyList<ApplicationEvent>>> GetEventsAsync(string ownerId, Guid applicationId, CancellationToken c |
| | | 74 | | Task<Result<IReadOnlyList<Domain.Tracking.Application>>> ListApplicationsAsync(string ownerId, string? outcome = nul |
| | | 75 | | Task<Result<int>> CountApplicationsAsync(string ownerId, string? outcome = null, CancellationToken cancellationToken |
| | | 76 | | } |
| | | 77 | | |
| | | 78 | | public interface IContactRepository |
| | | 79 | | { |
| | | 80 | | Task<Result<Domain.Tracking.Contact?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken = d |
| | | 81 | | Task<Result<bool>> UpsertContactAsync(Domain.Tracking.Contact contact, CancellationToken cancellationToken = default |
| | | 82 | | Task<Result<int>> CountContactsAsync(string ownerId, bool? isRedacted = null, CancellationToken cancellationToken = |
| | | 83 | | } |
| | | 84 | | |
| | | 85 | | public interface ISearchRunRepository |
| | | 86 | | { |
| | | 87 | | Task<Result<Domain.Tracking.SearchRun?>> GetByIdAsync(string ownerId, Guid id, CancellationToken cancellationToken = |
| | | 88 | | Task<Result<Domain.Tracking.SearchRun?>> GetByStartedAtAsync(string ownerId, DateTimeOffset startedAt, CancellationT |
| | | 89 | | Task<Result<bool>> UpsertSearchRunAsync(Domain.Tracking.SearchRun searchRun, CancellationToken cancellationToken = d |
| | | 90 | | } |