mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
21 changed files with 212 additions and 14 deletions
@ -0,0 +1,27 @@ |
|||||
|
import { COMMENT_MAXIMUM_LENGTH } from '@ghostfolio/common/config'; |
||||
|
|
||||
|
import { Transform, TransformFnParams } from 'class-transformer'; |
||||
|
import { |
||||
|
IsISO8601, |
||||
|
IsNumber, |
||||
|
IsOptional, |
||||
|
IsString, |
||||
|
MaxLength |
||||
|
} from 'class-validator'; |
||||
|
import { isString } from 'lodash-es'; |
||||
|
|
||||
|
export class AccountBalanceDto { |
||||
|
@IsOptional() |
||||
|
@IsString() |
||||
|
@MaxLength(COMMENT_MAXIMUM_LENGTH) |
||||
|
@Transform(({ value }: TransformFnParams) => |
||||
|
isString(value) ? value.trim() : value |
||||
|
) |
||||
|
comment?: string | null; |
||||
|
|
||||
|
@IsISO8601() |
||||
|
date: string; |
||||
|
|
||||
|
@IsNumber() |
||||
|
value: number; |
||||
|
} |
||||
@ -1,4 +1,5 @@ |
|||||
export interface AccountBalance { |
export interface AccountBalance { |
||||
|
comment?: string; |
||||
date: string; |
date: string; |
||||
value: number; |
value: number; |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,2 @@ |
|||||
|
-- AlterTable |
||||
|
ALTER TABLE "AccountBalance" ADD COLUMN "comment" TEXT; |
||||
Loading…
Reference in new issue