-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(summary): Add more logging and other minor fixes (#701)
- [ ] New feature - [ ] Bug fix - [ ] High impact **Description of work:** Adds more logging and changes log level of some logs. Added check if the departmentFilter string is emtpy => if empty then do all departments Added departmentFilter to az sender Update if any recipients check in the sync az function **Testing:** - [ ] Can be tested - [x] Automatic tests created / updated - [x] Local tests are passing **Checklist:** - [x] Considered automated tests - [ ] Considered updating specification / documentation - [ ] Considered work items - [x] Considered security - [ ] Performed developer testing - [x] Checklist finalized / ready for review
- Loading branch information
1 parent
d334e71
commit bea5ea2
Showing
9 changed files
with
464 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/tests/Fusion.Summary.Functions.Tests/Fusion.Summary.Functions.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="6.12.1"/> | ||
<PackageReference Include="coverlet.collector" Version="6.0.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/> | ||
<PackageReference Include="xunit" Version="2.9.0"/> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Xunit"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Fusion.Summary.Functions\Fusion.Summary.Functions.csproj"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="nuget.config"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Update="nuget.config"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
</Project> |
110 changes: 110 additions & 0 deletions
110
...ts/Fusion.Summary.Functions.Tests/Notifications/Mock/NotificationReportApiResponseMock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
using Fusion.Resources.Functions.Common.ApiClients; | ||
|
||
namespace Fusion.Summary.Functions.Tests.Notifications.Mock; | ||
|
||
public abstract class NotificationReportApiResponseMock | ||
{ | ||
public static List<IResourcesApiClient.InternalPersonnelPerson> GetMockedInternalPersonnel( | ||
double personnelCount, | ||
double workload, | ||
double otherTasks, | ||
double vacationLeave, | ||
double absenceLeave) | ||
{ | ||
var personnel = new List<IResourcesApiClient.InternalPersonnelPerson>(); | ||
for (var i = 0; i < personnelCount; i++) | ||
{ | ||
personnel.Add(new IResourcesApiClient.InternalPersonnelPerson() | ||
{ | ||
EmploymentStatuses = new List<IResourcesApiClient.ApiPersonAbsence> | ||
{ | ||
new() | ||
{ | ||
Type = IResourcesApiClient.ApiAbsenceType.Vacation, | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AbsencePercentage = vacationLeave | ||
}, | ||
new() | ||
{ | ||
Type = IResourcesApiClient.ApiAbsenceType.OtherTasks, | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AbsencePercentage = otherTasks | ||
}, | ||
new() | ||
{ | ||
Type = IResourcesApiClient.ApiAbsenceType.Absence, | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AbsencePercentage = absenceLeave | ||
} | ||
}, | ||
PositionInstances = new List<IResourcesApiClient.PersonnelPosition> | ||
{ | ||
new() | ||
{ | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
Workload = workload | ||
} | ||
} | ||
} | ||
); | ||
; | ||
} | ||
|
||
return personnel; | ||
} | ||
|
||
public static List<IResourcesApiClient.InternalPersonnelPerson> GetMockedInternalPersonnelWithInstancesWithAndWithoutChanges(double personnelCount) | ||
{ | ||
var personnel = new List<IResourcesApiClient.InternalPersonnelPerson>(); | ||
for (var i = 0; i < personnelCount; i++) | ||
{ | ||
personnel.Add(new IResourcesApiClient.InternalPersonnelPerson() | ||
{ | ||
// Should return 4 instances for each person | ||
PositionInstances = new List<IResourcesApiClient.PersonnelPosition> | ||
{ | ||
new() | ||
{ | ||
// One active instance without any changes | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AllocationState = null, | ||
AllocationUpdated = null | ||
}, | ||
new() | ||
{ | ||
// One active instance that contains changes done within the last week | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AllocationState = "ChangeByTaskOwner", | ||
AllocationUpdated = DateTime.UtcNow | ||
}, | ||
new() | ||
{ | ||
// One active instance that contains changes done more than a week ago | ||
AppliesFrom = DateTime.UtcNow.AddDays(-1 - i), | ||
AppliesTo = DateTime.UtcNow.AddDays(1 + i * 10), | ||
AllocationState = "ChangeByTaskOwner", | ||
AllocationUpdated = DateTime.UtcNow.AddDays(-8) | ||
}, | ||
new() | ||
{ | ||
// One instance that will become active in more than 3 months that contains changes | ||
AppliesFrom = DateTime.UtcNow.AddMonths(4), | ||
AppliesTo = DateTime.UtcNow.AddMonths(4 + i), | ||
AllocationState = "ChangeByTaskOwner", | ||
AllocationUpdated = DateTime.UtcNow | ||
} | ||
} | ||
} | ||
); | ||
; | ||
} | ||
|
||
return personnel; | ||
} | ||
} |
Oops, something went wrong.