diff --git a/src/entity/finance/finance_cpv_config.ts b/src/entity/finance/finance_cpv_config.ts new file mode 100644 index 0000000..b98d9f2 --- /dev/null +++ b/src/entity/finance/finance_cpv_config.ts @@ -0,0 +1,24 @@ +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; +} diff --git a/src/schema/finances.ts b/src/schema/finances.ts index 8e67253..824b8ce 100644 --- a/src/schema/finances.ts +++ b/src/schema/finances.ts @@ -12,6 +12,7 @@ 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";