mirror of
https://github.com/aclindsa/ofxgo.git
synced 2025-07-01 03:38:38 -04:00
Use named constants instead of strings for enum-like OFX fields
This adds a python script to generate constants.go when `go generate` is called, and updates the structs, tests, and command-line client to all use the new named constants.
This commit is contained in:
@ -59,7 +59,7 @@ func TestMarshalBankStatementRequest(t *testing.T) {
|
||||
BankAcctFrom: ofxgo.BankAcct{
|
||||
BankId: "318398732",
|
||||
AcctId: "78346129",
|
||||
AcctType: "CHECKING",
|
||||
AcctType: ofxgo.AcctTypeChecking,
|
||||
},
|
||||
Include: true,
|
||||
}
|
||||
@ -158,14 +158,14 @@ func TestUnmarshalBankStatementResponse(t *testing.T) {
|
||||
DtEnd: *ofxgo.NewDateGMT(2006, 1, 15, 0, 0, 0, 0),
|
||||
Transactions: []ofxgo.Transaction{
|
||||
{
|
||||
TrnType: "CHECK",
|
||||
TrnType: ofxgo.TrnTypeCheck,
|
||||
DtPosted: *ofxgo.NewDateGMT(2006, 1, 4, 0, 0, 0, 0),
|
||||
TrnAmt: trnamt1,
|
||||
FiTId: "00592",
|
||||
CheckNum: "2002",
|
||||
},
|
||||
{
|
||||
TrnType: "ATM",
|
||||
TrnType: ofxgo.TrnTypeATM,
|
||||
DtPosted: *ofxgo.NewDateGMT(2006, 1, 12, 0, 0, 0, 0),
|
||||
DtUser: ofxgo.NewDateGMT(2006, 1, 12, 0, 0, 0, 0),
|
||||
TrnAmt: trnamt2,
|
||||
@ -188,7 +188,7 @@ func TestUnmarshalBankStatementResponse(t *testing.T) {
|
||||
BankAcctFrom: ofxgo.BankAcct{
|
||||
BankId: "318398732",
|
||||
AcctId: "78346129",
|
||||
AcctType: "CHECKING",
|
||||
AcctType: ofxgo.AcctTypeChecking,
|
||||
},
|
||||
BankTranList: &banktranlist,
|
||||
BalAmt: balamt,
|
||||
|
Reference in New Issue
Block a user