Feature/simplify data source checks in DTOs (#4581)

* Simplify DataSource checks in DTOs

* Add test case

* Update changelog
This commit is contained in:
Thomas Kaul
2025-04-23 20:24:08 +02:00
committed by GitHub
parent 10580e22d1
commit 50e7e3d3c7
4 changed files with 22 additions and 2 deletions

View File

@ -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

View File

@ -32,7 +32,7 @@ export class UpdateAssetProfileDto {
@IsOptional()
currency?: string;
@IsEnum(DataSource, { each: true })
@IsEnum(DataSource)
@IsOptional()
dataSource?: DataSource;

View File

@ -49,7 +49,7 @@ export class CreateOrderDto {
@IsOptional()
customCurrency?: string;
@IsEnum(DataSource, { each: true })
@IsEnum(DataSource)
@IsOptional()
dataSource?: DataSource;

View 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
}
]
}