Backend half
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
OneToMany
|
||||
} from 'typeorm';
|
||||
import { User } from './user.entity';
|
||||
|
||||
@Entity('Company')
|
||||
export class Company {
|
||||
@PrimaryGeneratedColumn()
|
||||
CompanyId!: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
Name!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
ContactFirstName!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
ContactLastName!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
ContactEmail!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
FirstAPI!: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
||||
TokenAPI!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
RegDate!: Date;
|
||||
|
||||
// Relation to User entity (optional)
|
||||
@OneToMany(() => User, user => user.company)
|
||||
users!: User[];
|
||||
}
|
||||
Reference in New Issue
Block a user