Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Direct requests assigned to incorrect org unit #729

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
{
public class ApiPersonAllocationRequestStatus
{
/// <summary>
/// Should the request be auto approved?
/// </summary>
public bool AutoApproval { get; set; }

/// <summary>
/// Applicable manager for the user. This is based on who is set as manager in Entra ID.
/// </summary>
public ApiPerson? Manager { get; set; }

/// <summary>
/// The relevant org unit requests should be assigned to.
/// </summary>
public Services.LineOrg.ApiModels.ApiOrgUnit? RequestOrgUnit { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Fusion.AspNetCore.OData;
using Microsoft.VisualBasic;
using NodaTime.TimeZones;
using Fusion.Services.LineOrg.ApiModels;

namespace Fusion.Resources.Api.Controllers
{
Expand Down Expand Up @@ -327,10 +328,13 @@ public async Task<ActionResult<ApiPersonAllocationRequestStatus>> 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
};
}

Expand Down
Loading