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