add earchive_doc
This commit is contained in:
@ -1,16 +1,94 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
|
import { User } from "./users";
|
||||||
|
import { StatusDocument, TypeDocument, TypePriority } from "../types/earchive";
|
||||||
|
import { EarchiveDocLogs } from "./earchive_doclogs";
|
||||||
|
|
||||||
@Entity("earchive_doc", { schema: "earchive" })
|
@Entity("earchive_doc", { schema: "earchive" })
|
||||||
export class EarchiveDoc {
|
export class EarchiveDoc {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
docnumber: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
docsubject: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
doctype: TypeDocument;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
doctypename: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
docpriority: TypePriority;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
companyname: string;
|
||||||
|
|
||||||
|
@Column({ name: 'docdates', nullable: true })
|
||||||
|
docdates: Date;
|
||||||
|
|
||||||
|
@Column({ name: 'approvalbyid', type: 'uuid', nullable: true })
|
||||||
|
approvalbyid: string;
|
||||||
|
|
||||||
|
// @OneToOne(() => User, { nullable: true })
|
||||||
|
// @JoinColumn({ name: 'approvalbyid' })
|
||||||
|
// approvalby: User
|
||||||
|
|
||||||
|
@Column({ name: 'approvaldate', nullable: true })
|
||||||
|
approvaldate: Date;
|
||||||
|
|
||||||
|
@Column({ name: 'dispositionbyid', type: 'uuid', nullable: true })
|
||||||
|
dispositionbyid: string;
|
||||||
|
|
||||||
|
// @OneToOne(() => User, { nullable: true })
|
||||||
|
// @JoinColumn({ name: 'dispositionbyid' })
|
||||||
|
// dispositionby: User
|
||||||
|
|
||||||
|
@Column({ name: 'dispositiondate', nullable: true })
|
||||||
|
dispositiondate: Date;
|
||||||
|
|
||||||
|
@Column({ name: 'attachdoc', nullable: true })
|
||||||
|
attachdoc: string;
|
||||||
|
|
||||||
|
@Column({ name: 'attachdocurl', nullable: true })
|
||||||
|
attachdocurl: string;
|
||||||
|
|
||||||
|
@Column({ name: 'attachlink', nullable: true })
|
||||||
|
attachlink: string;
|
||||||
|
|
||||||
|
@Column({ type: 'text', nullable: true })
|
||||||
|
content: string;
|
||||||
|
|
||||||
|
@Column({ type: 'int', nullable: true })
|
||||||
|
statusdoc: StatusDocument;
|
||||||
|
|
||||||
|
@Column({ type: 'text', nullable: true })
|
||||||
|
statusdocdesc: string;
|
||||||
|
|
||||||
|
@Column({ name: 'laststatusdate', nullable: true })
|
||||||
|
laststatusdate: Date;
|
||||||
|
|
||||||
|
@Column({ type: 'text', nullable: true })
|
||||||
|
remarks: string;
|
||||||
|
|
||||||
|
@OneToMany(() => EarchiveDocLogs, (ipo) => ipo.docs, {
|
||||||
|
cascade: false,
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
logs: EarchiveDocLogs;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|
||||||
@Column({ nullable: true, length: 256 })
|
@Column({ name: 'createdbyid', type: 'uuid', nullable: true })
|
||||||
created_by: string;
|
createdbyid: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'createdbyid' })
|
||||||
|
createdby: User
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@UpdateDateColumn()
|
@UpdateDateColumn()
|
||||||
@ -26,3 +104,5 @@ export class EarchiveDoc {
|
|||||||
@Column({ nullable: true, length: 256 })
|
@Column({ nullable: true, length: 256 })
|
||||||
deleted_by: string;
|
deleted_by: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
56
src/entity/earchive_doclogs.ts
Normal file
56
src/entity/earchive_doclogs.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import { Column, Entity, DeleteDateColumn, PrimaryGeneratedColumn, ManyToOne, JoinColumn, UpdateDateColumn } from "typeorm";
|
||||||
|
import { EarchiveDoc } from "./earchive_doc";
|
||||||
|
import { User } from "./users";
|
||||||
|
|
||||||
|
@Entity("earchive_doclogs", { schema: "earchive" })
|
||||||
|
export class EarchiveDocLogs {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => EarchiveDoc, { onDelete: "CASCADE", nullable: true })
|
||||||
|
@JoinColumn({ name: 'docs' })
|
||||||
|
docs: EarchiveDoc;
|
||||||
|
|
||||||
|
@Column("smallint", { name: "status", nullable: false, default: 0 })
|
||||||
|
status: number;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
statusdescription: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
remark: string;
|
||||||
|
|
||||||
|
@Column({ name: 'createdbyid', type: 'uuid', nullable: true })
|
||||||
|
createdbyid: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, (ipo) => ipo.id, {
|
||||||
|
cascade: false,
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
@JoinColumn({ name: 'createdbyid' })
|
||||||
|
createdby: User;
|
||||||
|
|
||||||
|
@Column("timestamp", {
|
||||||
|
name: "created_at",
|
||||||
|
default: () => "CURRENT_TIMESTAMP",
|
||||||
|
})
|
||||||
|
createdAt: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column("timestamp", {
|
||||||
|
name: "updated_at",
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updatedAt: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
deleted_by: string;
|
||||||
|
|
||||||
|
@Column("timestamp", { name: "deleted_at", nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deletedAt: Date | null;
|
||||||
|
|
||||||
|
}
|
||||||
48
src/entity/earchive_receiver.ts
Normal file
48
src/entity/earchive_receiver.ts
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
|
import { User } from "./users";
|
||||||
|
import { EarchiveDoc } from "./earchive_doc";
|
||||||
|
import { TypeReceiver } from "../types/earchive";
|
||||||
|
|
||||||
|
@Entity("earchive_receiver", { schema: "earchive" })
|
||||||
|
export class EarchiveReceiver {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({ name: 'docid', type: 'uuid', nullable: true })
|
||||||
|
docid: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => EarchiveDoc, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'docid' })
|
||||||
|
doc: EarchiveDoc;
|
||||||
|
|
||||||
|
@Column({ name: 'typereceiver', nullable: true })
|
||||||
|
typereceiver: TypeReceiver;
|
||||||
|
|
||||||
|
@Column({ name: 'uuidreceiver', type: 'uuid', nullable: true })
|
||||||
|
uuidreceiver: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ name: 'createdbyid', type: 'uuid', nullable: true })
|
||||||
|
createdbyid: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, { nullable: true })
|
||||||
|
@JoinColumn({ name: 'createdbyid' })
|
||||||
|
createdby: User
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
53
src/entity/hrms_dept.ts
Normal file
53
src/entity/hrms_dept.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn } from "typeorm";
|
||||||
|
// import { Employee } from "./hrms_employee";
|
||||||
|
|
||||||
|
@Entity("tbl_employeedept", { schema: "hrms", synchronize: false })
|
||||||
|
export class EmployeeDept {
|
||||||
|
@PrimaryColumn("uuid", { name: "uuid" })
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: true })
|
||||||
|
_idx: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 80, nullable: true })
|
||||||
|
deptname: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
nikspv: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
nikmgr: string;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
idxdivisi: number;
|
||||||
|
|
||||||
|
// @OneToMany(() => Employee, (emp) => emp.dept)
|
||||||
|
// employees: Employee[];
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
isdeleted: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 200, nullable: true })
|
||||||
|
remarkdeleted: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
iby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
idt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
uby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
udt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
dby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
ddt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 50, nullable: true })
|
||||||
|
nikgm: string;
|
||||||
|
}
|
||||||
138
src/entity/hrms_employee.ts
Normal file
138
src/entity/hrms_employee.ts
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, PrimaryColumn } from "typeorm";
|
||||||
|
// import { EmployeeDept } from "./hrms_dept";
|
||||||
|
|
||||||
|
@Entity("tbl_employee", { schema: "hrms", synchronize: false })
|
||||||
|
export class Employee {
|
||||||
|
@PrimaryColumn("uuid", { name: "uuid" })
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: true })
|
||||||
|
_idx: number;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: true })
|
||||||
|
fingerid: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
nik: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
employeename: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
idxlevel: number;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
idxdept: number;
|
||||||
|
|
||||||
|
// @ManyToOne(() => EmployeeDept, (dept) => dept.employees, { eager: false })
|
||||||
|
// @JoinColumn({ name: "idxdept", referencedColumnName: "_idx" })
|
||||||
|
// dept: EmployeeDept;
|
||||||
|
|
||||||
|
@Column({ type: "int", nullable: true })
|
||||||
|
idxdirecao: number;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
idxservico: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 300, nullable: true })
|
||||||
|
idxdeptaccessatt: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 200, nullable: true })
|
||||||
|
address: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
telp: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 80, nullable: true })
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
idxoffice: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
picemployee: string;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
isactivated: number;
|
||||||
|
|
||||||
|
@Column({ type: "smallint", nullable: true })
|
||||||
|
isdeleted: number;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 200, nullable: true })
|
||||||
|
remarkdeleted: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
iby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
idt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
uby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
udt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 30, nullable: true })
|
||||||
|
dby: string;
|
||||||
|
|
||||||
|
@Column({ type: "timestamp", nullable: true })
|
||||||
|
ddt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 200, nullable: true })
|
||||||
|
pass: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 50, nullable: true })
|
||||||
|
job_grade: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 50, nullable: true })
|
||||||
|
status: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
passportnumber: string;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: true })
|
||||||
|
passportexpdate: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
visanumber: string;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: true })
|
||||||
|
visaexpdate: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
eleitoralnumber: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
familynumber: string;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: true })
|
||||||
|
startworking: Date;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: true })
|
||||||
|
tmt: Date;
|
||||||
|
|
||||||
|
@Column({ type: "date", nullable: true })
|
||||||
|
birthdate: Date;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
|
relationwithemployee: string;
|
||||||
|
|
||||||
|
@Column({ type: "varchar", length: 50, nullable: true })
|
||||||
|
username: string;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
idcard: string;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
educationbackground: string;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
familycertificate: string;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
passport: string;
|
||||||
|
}
|
||||||
@ -1,2 +1,5 @@
|
|||||||
export * from "../entity/earchive_doc";
|
export * from "../entity/earchive_doc";
|
||||||
export * from "../entity/earchive_doctype";
|
export * from "../entity/earchive_doctype";
|
||||||
|
export * from "../entity/earchive_doclogs";
|
||||||
|
export * from "../entity/earchive_receiver";
|
||||||
|
export * from "../types/earchive";
|
||||||
@ -1 +1,3 @@
|
|||||||
export * from "../entity/log_hikvision";
|
export * from "../entity/log_hikvision";
|
||||||
|
export * from "../entity/hrms_employee";
|
||||||
|
export * from "../entity/hrms_dept";
|
||||||
|
|||||||
@ -6,3 +6,22 @@ export enum StatusDocument {
|
|||||||
"disposition" = 2,
|
"disposition" = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export enum TypeDocument {
|
||||||
|
"Nota_Dinas" = "ND",
|
||||||
|
"Surat_Internal" = "SI",
|
||||||
|
"Surat_Undangan" = "SU",
|
||||||
|
"Surat_Keputusan" = "SK",
|
||||||
|
"Surat_Eksternal" = "SE",
|
||||||
|
"Surat_Izin_Prinsip" = "SIP"
|
||||||
|
};
|
||||||
|
|
||||||
|
export enum TypeReceiver {
|
||||||
|
"Personal" = "P",
|
||||||
|
"Department" = "D"
|
||||||
|
};
|
||||||
|
|
||||||
|
export enum TypePriority {
|
||||||
|
"Priority" = "P",
|
||||||
|
"Non Priority" = "NP"
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user