add survey admin
This commit is contained in:
parent
2709fff7ea
commit
f4066e9120
5 changed files with 128 additions and 15 deletions
|
|
@ -2,6 +2,7 @@ import { Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn, OneToMany
|
|||
import { EntityBase } from "./base/Base";
|
||||
import { Assign } from "./Assign";
|
||||
import { Appoint } from "./Appoint";
|
||||
import { Survey } from "./Survey";
|
||||
|
||||
@Entity("personal")
|
||||
export class Personal extends EntityBase {
|
||||
|
|
@ -124,9 +125,10 @@ export class Personal extends EntityBase {
|
|||
@OneToOne(() => Appoint, (appoint) => appoint.personal)
|
||||
@JoinColumn()
|
||||
appoint: Appoint;
|
||||
// @OneToOne(() => Appoint, (appoint: Appoint) => appoint.profileId)
|
||||
// @JoinColumn({ name: "personal_id" })
|
||||
// appoint: Appoint
|
||||
|
||||
@OneToOne(() => Survey, (survey) => survey.personal)
|
||||
@JoinColumn({ name: "personal_id" })
|
||||
survey: Survey;
|
||||
}
|
||||
|
||||
export class CreatePersonal {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn, OneToOne } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Assign } from "./Assign";
|
||||
import { Personal } from "./Personal";
|
||||
|
||||
@Entity("survey")
|
||||
export class Survey extends EntityBase {
|
||||
|
|
@ -48,6 +43,10 @@ export class Survey extends EntityBase {
|
|||
@ManyToOne(() => Assign, (assign: Assign) => assign.surveys)
|
||||
@JoinColumn({ name: "assign_id" })
|
||||
assign: Assign;
|
||||
|
||||
@OneToOne(() => Personal, (person) => person.survey, { cascade: true })
|
||||
@JoinColumn({ name: "personal_id" })
|
||||
personal: Personal;
|
||||
}
|
||||
|
||||
export class CreateSurvel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue