1 | ## $Id: contracts.py 12617 2015-02-14 17:22:51Z 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 | Customer contract components. |
---|
20 | """ |
---|
21 | |
---|
22 | import grok |
---|
23 | from zope.component.interfaces import IFactory |
---|
24 | from zope.interface import implementedBy |
---|
25 | from waeup.ikoba.utils.helpers import attrs_to_fields |
---|
26 | from waeup.ikoba.customers.interfaces import ICustomerNavigation |
---|
27 | from waeup.ikoba.customers.contracts import ContractBase |
---|
28 | from ikobacustom.pcn.interfaces import MessageFactory as _ |
---|
29 | from ikobacustom.pcn.customers.interfaces import ( |
---|
30 | IRONContract, |
---|
31 | IRONContractEdit, |
---|
32 | IRONContractProcess, |
---|
33 | IRONContractOfficialUse, |
---|
34 | IROPContract, |
---|
35 | IROPContractEdit, |
---|
36 | IROPContractProcess, |
---|
37 | IROPContractOfficialUse, |
---|
38 | IRPRContract, |
---|
39 | IRPRContractEdit, |
---|
40 | IRPRContractProcess, |
---|
41 | IRPRContractOfficialUse, |
---|
42 | IRPCContract, |
---|
43 | IRPCContractEdit, |
---|
44 | IRPCContractProcess, |
---|
45 | IRPCContractOfficialUse, |
---|
46 | IIPPMVLContract, |
---|
47 | IIPPMVLContractEdit, |
---|
48 | IIPPMVLContractProcess, |
---|
49 | IIPPMVLContractOfficialUse, |
---|
50 | IRPPMVLContract, |
---|
51 | IRPPMVLContractEdit, |
---|
52 | IRPPMVLContractProcess, |
---|
53 | IRPPMVLContractOfficialUse, |
---|
54 | IAPPITContract, |
---|
55 | IAPPITContractEdit, |
---|
56 | IAPPITContractProcess, |
---|
57 | IAPPITContractOfficialUse, |
---|
58 | IRPTContract, |
---|
59 | IRPTContractEdit, |
---|
60 | IRPTContractProcess, |
---|
61 | IRPTContractOfficialUse, |
---|
62 | IAPPTContract, |
---|
63 | IAPPTContractEdit, |
---|
64 | IAPPTContractProcess, |
---|
65 | IAPPTContractOfficialUse, |
---|
66 | ) |
---|
67 | |
---|
68 | |
---|
69 | class RONContract(ContractBase): |
---|
70 | """This is a sample contract. |
---|
71 | """ |
---|
72 | |
---|
73 | grok.implements( |
---|
74 | IRONContractProcess, |
---|
75 | IRONContract, |
---|
76 | IRONContractEdit, |
---|
77 | ICustomerNavigation) |
---|
78 | |
---|
79 | contract_category = 'ron' |
---|
80 | |
---|
81 | form_fields_interface = IRONContract |
---|
82 | |
---|
83 | edit_form_fields_interface = IRONContractEdit |
---|
84 | |
---|
85 | ou_form_fields_interface = IRONContractOfficialUse |
---|
86 | |
---|
87 | check_docs_interface = IRONContract |
---|
88 | |
---|
89 | RONContract = attrs_to_fields(RONContract) |
---|
90 | |
---|
91 | |
---|
92 | class RONContractFactory(grok.GlobalUtility): |
---|
93 | """A factory for contracts. |
---|
94 | """ |
---|
95 | grok.implements(IFactory) |
---|
96 | grok.name(u'waeup.RONContract') |
---|
97 | title = u"Create a new license contract.", |
---|
98 | description = u"This factory instantiates new contract instances." |
---|
99 | |
---|
100 | def __call__(self, *args, **kw): |
---|
101 | return RONContract(*args, **kw) |
---|
102 | |
---|
103 | def getInterfaces(self): |
---|
104 | return implementedBy(RONContract) |
---|
105 | |
---|
106 | |
---|
107 | class ROPContract(ContractBase): |
---|
108 | """This is a sample contract. |
---|
109 | """ |
---|
110 | |
---|
111 | grok.implements( |
---|
112 | IROPContractProcess, |
---|
113 | IROPContract, |
---|
114 | IROPContractEdit, |
---|
115 | ICustomerNavigation) |
---|
116 | |
---|
117 | contract_category = 'rop' |
---|
118 | |
---|
119 | form_fields_interface = IROPContract |
---|
120 | |
---|
121 | edit_form_fields_interface = IROPContractEdit |
---|
122 | |
---|
123 | ou_form_fields_interface = IROPContractOfficialUse |
---|
124 | |
---|
125 | check_docs_interface = IROPContract |
---|
126 | |
---|
127 | ROPContract = attrs_to_fields(ROPContract) |
---|
128 | |
---|
129 | |
---|
130 | class ROPContractFactory(grok.GlobalUtility): |
---|
131 | """A factory for contracts. |
---|
132 | """ |
---|
133 | grok.implements(IFactory) |
---|
134 | grok.name(u'waeup.ROPContract') |
---|
135 | title = u"Create a new license contract.", |
---|
136 | description = u"This factory instantiates new contract instances." |
---|
137 | |
---|
138 | def __call__(self, *args, **kw): |
---|
139 | return ROPContract(*args, **kw) |
---|
140 | |
---|
141 | def getInterfaces(self): |
---|
142 | return implementedBy(ROPContract) |
---|
143 | |
---|
144 | |
---|
145 | class RPRContract(ContractBase): |
---|
146 | """Registration in the Provisional Register contract. |
---|
147 | """ |
---|
148 | |
---|
149 | grok.implements( |
---|
150 | IRPRContractProcess, |
---|
151 | IRPRContract, |
---|
152 | IRPRContractEdit, |
---|
153 | ICustomerNavigation) |
---|
154 | |
---|
155 | contract_category = 'rpr' |
---|
156 | |
---|
157 | form_fields_interface = IRPRContract |
---|
158 | |
---|
159 | edit_form_fields_interface = IRPRContractEdit |
---|
160 | |
---|
161 | ou_form_fields_interface = IRPRContractOfficialUse |
---|
162 | |
---|
163 | check_docs_interface = IRPRContract |
---|
164 | |
---|
165 | RPRContract = attrs_to_fields(RPRContract) |
---|
166 | |
---|
167 | |
---|
168 | class RPRContractFactory(grok.GlobalUtility): |
---|
169 | """A factory for contracts. |
---|
170 | """ |
---|
171 | grok.implements(IFactory) |
---|
172 | grok.name(u'waeup.RPRContract') |
---|
173 | title = u"Create a new license contract.", |
---|
174 | description = u"This factory instantiates new contract instances." |
---|
175 | |
---|
176 | def __call__(self, *args, **kw): |
---|
177 | return RPRContract(*args, **kw) |
---|
178 | |
---|
179 | def getInterfaces(self): |
---|
180 | return implementedBy(RPRContract) |
---|
181 | |
---|
182 | |
---|
183 | class RPCContract(ContractBase): |
---|
184 | """Registration as Pharmaceutical Chemist contract. |
---|
185 | """ |
---|
186 | |
---|
187 | grok.implements( |
---|
188 | IRPCContractProcess, |
---|
189 | IRPCContract, |
---|
190 | IRPCContractEdit, |
---|
191 | ICustomerNavigation) |
---|
192 | |
---|
193 | contract_category = 'rpc' |
---|
194 | |
---|
195 | form_fields_interface = IRPCContract |
---|
196 | |
---|
197 | edit_form_fields_interface = IRPCContractEdit |
---|
198 | |
---|
199 | ou_form_fields_interface = IRPCContractOfficialUse |
---|
200 | |
---|
201 | check_docs_interface = IRPCContract |
---|
202 | |
---|
203 | RPCContract = attrs_to_fields(RPCContract) |
---|
204 | |
---|
205 | |
---|
206 | class RPCContractFactory(grok.GlobalUtility): |
---|
207 | """A factory for contracts. |
---|
208 | """ |
---|
209 | grok.implements(IFactory) |
---|
210 | grok.name(u'waeup.RPCContract') |
---|
211 | title = u"Create a new license contract.", |
---|
212 | description = u"This factory instantiates new contract instances." |
---|
213 | |
---|
214 | def __call__(self, *args, **kw): |
---|
215 | return RPCContract(*args, **kw) |
---|
216 | |
---|
217 | def getInterfaces(self): |
---|
218 | return implementedBy(RPCContract) |
---|
219 | |
---|
220 | |
---|
221 | class IPPMVLContract(ContractBase): |
---|
222 | """Issuance of Patent and Proprietary Medicines Vendors License contract. |
---|
223 | """ |
---|
224 | |
---|
225 | grok.implements( |
---|
226 | IIPPMVLContractProcess, |
---|
227 | IIPPMVLContract, |
---|
228 | IIPPMVLContractEdit, |
---|
229 | ICustomerNavigation) |
---|
230 | |
---|
231 | contract_category = 'ippmvl' |
---|
232 | |
---|
233 | form_fields_interface = IIPPMVLContract |
---|
234 | |
---|
235 | edit_form_fields_interface = IIPPMVLContractEdit |
---|
236 | |
---|
237 | ou_form_fields_interface = IIPPMVLContractOfficialUse |
---|
238 | |
---|
239 | check_docs_interface = IIPPMVLContract |
---|
240 | |
---|
241 | IPPMVLContract = attrs_to_fields(IPPMVLContract) |
---|
242 | |
---|
243 | |
---|
244 | class IPPMVLContractFactory(grok.GlobalUtility): |
---|
245 | """A factory for contracts. |
---|
246 | """ |
---|
247 | grok.implements(IFactory) |
---|
248 | grok.name(u'waeup.IPPMVLContract') |
---|
249 | title = u"Create a new license contract.", |
---|
250 | description = u"This factory instantiates new contract instances." |
---|
251 | |
---|
252 | def __call__(self, *args, **kw): |
---|
253 | return IPPMVLContract(*args, **kw) |
---|
254 | |
---|
255 | def getInterfaces(self): |
---|
256 | return implementedBy(IPPMVLContract) |
---|
257 | |
---|
258 | |
---|
259 | class RPPMVLContract(ContractBase): |
---|
260 | """Renewal of Patent and Proprietary Medicines Vendors License contract. |
---|
261 | """ |
---|
262 | |
---|
263 | grok.implements( |
---|
264 | IRPPMVLContractProcess, |
---|
265 | IRPPMVLContract, |
---|
266 | IRPPMVLContractEdit, |
---|
267 | ICustomerNavigation) |
---|
268 | |
---|
269 | contract_category = 'rppmvl' |
---|
270 | |
---|
271 | form_fields_interface = IRPPMVLContract |
---|
272 | |
---|
273 | edit_form_fields_interface = IRPPMVLContractEdit |
---|
274 | |
---|
275 | ou_form_fields_interface = IRPPMVLContractOfficialUse |
---|
276 | |
---|
277 | check_docs_interface = IRPPMVLContract |
---|
278 | |
---|
279 | RPPMVLContract = attrs_to_fields(RPPMVLContract) |
---|
280 | |
---|
281 | |
---|
282 | class RPPMVLContractFactory(grok.GlobalUtility): |
---|
283 | """A factory for contracts. |
---|
284 | """ |
---|
285 | grok.implements(IFactory) |
---|
286 | grok.name(u'waeup.RPPMVLContract') |
---|
287 | title = u"Create a new license contract.", |
---|
288 | description = u"This factory instantiates new contract instances." |
---|
289 | |
---|
290 | def __call__(self, *args, **kw): |
---|
291 | return RPPMVLContract(*args, **kw) |
---|
292 | |
---|
293 | def getInterfaces(self): |
---|
294 | return implementedBy(RPPMVLContract) |
---|
295 | |
---|
296 | |
---|
297 | class APPITContract(ContractBase): |
---|
298 | """Accepting Pupil Pharmacist for Internship Training contract. |
---|
299 | """ |
---|
300 | |
---|
301 | grok.implements( |
---|
302 | IAPPITContractProcess, |
---|
303 | IAPPITContract, |
---|
304 | IAPPITContractEdit, |
---|
305 | ICustomerNavigation) |
---|
306 | |
---|
307 | contract_category = 'appit' |
---|
308 | |
---|
309 | form_fields_interface = IAPPITContract |
---|
310 | |
---|
311 | edit_form_fields_interface = IAPPITContractEdit |
---|
312 | |
---|
313 | ou_form_fields_interface = IAPPITContractOfficialUse |
---|
314 | |
---|
315 | check_docs_interface = IAPPITContract |
---|
316 | |
---|
317 | APPITContract = attrs_to_fields(APPITContract) |
---|
318 | |
---|
319 | |
---|
320 | class APPITContractFactory(grok.GlobalUtility): |
---|
321 | """A factory for contracts. |
---|
322 | """ |
---|
323 | grok.implements(IFactory) |
---|
324 | grok.name(u'waeup.APPITContract') |
---|
325 | title = u"Create a new license contract.", |
---|
326 | description = u"This factory instantiates new contract instances." |
---|
327 | |
---|
328 | def __call__(self, *args, **kw): |
---|
329 | return APPITContract(*args, **kw) |
---|
330 | |
---|
331 | def getInterfaces(self): |
---|
332 | return implementedBy(APPITContract) |
---|
333 | |
---|
334 | |
---|
335 | class RPTContract(ContractBase): |
---|
336 | """Registration as a Pharmacy Technician contract. |
---|
337 | """ |
---|
338 | |
---|
339 | grok.implements( |
---|
340 | IRPTContractProcess, |
---|
341 | IRPTContract, |
---|
342 | IRPTContractEdit, |
---|
343 | ICustomerNavigation) |
---|
344 | |
---|
345 | contract_category = 'rpt' |
---|
346 | |
---|
347 | form_fields_interface = IRPTContract |
---|
348 | |
---|
349 | edit_form_fields_interface = IRPTContractEdit |
---|
350 | |
---|
351 | ou_form_fields_interface = IRPTContractOfficialUse |
---|
352 | |
---|
353 | check_docs_interface = IRPTContract |
---|
354 | |
---|
355 | RPTContract = attrs_to_fields(RPTContract) |
---|
356 | |
---|
357 | |
---|
358 | class RPTContractFactory(grok.GlobalUtility): |
---|
359 | """A factory for contracts. |
---|
360 | """ |
---|
361 | grok.implements(IFactory) |
---|
362 | grok.name(u'waeup.RPTContract') |
---|
363 | title = u"Create a new license contract.", |
---|
364 | description = u"This factory instantiates new contract instances." |
---|
365 | |
---|
366 | def __call__(self, *args, **kw): |
---|
367 | return RPTContract(*args, **kw) |
---|
368 | |
---|
369 | def getInterfaces(self): |
---|
370 | return implementedBy(RPTContract) |
---|
371 | |
---|
372 | |
---|
373 | class APPTContract(ContractBase): |
---|
374 | """Annual Permit for Pharmacy Technician contract. |
---|
375 | """ |
---|
376 | |
---|
377 | grok.implements( |
---|
378 | IAPPTContractProcess, |
---|
379 | IAPPTContract, |
---|
380 | IAPPTContractEdit, |
---|
381 | ICustomerNavigation) |
---|
382 | |
---|
383 | contract_category = 'appt' |
---|
384 | |
---|
385 | form_fields_interface = IAPPTContract |
---|
386 | |
---|
387 | edit_form_fields_interface = IAPPTContractEdit |
---|
388 | |
---|
389 | ou_form_fields_interface = IAPPTContractOfficialUse |
---|
390 | |
---|
391 | check_docs_interface = IAPPTContract |
---|
392 | |
---|
393 | APPTContract = attrs_to_fields(APPTContract) |
---|
394 | |
---|
395 | |
---|
396 | class APPTContractFactory(grok.GlobalUtility): |
---|
397 | """A factory for contracts. |
---|
398 | """ |
---|
399 | grok.implements(IFactory) |
---|
400 | grok.name(u'waeup.APPTContract') |
---|
401 | title = u"Create a new license contract.", |
---|
402 | description = u"This factory instantiates new contract instances." |
---|
403 | |
---|
404 | def __call__(self, *args, **kw): |
---|
405 | return APPTContract(*args, **kw) |
---|
406 | |
---|
407 | def getInterfaces(self): |
---|
408 | return implementedBy(APPTContract) |
---|
409 | |
---|