numerous improvemts

This commit is contained in:
Ross
2025-06-08 14:00:15 +01:00
parent ad75b6b8b5
commit d7e5f9e5f1
6 changed files with 331 additions and 80 deletions
+8
View File
@@ -111,6 +111,9 @@ class Worker(BaseModel):
bank_holiday_extra: int = 0
pair: int | str | None = None
locum: bool = False
allowed_multi_shift_sets: list[set] = [] # or list/set of frozensets
prefer_multi_shift_together: int = 0 # Default: no preference
# Set to a positive integer to prefer, negative to discourage, 0 for neutral
shift_fte_overrides: dict[str, int] = {} # Need checks to ensure shifts exist
@@ -389,3 +392,8 @@ class Worker(BaseModel):
if shift in self.fte_adj_shifts:
return self.fte_adj_shifts[shift]
return self.fte_adj
def allow_shifts_together(self, *shifts):
if not hasattr(self, "allowed_multi_shift_sets"):
self.allowed_multi_shift_sets = []
self.allowed_multi_shift_sets.append(frozenset(shifts))