Feature/check currency in import validation (#538)
* Check currency in import validation (avoid importing transactions in wrong currency) * Update changelog
This commit is contained in:
parent
ed7209fb53
commit
e255b76053
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleasd
|
||||
|
||||
### Added
|
||||
|
||||
- Extended the validation in the import functionality for transactions by checking the currency of the data provider service
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed the default transactions import limit
|
||||
|
@ -104,6 +104,12 @@ export class ImportService {
|
||||
`orders.${index}.symbol ("${symbol}") is not valid for the specified data source ("${dataSource}")`
|
||||
);
|
||||
}
|
||||
|
||||
if (result[symbol].currency !== currency) {
|
||||
throw new Error(
|
||||
`orders.${index}.currency ("${currency}") does not match with "${result[symbol].currency}"`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
test/import/invalid-currency.csv
Normal file
2
test/import/invalid-currency.csv
Normal file
@ -0,0 +1,2 @@
|
||||
Date,Code,Currency,Price,Quantity,Action,Fee
|
||||
12/12/2021,BTC,EUR,44558.42,1,buy,0
|
|
Loading…
x
Reference in New Issue
Block a user