init
This commit is contained in:
@ -1,57 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
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({
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
checklist_payment_at: 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;
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
sub_budget_line: FinanceSubBudgetLine;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
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;
|
||||
|
||||
@Column({ nullable: true, default: false })
|
||||
is_signed: boolean;
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
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[];
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
import { Entity, PrimaryColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
|
||||
/**
|
||||
* Single-row config for CPV default signatories.
|
||||
* Used when creating CPV to auto-fill: AUTORIZADOR DA AGENCIA, CERTIFICADO DA AGENCIA, AUTORIZADOR DO TESOURO.
|
||||
*/
|
||||
@Entity("finance_cpv_config", { schema: "finances" })
|
||||
export class FinanceCpvConfig {
|
||||
@PrimaryColumn({ length: 64, default: "default" })
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
agency_authorizer: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
agency_certifier: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
treasury_authorizer: HrmsEmployee;
|
||||
}
|
||||
@ -1,159 +0,0 @@
|
||||
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 { FinanceCpvPaymentMethodType, FinanceCpvPaymentModelType, FinanceCpvPaymentStageType, FinanceCpvStatusType, FinanceCpvType, FinancePurchaseRequestStatusType } from "../../types/finance";
|
||||
import { FinanceAgencia } from "./finance_agencia";
|
||||
import { FinanceFundingSource } from "./finance_funding_sources";
|
||||
import { FinanceCompany } from "./finance_company";
|
||||
import { FinancePurchaseRequest } from "./finance_purchase_requests";
|
||||
|
||||
@Entity("finance_cpvs", { schema: "finances" })
|
||||
export class FinanceCpv {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceFundingSource, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
funding_source: FinanceFundingSource;
|
||||
|
||||
@ManyToOne(() => FinanceAgencia, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
agencia: FinanceAgencia;
|
||||
|
||||
@ManyToOne(() => FinanceAtividade, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
atividade: FinanceAtividade;
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
sub_budget_line: FinanceSubBudgetLine;
|
||||
|
||||
@ManyToOne(() => FinanceLocalizacao, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
localizacao: FinanceLocalizacao;
|
||||
|
||||
@ManyToOne(() => FinancePurchaseRequest, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
purchase_request: FinancePurchaseRequest;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
type: FinanceCpvType;
|
||||
|
||||
@Column({
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
cpv_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
payment_model: FinanceCpvPaymentModelType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
payment_stage: FinanceCpvPaymentStageType;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
amount_words: String;
|
||||
|
||||
@ManyToOne(() => FinanceCompany, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
company: FinanceCompany;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
description_item: String;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
explanation_justification: String;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
payment_description: String;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
financial_responsible: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
agency_authorizer: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
agency_certifier: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
treasury_authorizer: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
type: "jsonb",
|
||||
nullable: true,
|
||||
})
|
||||
documents: any;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
payment_method: FinanceCpvPaymentMethodType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: FinanceCpvStatusType.draft,
|
||||
length: 128,
|
||||
})
|
||||
status: FinanceCpvStatusType;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("finance_funding_sources", { schema: "finances" })
|
||||
export class FinanceFundingSource {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
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;
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("finance_localizacao", { schema: "finances" })
|
||||
export class FinanceLocalizacao {
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,102 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
import { FinanceCpv } from "./finance_cpvs";
|
||||
import { FinanceBankAccount } from "./finance_bank_account";
|
||||
import { FinancePaymentOrderStatusType } from "../../types/finance";
|
||||
|
||||
@Entity("finance_payment_orders", { schema: "finances" })
|
||||
export class FinancePaymentOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
cpv: FinanceCpv;
|
||||
|
||||
@Column({
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
payment_order_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
paid_to_name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
paid_to_title: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
subject_type: string;
|
||||
|
||||
@ManyToOne(() => FinanceBankAccount, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
bank_account: FinanceBankAccount;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
amount_words: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
objective: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
approved_by: HrmsEmployee;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
authorized_by: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: FinancePaymentOrderStatusType.draft,
|
||||
length: 128,
|
||||
})
|
||||
status: FinancePaymentOrderStatusType;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { FinanceCpv } from "./finance_cpvs";
|
||||
import { FinancePaymentOrder } from "./finance_payment_orders";
|
||||
|
||||
@Entity("finance_petty_cash_credits", { schema: "finances" })
|
||||
export class FinancePettyCashCredit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "cpvId" })
|
||||
cpv: FinanceCpv;
|
||||
|
||||
@ManyToOne(() => FinancePaymentOrder, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
payment_order: FinancePaymentOrder; // Order Pagamento from CPV
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "float8",
|
||||
})
|
||||
amount: number; // Amount from CPV
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
amount_words: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
description: string;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { FinanceAgencia } from "./finance_agencia";
|
||||
import { FinanceAtividade } from "./finance_atividade";
|
||||
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
|
||||
import { FinanceLocalizacao } from "./finance_localizacao";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
|
||||
@Entity("finance_petty_cash_expenses", { schema: "finances" })
|
||||
export class FinancePettyCashExpense {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string; // Voucher code (e.g., "2025-0001/ANATL,E.P./03")
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
expense_date: Date; // Date of expense
|
||||
|
||||
@ManyToOne(() => FinanceAgencia, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
division_classification: FinanceAgencia; // Division Classification
|
||||
|
||||
@ManyToOne(() => FinanceAtividade, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
activity_classification: FinanceAtividade; // Activity Classification
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
sub_rubric_code: FinanceSubBudgetLine; // Sub Rubric Code
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 255,
|
||||
})
|
||||
paid_to: string; // Paid To/For
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "float8",
|
||||
})
|
||||
total_amount: number; // Total Amount
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
amount_in_words: string; // Amount in Words
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
description: string; // Description of expense
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
authorizing_officer: HrmsEmployee; // Authorizing Officer
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
finance_officer: HrmsEmployee; // Finance Officer
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
acknowledgement: string; // Acknowledgement text
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 255,
|
||||
})
|
||||
acknowledged_by_name: string; // Name of person acknowledging
|
||||
|
||||
@ManyToOne(() => FinanceLocalizacao, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
location: FinanceLocalizacao; // Location Code
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
})
|
||||
document_number: string; // No. Doc. (e.g., "01", "02", "03")
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
observation: string; // Observation/Notes
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("finance_petty_cash_pockets", { schema: "finances" })
|
||||
export class FinancePettyCashPocket {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 255,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "float8",
|
||||
default: 0,
|
||||
})
|
||||
balance: number; // Current balance of the petty cash pocket
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { FinancePettyCashCredit } from "./finance_petty_cash_credits";
|
||||
import { FinancePettyCashExpense } from "./finance_petty_cash_expenses";
|
||||
import { FinanceAgencia } from "./finance_agencia";
|
||||
import { FinanceAtividade } from "./finance_atividade";
|
||||
import { FinanceSubBudgetLine } from "./fincance_sub_budget_lines";
|
||||
import { FinanceLocalizacao } from "./finance_localizacao";
|
||||
import { PettyCashTransactionType } from "../../types/finance";
|
||||
|
||||
@Entity("finance_petty_cash_transactions", { schema: "finances" })
|
||||
export class FinancePettyCashTransaction {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
transaction_date: Date; // Transaction date
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
type: PettyCashTransactionType; // credit or expense
|
||||
|
||||
@ManyToOne(() => FinancePettyCashCredit, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
credit: FinancePettyCashCredit; // Reference to credit if type is credit
|
||||
|
||||
@ManyToOne(() => FinancePettyCashExpense, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
expense: FinancePettyCashExpense; // Reference to expense if type is expense
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
description: string; // Description (e.g., "Limpesa e Seguranca", "Outros Serviso Correntes")
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
})
|
||||
document_number: string; // No. Doc.
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
})
|
||||
fund_code: string; // Fund code
|
||||
|
||||
@ManyToOne(() => FinanceAgencia, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
division_classification: FinanceAgencia; // Division Classification
|
||||
|
||||
@ManyToOne(() => FinanceAtividade, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
activity_classification: FinanceAtividade; // Activity Classification
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
rubric_sub_rubric: FinanceSubBudgetLine; // Rubric/Sub-Rubric
|
||||
|
||||
@ManyToOne(() => FinanceLocalizacao, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
location_code: FinanceLocalizacao; // Location Code
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
default: 0,
|
||||
})
|
||||
entry_fund: number; // Entry Fund (USD $) - for credits
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
default: 0,
|
||||
})
|
||||
expenses: number; // Expenses (USD $) - for expenses
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "float8",
|
||||
})
|
||||
balance: number; // Running balance after this transaction
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
})
|
||||
observation: string; // Observation/Notes
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,187 +0,0 @@
|
||||
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";
|
||||
|
||||
@Entity("finance_plan_items", { schema: "finances" })
|
||||
export class FinancePlanItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinancePlan, { onDelete: "RESTRICT", nullable: true })
|
||||
@JoinColumn()
|
||||
plan: 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;
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { FinancePurchaseRequest } from "./finance_purchase_requests";
|
||||
|
||||
@Entity("finance_purchase_request_items", { schema: "finances" })
|
||||
export class FinancePurchaseRequestItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => FinancePurchaseRequest, { onDelete: "RESTRICT", nullable: true })
|
||||
@JoinColumn()
|
||||
purchase_request: FinancePurchaseRequest;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096,
|
||||
})
|
||||
item: string;
|
||||
|
||||
@Column({
|
||||
type: "float8",
|
||||
nullable: false,
|
||||
})
|
||||
quantity: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
unit: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
price: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
total: 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;
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
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 { FinancePurchaseRequestStatusType } 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;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
prepare_at: Date;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
approval_by: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
approval_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
default: FinancePurchaseRequestStatusType.draft,
|
||||
length: 128,
|
||||
})
|
||||
status: FinancePurchaseRequestStatusType;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from "../../types/status";
|
||||
import { FinanceCategory } from "./fincance_categories";
|
||||
|
||||
@Entity("finance_budget_lines", { schema: "finances" })
|
||||
export class FinanceBudgetLine {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@ManyToOne(() => FinanceCategory, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinTable()
|
||||
category: FinanceCategory;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("finance_categories", { schema: "finances" })
|
||||
export class FinanceCategory {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
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;
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||
|
||||
import { Status } from "../../types/status";
|
||||
import { FinanceCategory } from "./fincance_categories";
|
||||
import { FinanceBudgetLine } from "./fincance_budget_lines";
|
||||
|
||||
@Entity("finance_sub_budget_lines", { schema: "finances" })
|
||||
export class FinanceSubBudgetLine {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
unique: false,
|
||||
length: 64,
|
||||
})
|
||||
description: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@ManyToOne(() => FinanceBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinTable()
|
||||
budget_line: FinanceBudgetLine;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, PrimaryColumn, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("hrms_airports", { schema: "hrms" })
|
||||
export class HrmsAirport {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: false,
|
||||
length: 64
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
unique: false,
|
||||
length: 64
|
||||
})
|
||||
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;
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, JoinTable } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
import { HrmsAirport } from "./hrms_airport";
|
||||
import { HrmsDepartment } from "./hrms_department";
|
||||
import { HrmsPosition } from "./hrms_position";
|
||||
import { HrmsShift } from "./hrms_shift";
|
||||
@ -71,10 +70,6 @@ export class HrmsEmployee {
|
||||
@Column({ length: 256 })
|
||||
street: string;
|
||||
|
||||
@ManyToOne(() => HrmsAirport)
|
||||
@JoinColumn()
|
||||
airport: HrmsAirport;
|
||||
|
||||
@ManyToOne(() => HrmsDepartment)
|
||||
@JoinColumn()
|
||||
department: HrmsDepartment;
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("procurement_category", { schema: "procurement" })
|
||||
export class ProcurementCategory {
|
||||
@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;
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { HrmsDepartment } from "../hrms/hrms_department";
|
||||
import { ProcurementChecklistPaymentItem } from "./procurement_checklist_payment_item";
|
||||
import { ProcurementChecklistPaymentApproval } from "./procurement_checklist_payment_approval";
|
||||
import { FinanceFundingSource } from "../finance/finance_funding_sources";
|
||||
import { FinanceAtividade } from "../finance/finance_atividade";
|
||||
import { FinanceSubBudgetLine } from "../finance/fincance_sub_budget_lines";
|
||||
import { ProcurementChecklistPaymentStatus, ProcurementChecklistPaymentType } from "../../types/procurement";
|
||||
import { ProcurementTender } from "./procurement_tender";
|
||||
|
||||
@Entity("procurement_checklist_payment", { schema: "procurement" })
|
||||
export class ProcurementChecklistPayment {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementTender, (tender) => tender.checklist_payment, { onDelete: "CASCADE" })
|
||||
tender: ProcurementTender;
|
||||
|
||||
@Column({
|
||||
unique: false,
|
||||
length: 128,
|
||||
})
|
||||
type: ProcurementChecklistPaymentType;
|
||||
|
||||
@Column({
|
||||
unique: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
checklist_payment_at: 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;
|
||||
|
||||
@ManyToOne(() => FinanceSubBudgetLine, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
sub_budget_line: FinanceSubBudgetLine;
|
||||
|
||||
@OneToMany(() => ProcurementChecklistPaymentItem, (item) => item.payment, { cascade: true })
|
||||
items: ProcurementChecklistPaymentItem[];
|
||||
|
||||
@OneToMany(() => ProcurementChecklistPaymentApproval, (approval) => approval.payment, { cascade: true })
|
||||
approvals: ProcurementChecklistPaymentApproval[];
|
||||
|
||||
@Column({ nullable: false })
|
||||
status: ProcurementChecklistPaymentStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { ProcurementChecklistPayment } from "./procurement_checklist_payment";
|
||||
import { ProcurementChecklistPaymentApprovalRole } from "../../types/procurement";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
|
||||
@Entity("procurement_checklist_payment_approval", { schema: "procurement" })
|
||||
export class ProcurementChecklistPaymentApproval {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementChecklistPayment, (payment) => payment.approvals, { onDelete: "CASCADE" })
|
||||
payment: ProcurementChecklistPayment;
|
||||
|
||||
@Column({ type: "enum", enum: ProcurementChecklistPaymentApprovalRole })
|
||||
role: ProcurementChecklistPaymentApprovalRole;
|
||||
|
||||
@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;
|
||||
|
||||
@Column({ nullable: true, default: false })
|
||||
is_signed: boolean;
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
import { Column, CreateDateColumn, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { ProcurementChecklistPaymentItem } from "./procurement_checklist_payment_item";
|
||||
|
||||
@Entity("procurement_checklist_payment_document", { schema: "procurement" })
|
||||
export class ProcurementChecklistPaymentDocument {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementChecklistPaymentItem, (item) => item.documents, { onDelete: "CASCADE" })
|
||||
checklist_item: ProcurementChecklistPaymentItem;
|
||||
|
||||
@Column({ nullable: true })
|
||||
reference_id: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
document_number: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { ProcurementChecklistPayment } from "./procurement_checklist_payment";
|
||||
import { ProcurementChecklistPaymentItemType } from "../../types/procurement";
|
||||
import { ProcurementChecklistPaymentDocument } from "./procurement_checklist_payment_document";
|
||||
|
||||
@Entity("procurement_checklist_payment_item", { schema: "procurement" })
|
||||
export class ProcurementChecklistPaymentItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementChecklistPayment, (payment) => payment.items, { onDelete: "CASCADE" })
|
||||
payment: ProcurementChecklistPayment;
|
||||
|
||||
@Column({ type: "enum", enum: ProcurementChecklistPaymentItemType })
|
||||
type: ProcurementChecklistPaymentItemType;
|
||||
|
||||
@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(() => ProcurementChecklistPaymentDocument, (doc) => doc.checklist_item, { cascade: true })
|
||||
documents: ProcurementChecklistPaymentDocument[];
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
|
||||
import { ProcurementPurchaseOrder } from "./procurement_purchase_order";
|
||||
import { ProcurementVendor } from "./procurement_vendor";
|
||||
import { FinancePurchaseRequest } from "../finance/finance_purchase_requests";
|
||||
import { FinanceCpv } from "../finance/finance_cpvs";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
import { ProcurementPRCStatus } from "../../types/procurement";
|
||||
|
||||
@Entity("procurement_payment_request", { schema: "procurement" })
|
||||
export class ProcurementPaymentRequest {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// HEADER
|
||||
// =========================
|
||||
|
||||
@Column({ type: "varchar", length: 50, unique: true })
|
||||
code: string; // PRC Code Automaticaly
|
||||
|
||||
@Column({ type: "date" })
|
||||
prc_date: Date; // Payment Request Date
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
to: string; // To (Director Finance)
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
from: string; // From (Procurement Unit)
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
payment_type: string; // Payment for Procurement
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
status: ProcurementPRCStatus; // Draft / Received / Approved / Rejected
|
||||
|
||||
// =========================
|
||||
// REFERENCES
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => FinanceCpv, { nullable: true, onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
cpv: FinanceCpv; // CPV Number
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
cpv_amount_usd: number;
|
||||
|
||||
@ManyToOne(() => ProcurementPurchaseOrder, { nullable: true, onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
po: ProcurementPurchaseOrder; // PO Number
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
po_amount_usd: number;
|
||||
|
||||
@ManyToOne(() => FinancePurchaseRequest, { nullable: true, onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
pr: FinancePurchaseRequest; // PR Number
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
pr_amount_usd: number;
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
contract_number: string; // Contract Number
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
contract_date: Date;
|
||||
|
||||
// =========================
|
||||
// PAYMENT REQUEST DETAIL
|
||||
// =========================
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
payment_description: string; // Payment Request Description
|
||||
|
||||
@ManyToOne(() => ProcurementVendor, { nullable: true })
|
||||
@JoinColumn()
|
||||
vendor: ProcurementVendor; // Supplier / Contractor
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
invoice_number: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
invoice_date: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 20, nullable: true })
|
||||
currency: string; // USD
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
amount_claimed: number;
|
||||
|
||||
// =========================
|
||||
// DEDUCTIONS
|
||||
// =========================
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
advance_payment_percent: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
advance_payment_amount: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
retention_percent: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
retention_amount: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
deduction_tax_percent: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
deduction_tax_amount: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
deduction_penalty_percent: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
deduction_penalty_amount: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
net_amount_paid: number; // NET TO BE PAID
|
||||
|
||||
// =========================
|
||||
// PAYMENT STATUS
|
||||
// =========================
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
is_partial: boolean; // Partial (YES/NO)
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
is_final: boolean; // Final (YES/NO)
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
balance_remaining: number; // Balance excluding outstanding PRC
|
||||
|
||||
// =========================
|
||||
// BANKING DETAILS
|
||||
// =========================
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
bank_name: string;
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
bank_swift_aba_bsb: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
bank_account_name: string;
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
bank_account_number: string;
|
||||
|
||||
// =========================
|
||||
// DEDUCTION ACCOUNT
|
||||
// =========================
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
deduction_bank_name: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
deduction_bank_address: string;
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
deduction_account_no: string;
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
deduction_account_name: string;
|
||||
|
||||
// =========================
|
||||
// APPROVAL FLOW
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { nullable: true })
|
||||
@JoinColumn()
|
||||
prepared_by: HrmsEmployee;
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
prepared_by_position: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { nullable: true })
|
||||
@JoinColumn()
|
||||
verified_by: HrmsEmployee;
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
verified_by_position: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { nullable: true })
|
||||
@JoinColumn()
|
||||
certified_by: HrmsEmployee;
|
||||
|
||||
@Column({ type: "varchar", length: 150, nullable: true })
|
||||
certified_by_position: string;
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,130 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { ProcurementMethod, ProcurementPreparationStatus, ProcurementStatusType } from "../../types/procurement";
|
||||
import { ProcurementCategory } from "./procurement_category";
|
||||
|
||||
@Entity("procurement_project_yearly", { schema: "procurement" })
|
||||
export class ProcurementProjectYearly {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// BASIC INFO
|
||||
// =========================
|
||||
|
||||
@Column({ type: "int" })
|
||||
fiscal_year: number; // Tahun anggaran (2025)
|
||||
|
||||
@Column({ type: "varchar", length: 256 })
|
||||
program_name: string; // Program & atividade PA
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
activity_description: string; // Sasan / Obrasa / Servisu description
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
anatl_code: string; // Kodigu ANATL,E.P.
|
||||
|
||||
@Column({ type: "int", nullable: true })
|
||||
sequence_number: number; // N. Sekuensia
|
||||
|
||||
@Column({ type: "int", nullable: true })
|
||||
quantity: number; // Kuantidade
|
||||
|
||||
@ManyToOne(() => ProcurementCategory, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
budget_category: ProcurementCategory; // Categoria Orsamentu
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
item_code: string; // Item Code (livro oramentu)
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
line_item_code: string; // Line Item Code
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
organization_name: string; // ANATL, E.P.
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
estimated_cost_usd: number; // Kusto Estimasaun (USD)
|
||||
|
||||
// =========================
|
||||
// SPECIFICATION & PROCESS
|
||||
// =========================
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
preparation_status: ProcurementPreparationStatus; // Status preparation (ready / not ready)
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
finance_submission_date: Date; // Data entrega ba Finansas
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
implementation_location: string; // Local implementasaun
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
implementation_date: Date; // Data implementasaun
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
procurement_method: ProcurementMethod; // DP, SP, RFP, RFQ, NCB, ICB
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
contract_exists: boolean; // Kontratu existe no valido
|
||||
|
||||
@Column({ type: "varchar", length: 100, nullable: true })
|
||||
fund_source: string; // Foun
|
||||
|
||||
// =========================
|
||||
// KRONOGRAMA DE APROVISIONAMENTU
|
||||
// (Quarterly Budget Plan)
|
||||
// =========================
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
budget_q1_usd: number; // 1T Planu de Despeza
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
budget_q2_usd: number; // 2T
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
budget_q3_usd: number; // 3T
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
budget_q4_usd: number; // 4T
|
||||
|
||||
// =========================
|
||||
// ESTIMATED EXECUTION
|
||||
// =========================
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
estimated_q1_value: number; // Estimasaun 1T
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
estimated_q2_value: number; // 2T
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
estimated_q3_value: number; // 3T
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
estimated_q4_value: number; // 4T
|
||||
|
||||
// =========================
|
||||
// STATUS & AUDIT
|
||||
// =========================
|
||||
|
||||
@Column({ type: "varchar", length: 30, default: "DRAFT" })
|
||||
status: ProcurementStatusType;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,131 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, OneToMany, JoinColumn } from "typeorm";
|
||||
|
||||
import { ProcurementTender } from "./procurement_tender";
|
||||
import { ProcurementVendor } from "./procurement_vendor";
|
||||
import { ProcurementPOStatus } from "../../types/procurement";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
import { FinancePurchaseRequest } from "../finance/finance_purchase_requests";
|
||||
import { FinanceCpv } from "../finance/finance_cpvs";
|
||||
import { ProcurementPurchaseOrderItem } from "./procurement_purchase_order_item";
|
||||
|
||||
@Entity("procurement_purchase_order", { schema: "procurement" })
|
||||
export class ProcurementPurchaseOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementTender, { nullable: false })
|
||||
@JoinColumn()
|
||||
tender: ProcurementTender; // Tender
|
||||
|
||||
@Column({ type: "varchar", length: 50, unique: true })
|
||||
code: string; // Po Code Automaticaly
|
||||
|
||||
@Column({ type: "varchar", length: 50, unique: true })
|
||||
po_number: string; // Numero Ordem de Compra
|
||||
|
||||
@Column({ type: "date" })
|
||||
po_date: Date; // Data Ordem de Compra
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
address: string; // Morada / Address
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
attention_to: string; // Send all queries about this order to the procurement office marked to
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
amandement_number: string; // NNumero de Emenda
|
||||
|
||||
// =========================
|
||||
// DELIVERY INFO
|
||||
// =========================
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
delivery_to: string; // Entregar a / Delivery to
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
delivery_start_date: Date; // Data de Entrage / Delivery Date start
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
delivery_end_date: Date; // Data de Entrage / Delivery Date end
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
delivery_terms: string; // Pontos & termos de entrega
|
||||
|
||||
@ManyToOne(() => ProcurementVendor, { nullable: false })
|
||||
@JoinColumn()
|
||||
vendor: ProcurementVendor; // Vendedor / Vendor
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
status: ProcurementPOStatus; // Approved / Rejected / Pending
|
||||
|
||||
// =========================
|
||||
// APPROVAL
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
prepared_by: HrmsEmployee; // Preparado por
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
prepared_by_signature_image: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
prepared_by_signature_hash: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
approved_by: HrmsEmployee; // Aprovado por
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
approved_by_signature_image: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
approved_by_signature_hash: string;
|
||||
|
||||
// =========================
|
||||
// Requisitioner
|
||||
// =========================
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
requisitioner: string; // Requisitante / Requisitioner
|
||||
|
||||
@ManyToOne(() => FinancePurchaseRequest, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
pr_number: FinancePurchaseRequest; // Numero de Requisicao de Compra
|
||||
|
||||
@ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
cpv: FinanceCpv; // Numero de FCP / CPV Number :
|
||||
|
||||
// =========================
|
||||
// RELATION
|
||||
// =========================
|
||||
|
||||
@OneToMany(() => ProcurementPurchaseOrderItem, (item) => item.purchase_order, { cascade: true })
|
||||
items: ProcurementPurchaseOrderItem[];
|
||||
|
||||
@Column({ type: "float8", default: 0 })
|
||||
total_amount_usd: number; // Total Montante (USD)
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { ProcurementPurchaseOrder } from "./procurement_purchase_order";
|
||||
|
||||
@Entity("procurement_purchase_order_item", { schema: "procurement" })
|
||||
export class ProcurementPurchaseOrderItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ProcurementPurchaseOrder, (po) => po.items, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
purchase_order: ProcurementPurchaseOrder;
|
||||
|
||||
@Column({ type: "text" })
|
||||
description: string; // Descricao / Description
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
unit: string; // Unidade
|
||||
|
||||
@Column({ type: "int" })
|
||||
quantity: number; // Quantidade
|
||||
|
||||
@Column({ type: "float8" })
|
||||
unit_price_usd: number; // Preco Unitario (USD)
|
||||
|
||||
@Column({ type: "float8" })
|
||||
amount_usd: number; // Montante (qty * unit price)
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { ProcurementVendor } from "./procurement_vendor";
|
||||
|
||||
@Entity("procurement_surveys", { schema: "procurement" })
|
||||
export class ProcurementSurvey {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// SURVEY INFORMATION
|
||||
// =========================
|
||||
|
||||
@Column({ type: "date" })
|
||||
data_date: Date; // DATA field
|
||||
|
||||
@Column({ type: "date" })
|
||||
survey_date: Date; // TANGGAL SURVEY field
|
||||
|
||||
// =========================
|
||||
// COMPANY & LOCATION
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => ProcurementVendor, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
company: ProcurementVendor; // KOMPANYA
|
||||
|
||||
@Column({ length: 256 })
|
||||
location: string; // LOCATION - CRISTO REI, DILI
|
||||
|
||||
// =========================
|
||||
// SURVEY RESULT
|
||||
// =========================
|
||||
|
||||
@Column({ type: "text" })
|
||||
survey_result: string; // HASIL SURVEY
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,229 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { HrmsDepartment } from "../hrms/hrms_department";
|
||||
import { Status } from "../../types/status";
|
||||
import { FinanceCpv } from "../finance/finance_cpvs";
|
||||
import { ProcurementTenderStatus } from "../../types/procurement";
|
||||
import { ProcurementVendor } from "./procurement_vendor";
|
||||
import { ProcurementChecklistPayment } from "./procurement_checklist_payment";
|
||||
|
||||
@Entity("procurement_tenders", { schema: "procurement" })
|
||||
export class ProcurementTender {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// GENERAL INFORMATION
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => HrmsDepartment, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
department: HrmsDepartment;
|
||||
|
||||
@ManyToOne(() => FinanceCpv, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
cpv: FinanceCpv;
|
||||
|
||||
// =========================
|
||||
// TENDER INFORMATION
|
||||
// =========================
|
||||
|
||||
@Column({ length: 64 })
|
||||
tender_number: string; // 123/ANTL/2025/011
|
||||
|
||||
@Column({ length: 256 })
|
||||
tender_name: string;
|
||||
|
||||
@Column({ length: 32 })
|
||||
tender_type: string; // Tender
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
planning_price: number;
|
||||
|
||||
@Column({ type: "float8", nullable: true })
|
||||
realization_price: number;
|
||||
|
||||
@ManyToOne(() => ProcurementVendor, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
vendor: ProcurementVendor;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
start_date: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
target_complete_date: Date;
|
||||
|
||||
@Column({ length: 32 })
|
||||
status: ProcurementTenderStatus; // On Going, Completed, Cancelled
|
||||
|
||||
// =========================
|
||||
// UPLOAD DOCUMENTS (CORE)
|
||||
// =========================
|
||||
|
||||
// Pedido Pagamentu (PR)
|
||||
@Column({ length: 256, nullable: true })
|
||||
pr_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
pr_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
pr_number: string;
|
||||
|
||||
// CPV / PR
|
||||
@Column({ length: 256, nullable: true })
|
||||
cpv_pr_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
cpv_pr_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
cpv_pr_number: string;
|
||||
|
||||
// Obrigasan
|
||||
@Column({ length: 256, nullable: true })
|
||||
obrigasan_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
obrigasan_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
obrigasan_number: string;
|
||||
|
||||
// PO
|
||||
@Column({ length: 256, nullable: true })
|
||||
po_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
po_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
po_number: string;
|
||||
|
||||
// Factura
|
||||
@Column({ length: 256, nullable: true })
|
||||
facture_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
facture_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
facture_number: string;
|
||||
|
||||
// R&I Report
|
||||
@Column({ length: 256, nullable: true })
|
||||
ri_report_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
ri_report_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
ri_report_number: string;
|
||||
|
||||
// Certificate Payment
|
||||
@Column({ length: 256, nullable: true })
|
||||
certificate_payment_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
certificate_payment_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
certificate_payment_number: string;
|
||||
|
||||
// Contract
|
||||
@Column({ length: 256, nullable: true })
|
||||
contract_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
contract_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
contract_number: string;
|
||||
|
||||
// Recommendation Maintenance
|
||||
@Column({ length: 256, nullable: true })
|
||||
recommendation_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
recommendation_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
recommendation_number: string;
|
||||
|
||||
// Service Report
|
||||
@Column({ length: 256, nullable: true })
|
||||
service_report_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
service_report_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
service_report_number: string;
|
||||
|
||||
// =========================
|
||||
// OTHER DOCUMENT (3 ITEMS)
|
||||
// =========================
|
||||
|
||||
@Column({ length: 128, nullable: true })
|
||||
other_doc1_label: string;
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
other_doc1_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
other_doc1_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
other_doc1_number: string;
|
||||
|
||||
@Column({ length: 128, nullable: true })
|
||||
other_doc2_label: string;
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
other_doc2_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
other_doc2_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
other_doc2_number: string;
|
||||
|
||||
@Column({ length: 128, nullable: true })
|
||||
other_doc3_label: string;
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
other_doc3_file_url: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
other_doc3_file_date: Date;
|
||||
|
||||
@Column({ length: 64, nullable: true })
|
||||
other_doc3_number: string;
|
||||
|
||||
// =========================
|
||||
// CHECKLIST PAAMENTO
|
||||
// =========================
|
||||
@OneToMany(() => ProcurementChecklistPayment, (item) => item.tender, { cascade: true })
|
||||
checklist_payment: ProcurementChecklistPayment;
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
|
||||
@Entity("procurement_vendor", { schema: "procurement" })
|
||||
export class ProcurementVendor {
|
||||
@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;
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { ProcurementWorkOrder } from "./procurement_work_orders";
|
||||
|
||||
@Entity("procurement_work_order_copies", { schema: "procurement" })
|
||||
export class ProcurementWorkOrderCopy {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// REFERENCE
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => ProcurementWorkOrder, (wo) => wo.copies, { onDelete: "CASCADE", nullable: false })
|
||||
@JoinColumn()
|
||||
work_order: ProcurementWorkOrder;
|
||||
|
||||
// =========================
|
||||
// COPY INFORMATION
|
||||
// =========================
|
||||
|
||||
@Column({ length: 32 })
|
||||
label: string; // COPIA 1, COPIA 2, COPIA 3
|
||||
|
||||
@Column({ length: 256 })
|
||||
recipient: string; // Exe. Presidente do C.A. da ANATL, E.P.
|
||||
|
||||
@Column({ type: "int" })
|
||||
order: number; // 1, 2, 3 - untuk urutan display
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { ProcurementTender } from "./procurement_tender";
|
||||
import { ProcurementWorkOrderStatus } from "../../types/procurement";
|
||||
import { ProcurementWorkOrderCopy } from "./procurement_work_order_copies";
|
||||
import { HrmsEmployee } from "../hrms/hrms_employee";
|
||||
|
||||
@Entity("procurement_work_orders", { schema: "procurement" })
|
||||
export class ProcurementWorkOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// =========================
|
||||
// REFERENCE
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => ProcurementTender, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn()
|
||||
tender: ProcurementTender;
|
||||
|
||||
@Column({ length: 64 })
|
||||
reference_number: string; // 142/ANATL,E.P./U-APROV./VII/2025
|
||||
|
||||
// =========================
|
||||
// RECIPIENT INFORMATION
|
||||
// =========================
|
||||
|
||||
@Column({ length: 256 })
|
||||
recipient_name: string; // SR. JUSCELINO DE JESUS PEREIRA
|
||||
|
||||
@Column({ type: "text" })
|
||||
subject: string; // ORDEM DO SERVISU MANUTENSAUN EDIFISIU...
|
||||
|
||||
// =========================
|
||||
// CONTENT
|
||||
// =========================
|
||||
|
||||
@Column({ type: "text" })
|
||||
content: string; // Full work order content/body
|
||||
|
||||
// =========================
|
||||
// SIGNATURE
|
||||
// =========================
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { nullable: true })
|
||||
@JoinColumn()
|
||||
signer: HrmsEmployee; // ENG. JOSÉ ANTÓNÍO SANCHES
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
signer_position: string; // DIRECTOR U-APROVISIONAMENTO ANATL, E.P.
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
signed_date: Date;
|
||||
|
||||
// =========================
|
||||
// STATUS & METADATA
|
||||
// =========================
|
||||
|
||||
@Column({ length: 32, default: "draft" })
|
||||
status: ProcurementWorkOrderStatus; // draft, issued, completed, cancelled
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
issue_date: Date; // When the work order was officially issued
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
start_date: Date; // Expected start date of work
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
completion_date: Date; // Expected completion date
|
||||
|
||||
// =========================
|
||||
// DOCUMENT
|
||||
// =========================
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
document_file_url: string; // URL to generated PDF
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
document_generated_at: Date;
|
||||
|
||||
// =========================
|
||||
// COPIES
|
||||
// =========================
|
||||
|
||||
@OneToMany(() => ProcurementWorkOrderCopy, (copy) => copy.work_order, { cascade: true })
|
||||
copies: ProcurementWorkOrderCopy[];
|
||||
|
||||
// =========================
|
||||
// AUDIT
|
||||
// =========================
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,26 +1,3 @@
|
||||
export * from "../entity/finance/finance_funding_sources";
|
||||
export * from "../entity/finance/fincance_categories";
|
||||
export * from "../entity/finance/fincance_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";
|
||||
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";
|
||||
export * from "../entity/finance/finance_purchase_request_items";
|
||||
export * from "../entity/finance/finance_cpvs";
|
||||
export * from "../entity/finance/finance_cpv_config";
|
||||
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 "../entity/finance/finance_payment_orders";
|
||||
export * from "../entity/finance/finance_petty_cash_pockets";
|
||||
export * from "../entity/finance/finance_petty_cash_credits";
|
||||
export * from "../entity/finance/finance_petty_cash_expenses";
|
||||
export * from "../entity/finance/finance_petty_cash_transactions";
|
||||
|
||||
// Finance entities (../entity/finance/*) are not yet implemented.
|
||||
// Re-export types for consumers.
|
||||
export * from "../types/finance";
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
export * from "../entity/hrms/hrms_department";
|
||||
export * from "../entity/hrms/hrms_airport";
|
||||
export * from "../entity/hrms/hrms_position";
|
||||
export * from "../entity/hrms/hrms_holiday";
|
||||
export * from "../entity/hrms/hrms_leave_type";
|
||||
|
||||
@ -1,16 +1,3 @@
|
||||
export * from "../entity/procurement/procurement_category";
|
||||
export * from "../entity/procurement/procurement_vendor";
|
||||
export * from "../entity/procurement/procurement_project_yearly";
|
||||
export * from "../entity/procurement/procurement_tender";
|
||||
export * from "../entity/procurement/procurement_checklist_payment";
|
||||
export * from "../entity/procurement/procurement_checklist_payment_item";
|
||||
export * from "../entity/procurement/procurement_checklist_payment_document";
|
||||
export * from "../entity/procurement/procurement_checklist_payment_approval";
|
||||
export * from "../entity/procurement/procurement_purchase_order";
|
||||
export * from "../entity/procurement/procurement_purchase_order_item";
|
||||
export * from "../entity/procurement/procurement_payment_request";
|
||||
export * from "../entity/procurement/procurement_work_orders";
|
||||
export * from "../entity/procurement/procurement_work_order_copies";
|
||||
export * from "../entity/procurement/procurement_surveys";
|
||||
|
||||
// Procurement entities (../entity/procurement/*) are not yet implemented.
|
||||
// Re-export types for consumers.
|
||||
export * from "../types/procurement";
|
||||
|
||||
Reference in New Issue
Block a user