File: account_information.go

package info (click to toggle)
golang-github-mitch000001-go-hbci 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,468 kB
  • sloc: java: 1,092; makefile: 5
file content (269 lines) | stat: -rw-r--r-- 10,333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
package segment

import (
	"github.com/mitch000001/go-hbci/domain"
	"github.com/mitch000001/go-hbci/element"
)

type AccountInformationRequest interface {
	ClientSegment
	SetContinuationMark(continuationMark string)
}

func NewAccountInformationRequestSegmentV1(account domain.AccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV1{
		AccountConnection: element.NewAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV1 struct {
	ClientSegment
	AccountConnection     *element.AccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV1) Version() int         { return 1 }
func (a *AccountInformationRequestSegmentV1) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV1) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV1) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV1) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV1) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

func NewAccountInformationRequestSegmentV2(account domain.AccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV2{
		AccountConnection: element.NewAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV2 struct {
	ClientSegment
	AccountConnection     *element.AccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV2) Version() int         { return 2 }
func (a *AccountInformationRequestSegmentV2) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV2) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV2) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV2) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV2) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

func NewAccountInformationRequestSegmentV3(account domain.InternationalAccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV3{
		AccountConnection: element.NewInternationalAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV3 struct {
	ClientSegment
	AccountConnection     *element.InternationalAccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV3) Version() int         { return 3 }
func (a *AccountInformationRequestSegmentV3) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV3) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV3) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV3) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV3) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

func NewAccountInformationRequestSegmentV4(account domain.InternationalAccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV4{
		AccountConnection: element.NewInternationalAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV4 struct {
	ClientSegment
	AccountConnection     *element.InternationalAccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV4) Version() int         { return 4 }
func (a *AccountInformationRequestSegmentV4) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV4) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV4) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV4) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV4) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

func NewAccountInformationRequestSegmentV5(account domain.InternationalAccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV5{
		AccountConnection: element.NewInternationalAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV5 struct {
	ClientSegment
	AccountConnection     *element.InternationalAccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV5) Version() int         { return 5 }
func (a *AccountInformationRequestSegmentV5) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV5) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV5) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV5) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV5) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

func NewAccountInformationRequestSegmentV6(account domain.InternationalAccountConnection, allAccounts bool) AccountInformationRequest {
	a := &AccountInformationRequestSegmentV6{
		AccountConnection: element.NewInternationalAccountConnection(account),
		AllAccounts:       element.NewBoolean(allAccounts),
	}
	a.ClientSegment = NewBasicSegment(1, a)
	return a
}

type AccountInformationRequestSegmentV6 struct {
	ClientSegment
	AccountConnection     *element.InternationalAccountConnectionDataElement
	AllAccounts           *element.BooleanDataElement
	MaxEntries            *element.NumberDataElement
	ContinuationReference *element.AlphaNumericDataElement
}

func (a *AccountInformationRequestSegmentV6) Version() int         { return 6 }
func (a *AccountInformationRequestSegmentV6) ID() string           { return "HKKIF" }
func (a *AccountInformationRequestSegmentV6) referencedId() string { return "" }
func (a *AccountInformationRequestSegmentV6) sender() string       { return senderUser }

func (a *AccountInformationRequestSegmentV6) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AllAccounts,
		a.MaxEntries,
		a.ContinuationReference,
	}
}

func (a *AccountInformationRequestSegmentV6) SetContinuationMark(continuationMark string) {
	a.ContinuationReference = element.NewAlphaNumeric(continuationMark, 35)
}

//go:generate go run ../cmd/unmarshaler/unmarshaler_generator.go -segment AccountInformationResponseSegment

type AccountInformationResponseSegment struct {
	Segment
	AccountConnection                *element.AccountConnectionDataElement
	AccountKind                      *element.NumberDataElement
	Name1                            *element.AlphaNumericDataElement
	Name2                            *element.AlphaNumericDataElement
	AccountProductID                 *element.AlphaNumericDataElement
	AccountCurrency                  *element.CurrencyDataElement
	OpeningDate                      *element.DateDataElement
	DebitInterest                    *element.ValueDataElement
	CreditInterest                   *element.ValueDataElement
	OverDebitInterest                *element.ValueDataElement
	CreditLimit                      *element.AmountDataElement
	ReferenceAccount                 *element.AccountConnectionDataElement
	AccountStatementShippingType     *element.NumberDataElement
	AccountStatementShippingRotation *element.NumberDataElement
	AdditionalInformation            *element.TextDataElement
	DisposalEligiblePersons          *element.DisposalEligiblePersonsDataElement
}

func (a *AccountInformationResponseSegment) Version() int         { return 1 }
func (a *AccountInformationResponseSegment) ID() string           { return "HIKIF" }
func (a *AccountInformationResponseSegment) referencedId() string { return "" }
func (a *AccountInformationResponseSegment) sender() string       { return senderBank }

func (a *AccountInformationResponseSegment) elements() []element.DataElement {
	return []element.DataElement{
		a.AccountConnection,
		a.AccountKind,
		a.Name1,
		a.Name2,
		a.AccountProductID,
		a.AccountCurrency,
		a.OpeningDate,
		a.DebitInterest,
		a.CreditInterest,
		a.OverDebitInterest,
		a.CreditLimit,
		a.ReferenceAccount,
		a.AccountStatementShippingType,
		a.AccountStatementShippingRotation,
		a.AdditionalInformation,
		a.DisposalEligiblePersons,
	}
}