43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
ManyToOne,
|
|
OneToMany,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { ActionCategory } from './action-category.entity';
|
|
import { ActionType } from './action-type.entity';
|
|
import { ActionSubmissionValue } from './action-submission-value.entity';
|
|
|
|
@Entity({ name: 'tbl_action_submissions', schema: 'masters' })
|
|
export class ActionSubmission {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@Column({ type: 'uuid' })
|
|
categoryId!: string;
|
|
|
|
@ManyToOne(() => ActionCategory, { onDelete: 'CASCADE', nullable: true })
|
|
@JoinColumn({ name: 'categoryId' })
|
|
category?: ActionCategory;
|
|
|
|
@Column({ type: 'uuid' })
|
|
actionTypeId!: string;
|
|
|
|
@ManyToOne(() => ActionType, { onDelete: 'CASCADE', nullable: true })
|
|
@JoinColumn({ name: 'actionTypeId' })
|
|
actionType?: ActionType;
|
|
|
|
@OneToMany(() => ActionSubmissionValue, (val) => val.submission, { cascade: true })
|
|
values!: ActionSubmissionValue[];
|
|
|
|
@CreateDateColumn()
|
|
createdAt!: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt!: Date;
|
|
}
|