update employee

This commit is contained in:
Narul Hidayah
2025-12-31 16:30:32 +07:00
parent cf3a070465
commit 7383c1cf7b
6 changed files with 141 additions and 13 deletions

View File

@ -1,6 +1,7 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
import { Status } from '../types/status';
import { Munisipo } from './munisipo';
@Entity('administrativus')
export class Administrativu {
@ -13,6 +14,10 @@ export class Administrativu {
})
code: string;
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
@JoinColumn()
munisipo: Munisipo;
@Column({
nullable: false,
length: 256

View File

@ -1,6 +1,7 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
import { Status } from '../types/status';
import { Suco } from './suco';
@Entity('aldeias')
export class Aldeia {
@ -25,6 +26,10 @@ export class Aldeia {
})
status: Status;
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
@JoinColumn()
suco: Suco;
@Column()
@CreateDateColumn()
created_at: Date;

View File

@ -13,6 +13,11 @@ import { HrmsAirport } from "./hrms_airport";
import { HrmsDepartment } from "./hrms_department";
import { HrmsPosition } from "./hrms_position";
import { HrmsShift } from "./hrms_shift";
import { Nationality } from "../nationality";
import { Aldeia } from "../aldeia";
import { Suco } from "../suco";
import { Administrativu } from "../administrativu";
import { Munisipo } from "../munisipo";
@Entity("hrms_employees", { schema: "hrms" })
export class HrmsEmployee {
@ -44,8 +49,9 @@ export class HrmsEmployee {
@Column({ length: 128 })
email: string;
@Column({ length: 64 })
nationality: string;
@ManyToOne(() => Nationality)
@JoinColumn({ name: "nationality_id" })
nationality: Nationality;
@Column({ length: 64 })
last_education: string;
@ -53,17 +59,21 @@ export class HrmsEmployee {
@Column({ nullable: true, length: 256 })
photo_url: string;
@Column({ length: 64 })
aldeia: string;
@ManyToOne(() => Aldeia)
@JoinColumn({ name: "aldeia_id" })
aldeia: Aldeia;
@Column({ length: 64 })
suco: string;
@ManyToOne(() => Suco)
@JoinColumn({ name: "suco_id" })
suco: Suco;
@Column({ length: 64 })
administrativu: string;
@ManyToOne(() => Administrativu)
@JoinColumn({ name: "administrativu_id" })
administrativu: Administrativu;
@Column({ length: 64 })
district: string;
@ManyToOne(() => Munisipo)
@JoinColumn({ name: "munisipo_id" })
munisipo: Munisipo;
@Column({ length: 256 })
street: string;
@ -87,6 +97,69 @@ export class HrmsEmployee {
@Column({ type: "int" })
yearly_leave_quota: number;
@Column({ length: 128 })
emergency_name: string;
@Column({ length: 32 })
emergency_phone: string;
@Column({ length: 64 })
emergency_relation: string;
@Column({ length: 128, nullable: true })
electoral_number: string;
@Column({ type: "date", nullable: true })
electoral_expired_at: Date;
@Column({ length: 256, nullable: true })
electoral_file_url: string;
@Column({ length: 128, nullable: true })
bi_number: string;
@Column({ type: "date", nullable: true })
bi_expired_at: Date;
@Column({ length: 256, nullable: true })
bi_file_url: string;
@Column({ length: 128, nullable: true })
niss_number: string;
@Column({ type: "date", nullable: true })
niss_expired_at: Date;
@Column({ length: 256, nullable: true })
niss_file_url: string;
@Column({ length: 128, nullable: true })
passport_number: string;
@Column({ type: "date", nullable: true })
passport_expired_at: Date;
@Column({ length: 256, nullable: true })
passport_file_url: string;
@Column({ length: 128, nullable: true })
visa_number: string;
@Column({ type: "date", nullable: true })
visa_expired_at: Date;
@Column({ length: 256, nullable: true })
visa_file_url: string;
@Column({ length: 128, nullable: true })
pr_number: string;
@Column({ type: "date", nullable: true })
pr_expired_at: Date;
@Column({ length: 256, nullable: true })
pr_file_url: string;
@Column({ length: 64 })
status: Status;

39
src/entity/nationality.ts Normal file
View File

@ -0,0 +1,39 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
import { Status } from '../types/status';
@Entity('nationality')
export class Nationality {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({
nullable: false,
length: 128
})
code: string;
@Column({
nullable: false,
length: 256
})
name: string;
@Column({
nullable: false,
length: 64
})
status: Status;
@Column()
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true })
@UpdateDateColumn()
updated_at: Date;
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
}

View File

@ -1,6 +1,7 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
import { Status } from '../types/status';
import { Administrativu } from './administrativu';
@Entity('sucos')
export class Suco {
@ -19,6 +20,10 @@ export class Suco {
})
name: string;
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
@JoinColumn()
administrativu: Administrativu;
@Column({
nullable: false,
length: 64

View File

@ -9,6 +9,7 @@ export * from "../entity/district";
export * from "../entity/munisipo";
export * from "../entity/suco";
export * from "../entity/application"
export * from "../entity/nationality"
export * from "../types/action";
export * from "../types/error";