pull/548/merge
Abdelrahman Aly 2024-12-02 18:05:19 +00:00 committed by GitHub
commit d90fb9a3ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 16 deletions

View File

@ -106,28 +106,28 @@
"\n", "\n",
"class Operator(Employee):\n", "class Operator(Employee):\n",
"\n", "\n",
" def __init__(self, employee_id, name):\n", " def __init__(self, employee_id, name, call_center):\n",
" super(Operator, self).__init__(employee_id, name, Rank.OPERATOR)\n", " super(Operator, self).__init__(employee_id, name, Rank.OPERATOR, call_center)\n",
"\n", "\n",
" def escalate_call(self):\n", " def escalate_call(self):\n",
" self.call.level = Rank.SUPERVISOR\n", " self.call.rank = Rank.SUPERVISOR\n",
" self._escalate_call()\n", " self._escalate_call()\n",
"\n", "\n",
"\n", "\n",
"class Supervisor(Employee):\n", "class Supervisor(Employee):\n",
"\n", "\n",
" def __init__(self, employee_id, name):\n", " def __init__(self, employee_id, name, call_center):\n",
" super(Operator, self).__init__(employee_id, name, Rank.SUPERVISOR)\n", " super(Operator, self).__init__(employee_id, name, Rank.SUPERVISOR, call_center)\n",
"\n", "\n",
" def escalate_call(self):\n", " def escalate_call(self):\n",
" self.call.level = Rank.DIRECTOR\n", " self.call.rank = Rank.DIRECTOR\n",
" self._escalate_call()\n", " self._escalate_call()\n",
"\n", "\n",
"\n", "\n",
"class Director(Employee):\n", "class Director(Employee):\n",
"\n", "\n",
" def __init__(self, employee_id, name):\n", " def __init__(self, employee_id, name, call_center):\n",
" super(Operator, self).__init__(employee_id, name, Rank.DIRECTOR)\n", " super(Operator, self).__init__(employee_id, name, Rank.DIRECTOR, call_center)\n",
"\n", "\n",
" def escalate_call(self):\n", " def escalate_call(self):\n",
" raise NotImplemented('Directors must be able to handle any call')\n", " raise NotImplemented('Directors must be able to handle any call')\n",

View File

@ -42,28 +42,28 @@ class Employee(metaclass=ABCMeta):
class Operator(Employee): class Operator(Employee):
def __init__(self, employee_id, name): def __init__(self, employee_id, name, call_center):
super(Operator, self).__init__(employee_id, name, Rank.OPERATOR) super(Operator, self).__init__(employee_id, name, Rank.OPERATOR, call_center)
def escalate_call(self): def escalate_call(self):
self.call.level = Rank.SUPERVISOR self.call.rank = Rank.SUPERVISOR
self._escalate_call() self._escalate_call()
class Supervisor(Employee): class Supervisor(Employee):
def __init__(self, employee_id, name): def __init__(self, employee_id, name, call_center):
super(Operator, self).__init__(employee_id, name, Rank.SUPERVISOR) super(Operator, self).__init__(employee_id, name, Rank.SUPERVISOR, call_center)
def escalate_call(self): def escalate_call(self):
self.call.level = Rank.DIRECTOR self.call.rank = Rank.DIRECTOR
self._escalate_call() self._escalate_call()
class Director(Employee): class Director(Employee):
def __init__(self, employee_id, name): def __init__(self, employee_id, name, call_center):
super(Operator, self).__init__(employee_id, name, Rank.DIRECTOR) super(Operator, self).__init__(employee_id, name, Rank.DIRECTOR, call_center)
def escalate_call(self): def escalate_call(self):
raise NotImplementedError('Directors must be able to handle any call') raise NotImplementedError('Directors must be able to handle any call')