1
"""Enums for all codes used in OCR files."""
2

3 4
from enum import IntEnum
4

5

6 4
__all__ = [
7
    'ServiceCode',
8
    'RecordType',
9
    'AssignmentType',
10
    'TransactionType',
11
    'AvtaleGiroRegistrationType',
12
]
13

14

15 4
class ServiceCode(IntEnum):
16
    """Service codes tell which Nets service the record applies to."""
17

18
    #: Used for the transmission start and end record.
19 4
    NONE = 0
20

21
    #: Used for all OCR Giro records.
22 4
    OCR_GIRO = 9
23

24
    #: Used for all AvtaleGiro records.
25 4
    AVTALEGIRO = 21
26

27

28 4
class RecordType(IntEnum):
29
    """Record types tell what type of record this is."""
30

31
    #: See :class:`netsgiro.TransmissionStart`.
32 4
    TRANSMISSION_START = 10
33

34
    #: See :class:`netsgiro.AssignmentStart`.
35 4
    ASSIGNMENT_START = 20
36

37
    #: See :class:`netsgiro.TransactionAmountItem1`.
38 4
    TRANSACTION_AMOUNT_ITEM_1 = 30
39

40
    #: See :class:`netsgiro.TransactionAmountItem2`.
41 4
    TRANSACTION_AMOUNT_ITEM_2 = 31
42

43
    #: See :class:`netsgiro.TransactionAmountItem3`.
44 4
    TRANSACTION_AMOUNT_ITEM_3 = 32
45

46
    #: See :class:`netsgiro.TransactionSpecification`.
47 4
    TRANSACTION_SPECIFICATION = 49
48

49
    #: See :class:`netsgiro.TransactionAgreements`.
50 4
    TRANSACTION_AGREEMENTS = 70
51

52
    #: See :class:`netsgiro.AssignmentEnd`.
53 4
    ASSIGNMENT_END = 88
54

55
    #: See :class:`netsgiro.TransmissionEnd`.
56 4
    TRANSMISSION_END = 89
57

58

59 4
class AssignmentType(IntEnum):
60
    """Assignment types tell what type of assignment this is."""
61

62
    #: Used both for AvtaleGiro payment requests and OCR Giro transactions.
63 4
    TRANSACTIONS = 0
64

65
    #: Used for AvtaleGiro agreement updates.
66 4
    AVTALEGIRO_AGREEMENTS = 24
67

68
    #: Used for AvtaleGiro cancellations.
69 4
    AVTALEGIRO_CANCELLATIONS = 36
70

71

72 4
class TransactionType(IntEnum):
73
    """Assignment types tell what type of transaction this is."""
74

75
    #: Used for OCR Giro.
76 4
    FROM_GIRO_DEBITED_ACCOUNT = 10
77
    #: Used for OCR Giro.
78 4
    FROM_STANDING_ORDERS = 11
79
    #: Used for OCR Giro.
80 4
    FROM_DIRECT_REMITTANCE = 12
81
    #: Used for OCR Giro.
82 4
    FROM_BUSINESS_TERMINAL_GIRO = 13
83
    #: Used for OCR Giro.
84 4
    FROM_COUNTER_GIRO = 14
85
    #: Used for OCR Giro.
86 4
    FROM_AVTALEGIRO = 15
87
    #: Used for OCR Giro.
88 4
    FROM_TELEGIRO = 16
89
    #: Used for OCR Giro.
90 4
    FROM_CASH_GIRO = 17
91

92
    #: Used for OCR Giro.
93 4
    REVERSING_WITH_KID = 18
94
    #: Used for OCR Giro.
95 4
    PURCHASE_WITH_KID = 19
96
    #: Used for OCR Giro.
97 4
    REVERSING_WITH_TEXT = 20
98
    #: Used for OCR Giro.
99
    #:
100
    #: .. note::
101
    #:     The value ``21`` is used for both :attr:`PURCHASE_WITH_TEXT` and
102
    #:     :attr:`AVTALEGIRO_WITH_BANK_NOTIFICATION`. The enum
103
    #:     representation will be ``<PURCHASE_WITH_TEXT: 21>`` in either case.
104 4
    PURCHASE_WITH_TEXT = 21
105

106
    #: Used for AvtaleGiro when you want to notify the payer yourself.
107 4
    AVTALEGIRO_WITH_PAYEE_NOTIFICATION = 2
108
    #: Used for AvtaleGiro when you want the bank to notify the payer.
109 4
    AVTALEGIRO_WITH_BANK_NOTIFICATION = 21
110
    #: Used for transactions that are part of an AvtaleGiro cancellation
111
    #: assignment.
112 4
    AVTALEGIRO_CANCELLATION = 93
113
    #: Used by Nets for updates to AvtaleGiro agreeements.
114 4
    AVTALEGIRO_AGREEMENT = 94
115

116

117 4
class AvtaleGiroRegistrationType(IntEnum):
118
    """AvtaleGiro registration types tell what kind of update this is."""
119

120
    #: Used when the AvtaleGiro agreement assignment contains all currently
121
    #: active agreements.
122 4
    ACTIVE_AGREEMENT = 0
123

124
    #: Used when the AvtaleGiro agreement assignment contains only changes,
125
    #: and the current agreement is new or updated.
126 4
    NEW_OR_UPDATED_AGREEMENT = 1
127

128
    #: Used when the AvtaleGiro agreement assignment contains only changes,
129
    #: and the current agreement has been deleted.
130 4
    DELETED_AGREEMENT = 2

Read our documentation on viewing source code .

Loading