Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/workday-manage…
Browse files Browse the repository at this point in the history
…r-structure-support
  • Loading branch information
HansDahle committed Nov 18, 2024
2 parents 001c014 + 32fba0c commit e099980
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:
$settings = @{
clientId = "${{ parameters.clientId }}"
departmentFilter = "PRD"
departmentFilter = ""
projectTypeFilter = "PRD"
secretIds = @{
clientSecret = "https://$envVaultName.vault.azure.net:443/secrets/AzureAd--ClientSecret"
Expand Down
2 changes: 1 addition & 1 deletion pipelines/templates/deploy-summary-function-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
$settings = @{
clientId = "${{ parameters.clientId }}"
departmentFilter = "PRD"
departmentFilter = ""
projectTypeFilter = "PRD"
secretIds = @{
clientSecret = Get-SecretsId -secret AzureAd--ClientSecret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class OrgUnits
public string? FullDepartment { get; set; }
public string? SapId { get; set; }
public Management Management { get; set; }
public int Level { get; set; }
}

public class Management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task RunAsync(
// Fetch all departments
var departments = (await lineOrgApiClient.GetOrgUnitDepartmentsAsync())
.DistinctBy(d => d.SapId)
.Where(d => d.FullDepartment != null && d.SapId != null);
.Where(d => d.FullDepartment != null && d.SapId != null)
.Where(d => d.Level >= 4);

if (_departmentFilter.Length != 0)
departments = departments.Where(d => _departmentFilter.Any(df => d.FullDepartment!.Contains(df)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async Task SendResourceOwnersToQueue(ServiceBusSender sender, int totalB
// Query departments from LineOrg
var departments = (await _lineOrgClient.GetOrgUnitDepartmentsAsync())
.Where(d => d.FullDepartment != null) // Exclude departments with blank department name
.Where(d => d.FullDepartment.Contains("PRD"))
.Where(d => d.Level >= 4) // Only include departments of level 4 and up
.Where(x => x.Management?.Persons.Length > 0) // Exclude departments with no receivers
.ToList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0"/>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0"/>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.16.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Fusion.Resources.Functions.Common\Fusion.Resources.Functions.Common.csproj" />
Expand Down

0 comments on commit e099980

Please sign in to comment.