checklist payment
This commit is contained in:
68
src/entity/finance/finance_checklist_payment.ts
Normal file
68
src/entity/finance/finance_checklist_payment.ts
Normal file
@ -0,0 +1,68 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
|
||||
import { FinanceFundingSource } from "./finance_funding_sources";
|
||||
import { FinanceAtividade } from "./finance_atividade";
|
||||
import { FinanceBudgetLine } from "./fincance_budget_lines";
|
||||
import { HrmsDepartment } from "../hrms/hrms_department";
|
||||
import { FinanceChecklistPaymentItem } from "./finance_checklist_payment_item";
|
||||
import { FinanceChecklistPaymentApproval } from "./finance_checklist_payment_approval";
|
||||
import { FinanceChecklistPaymentStatus, FinanceChecklistPaymentType } from "../../types/finance";
|
||||
|
||||
@Entity("finance_checklist_payment", { schema: "finances" })
|
||||
export class FinanceChecklistPayment {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
unique: false,
|
||||
length: 128,
|
||||
})
|
||||
type: FinanceChecklistPaymentType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
date: Date;
|
||||
|
||||
@ManyToOne(() => FinanceFundingSource, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
funding_source: FinanceFundingSource;
|
||||
|
||||
@ManyToOne(() => HrmsDepartment, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
department: HrmsDepartment;
|
||||
|
||||
@ManyToOne(() => FinanceAtividade, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
activity: FinanceAtividade;
|
||||
|
||||
@OneToMany(() => FinanceChecklistPaymentItem, (item) => item.payment, { cascade: true })
|
||||
items: FinanceChecklistPaymentItem[];
|
||||
|
||||
@OneToMany(() => FinanceChecklistPaymentApproval, (approval) => approval.payment, { cascade: true })
|
||||
approvals: FinanceChecklistPaymentApproval[];
|
||||
|
||||
@Column({ nullable: false })
|
||||
status: FinanceChecklistPaymentStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
29
src/entity/finance/finance_checklist_payment_approval.ts
Normal file
29
src/entity/finance/finance_checklist_payment_approval.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { FinanceChecklistPayment } from "./finance_checklist_payment";
|
||||
import { FinanceChecklistPaymentApprovalRole } from "../../types/finance";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
|
||||
@Entity("finance_checklist_payment_approval", { schema: "finances" })
|
||||
export class FinanceChecklistPaymentApproval {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceChecklistPayment, (payment) => payment.approvals, { onDelete: "CASCADE" })
|
||||
payment: FinanceChecklistPayment;
|
||||
|
||||
@Column({ type: "enum", enum: FinanceChecklistPaymentApprovalRole })
|
||||
role: FinanceChecklistPaymentApprovalRole;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
employee: HrmsEmployee;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
position: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
signed_date: Date;
|
||||
}
|
||||
20
src/entity/finance/finance_checklist_payment_document.ts
Normal file
20
src/entity/finance/finance_checklist_payment_document.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { FinanceChecklistPaymentItem } from "./finance_checklist_payment_item";
|
||||
|
||||
@Entity("finance_checklist_payment_document", { schema: "finances" })
|
||||
export class FinanceChecklistPaymentDocument {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceChecklistPaymentItem, (item) => item.documents, { onDelete: "CASCADE" })
|
||||
checklist_item: FinanceChecklistPaymentItem;
|
||||
|
||||
@Column({ nullable: true })
|
||||
reference_id: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
document_number: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
}
|
||||
37
src/entity/finance/finance_checklist_payment_item.ts
Normal file
37
src/entity/finance/finance_checklist_payment_item.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { FinanceChecklistPayment } from "./finance_checklist_payment";
|
||||
import { FinanceChecklistPaymentItemType } from "../../types/finance";
|
||||
import { FinanceChecklistPaymentDocument } from "./finance_checklist_payment_document";
|
||||
|
||||
@Entity("finance_checklist_payment_item", { schema: "finances" })
|
||||
export class FinanceChecklistPaymentItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceChecklistPayment, (payment) => payment.items, { onDelete: "CASCADE" })
|
||||
payment: FinanceChecklistPayment;
|
||||
|
||||
@Column({ type: "enum", enum: FinanceChecklistPaymentItemType })
|
||||
type: FinanceChecklistPaymentItemType;
|
||||
|
||||
@Column({ default: false })
|
||||
is_checked: boolean;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
file_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
fund: number;
|
||||
|
||||
@Column({ length: 128, nullable: true })
|
||||
document_number: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
reference_id: string;
|
||||
|
||||
@OneToMany(() => FinanceChecklistPaymentDocument, (doc) => doc.checklist_item, { cascade: true })
|
||||
documents: FinanceChecklistPaymentDocument[];
|
||||
}
|
||||
@ -12,5 +12,9 @@ export * from "../entity/finance/finance_plan_items";
|
||||
export * from "../entity/finance/finance_purchase_requests";
|
||||
export * from "../entity/finance/finance_purchase_request_items";
|
||||
export * from "../entity/finance/finance_cpvs";
|
||||
export * from "../entity/finance/finance_checklist_payment";
|
||||
export * from "../entity/finance/finance_checklist_payment_item";
|
||||
export * from "../entity/finance/finance_checklist_payment_approval";
|
||||
export * from "../entity/finance/finance_checklist_payment_document";
|
||||
|
||||
export * from "../types/finance";
|
||||
|
||||
@ -41,3 +41,38 @@ export enum FinanceCpvStatusType {
|
||||
paid = "paid",
|
||||
reject = "reject",
|
||||
}
|
||||
|
||||
export enum FinanceChecklistPaymentItemType {
|
||||
ADVANCE_FUND = "advance_fund",
|
||||
FCP_CPV = "fcp_cpv",
|
||||
PRT = "prt",
|
||||
PAYMENT_ORDER = "payment_order",
|
||||
OBLIGATION = "obligation",
|
||||
PAYMENT_REQUEST = "payment_request",
|
||||
CHEQUE = "cheque",
|
||||
INVOICE = "invoice",
|
||||
ASSET_REGISTRATION = "asset_registration",
|
||||
AND_RECOMMENDATION = "and_recomendation",
|
||||
SERVICE_REPORT = "service_report",
|
||||
FINANCE_CODE = "finance_code",
|
||||
OTHER_DOCUMENT = "other_document",
|
||||
}
|
||||
|
||||
export enum FinanceChecklistPaymentApprovalRole {
|
||||
PREPARER = "preparer",
|
||||
VERIFIER = "verifier",
|
||||
APPROVER = "approver",
|
||||
}
|
||||
|
||||
export enum FinanceChecklistPaymentStatus {
|
||||
DRAFT = "draft",
|
||||
PENDING_VERIFY = "pending_verifier",
|
||||
PENDING_APPROVE = "pending_approver",
|
||||
SUCCESS = "success",
|
||||
REJECTED = "rejected",
|
||||
}
|
||||
|
||||
export enum FinanceChecklistPaymentType {
|
||||
SALARY_PAYMENT = "salary_payment",
|
||||
DIRECT_PAYMENT = "direct_payment",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user