Feature/simplify data source checks in DTOs (#4581)
* Simplify DataSource checks in DTOs * Add test case * Update changelog
This commit is contained in:
@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Simplified the data source check in the DTO of the activity creation
|
||||
- Simplified the data source check in the DTO of the asset profile update
|
||||
- Renamed `User` to `user` in the `Subscription` database schema
|
||||
- Migrated the `@ghostfolio/ui/assistant` component to control flow
|
||||
- Migrated the `@ghostfolio/ui/value` component to control flow
|
||||
|
@ -32,7 +32,7 @@ export class UpdateAssetProfileDto {
|
||||
@IsOptional()
|
||||
currency?: string;
|
||||
|
||||
@IsEnum(DataSource, { each: true })
|
||||
@IsEnum(DataSource)
|
||||
@IsOptional()
|
||||
dataSource?: DataSource;
|
||||
|
||||
|
@ -49,7 +49,7 @@ export class CreateOrderDto {
|
||||
@IsOptional()
|
||||
customCurrency?: string;
|
||||
|
||||
@IsEnum(DataSource, { each: true })
|
||||
@IsEnum(DataSource)
|
||||
@IsOptional()
|
||||
dataSource?: DataSource;
|
||||
|
||||
|
18
test/import/invalid-data-source.json
Normal file
18
test/import/invalid-data-source.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"meta": {
|
||||
"date": "2021-01-01T00:00:00.000Z",
|
||||
"version": "dev"
|
||||
},
|
||||
"activities": [
|
||||
{
|
||||
"currency": "USD",
|
||||
"dataSource": "<invalid>",
|
||||
"date": "2021-01-01T00:00:00.000Z",
|
||||
"fee": 0,
|
||||
"quantity": 20,
|
||||
"symbol": "AAPL",
|
||||
"type": "BUY",
|
||||
"unitPrice": 100.0
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user