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
:
64 self
._CashierShifts
.append(obj
)
66 def removeCashierShifts(self
, *CashierShifts
):
67 for obj
in CashierShifts
:
69 self
._CashierShifts
.remove(obj
)
72 electronicAddress
= None
75 """Vendor that manages this Cachier.
79 def setVendor(self
, value
):
80 if self
._Vendor
is not None:
81 filtered
= [x
for x
in self
.Vendor
.Cashiers
if x
!= self
]
82 self
._Vendor
._Cashiers
= filtered
85 if self
._Vendor
is not None:
86 self
._Vendor
._Cashiers
.append(self
)
88 Vendor
= property(getVendor
, setVendor
)