This commit is contained in:
Ross
2022-01-15 08:45:43 +00:00
parent 2040499145
commit 85c1344737
6 changed files with 305 additions and 197 deletions
+17 -7
View File
@@ -2,28 +2,36 @@ import datetime
from collections import defaultdict
# from shifts import RotaBuilder, days, sites
import uuid
class Worker:
def __init__(
self,
Rota,
id,
name,
site,
grade,
fte=100,
grade: int,
id=None,
fte: int = 100,
nwd=None,
end_date=None,
oop=None,
not_available_to_work=None,
pref_not_to_work=None,
work_requests=None,
proc_site="plymouth", # We set a default proc_site
previous_shifts={},
pair=0,
proc_site: str = "plymouth", # We set a default proc_site
previous_shifts: dict = {},
shift_balance_extra: dict = {},
bank_holiday_extra: int = 0,
pair: int = 0,
):
self.id = id
# We can either have a user generated ID
if id is not None:
self.id = id
else:
self.id = uuid.uuid4()
self.name = name
self.site = site
# Grade are equivalent to roles, by keeping them integer defining model
@@ -33,6 +41,8 @@ class Worker:
self.nwd = nwd
self.proportion_rota_to_work = 1
self.pair = pair
self.shift_balance_extra = shift_balance_extra
self.bank_holiday_extra = bank_holiday_extra
self.proc_site = proc_site
if proc_site == "plymouth" or proc_site == "":