gradido/backend/src/graphql/arg/TransactionSendArgs.ts
2023-08-30 18:35:07 +02:00

27 lines
697 B
TypeScript

import { MaxLength, MinLength, IsString } from 'class-validator'
import { Decimal } from 'decimal.js-light'
import { ArgsType, Field } from 'type-graphql'
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from '@/graphql/resolver/const/const'
import { IsPositiveDecimal } from '@/graphql/validator/Decimal'
@ArgsType()
export class TransactionSendArgs {
@Field(() => String, { nullable: true })
@IsString()
recipientCommunityIdentifier?: string | null | undefined
@Field(() => String)
@IsString()
recipientIdentifier: string
@Field(() => Decimal)
@IsPositiveDecimal()
amount: Decimal
@Field(() => String)
@MaxLength(MEMO_MAX_CHARS)
@MinLength(MEMO_MIN_CHARS)
memo: string
}