Add support for multi-currency transfers

This commit is contained in:
2024-08-19 13:23:20 +03:00
parent de24343ec0
commit 1646d484fb
6 changed files with 40 additions and 11 deletions

View File

@ -8,6 +8,7 @@ type Config struct {
type ConfigAccount struct {
Firefly3Name string `json:"firefly3_name,omitempty"`
MonobankId string `json:"monobank_id,omitempty"`
Currency string `json:"currency,omitempty"`
}
type ConfigTransactionTypes struct {

View File

@ -9,3 +9,13 @@ func (c *Config) GetAccountByMonobankId(q string) ConfigAccount {
return ConfigAccount{}
}
func (c *Config) GetAccountByFirefly3Name(q string) ConfigAccount {
for _, row := range c.Accounts {
if row.Firefly3Name == q {
return row
}
}
return ConfigAccount{}
}