1 | ## $Id: interfaces.py 12502 2015-01-20 18:09:03Z 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 | |
---|
19 | from zope import schema |
---|
20 | from waeup.ikoba.interfaces import IIkobaObject |
---|
21 | from waeup.ikoba.customers.interfaces import ( |
---|
22 | ICustomer, ICustomerDocument, IContract) |
---|
23 | from waeup.ikoba.customers.vocabularies import ( |
---|
24 | ConCatProductSource, CustomerDocumentSource) |
---|
25 | from waeup.ikoba.products.productoptions import ProductOptionField |
---|
26 | from ikobacustom.skeleton.interfaces import MessageFactory as _ |
---|
27 | |
---|
28 | |
---|
29 | class ISkeletonCustomer(ICustomer): |
---|
30 | """Representation of a customer. |
---|
31 | |
---|
32 | """ |
---|
33 | |
---|
34 | # Customer document interfaces |
---|
35 | |
---|
36 | |
---|
37 | class ISkeletonCustomerDocument(ICustomerDocument): |
---|
38 | """A customer document. |
---|
39 | |
---|
40 | """ |
---|
41 | |
---|
42 | # Customer contract interfaces |
---|
43 | |
---|
44 | class ISkeletonContract(IContract): |
---|
45 | """A customer contract sample with document attached. |
---|
46 | |
---|
47 | """ |
---|
48 | |
---|
49 | document_object = schema.Choice( |
---|
50 | title = _(u'Document'), |
---|
51 | source = CustomerDocumentSource(), |
---|
52 | required = False, |
---|
53 | ) |
---|
54 | |
---|
55 | class ISkeletonContractOfficialUse(IIkobaObject): |
---|
56 | """Interface for editing official use data. |
---|
57 | |
---|
58 | """ |
---|
59 | |
---|
60 | comment = schema.Text( |
---|
61 | title= _('Reason for rejection'), |
---|
62 | required = False, |
---|
63 | ) |
---|
64 | |
---|
65 | class ISkeletonContractProcess(ISkeletonContract, ISkeletonContractOfficialUse): |
---|
66 | """Interface for processing contract data. |
---|
67 | """ |
---|
68 | |
---|
69 | product_options = schema.List( |
---|
70 | title = _(u'Options/Fees'), |
---|
71 | value_type = ProductOptionField(), |
---|
72 | required = False, |
---|
73 | readonly = False, |
---|
74 | default = [], |
---|
75 | ) |
---|
76 | |
---|
77 | class ISkeletonContractEdit(ISkeletonContract): |
---|
78 | """Interface for editing sample contract data by customers. |
---|
79 | |
---|
80 | """ |
---|
81 | |
---|
82 | document_object = schema.Choice( |
---|
83 | title = _(u'Document'), |
---|
84 | source = CustomerDocumentSource(), |
---|
85 | required = True, |
---|
86 | ) |
---|