Ignore:
Timestamp:
9 Feb 2015, 08:30:13 (10 years ago)
Author:
Henrik Bettermann
Message:

Add 'Registration in the Provisional Register' contract.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py

    r12499 r12571  
    2727    IPCNCustomerPDFDocument,
    2828    IRONContract,
    29     IROPContract)
     29    IROPContract,
     30    IRPRContract)
    3031from ikobacustom.pcn.interfaces import MessageFactory as _
    3132
     
    7576    iface = IROPContract
    7677    factory_name = 'waeup.ROPContract'
     78
     79class RPRContractProcessor(ContractProcessorBase):
     80    """A batch processor for IRPRContract objects.
     81    """
     82    util_name = 'rprcontractprocessor'
     83    grok.name(util_name)
     84    name = _('Registration in the Provisional Register Contract Processor')
     85    iface = IRPRContract
     86    factory_name = 'waeup.RPRContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py

    r12501 r12571  
    2828from ikobacustom.pcn.interfaces import MessageFactory as _
    2929from ikobacustom.pcn.customers.interfaces import (
    30     IRONContract, IRONContractEdit, IRONContractProcess,
    31     IROPContract, IROPContractEdit, IROPContractProcess,
    32     IRONContractOfficialUse, IROPContractOfficialUse)
     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    )
    3343
    3444
     
    107117    def getInterfaces(self):
    108118        return implementedBy(ROPContract)
     119
     120
     121class RPRContract(ContractBase):
     122    """Registration in the Provisional Register contract.
     123    """
     124
     125    grok.implements(
     126        IRPRContractProcess,
     127        IRPRContract,
     128        IRPRContractEdit,
     129        ICustomerNavigation)
     130
     131    contract_category = 'rpr'
     132
     133    form_fields_interface = IRPRContract
     134
     135    edit_form_fields_interface = IRPRContractEdit
     136
     137    ou_form_fields_interface = IRPRContractOfficialUse
     138
     139    check_docs_interface = IRPRContract
     140
     141RPRContract = attrs_to_fields(RPRContract)
     142
     143
     144class RPRContractFactory(grok.GlobalUtility):
     145    """A factory for contracts.
     146    """
     147    grok.implements(IFactory)
     148    grok.name(u'waeup.RPRContract')
     149    title = u"Create a new license contract.",
     150    description = u"This factory instantiates new contract instances."
     151
     152    def __call__(self, *args, **kw):
     153        return RPRContract(*args, **kw)
     154
     155    def getInterfaces(self):
     156        return implementedBy(RPRContract)
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py

    r12501 r12571  
    2323from ikobacustom.pcn.customers.interfaces import (
    2424    IPCNCustomer, IPCNCustomerJPGDocument,
    25     IPCNCustomerPDFDocument, IRONContractProcess, IROPContractProcess)
     25    IPCNCustomerPDFDocument,
     26    IRONContractProcess,
     27    IROPContractProcess,
     28    IRPRContractProcess)
    2629from ikobacustom.pcn.interfaces import MessageFactory as _
    2730
     
    6669    title = _(u'Registration of Premises Contracts')
    6770    class_name = 'ROPContract'
     71
     72class RPRContractExporter(ContractExporterBase):
     73    """Exporter for Contract instances.
     74    """
     75    grok.name('rprcontracts')
     76    iface = IRPRContractProcess
     77    title = _(u'Registration in the Provisional Register Contracts')
     78    class_name = 'RPRContract'
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12536 r12571  
    3030from ikobacustom.pcn.interfaces import MessageFactory as _
    3131from ikobacustom.pcn.interfaces import LGASource
     32from ikobacustom.pcn.customers.schoolgrades import ResultEntryField
    3233
    3334def year_range():
     
    104105        )
    105106
    106     res_address = schema.Text(
    107         title = _(u'Residential Address'),
    108         required = False,
    109         )
    110 
    111107    work_address = schema.Text(
    112108        title = _(u'Work Address'),
     
    293289    #    required = True,
    294290    #    )
     291
     292class IRPRContract(IContract):
     293    """A Registration in the Provisional Register contract.
     294
     295    """
     296
     297    state_of_origin = schema.Choice(
     298        vocabulary = nats_vocab,
     299        title = _(u'State of Origin'),
     300        required = False,
     301        )
     302
     303    res_address = schema.Text(
     304        title = _(u'Residential Address'),
     305        required = False,
     306        )
     307
     308    qualifications = schema.List(
     309        title = _(u'Qualifications'),
     310        value_type = ResultEntryField(),
     311        required = False,
     312        default = [],
     313        )
     314
     315    certificates = schema.Choice(
     316        title = _(u'Certificates'),
     317        source = CustomerDocumentSource(),
     318        required = False,
     319        )
     320
     321    referee1_name = schema.TextLine(
     322        title = _(u'First Referee Name'),
     323        required = False,
     324        readonly = False,
     325        )
     326
     327    referee1_address = schema.Text(
     328        title = _(u'First Referee Address'),
     329        required = False,
     330        readonly = False,
     331        )
     332
     333    referee1_license = schema.TextLine(
     334        title = _(u'First Referee License Number'),
     335        required = False,
     336        readonly = False,
     337        )
     338
     339    referee2_name = schema.TextLine(
     340        title = _(u'Second Referee Name'),
     341        required = False,
     342        readonly = False,
     343        )
     344
     345    referee2_address = schema.Text(
     346        title = _(u'Second Referee Address'),
     347        required = False,
     348        readonly = False,
     349        )
     350
     351    referee2_license = schema.TextLine(
     352        title = _(u'Second Referee License Number'),
     353        required = False,
     354        readonly = False,
     355        )
     356
     357    internship_address = schema.Text(
     358        title = _(u'Internship'),
     359        description = u'Enter address of company where you want to serve your internship.',
     360        required = False,
     361        readonly = False,
     362        )
     363
     364
     365
     366class IRPRContractOfficialUse(IIkobaObject):
     367    """Interface for editing RON official use data.
     368
     369    """
     370
     371    comment = schema.Text(
     372        title= _('Reason for rejection'),
     373        required = False,
     374        )
     375
     376
     377class IRPRContractProcess(IRPRContract, IRPRContractOfficialUse):
     378    """Interface for processing RON data.
     379    """
     380
     381    product_options = schema.List(
     382        title = _(u'Options/Fees'),
     383        value_type = ProductOptionField(),
     384        required = False,
     385        readonly = False,
     386        default = [],
     387        )
     388
     389class IRPRContractEdit(IRPRContract):
     390    """Interface for editing RON data by customers.
     391
     392    """
     393
     394    certificates = schema.Choice(
     395        title = _(u'Certificates'),
     396        source = CustomerDocumentSource(),
     397        required = True,
     398        )
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12499 r12571  
    2929
    3030from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
    31 from ikobacustom.pcn.customers.contracts import RONContract, ROPContract
    32 from ikobacustom.pcn.customers.interfaces import IRONContract, IROPContract
     31from ikobacustom.pcn.customers.contracts import (
     32    RONContract,
     33    ROPContract,
     34    RPRContract,
     35    )
     36from ikobacustom.pcn.customers.interfaces import (
     37    IRONContract,
     38    IROPContract,
     39    IRPRContract,
     40    )
    3341
    3442
     
    4452        verify.verifyObject(IROPContract, ROPContract())
    4553        verify.verifyObject(ICustomerNavigation, ROPContract())
     54        verify.verifyObject(IRPRContract, RPRContract())
     55        verify.verifyObject(ICustomerNavigation, RPRContract())
    4656        return
    4757
     
    5969        container.addContract(contract2)
    6070        self.assertEqual(container[id2], contract2)
    61         self.assertRaises(TypeError, container.addContract, object())
    6271        self.assertEqual(contract2.class_name, 'ROPContract')
     72
     73        contract3 = createObject(u'waeup.RPRContract')
     74        id3 = contract3.contract_id
     75        container.addContract(contract3)
     76        self.assertEqual(container[id3], contract3)
     77        self.assertEqual(contract3.class_name, 'RPRContract')
    6378        return
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py

    r12529 r12571  
    5656        'RONContract': _('Retention of Name on the Registrar'),
    5757        'ROPContract': _('Registration of Premises'),
     58        'RPRContract': _('Registration in the Provisional Register'),
    5859        }
    5960
     
    6768        'pcncustomerpdfdocuments',
    6869        'roncontracts',
    69         'ropcontracts')
     70        'ropcontracts',
     71        'rprcontracts')
Note: See TracChangeset for help on using the changeset viewer.