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

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

It should always be workflow state not status. My mistake.

File size: 2.0 KB
Line 
1"""Interfaces of access code related components.
2"""
3from zope import schema
4from zope.interface import Interface
5from waeup.sirp.interfaces import IWAeUPObject
6
7class IAccessCode(IWAeUPObject):
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',
24        default = 0.0, min = 0.0,
25        )
26    state = schema.TextLine(
27        title = u'Workflow state',
28        )
29    representation = schema.TextLine(
30        title = u'Complete title of access code',
31        )
32    history = schema.Text(
33        title = u'The history of access code as lines',
34        default = u'',
35        readonly = True,
36       )
37
38class IAccessCodeBatch(Interface):
39    """A factory for batches of access codes.
40    """
41    creation_date = schema.Date(
42        title = u'Creation date',
43        )
44    creator = schema.TextLine(
45        title = u'Batch creator',
46        )
47    prefix = schema.TextLine(
48        title = u'Batch prefix',
49        )
50    num = schema.Int(
51        title = u'Batch number (1-3 digits)',
52        min = 0, max = 999,
53        )
54    entry_num = schema.Int(
55        title = u'Number of access codes',
56        default = 1000, min = 1,
57        )
58    cost = schema.Float(
59        title = u'Cost of access code',
60        default = 0.0, min = 0.0,
61        )
62    disabled_num = schema.Int(
63        title = u'Number of disabled access codes inside the batch',
64        default = 0,
65        readonly = True,
66        )
67    used_num = schema.Int(
68        title = u'Number of used access codes inside the batch',
69        default = 0,
70        readonly = True,
71        )
72
73class IAccessCodeBatchContainer(IWAeUPObject):
74    """A container for access code batches.
75    """
76
77    def addBatch(batch):
78        """Add a batch.
79        """
Note: See TracBrowser for help on using the repository browser.