From fab89895f03a4a3677932a29807031a779776f4f Mon Sep 17 00:00:00 2001 From: Narul Hidayah Date: Tue, 30 Dec 2025 22:31:26 +0700 Subject: [PATCH] hrms department --- src/entity/hrms/hrms_department.ts | 56 ++++++++++++++++++++++++++++++ src/index.ts | 3 +- src/schema/hrms.ts | 1 + 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/entity/hrms/hrms_department.ts create mode 100644 src/schema/hrms.ts diff --git a/src/entity/hrms/hrms_department.ts b/src/entity/hrms/hrms_department.ts new file mode 100644 index 0000000..c234f56 --- /dev/null +++ b/src/entity/hrms/hrms_department.ts @@ -0,0 +1,56 @@ +import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm"; +import { Status } from "../../types/status"; + +@Entity("hrms_departments", { schema: "hrms" }) +export class HrmsDepartment { + @PrimaryGeneratedColumn('uuid') + id: string; + + @Column({ + nullable: false, + unique: false, + length: 64 + }) + code: string; + + @Column({ + nullable: false, + unique: false, + length: 64 + }) + name: string; + + @Column({ + nullable: true, + unique: false, + length: 64 + }) + 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/index.ts b/src/index.ts index bb4664b..bad606b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ -export * from "./schema/public"; \ No newline at end of file +export * from "./schema/public"; +export * from "./schema/hrms"; \ No newline at end of file diff --git a/src/schema/hrms.ts b/src/schema/hrms.ts new file mode 100644 index 0000000..e9f869b --- /dev/null +++ b/src/schema/hrms.ts @@ -0,0 +1 @@ +export * from "../entity/hrms/hrms_department" \ No newline at end of file