support importing transaction data from alipay export file

This commit is contained in:
MaysWind
2024-09-22 19:27:20 +08:00
parent 732fa3b9de
commit 52b37c2a13
19 changed files with 826 additions and 79 deletions
@@ -255,24 +255,6 @@ func TestEzBookKeepingPlainFileConverterParseImportedData_ParseInvalidTimezone(t
assert.NotNil(t, err)
}
func TestEzBookKeepingPlainFileConverterParseImportedData_ParseInvalidAccountName(t *testing.T) {
converter := EzBookKeepingTransactionDataCSVFileConverter
context := core.NewNullContext()
user := &models.User{
Uid: 1234567890,
DefaultCurrency: "CNY",
}
_, _, _, _, err := converter.ParseImportedData(context, user, []byte("Time,Type,Sub Category,Account,Amount,Account2,Account2 Amount\n"+
"2024-09-01 12:34:56,Expense,Test Category,,123.45,,"), 0, nil, nil, nil)
assert.NotNil(t, err)
_, _, _, _, err = converter.ParseImportedData(context, user, []byte("Time,Type,Sub Category,Account,Amount,Account2,Account2 Amount\n"+
"2024-09-01 12:34:56,Transfer,Test Category,Test Account,123.45,,123.45"), 0, nil, nil, nil)
assert.NotNil(t, err)
}
func TestEzBookKeepingPlainFileConverterParseImportedData_ParseValidAccountCurrency(t *testing.T) {
converter := EzBookKeepingTransactionDataCSVFileConverter
context := core.NewNullContext()