This commit is contained in:
Narul Hidayah
2026-01-27 14:49:56 +07:00
6 changed files with 271 additions and 0 deletions

View File

@ -0,0 +1,56 @@
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;
}

View File

@ -0,0 +1,133 @@
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: "text", nullable: true })
specification: string; // Detail Specification / TOR / SOW
@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;
}

View File

@ -0,0 +1,56 @@
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;
}

View File

@ -1,3 +1,4 @@
export * from "./schema/public";
export * from "./schema/hrms";
export * from "./schema/finances";
export * from "./schema/procurement";

View File

@ -0,0 +1,3 @@
export * from "../entity/procurement/procurement_category";
export * from "../entity/procurement/procurement_vendor";
export * from "../entity/procurement/procurement_project_yearly";

22
src/types/procurement.ts Normal file
View File

@ -0,0 +1,22 @@
export enum ProcurementStatusType {
draft = "draft",
pending_review = "pending_review",
pending_approve = "pending_approve",
approve = "approve",
reject = "reject",
}
export enum ProcurementPreparationStatus {
ready = "ready",
not_ready = "not_ready",
}
export enum ProcurementMethod {
DP = "DP",
SP = "SP",
RFP = "RFP",
SINGLE_SOURCE = "SINGLE_SOURCE",
RFQ = "RFQ",
NCB = "NCB",
ICB = "ICB",
}