working order
This commit is contained in:
51
src/entity/procurement/procurement_work_order_copies.ts
Normal file
51
src/entity/procurement/procurement_work_order_copies.ts
Normal file
@ -0,0 +1,51 @@
|
||||
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;
|
||||
}
|
||||
106
src/entity/procurement/procurement_work_orders.ts
Normal file
106
src/entity/procurement/procurement_work_orders.ts
Normal file
@ -0,0 +1,106 @@
|
||||
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";
|
||||
|
||||
@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
|
||||
// =========================
|
||||
|
||||
@Column({ length: 256, nullable: true })
|
||||
signer_name: string; // 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;
|
||||
}
|
||||
@ -9,5 +9,7 @@ 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 "../types/procurement";
|
||||
|
||||
@ -76,3 +76,15 @@ export enum ProcurementPRCStatus {
|
||||
REJECTED = "REJECTED",
|
||||
RECEIVED = "RECEIVED",
|
||||
}
|
||||
|
||||
// File: src/types/procurement.ts
|
||||
|
||||
export enum ProcurementWorkOrderStatus {
|
||||
DRAFT = "DRAFT",
|
||||
PENDING_APPROVAL = "PENDING_APPROVAL",
|
||||
APPROVED = "APPROVED",
|
||||
ISSUED = "ISSUED",
|
||||
IN_PROGRESS = "IN_PROGRESS",
|
||||
COMPLETED = "COMPLETED",
|
||||
CANCELLED = "CANCELLED",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user