You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
765 B
TypeScript

import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import { Project } from '../projects/project.entity';
@Entity('transaction_events')
@Index(['codeKey'], { unique: true })
export class TransactionEvent {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ name: 'code' })
petEventCode: string;
@Column()
codeKey: string;
@Column({ type: 'text', name: 'description' })
petEventDesc: string;
@ManyToOne(() => Project, (project) => project.transactionEvents, {
onDelete: 'CASCADE',
})
project: Project;
@Column()
projectId: string;
@CreateDateColumn({ type: 'timestamp' })
createdAt: Date;
@UpdateDateColumn({ type: 'timestamp' })
updatedAt: Date;
}