промежуточный коммит
This commit is contained in:
@@ -32,6 +32,18 @@ public sealed class HttpTnsuPortalClient(
|
||||
return new EmployeeLookupResult(employee is not null, employee?.Email, employee?.Fio);
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<EmployeeContactInfo>> GetAllEmployeesAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var employees = await GetAsync<List<EmployeeResponse>>("/Employee/All", cancellationToken);
|
||||
if (employees is null)
|
||||
return [];
|
||||
|
||||
return employees
|
||||
.Where(e => !string.IsNullOrWhiteSpace(e.Fio))
|
||||
.Select(e => new EmployeeContactInfo(e.Id, e.Fio!, e.Email, e.Company ?? string.Empty))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public async Task<string?> GetManagerAsync(string email, string managerType, CancellationToken cancellationToken)
|
||||
{
|
||||
var manager = await GetAsync<ManagerResponse>(
|
||||
@@ -40,6 +52,18 @@ public sealed class HttpTnsuPortalClient(
|
||||
return manager?.ManagerEmail;
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<EmployeeFullBaseInfo>> GetFullBaseAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var employees = await GetAsync<List<FullBaseResponse>>("/Employee/FullBase", cancellationToken);
|
||||
if (employees is null)
|
||||
return [];
|
||||
|
||||
return employees
|
||||
.Where(e => !string.IsNullOrWhiteSpace(e.Fio))
|
||||
.Select(e => new EmployeeFullBaseInfo(e.Id, e.Fio!, e.Company ?? string.Empty, e.DismissalDate))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<ProjectExecutorInfo>> GetProjectExecutorsAsync(Guid projectId, CancellationToken cancellationToken)
|
||||
{
|
||||
var project = await GetAsync<ProjectResponse>($"/Project/{projectId}", cancellationToken);
|
||||
@@ -100,6 +124,12 @@ public sealed class HttpTnsuPortalClient(
|
||||
private sealed record ManagerResponse(
|
||||
[property: JsonPropertyName("managerEmail")] string? ManagerEmail);
|
||||
|
||||
private sealed record FullBaseResponse(
|
||||
[property: JsonPropertyName("id")] Guid? Id,
|
||||
[property: JsonPropertyName("fio")] string? Fio,
|
||||
[property: JsonPropertyName("company")] string? Company,
|
||||
[property: JsonPropertyName("dismissalDate")] DateTimeOffset? DismissalDate);
|
||||
|
||||
private sealed record ProjectResponse(
|
||||
[property: JsonPropertyName("projectManager")] string? ProjectManager,
|
||||
[property: JsonPropertyName("planner")] string? Planner,
|
||||
|
||||
Reference in New Issue
Block a user