[12272] | 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 ( |
---|
[12384] | 21 | ICustomer, ICustomerDocument, ICustomerPDFDocument, IContract) |
---|
[12273] | 22 | from waeup.ikoba.customers.vocabularies import ( |
---|
| 23 | ConCatProductSource, CustomerDocumentSource) |
---|
[12335] | 24 | from waeup.ikoba.products.productoptions import ProductOptionField |
---|
[12371] | 25 | from ikobacustom.pcn.interfaces import MessageFactory as _ |
---|
[12272] | 26 | |
---|
| 27 | |
---|
[12371] | 28 | class IPCNCustomer(ICustomer): |
---|
[12272] | 29 | """Representation of a customer. |
---|
| 30 | |
---|
| 31 | """ |
---|
| 32 | |
---|
| 33 | # Customer document interfaces |
---|
| 34 | |
---|
| 35 | |
---|
[12384] | 36 | class IPCNCustomerJPGDocument(ICustomerDocument): |
---|
| 37 | """A customer jpg document. |
---|
[12272] | 38 | |
---|
| 39 | """ |
---|
| 40 | |
---|
[12384] | 41 | class IPCNCustomerPDFDocument(ICustomerPDFDocument): |
---|
| 42 | """A customer pdf document. |
---|
| 43 | |
---|
| 44 | """ |
---|
| 45 | |
---|
[12272] | 46 | # Customer contract interfaces |
---|
| 47 | |
---|
[12401] | 48 | class IPCNLicenseContract(IContract): |
---|
[12272] | 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 | ) |
---|
[12273] | 58 | |
---|
[12401] | 59 | class IPCNLicenseContractProcess(IPCNLicenseContract): |
---|
[12335] | 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 | |
---|
[12401] | 71 | class IPCNLicenseContractEdit(IPCNLicenseContract): |
---|
[12273] | 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 | ) |
---|