mirror of https://github.com/ghostfolio/ghostfolio
8 changed files with 121 additions and 54 deletions
@ -1,18 +0,0 @@ |
|||
import { |
|||
ValidatorConstraint, |
|||
ValidatorConstraintInterface |
|||
} from 'class-validator'; |
|||
|
|||
import { ghostfolioPrefix } from '../config'; |
|||
import { isValidCustomAssetProfileSymbol } from '../helper'; |
|||
|
|||
@ValidatorConstraint({ name: 'isCustomAssetProfileSymbol' }) |
|||
export class IsCustomAssetProfileSymbolConstraint implements ValidatorConstraintInterface { |
|||
public defaultMessage() { |
|||
return `$property must be a UUID or start with the prefix "${ghostfolioPrefix}_"`; |
|||
} |
|||
|
|||
public validate(aSymbol: string) { |
|||
return isValidCustomAssetProfileSymbol(aSymbol); |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"meta": { |
|||
"date": "2023-02-05T00:00:00.000Z", |
|||
"version": "dev" |
|||
}, |
|||
"activities": [ |
|||
{ |
|||
"accountId": null, |
|||
"comment": null, |
|||
"currency": "USD", |
|||
"dataSource": "MANUAL", |
|||
"date": "2022-01-01T00:00:00.000Z", |
|||
"fee": 0, |
|||
"quantity": 1, |
|||
"symbol": "Penthouse Apartment", |
|||
"tags": [], |
|||
"type": "BUY", |
|||
"unitPrice": 500000 |
|||
} |
|||
], |
|||
"user": { |
|||
"settings": { |
|||
"currency": "USD", |
|||
"performanceCalculationType": "ROAI" |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue