1 | ## $Id: interfaces.py 14184 2016-09-23 16:38:53Z 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, ICustomerPDFDocument, IContract) |
---|
23 | from waeup.ikoba.customers.vocabularies import ( |
---|
24 | ConCatProductSource, CustomerDocumentSource) |
---|
25 | from waeup.ikoba.products.productoptions import ProductOptionField |
---|
26 | from ikobacustom.uniben.interfaces import MessageFactory as _ |
---|
27 | |
---|
28 | |
---|
29 | class IUnibenCustomer(ICustomer): |
---|
30 | """Representation of a customer. |
---|
31 | |
---|
32 | """ |
---|
33 | |
---|
34 | # Customer document interfaces |
---|
35 | |
---|
36 | |
---|
37 | class IUnibenCustomerDocument(ICustomerDocument): |
---|
38 | """A customer document. |
---|
39 | |
---|
40 | """ |
---|
41 | |
---|
42 | class IUnibenCustomerPDFDocument(ICustomerPDFDocument): |
---|
43 | """A customer pdf document. |
---|
44 | |
---|
45 | """ |
---|
46 | |
---|
47 | # Customer contract interfaces |
---|
48 | |
---|
49 | class IUnibenContract(IContract): |
---|
50 | """A customer contract sample with document attached. |
---|
51 | |
---|
52 | """ |
---|
53 | |
---|
54 | document_object = schema.Choice( |
---|
55 | title = _(u'Document'), |
---|
56 | source = CustomerDocumentSource(), |
---|
57 | required = False, |
---|
58 | ) |
---|
59 | |
---|
60 | document_object2 = schema.Choice( |
---|
61 | title = _(u'Document 2'), |
---|
62 | source = CustomerDocumentSource(), |
---|
63 | required = False, |
---|
64 | ) |
---|
65 | |
---|
66 | class IRIAAContract(IUnibenContract): |
---|
67 | """A Retention of Name contract. |
---|
68 | |
---|
69 | """ |
---|
70 | |
---|
71 | class IRIAAContractOfficialUse(IIkobaObject): |
---|
72 | """Interface for editing RIAA official use data. |
---|
73 | |
---|
74 | """ |
---|
75 | |
---|
76 | comment = schema.Text( |
---|
77 | title= _('Reason for rejection'), |
---|
78 | required = False, |
---|
79 | ) |
---|
80 | |
---|
81 | |
---|
82 | class IRIAAContractProcess(IRIAAContract, IRIAAContractOfficialUse): |
---|
83 | """Interface for processing RIAA data. |
---|
84 | """ |
---|
85 | |
---|
86 | product_options = schema.List( |
---|
87 | title = _(u'Options/Fees'), |
---|
88 | value_type = ProductOptionField(), |
---|
89 | required = False, |
---|
90 | readonly = False, |
---|
91 | defaultFactory=list, |
---|
92 | ) |
---|
93 | |
---|
94 | class IRIAAContractEdit(IRIAAContract): |
---|
95 | """Interface for editing RIAA data by customers. |
---|
96 | |
---|
97 | """ |
---|
98 | |
---|
99 | document_object = schema.Choice( |
---|
100 | title = _(u'Document'), |
---|
101 | source = CustomerDocumentSource(), |
---|
102 | required = True, |
---|
103 | ) |
---|
104 | |
---|
105 | document_object2 = schema.Choice( |
---|
106 | title = _(u'Document 2'), |
---|
107 | source = CustomerDocumentSource(), |
---|
108 | required = True, |
---|
109 | ) |
---|