промежуточный коммит
Tests / frontend-test (pull_request) Successful in 47s
Tests / backend-test (pull_request) Successful in 1m34s

This commit is contained in:
gorbenko.pavel
2026-08-26 17:17:47 +05:00
parent 19a46b0df8
commit 874e41990c
12 changed files with 640 additions and 3 deletions
@@ -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,