-
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.
Browse files
Browse the repository at this point in the history
Co-authored-by: md <[email protected]>
- Loading branch information
Showing
7 changed files
with
38 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
using Api.StaffingController; | ||
using Core.Absences; | ||
using Core.Agreements; | ||
using Core.Consultants; | ||
using Core.Customers; | ||
using Core.DomainModels; | ||
|
@@ -57,39 +56,16 @@ public void AvailabilityCalculation( | |
Consultants = Substitute.For<List<Consultant>>() | ||
}; | ||
|
||
var customer = new Customer | ||
{ | ||
Id = 1, | ||
Name = "TestCustomer", | ||
Organization = org, | ||
Projects = new List<Engagement>() | ||
}; | ||
|
||
var engagement = new Engagement | ||
{ | ||
Id = 1, | ||
Customer = customer, | ||
State = EngagementState.Order, | ||
IsBillable = true, | ||
Staffings = new List<Staffing>(), | ||
Name = "TestProject", | ||
|
||
}; | ||
|
||
customer.Projects.Add(engagement); | ||
|
||
Consultant consultant = new() | ||
{ | ||
Id = 1, | ||
Name = "Test Variant", | ||
Email = "[email protected]", | ||
GraduationYear = 2010, | ||
Department = department, | ||
Projects = new List<Engagement>() | ||
Department = department | ||
}; | ||
|
||
consultant.Projects.Add(engagement); | ||
|
||
var mondayDateOnly = numberOfHolidays switch | ||
{ | ||
0 => new DateOnly(2023, 9, 4), // Week 36, 4th Sept 2023, (no public holidays) | ||
|
@@ -100,17 +76,12 @@ public void AvailabilityCalculation( | |
}; | ||
|
||
var week = Week.FromDateOnly(mondayDateOnly); | ||
|
||
|
||
|
||
Agreement agreement = new() | ||
{ | ||
Id = 1, | ||
EndDate = new DateTime(2023, 12, 31), | ||
StartDate = new DateTime(2023, 1, 1), | ||
EngagementId = 1, | ||
Engagement = engagement, | ||
}; | ||
var project = Substitute.For<Engagement>(); | ||
var customer = Substitute.For<Customer>(); | ||
customer.Name = "TestCustomer"; | ||
project.Customer = customer; | ||
project.State = EngagementState.Order; | ||
project.IsBillable = true; | ||
|
||
|
||
// TODO: Change this to update consultant data | ||
|
@@ -137,11 +108,11 @@ public void AvailabilityCalculation( | |
if (staffedHours > 0) | ||
consultant.Staffings.Add(new Staffing | ||
{ | ||
Engagement = engagement, | ||
Engagement = project, | ||
Consultant = consultant, | ||
Hours = staffedHours, | ||
Week = week, | ||
EngagementId = engagement.Id, | ||
EngagementId = project.Id, | ||
ConsultantId = consultant.Id | ||
}); | ||
|
||
|
@@ -191,12 +162,9 @@ public void MultiplePlannedAbsences() | |
Name = "Test Variant", | ||
Email = "[email protected]", | ||
GraduationYear = 2010, | ||
Department = department, | ||
Projects = new List<Engagement>() | ||
Department = department | ||
}; | ||
|
||
consultant.Projects.Add(Substitute.For<Engagement>()); | ||
|
||
var week = new Week(2000, 1); | ||
|
||
consultant.PlannedAbsences.Add(new PlannedAbsence | ||
|
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