32 lines
738 B
TypeScript
32 lines
738 B
TypeScript
import { Field, ObjectType } from "@nestjs/graphql";
|
|
import { FormularResult, FormularResults } from "src/dto/formular.dto";
|
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
import { FormResultsEntity } from "./results.entity";
|
|
|
|
|
|
@ObjectType()
|
|
@Entity()
|
|
export class FormResultEntity implements FormularResult{
|
|
|
|
@PrimaryGeneratedColumn()
|
|
@Field()
|
|
id: number;
|
|
|
|
@Column()
|
|
@Field()
|
|
parentid: number;
|
|
|
|
@Field(()=>FormResultsEntity)
|
|
@ManyToOne(()=>FormResultsEntity,entity=>entity.id)
|
|
@JoinColumn({"name":"parentid"})
|
|
parentobj: FormResultsEntity;
|
|
|
|
@Column()
|
|
@Field()
|
|
name: string;
|
|
|
|
@Column()
|
|
@Field()
|
|
value: string;
|
|
|
|
} |