You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
03 (Account Identifier) and 16 (Transaction Detail) records contain three-digit "type codes" that denote the type(s) of data the record contains. These are key to interpreting the data in the BAI2 file; therefore it makes sense that this library should return relevant information about them.
Type codes come in three broad categories:
Account Status: Pretty self explanatory, these describe things like ledger balance, available balance and float position. These show up in 03 records (and their continuations).
Activity Summary: These are summaries of credit and debit activity on the account. Again, these appear in 03 records (and their continuations).
Transaction Detail: These describe individual debits and credits on an account. As the name suggests, they show up on 16 records (and I assume their continuations, but the spec is mum on this).
Summary and Detail types also denote whether they refer to a debit or credit. The spec PDF has a large table detailing all the codes and their meanings. A kind person has helpfully transcribed them all into a CSV already.
We can probably convert that CSV into a hardcoded map without much difficulty. Something like
typeTypeCodestruct {
TypeCodestring// not int as leading zeros are significantTransactionstring// "CR" "DB" or "NA"Levelstring// "Status" "Summary" or "Detail"Descriptionstring
}
varTypeCodes:=map[string]TypeCode{
"010": {
TypeCode: "010",
Transaction: "NA",
Level: "Status",
Description: "Opening Ledger",
},
// ...
}
Then it would be an easy lookup. We could also make type-aliased string enums for transaction and level, but unsure if it's really necessary.
In 03 records, we can also determine whether a type code should have item count and funds type by whether it's a status or summary type code, which may help in parsing that.
The text was updated successfully, but these errors were encountered:
Bai2 Version:
0.1.0
03 (Account Identifier) and 16 (Transaction Detail) records contain three-digit "type codes" that denote the type(s) of data the record contains. These are key to interpreting the data in the BAI2 file; therefore it makes sense that this library should return relevant information about them.
Type codes come in three broad categories:
Summary and Detail types also denote whether they refer to a debit or credit. The spec PDF has a large table detailing all the codes and their meanings. A kind person has helpfully transcribed them all into a CSV already.
We can probably convert that CSV into a hardcoded map without much difficulty. Something like
Then it would be an easy lookup. We could also make type-aliased string enums for transaction and level, but unsure if it's really necessary.
In 03 records, we can also determine whether a type code should have item count and funds type by whether it's a status or summary type code, which may help in parsing that.
The text was updated successfully, but these errors were encountered: