byrokrat / autogiro

Read and write files for the swedish direct debit system autogirot.
GNU General Public License v3.0
10 stars 7 forks source link

Validate record count in response layouts #18

Closed hanneskod closed 6 years ago

hanneskod commented 6 years ago

Response layouts typically contains a closing record that specifies the number of different records in the file (and the summed amounts for transactions). These counts can be validated using a visitor.

A generic CountingVisitor could count all node types and validate the count using a generic Closing record node. The type of node a count refers to could be specified at parse time.

Monetary amounts could possible be validated in the same manner.

Edit: There is now a generic closing record universaly applied.

hanneskod commented 6 years ago

Payment sections also contain validatable counts. But in section headers... See for example PAYMENT_REFUND_OPENING.