diff --git a/src/backend/api/Fusion.Resources.Api/Controllers/Person/ApiModels/ApiPersonAllocationRequestStatus.cs b/src/backend/api/Fusion.Resources.Api/Controllers/Person/ApiModels/ApiPersonAllocationRequestStatus.cs index 32b6319eb..24c3c6058 100644 --- a/src/backend/api/Fusion.Resources.Api/Controllers/Person/ApiModels/ApiPersonAllocationRequestStatus.cs +++ b/src/backend/api/Fusion.Resources.Api/Controllers/Person/ApiModels/ApiPersonAllocationRequestStatus.cs @@ -2,7 +2,19 @@ { public class ApiPersonAllocationRequestStatus { + /// + /// Should the request be auto approved? + /// public bool AutoApproval { get; set; } + + /// + /// Applicable manager for the user. This is based on who is set as manager in Entra ID. + /// public ApiPerson? Manager { get; set; } + + /// + /// The relevant org unit requests should be assigned to. + /// + public Services.LineOrg.ApiModels.ApiOrgUnit? RequestOrgUnit { get; set; } } } \ No newline at end of file diff --git a/src/backend/api/Fusion.Resources.Api/Controllers/Person/PersonController.cs b/src/backend/api/Fusion.Resources.Api/Controllers/Person/PersonController.cs index 4753d1665..375f99242 100644 --- a/src/backend/api/Fusion.Resources.Api/Controllers/Person/PersonController.cs +++ b/src/backend/api/Fusion.Resources.Api/Controllers/Person/PersonController.cs @@ -15,6 +15,7 @@ using Fusion.AspNetCore.OData; using Microsoft.VisualBasic; using NodaTime.TimeZones; +using Fusion.Services.LineOrg.ApiModels; namespace Fusion.Resources.Api.Controllers { @@ -327,10 +328,13 @@ public async Task> GetPersonReque var autoApproval = await DispatchAsync(new Domain.Queries.GetPersonAutoApprovalStatus(user.azureId)); var manager = await DispatchAsync(new Domain.Queries.GetResourceOwner(user.azureId)); + var orgUnit = await DispatchAsync(new ResolveLineOrgUnit(user.fullDepartment)); + return new ApiPersonAllocationRequestStatus { AutoApproval = autoApproval.GetValueOrDefault(false), - Manager = manager is not null ? new ApiPerson(manager) : null + Manager = manager is not null ? new ApiPerson(manager) : null, + RequestOrgUnit = orgUnit }; }