34 lines
864 B
TypeScript
34 lines
864 B
TypeScript
import { Field, ObjectType } from "@nestjs/graphql";
|
|
import { FormularResult } from "src/dto/formular.dto";
|
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
|
import { FormResultsEntity } from "./results.entity";
|
|
import { FieldEntity } from "./fields.entity";
|
|
import { RelationIdAttribute } from "typeorm/query-builder/relation-id/RelationIdAttribute.js";
|
|
|
|
|
|
@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;
|
|
|
|
@Field()
|
|
@Column()
|
|
name: string;
|
|
|
|
@Column()
|
|
@Field()
|
|
value: string;
|
|
|
|
} |