source: main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py @ 12600

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

Add Registration as Pharmaceutical Chemist contract.

  • Property svn:keywords set to Id
File size: 5.1 KB
RevLine 
[12286]1## $Id: contracts.py 12591 2015-02-11 10:44:28Z henrik $
[12273]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"""
19Customer contract components.
20"""
21
22import grok
23from zope.component.interfaces import IFactory
24from zope.interface import implementedBy
25from waeup.ikoba.utils.helpers import attrs_to_fields
26from waeup.ikoba.customers.interfaces import ICustomerNavigation
27from waeup.ikoba.customers.contracts import ContractBase
[12371]28from ikobacustom.pcn.interfaces import MessageFactory as _
29from ikobacustom.pcn.customers.interfaces import (
[12571]30    IRONContract,
31    IRONContractEdit,
32    IRONContractProcess,
33    IRONContractOfficialUse,
34    IROPContract,
35    IROPContractEdit,
36    IROPContractProcess,
37    IROPContractOfficialUse,
38    IRPRContract,
39    IRPRContractEdit,
40    IRPRContractProcess,
41    IRPRContractOfficialUse,
[12591]42    IRPCContract,
43    IRPCContractEdit,
44    IRPCContractProcess,
45    IRPCContractOfficialUse,
[12571]46    )
[12273]47
48
[12484]49class RONContract(ContractBase):
[12273]50    """This is a sample contract.
51    """
52
53    grok.implements(
[12484]54        IRONContractProcess,
55        IRONContract,
56        IRONContractEdit,
[12335]57        ICustomerNavigation)
[12273]58
[12488]59    contract_category = 'ron'
[12273]60
[12484]61    form_fields_interface = IRONContract
[12273]62
[12484]63    edit_form_fields_interface = IRONContractEdit
[12273]64
[12501]65    ou_form_fields_interface = IRONContractOfficialUse
66
[12484]67    check_docs_interface = IRONContract
[12273]68
[12484]69RONContract = attrs_to_fields(RONContract)
[12273]70
71
[12484]72class RONContractFactory(grok.GlobalUtility):
[12273]73    """A factory for contracts.
74    """
75    grok.implements(IFactory)
[12484]76    grok.name(u'waeup.RONContract')
[12401]77    title = u"Create a new license contract.",
[12499]78    description = u"This factory instantiates new contract instances."
[12273]79
80    def __call__(self, *args, **kw):
[12484]81        return RONContract(*args, **kw)
[12273]82
83    def getInterfaces(self):
[12484]84        return implementedBy(RONContract)
[12499]85
86
87class ROPContract(ContractBase):
88    """This is a sample contract.
89    """
90
91    grok.implements(
92        IROPContractProcess,
93        IROPContract,
94        IROPContractEdit,
95        ICustomerNavigation)
96
97    contract_category = 'rop'
98
99    form_fields_interface = IROPContract
100
101    edit_form_fields_interface = IROPContractEdit
102
[12501]103    ou_form_fields_interface = IROPContractOfficialUse
104
[12499]105    check_docs_interface = IROPContract
106
107ROPContract = attrs_to_fields(ROPContract)
108
109
110class ROPContractFactory(grok.GlobalUtility):
111    """A factory for contracts.
112    """
113    grok.implements(IFactory)
114    grok.name(u'waeup.ROPContract')
115    title = u"Create a new license contract.",
116    description = u"This factory instantiates new contract instances."
117
118    def __call__(self, *args, **kw):
119        return ROPContract(*args, **kw)
120
121    def getInterfaces(self):
122        return implementedBy(ROPContract)
[12571]123
124
125class RPRContract(ContractBase):
126    """Registration in the Provisional Register contract.
127    """
128
129    grok.implements(
130        IRPRContractProcess,
131        IRPRContract,
132        IRPRContractEdit,
133        ICustomerNavigation)
134
135    contract_category = 'rpr'
136
137    form_fields_interface = IRPRContract
138
139    edit_form_fields_interface = IRPRContractEdit
140
141    ou_form_fields_interface = IRPRContractOfficialUse
142
143    check_docs_interface = IRPRContract
144
145RPRContract = attrs_to_fields(RPRContract)
146
147
148class RPRContractFactory(grok.GlobalUtility):
149    """A factory for contracts.
150    """
151    grok.implements(IFactory)
152    grok.name(u'waeup.RPRContract')
153    title = u"Create a new license contract.",
154    description = u"This factory instantiates new contract instances."
155
156    def __call__(self, *args, **kw):
157        return RPRContract(*args, **kw)
158
159    def getInterfaces(self):
160        return implementedBy(RPRContract)
[12591]161
162
163class RPCContract(ContractBase):
164    """Registration as Pharmaceutical Chemist contract.
165    """
166
167    grok.implements(
168        IRPCContractProcess,
169        IRPCContract,
170        IRPCContractEdit,
171        ICustomerNavigation)
172
173    contract_category = 'rpc'
174
175    form_fields_interface = IRPCContract
176
177    edit_form_fields_interface = IRPCContractEdit
178
179    ou_form_fields_interface = IRPCContractOfficialUse
180
181    check_docs_interface = IRPCContract
182
183RPCContract = attrs_to_fields(RPCContract)
184
185
186class RPCContractFactory(grok.GlobalUtility):
187    """A factory for contracts.
188    """
189    grok.implements(IFactory)
190    grok.name(u'waeup.RPCContract')
191    title = u"Create a new license contract.",
192    description = u"This factory instantiates new contract instances."
193
194    def __call__(self, *args, **kw):
195        return RPCContract(*args, **kw)
196
197    def getInterfaces(self):
198        return implementedBy(RPCContract)
199
Note: See TracBrowser for help on using the repository browser.