finance Purchase Request
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { HrmsDepartment } from "../hrms/hrms_department";
|
||||
import { FinancePlan } from "./finance_plans";
|
||||
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
|
||||
import { HrmsDepartment } from "../hrms/hrms_department";
|
||||
|
||||
@Entity("finance_plan_items", { schema: "finances" })
|
||||
export class FinancePlanItem {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
@Entity("finance_plans", { schema: "finances" })
|
||||
export class FinancePlan {
|
||||
|
||||
77
src/entity/finance/finance_purchase_requests.ts
Normal file
77
src/entity/finance/finance_purchase_requests.ts
Normal file
@ -0,0 +1,77 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
import { FinanceAtividade } from "./finance_atividade";
|
||||
import { FinanceLocalizacao } from "./finance_localizacao";
|
||||
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
|
||||
import { PurchaseRequestStatusType } from "../../types/finance";
|
||||
|
||||
@Entity("finance_purchase_requests", { schema: "finances" })
|
||||
export class FinancePurchaseRequest {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceAtividade, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
atividade: FinanceAtividade;
|
||||
|
||||
@ManyToOne(() => FinanceLocalizacao, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
localizacao: FinanceLocalizacao;
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
sub_budget_line: FinanceSubBudgetLine;
|
||||
|
||||
@Column({
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
purchase_request_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
total: number;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
prepare_by: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
approval_by: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: PurchaseRequestStatusType.draft,
|
||||
length: 128,
|
||||
})
|
||||
status: PurchaseRequestStatusType;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -9,3 +9,4 @@ 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_items";
|
||||
export * from "../entity/finance/finance_purchase_requests";
|
||||
|
||||
6
src/types/finance.ts
Normal file
6
src/types/finance.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export enum PurchaseRequestStatusType {
|
||||
draft = "draft",
|
||||
pending_approval = "pending_approval",
|
||||
approve = "approve",
|
||||
reject = "reject",
|
||||
}
|
||||
Reference in New Issue
Block a user