32 lines
862 B
TypeScript
32 lines
862 B
TypeScript
import { CuestionarioRespondido } from 'src/cuestionario_respondido/entities/cuestionario_respondido.entity';
|
|
import { ParticipanteEvento } from 'src/participante_evento/entities/participante_evento.entity';
|
|
import {
|
|
Column,
|
|
Entity,
|
|
OneToMany,
|
|
PrimaryGeneratedColumn,
|
|
} from 'typeorm';
|
|
|
|
@Entity()
|
|
export class Participante {
|
|
@PrimaryGeneratedColumn()
|
|
id_participante: number;
|
|
|
|
@Column({ unique: true })
|
|
correo: string;
|
|
|
|
// Cuestionarios que ha respondido
|
|
@OneToMany(
|
|
() => CuestionarioRespondido,
|
|
(cuestionarioRespondido) => cuestionarioRespondido.participante,
|
|
)
|
|
cuestionariosRespondidos: CuestionarioRespondido[];
|
|
|
|
// Cuestionarios a los que se ha inscrito (subeventos)
|
|
@OneToMany(
|
|
() => ParticipanteEvento,
|
|
(participanteEvento) => participanteEvento.participante,
|
|
)
|
|
participanteEventos: ParticipanteEvento[];
|
|
}
|