From 437da5eedaaa9ad13dc9a6c08b44e859217d8645 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 9 Mar 2022 11:05:01 +0100 Subject: [PATCH] feat: Transaction Link Model --- backend/src/graphql/model/TransactionLink.ts | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 backend/src/graphql/model/TransactionLink.ts diff --git a/backend/src/graphql/model/TransactionLink.ts b/backend/src/graphql/model/TransactionLink.ts new file mode 100644 index 000000000..4511c5cdd --- /dev/null +++ b/backend/src/graphql/model/TransactionLink.ts @@ -0,0 +1,33 @@ +import { ObjectType, Field } from 'type-graphql' +import Decimal from 'decimal.js-light' +import { User } from './User' + +@ObjectType() +export class TransactionLink { + @Field(() => Number) + id: number + + @Field(() => User) + user: User + + @Field(() => Decimal) + amount: Decimal + + @Field(() => String) + memo: string + + @Field(() => Date) + createdAt: Date + + @Field(() => Date) + validUntil: Date + + @Field(() => Boolean) + showEmail: boolean + + @Field(() => Date, { nullable: true }) + redeemedAt: Date | null + + @Field(() => User, { nullable: true }) + redeemedBy: User | null +}