fix asset class and add employee
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
DeleteDateColumn,
|
DeleteDateColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
|
|
||||||
@Entity('assetClassification')
|
@Entity('asset_classification')
|
||||||
export class AssetClassification {
|
export class AssetClassification {
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
id: string;
|
id: string;
|
||||||
113
src/entity/employee.ts
Normal file
113
src/entity/employee.ts
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
Index,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
} from 'typeorm';
|
||||||
|
|
||||||
|
import { Status } from '../types/status';
|
||||||
|
import { User } from './users';
|
||||||
|
|
||||||
|
@Entity('employees')
|
||||||
|
export class Employee {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
first_name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
last_name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 128,
|
||||||
|
})
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 15,
|
||||||
|
})
|
||||||
|
phone_number: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 128,
|
||||||
|
})
|
||||||
|
position: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: 'uuid',
|
||||||
|
})
|
||||||
|
branch_id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
type: 'date',
|
||||||
|
})
|
||||||
|
hired_date: Date;
|
||||||
|
|
||||||
|
@ManyToOne(() => Employee, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'manager_id' })
|
||||||
|
manager: Employee;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: 'uuid',
|
||||||
|
})
|
||||||
|
manager_id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'created_by' })
|
||||||
|
createdBy: User;
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: 'uuid',
|
||||||
|
})
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'updated_by' })
|
||||||
|
updatedBy: User;
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: 'uuid',
|
||||||
|
})
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
@ -47,7 +47,8 @@ import { CreditApplication } from "./entity/credit_applications";
|
|||||||
import { CreditApplicationStatus } from "./types/credit";
|
import { CreditApplicationStatus } from "./types/credit";
|
||||||
import { CreditApplicationForm } from "./entity/credit_application_forms";
|
import { CreditApplicationForm } from "./entity/credit_application_forms";
|
||||||
import { Application } from "./entity/application";
|
import { Application } from "./entity/application";
|
||||||
import { AssetClassification } from "./assetClasification";
|
import { AssetClassification } from "./entity/asset_classification"
|
||||||
|
import { Employee } from "./entity/employee";
|
||||||
export {
|
export {
|
||||||
User, //
|
User, //
|
||||||
UserRole,
|
UserRole,
|
||||||
@ -95,6 +96,7 @@ export {
|
|||||||
Supplier,
|
Supplier,
|
||||||
AssetCategory,
|
AssetCategory,
|
||||||
AssetClassification,
|
AssetClassification,
|
||||||
|
Employee,
|
||||||
Ledger,
|
Ledger,
|
||||||
CreditCompany,
|
CreditCompany,
|
||||||
CreditDebtor,
|
CreditDebtor,
|
||||||
|
|||||||
Reference in New Issue
Block a user