From 7383c1cf7bad8ea9bd22f0f97fa6da86e183c8ea Mon Sep 17 00:00:00 2001 From: Narul Hidayah Date: Wed, 31 Dec 2025 16:30:32 +0700 Subject: [PATCH 1/5] update employee --- src/entity/administrativu.ts | 7 ++- src/entity/aldeia.ts | 7 ++- src/entity/hrms/hrms_employee.ts | 93 ++++++++++++++++++++++++++++---- src/entity/nationality.ts | 39 ++++++++++++++ src/entity/suco.ts | 7 ++- src/schema/public.ts | 1 + 6 files changed, 141 insertions(+), 13 deletions(-) create mode 100644 src/entity/nationality.ts diff --git a/src/entity/administrativu.ts b/src/entity/administrativu.ts index 4c29028..6fde6b5 100644 --- a/src/entity/administrativu.ts +++ b/src/entity/administrativu.ts @@ -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 diff --git a/src/entity/aldeia.ts b/src/entity/aldeia.ts index 4949ef8..ddaf223 100644 --- a/src/entity/aldeia.ts +++ b/src/entity/aldeia.ts @@ -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; diff --git a/src/entity/hrms/hrms_employee.ts b/src/entity/hrms/hrms_employee.ts index 7cceb91..3953ae6 100644 --- a/src/entity/hrms/hrms_employee.ts +++ b/src/entity/hrms/hrms_employee.ts @@ -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; diff --git a/src/entity/nationality.ts b/src/entity/nationality.ts new file mode 100644 index 0000000..a47158b --- /dev/null +++ b/src/entity/nationality.ts @@ -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; +} \ No newline at end of file diff --git a/src/entity/suco.ts b/src/entity/suco.ts index 2c1ffde..50b2e09 100644 --- a/src/entity/suco.ts +++ b/src/entity/suco.ts @@ -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 diff --git a/src/schema/public.ts b/src/schema/public.ts index 6e86eb1..a42c14b 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -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"; From f96cd18f5d7c73a1fe34eb22cb5dd4f210a8cfb8 Mon Sep 17 00:00:00 2001 From: Sony Surahmn Date: Wed, 31 Dec 2025 16:30:48 +0700 Subject: [PATCH 2/5] Add FinanceAgencia entity and update schema exports --- src/entity/finance/finance_agencia.ts | 57 +++++++++++++++++++++++++++ src/schema/finances.ts | 1 + 2 files changed, 58 insertions(+) create mode 100644 src/entity/finance/finance_agencia.ts diff --git a/src/entity/finance/finance_agencia.ts b/src/entity/finance/finance_agencia.ts new file mode 100644 index 0000000..3d4da37 --- /dev/null +++ b/src/entity/finance/finance_agencia.ts @@ -0,0 +1,57 @@ +import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm"; +import { Status } from "../../types/status"; + +@Entity("finance_agencia", { schema: "finances" }) +export class FinanceAgencia { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: false, + unique: false, + length: 64, + }) + code: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + name: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + description: string; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} + diff --git a/src/schema/finances.ts b/src/schema/finances.ts index add5a81..4c74e02 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -1 +1,2 @@ export * from "../entity/finance/finance_funding_sources"; +export * from "../entity/finance/finance_agencia"; From 3bff0053cdcbd49967981d2024e1488f5dab5336 Mon Sep 17 00:00:00 2001 From: Sony Surahmn Date: Wed, 31 Dec 2025 16:33:53 +0700 Subject: [PATCH 3/5] Add FinanceAtividade entity and update schema exports --- src/entity/finance/finance_atividade.ts | 57 +++++++++++++++++++++++++ src/schema/finances.ts | 1 + 2 files changed, 58 insertions(+) create mode 100644 src/entity/finance/finance_atividade.ts diff --git a/src/entity/finance/finance_atividade.ts b/src/entity/finance/finance_atividade.ts new file mode 100644 index 0000000..4dbc3d6 --- /dev/null +++ b/src/entity/finance/finance_atividade.ts @@ -0,0 +1,57 @@ +import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm"; +import { Status } from "../../types/status"; + +@Entity("finance_atividade", { schema: "finances" }) +export class FinanceAtividade { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: false, + unique: false, + length: 64, + }) + code: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + name: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + description: string; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} + diff --git a/src/schema/finances.ts b/src/schema/finances.ts index 4c74e02..8ab9a9f 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -1,2 +1,3 @@ export * from "../entity/finance/finance_funding_sources"; export * from "../entity/finance/finance_agencia"; +export * from "../entity/finance/finance_atividade"; From f479d266863e946b48eb8c3461f5f9727203de6d Mon Sep 17 00:00:00 2001 From: Sony Surahmn Date: Wed, 31 Dec 2025 16:39:36 +0700 Subject: [PATCH 4/5] Add FinanceCompany entity and update schema exports --- src/entity/finance/finance_company.ts | 106 ++++++++++++++++++++++++++ src/schema/finances.ts | 1 + 2 files changed, 107 insertions(+) create mode 100644 src/entity/finance/finance_company.ts diff --git a/src/entity/finance/finance_company.ts b/src/entity/finance/finance_company.ts new file mode 100644 index 0000000..cfc6655 --- /dev/null +++ b/src/entity/finance/finance_company.ts @@ -0,0 +1,106 @@ +import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm"; +import { Status } from "../../types/status"; + +@Entity("finance_company", { schema: "finances" }) +export class FinanceCompany { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: false, + unique: false, + length: 64, + }) + code: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + name: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + address: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + pic_name: string; + + @Column({ + nullable: true, + unique: false, + length: 64, + }) + pic_phone: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + bank: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + bank_acc_number: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + bank_acc_name: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + iban_swift_code: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + description: string; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} + diff --git a/src/schema/finances.ts b/src/schema/finances.ts index 8ab9a9f..1f78516 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -1,3 +1,4 @@ export * from "../entity/finance/finance_funding_sources"; export * from "../entity/finance/finance_agencia"; export * from "../entity/finance/finance_atividade"; +export * from "../entity/finance/finance_company"; From c3e8cf92bd748f4b7ce1e7e5cd264e6ace7165d8 Mon Sep 17 00:00:00 2001 From: Sony Surahmn Date: Wed, 31 Dec 2025 16:43:50 +0700 Subject: [PATCH 5/5] Add FinanceBankAccount entity and update schema exports --- src/entity/finance/finance_bank_account.ts | 77 ++++++++++++++++++++++ src/schema/finances.ts | 1 + 2 files changed, 78 insertions(+) create mode 100644 src/entity/finance/finance_bank_account.ts diff --git a/src/entity/finance/finance_bank_account.ts b/src/entity/finance/finance_bank_account.ts new file mode 100644 index 0000000..ea2f0da --- /dev/null +++ b/src/entity/finance/finance_bank_account.ts @@ -0,0 +1,77 @@ +import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm"; +import { Status } from "../../types/status"; + +@Entity("finance_bank_account", { schema: "finances" }) +export class FinanceBankAccount { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: false, + unique: false, + length: 64, + }) + code: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + bank: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + bank_acc_number: string; + + @Column({ + nullable: false, + unique: false, + length: 255, + }) + bank_acc_name: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + iban_swift_code: string; + + @Column({ + nullable: true, + unique: false, + length: 255, + }) + description: string; + + @Column({ + nullable: false, + length: 64, + }) + status: Status; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/schema/finances.ts b/src/schema/finances.ts index 1f78516..6809625 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -2,3 +2,4 @@ export * from "../entity/finance/finance_funding_sources"; export * from "../entity/finance/finance_agencia"; export * from "../entity/finance/finance_atividade"; export * from "../entity/finance/finance_company"; +export * from "../entity/finance/finance_bank_account";