-
Notifications
You must be signed in to change notification settings - Fork 0
/
actors.py
52 lines (40 loc) · 1.3 KB
/
actors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Person:
def __init__(self, id, name):
self.name = name
self.id = id
class Child(Person):
def __init__(self, id, name, dob, child_schedule, day_rate, parent):
super().__init__(id, name)
self.dob = dob
self.child_schedule = child_schedule
self.day_rate = day_rate
self.parent = parent
self.parent.add_child(self)
# accounting - current will be calculated in get_attendance_count for
# a given month
self.current_month = None
self.current_fee = 0
self.current_attendance_dates = []
class Parent(Person):
def __init__(self, id, name, email):
super().__init__(id, name)
self.children = []
self.email = email
def add_child(self, child):
self.children.append(child)
class DayCare:
def __init__(self, name, town_state_zip, address, phone, ein, logo):
self.name = name
self.address = address
self.town_state_zip = town_state_zip
self.phone = phone
self.ein = ein
self.logo = logo
self.children = []
self._parents = set()
def add_child(self, child):
self.children.append(child)
self.parents.add(child.parent)
@property
def parents(self) -> set:
return self._parents