This commit is contained in:
fro1991
2025-12-31 17:02:26 +07:00
11 changed files with 442 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 { Status } from '../types/status';
import { Munisipo } from './munisipo';
@Entity('administrativus') @Entity('administrativus')
export class Administrativu { export class Administrativu {
@ -13,6 +14,10 @@ export class Administrativu {
}) })
code: string; code: string;
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
@JoinColumn()
munisipo: Munisipo;
@Column({ @Column({
nullable: false, nullable: false,
length: 256 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 { Status } from '../types/status';
import { Suco } from './suco';
@Entity('aldeias') @Entity('aldeias')
export class Aldeia { export class Aldeia {
@ -25,6 +26,10 @@ export class Aldeia {
}) })
status: Status; status: Status;
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
@JoinColumn()
suco: Suco;
@Column() @Column()
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -13,6 +13,11 @@ import { HrmsAirport } from "./hrms_airport";
import { HrmsDepartment } from "./hrms_department"; import { HrmsDepartment } from "./hrms_department";
import { HrmsPosition } from "./hrms_position"; import { HrmsPosition } from "./hrms_position";
import { HrmsShift } from "./hrms_shift"; 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" }) @Entity("hrms_employees", { schema: "hrms" })
export class HrmsEmployee { export class HrmsEmployee {
@ -44,8 +49,9 @@ export class HrmsEmployee {
@Column({ length: 128 }) @Column({ length: 128 })
email: string; email: string;
@Column({ length: 64 }) @ManyToOne(() => Nationality)
nationality: string; @JoinColumn({ name: "nationality_id" })
nationality: Nationality;
@Column({ length: 64 }) @Column({ length: 64 })
last_education: string; last_education: string;
@ -53,17 +59,21 @@ export class HrmsEmployee {
@Column({ nullable: true, length: 256 }) @Column({ nullable: true, length: 256 })
photo_url: string; photo_url: string;
@Column({ length: 64 }) @ManyToOne(() => Aldeia)
aldeia: string; @JoinColumn({ name: "aldeia_id" })
aldeia: Aldeia;
@Column({ length: 64 }) @ManyToOne(() => Suco)
suco: string; @JoinColumn({ name: "suco_id" })
suco: Suco;
@Column({ length: 64 }) @ManyToOne(() => Administrativu)
administrativu: string; @JoinColumn({ name: "administrativu_id" })
administrativu: Administrativu;
@Column({ length: 64 }) @ManyToOne(() => Munisipo)
district: string; @JoinColumn({ name: "munisipo_id" })
munisipo: Munisipo;
@Column({ length: 256 }) @Column({ length: 256 })
street: string; street: string;
@ -87,6 +97,69 @@ export class HrmsEmployee {
@Column({ type: "int" }) @Column({ type: "int" })
yearly_leave_quota: number; 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 }) @Column({ length: 64 })
status: Status; 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 { Status } from '../types/status';
import { Administrativu } from './administrativu';
@Entity('sucos') @Entity('sucos')
export class Suco { export class Suco {
@ -19,6 +20,10 @@ export class Suco {
}) })
name: string; name: string;
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
@JoinColumn()
administrativu: Administrativu;
@Column({ @Column({
nullable: false, nullable: false,
length: 64 length: 64

View File

@ -2,3 +2,7 @@ export * from "../entity/finance/finance_funding_sources";
export * from "../entity/finance/fincance_categories"; export * from "../entity/finance/fincance_categories";
export * from "../entity/finance/fincance_budget_lines"; export * from "../entity/finance/fincance_budget_lines";
export * from "../entity/finance/fincance_sub_budget_lines"; export * from "../entity/finance/fincance_sub_budget_lines";
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";

View File

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