уточнил недостающие данные
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user