1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
19 class Cashier(IdentifiedObject
):
20 """The operator of the point of sale for the duration of CashierShift. Cashier is under the exclusive management control of Vendor.
23 def __init__(self
, CashierShifts
=None, electronicAddress
=None, Vendor
=None, *args
, **kw_args
):
24 """Initialises a new 'Cashier' instance.
26 @param CashierShifts: All shifts operated by this cashier.
27 @param electronicAddress: Electronic address.
28 @param Vendor: Vendor that manages this Cachier.
30 self
._CashierShifts
= []
31 self
.CashierShifts
= [] if CashierShifts
is None else CashierShifts
33 self
.electronicAddress
= electronicAddress
38 super(Cashier
, self
).__init
__(*args
, **kw_args
)
44 _refs
= ["CashierShifts", "electronicAddress", "Vendor"]
45 _many_refs
= ["CashierShifts"]
47 def getCashierShifts(self
):
48 """All shifts operated by this cashier.
50 return self
._CashierShifts
52 def setCashierShifts(self
, value
):
53 for x
in self
._CashierShifts
:
57 self
._CashierShifts
= value
59 CashierShifts
= property(getCashierShifts
, setCashierShifts
)
61 def addCashierShifts(self
, *CashierShifts
):
62 for obj
in CashierShifts
:
65 def removeCashierShifts(self
, *CashierShifts
):
66 for obj
in CashierShifts
:
70 electronicAddress
= None
73 """Vendor that manages this Cachier.
77 def setVendor(self
, value
):
78 if self
._Vendor
is not None:
79 filtered
= [x
for x
in self
.Vendor
.Cashiers
if x
!= self
]
80 self
._Vendor
._Cashiers
= filtered
83 if self
._Vendor
is not None:
84 if self
not in self
._Vendor
._Cashiers
:
85 self
._Vendor
._Cashiers
.append(self
)
87 Vendor
= property(getVendor
, setVendor
)