уточнил недостающие данные

This commit is contained in:
gorbenko.pavel
2026-08-19 11:14:49 +05:00
parent 58c27b2aa5
commit ef4325921b
6 changed files with 15 additions and 8 deletions
@@ -25,12 +25,12 @@ public sealed class HttpTnsuPortalClient(
return new EmployeeDirectoryInfo(employee.CompanyId ?? Guid.Empty, employee.DepartmentId, employee.Company ?? string.Empty, employee.Position);
}
public async Task<string?> GetEmployeeByPositionAsync(string position, string company, CancellationToken cancellationToken)
public async Task<EmployeeLookupResult> GetEmployeeByPositionAsync(string position, string company, CancellationToken cancellationToken)
{
var employee = await GetAsync<EmployeeResponse>(
$"/Employee/ByPosition?position={Uri.EscapeDataString(position)}&company={Uri.EscapeDataString(company)}", cancellationToken);
return employee?.Email;
return new EmployeeLookupResult(employee is not null, employee?.Email, employee?.Fio);
}
public async Task<string?> GetManagerAsync(string email, string managerType, CancellationToken cancellationToken)
@@ -107,7 +107,8 @@ public sealed class HttpTnsuPortalClient(
[property: JsonPropertyName("company")] string? Company,
[property: JsonPropertyName("companyId")] Guid? CompanyId,
[property: JsonPropertyName("departmentId")] Guid? DepartmentId,
[property: JsonPropertyName("position")] string? Position);
[property: JsonPropertyName("position")] string? Position,
[property: JsonPropertyName("fio")] string? Fio);
private sealed record ManagerResponse(
[property: JsonPropertyName("managerEmail")] string? ManagerEmail);