finance plan

This commit is contained in:
fro1991
2026-01-17 14:26:18 +07:00
parent 93d8f95e3c
commit 12a48b4b27
3 changed files with 255 additions and 0 deletions

View File

@ -0,0 +1,188 @@
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
import { Status } from "../../types/status";
import { FinancePlan } from "./finance_plans";
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
import { HrmsDepartment } from "../hrms/hrms_department";
@Entity("finance_plan_details", { schema: "finances" })
export class FinancePlanDetail {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => FinancePlan, { onDelete: "RESTRICT", nullable: true })
@JoinColumn()
employee: FinancePlan;
@Column({
nullable: true,
length: 128,
})
program_code: string;
@Column({
nullable: true,
length: 128,
})
program_sub_code: string;
@Column({
nullable: true,
length: 128,
})
activity_code: string;
@Column({
nullable: true,
length: 256,
})
activity_description: string;
@Column({
nullable: true,
length: 256,
})
activity_sub_description: string;
@Column({
nullable: true,
length: 4096,
})
item: string;
@Column({
nullable: true,
length: 128,
})
unit: string;
@Column({
nullable: true,
type: "float8",
})
price: number;
@Column({
type: "int",
nullable: false,
})
duration: number;
@Column({
nullable: true,
type: "float8",
})
cost: number;
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
sub_budget_line: FinanceSubBudgetLine;
@Column({
nullable: true,
length: 256,
})
expanse_type: string;
@ManyToOne(() => HrmsDepartment, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
department: HrmsDepartment;
@Column({
nullable: true,
length: 128,
})
mtc_code: string;
@Column({
nullable: true,
type: "float8",
})
t1_1: number;
@Column({
nullable: true,
type: "float8",
})
t1_2: number;
@Column({
nullable: true,
type: "float8",
})
t1_3: number;
@Column({
nullable: true,
type: "float8",
})
t2_4: number;
@Column({
nullable: true,
type: "float8",
})
t2_5: number;
@Column({
nullable: true,
type: "float8",
})
t2_6: number;
@Column({
nullable: true,
type: "float8",
})
t3_7: number;
@Column({
nullable: true,
type: "float8",
})
t3_8: number;
@Column({
nullable: true,
type: "float8",
})
t3_9: number;
@Column({
nullable: true,
type: "float8",
})
t4_10: number;
@Column({
nullable: true,
type: "float8",
})
t4_11: number;
@Column({
nullable: true,
type: "float8",
})
t4_12: number;
@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,65 @@
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
import { Status } from "../../types/status";
@Entity("finance_plans", { schema: "finances" })
export class FinancePlan {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
type: "int",
nullable: false,
})
year: number; // e.g., 2026
@Column({
nullable: false,
})
version_at: Date;
@Column({
nullable: false,
unique: false,
length: 128,
})
version_code: string;
@Column({
nullable: true,
type: "float8",
})
total_price: number;
@Column({
nullable: true,
type: "float8",
})
total_duration: number;
@Column({
nullable: true,
type: "float8",
})
total_cost: number;
@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

@ -7,3 +7,5 @@ export * from "../entity/finance/finance_atividade";
export * from "../entity/finance/finance_company";
export * from "../entity/finance/finance_bank_account";
export * from "../entity/finance/finance_localizacao";
export * from "../entity/finance/finance_plans";
export * from "../entity/finance/finance_plan_details";