Added form results
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { Field, ObjectType } from "@nestjs/graphql";
|
||||
import { Formular, FormularResult, FormularResults } from "src/dto/formular.dto";
|
||||
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { FormularEntity } from "./formular.entity";
|
||||
import { FormResultEntity } from "./result.entity";
|
||||
|
||||
|
||||
@ObjectType()
|
||||
@Entity()
|
||||
export class FormResultsEntity implements FormularResults{
|
||||
@PrimaryGeneratedColumn()
|
||||
@Field()
|
||||
id: number;
|
||||
|
||||
@ManyToOne(()=>FormularEntity,entity=>entity.id)
|
||||
@Field(()=>FormularEntity)
|
||||
@JoinColumn({name:"formularid"})
|
||||
formular: FormularEntity;
|
||||
|
||||
@Field()
|
||||
@Column()
|
||||
formularid: number;
|
||||
|
||||
@Field(()=>[FormResultEntity])
|
||||
@OneToMany(()=>FormResultEntity,entity=>entity.parentobj)
|
||||
results: FormResultEntity[];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user