This commit is contained in:
Ross
2023-01-23 14:37:09 +00:00
parent aaa10d5fb8
commit 0179ed410a
8 changed files with 961 additions and 32 deletions
+5 -1
View File
@@ -128,7 +128,10 @@ class Worker(BaseModel):
self.calculated_start_date = Rota.start_date
else:
# ? test if start date is valid
self.calculated_start_date = self.start_date
if self.start_date < Rota.start_date:
self.calculated_start_date = self.start_date
else:
self.calculated_start_date = self.start_date
if self.end_date is None:
self.calculated_end_date = Rota.rota_end_date
@@ -271,6 +274,7 @@ class Worker(BaseModel):
self.fte_adj = 0
if days_to_work > 0 and (days_to_work - len(unavailable_set)) / days_to_work < 0.3:
console.print(f"{ self.name }: {days_to_work}, {Rota.rota_days_length}")
console.print(f"Warning {self.name} has excessive unavailability [{len(unavailable_set)}/{days_to_work}, adjusted fte={self.fte_adj}] (this may be infeasible)", style="red")
def __lt__(self, other) -> bool: