source: main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/interfaces.py @ 6451

Last change on this file since 6451 was 6450, checked in by Henrik Bettermann, 14 years ago

Implement search page for access codes (work in progress).

File size: 2.3 KB
RevLine 
[5068]1"""Interfaces of access code related components.
2"""
3from zope import schema
4from zope.interface import Interface
[5081]5from waeup.sirp.interfaces import IWAeUPObject
[5068]6
[5081]7class IAccessCode(IWAeUPObject):
[5068]8    """An access code.
9    """
10    batch_serial = schema.Int(
11        title = u'Serial number inside batch',
12        )
13    batch_prefix = schema.TextLine(
14        title = u'Prefix inside batch',
15        )
16    batch_num = schema.Int(
17        title = u'Batch number',
18        )
19    random_num = schema.TextLine(
20        title = u'Random part of access code.',
21        )
22    cost = schema.Float(
23        title = u'Cost of access code',
[5085]24        default = 0.0, min = 0.0,
[5068]25        )
[6450]26    status = schema.TextLine(
27        title = u'Workflow status',
28        )
[6419]29    disabled = schema.Bool(
30        title = u'Access code is disabled',
31        default = False,
32        readonly = True,
[5068]33        )
[6419]34    used = schema.Bool(
35        title = u'Access code is already in use.',
36        default = False,
37        readonly = True,
[5068]38        )
[5098]39    representation = schema.TextLine(
40        title = u'Complete title of access code',
41        )
[6423]42    history = schema.Text(
43        title = u'The history of access code as lines',
44        default = u'',
45        readonly = True,
46       )
[6413]47
[5068]48class IAccessCodeBatch(Interface):
49    """A factory for batches of access codes.
50    """
51    creation_date = schema.Date(
52        title = u'Creation date',
53        )
54    creator = schema.TextLine(
55        title = u'Batch creator',
56        )
[6415]57    prefix = schema.TextLine(
[5085]58        title = u'Batch prefix',
[5068]59        )
[6415]60    num = schema.Int(
[5085]61        title = u'Batch number (1-3 digits)',
62        min = 0, max = 999,
[5068]63        )
[5085]64    entry_num = schema.Int(
65        title = u'Number of access codes',
66        default = 1000, min = 1,
67        )
68    cost = schema.Float(
69        title = u'Cost of access code',
70        default = 0.0, min = 0.0,
71        )
[6425]72    disabled_num = schema.Int(
73        title = u'Number of disabled access codes inside the batch',
74        default = 0,
75        readonly = True,
76        )
77    used_num = schema.Int(
78        title = u'Number of used access codes inside the batch',
79        default = 0,
80        readonly = True,
81        )
[5081]82
83class IAccessCodeBatchContainer(IWAeUPObject):
84    """A container for access code batches.
85    """
86
87    def addBatch(batch):
88        """Add a batch.
89        """
Note: See TracBrowser for help on using the repository browser.