update
This commit is contained in:
110
src/entity/hrms/hrms_employee.ts
Normal file
110
src/entity/hrms/hrms_employee.ts
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
} from "typeorm";
|
||||||
|
import { Status } from "../../types/status";
|
||||||
|
import { HrmsAirport } from "./hrms_airport";
|
||||||
|
import { HrmsDepartment } from "./hrms_department";
|
||||||
|
import { HrmsPosition } from "./hrms_position";
|
||||||
|
import { HrmsShift } from "./hrms_shift";
|
||||||
|
|
||||||
|
@Entity("hrms_employees", { schema: "hrms" })
|
||||||
|
export class HrmsEmployee {
|
||||||
|
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({ length: 32, unique: true })
|
||||||
|
employee_id: string;
|
||||||
|
|
||||||
|
@Column({ length: 32, unique: true })
|
||||||
|
device_user_id: string;
|
||||||
|
|
||||||
|
@Column({ length: 128 })
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
place_birth: string;
|
||||||
|
|
||||||
|
@Column({ type: "date" })
|
||||||
|
birth_date: Date;
|
||||||
|
|
||||||
|
@Column({ length: 16 })
|
||||||
|
gender: string;
|
||||||
|
|
||||||
|
@Column({ length: 32 })
|
||||||
|
phone: string;
|
||||||
|
|
||||||
|
@Column({ length: 128 })
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
nationality: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
last_education: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
photo_url: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
aldeia: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
suco: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
administrativu: string;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
district: string;
|
||||||
|
|
||||||
|
@Column({ length: 256 })
|
||||||
|
street: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsAirport)
|
||||||
|
@JoinColumn({ name: "airport_id" })
|
||||||
|
airport: HrmsAirport;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsDepartment)
|
||||||
|
@JoinColumn({ name: "department_id" })
|
||||||
|
department: HrmsDepartment;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsPosition)
|
||||||
|
@JoinColumn({ name: "position_id" })
|
||||||
|
position: HrmsPosition;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsShift)
|
||||||
|
@JoinColumn({ name: "shift_id" })
|
||||||
|
shift: HrmsShift;
|
||||||
|
|
||||||
|
@Column({ type: "int" })
|
||||||
|
yearly_leave_quota: number;
|
||||||
|
|
||||||
|
@Column({ length: 64 })
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@UpdateDateColumn({ nullable: true })
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@DeleteDateColumn({ nullable: true })
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||||
import { Status } from "../../types/status";
|
import { Status } from "../../types/status";
|
||||||
|
import { HrmsDepartment } from "./hrms_department";
|
||||||
|
|
||||||
@Entity("hrms_positions", { schema: "hrms" })
|
@Entity("hrms_positions", { schema: "hrms" })
|
||||||
export class HrmsPosition {
|
export class HrmsPosition {
|
||||||
@ -27,6 +28,13 @@ export class HrmsPosition {
|
|||||||
})
|
})
|
||||||
description: string;
|
description: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => HrmsDepartment, {
|
||||||
|
nullable: false,
|
||||||
|
onDelete: "RESTRICT"
|
||||||
|
})
|
||||||
|
@JoinColumn({ name: "department_id" })
|
||||||
|
department: HrmsDepartment;
|
||||||
|
|
||||||
@ManyToOne(() => HrmsPosition, position => position.children, {
|
@ManyToOne(() => HrmsPosition, position => position.children, {
|
||||||
nullable: true,
|
nullable: true,
|
||||||
onDelete: "SET NULL"
|
onDelete: "SET NULL"
|
||||||
|
|||||||
@ -4,5 +4,6 @@ export * from "../entity/hrms/hrms_position"
|
|||||||
export * from "../entity/hrms/hrms_holiday"
|
export * from "../entity/hrms/hrms_holiday"
|
||||||
export * from "../entity/hrms/hrms_leave_type"
|
export * from "../entity/hrms/hrms_leave_type"
|
||||||
export * from "../entity/hrms/hrms_shift"
|
export * from "../entity/hrms/hrms_shift"
|
||||||
|
export * from "../entity/hrms/hrms_employee"
|
||||||
|
|
||||||
export * from "../types/hrms"
|
export * from "../types/hrms"
|
||||||
Reference in New Issue
Block a user