source: main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/customers/interfaces.py @ 11956

Last change on this file since 11956 was 11956, checked in by Henrik Bettermann, 10 years ago

Add container for customers.

File size: 2.5 KB
Line 
1## $Id: interfaces.py 11589 2014-04-22 07:13:16Z henrik $
2##
3## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18#from datetime import datetime
19from zope.component import getUtility
20from zope.interface import Attribute, Interface
21from zope import schema
22from zc.sourcefactory.contextual import BasicContextualSourceFactory
23from waeup.ikoba.interfaces import MessageFactory as _
24from waeup.ikoba.schema import TextLineChoice, FormattedDate, PhoneNumber
25from waeup.ikoba.interfaces import IIkobaObject
26
27class ICustomersUtils(Interface):
28    """A collection of methods which are subject to customization.
29
30    """
31
32class ICustomersContainer(IIkobaObject):
33    """A customers container contains company customers.
34
35    """
36    def addCustomer(customer):
37        """Add an ICustomer object and subcontainers.
38
39        """
40
41    def archive(id=None):
42        """Create on-dist archive of customers.
43
44        If id is `None`, all customers are archived.
45
46        If id contains a single id string, only the respective
47        customers are archived.
48
49        If id contains a list of id strings all of the respective
50        customers types are saved to disk.
51        """
52
53    def clear(id=None, archive=True):
54        """Remove customers of type given by 'id'.
55
56        Optionally archive the customers.
57
58        If id is `None`, all customers are archived.
59
60        If id contains a single id string, only the respective
61        customers are archived.
62
63        If id contains a list of id strings all of the respective
64        customer types are saved to disk.
65
66        If `archive` is ``False`` none of the archive-handling is done
67        and respective customers are simply removed from the
68        database.
69        """
70
71    unique_customer_id = Attribute("""A unique customer id.""")
72
73class ICustomer(IIkobaObject):
74    """Representation of a customer.
75
76    """
77
Note: See TracBrowser for help on using the repository browser.