update
This commit is contained in:
69
src/entity/trx_maintenance_details.ts
Normal file
69
src/entity/trx_maintenance_details.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { TrxMaintenanceActionType, TrxMaintenancePosition, TrxMaintenanceStatus } from "../types/trx";
|
||||
import { TrxMaintenance } from "./trx_maintenances";
|
||||
import { text } from "stream/consumers";
|
||||
|
||||
@Entity("trx_maintenance_details", { schema: "trx" })
|
||||
export class trxMaintenanceDetail {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => TrxMaintenance, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
maintenance: TrxMaintenance;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
action_type: TrxMaintenanceActionType;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
reference_table: String;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
reference_column: String;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
type: "uuid",
|
||||
})
|
||||
reference_id: String;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
value_old: String;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
value_new: 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;
|
||||
}
|
||||
71
src/entity/trx_maintenance_slas.ts
Normal file
71
src/entity/trx_maintenance_slas.ts
Normal file
@ -0,0 +1,71 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { TrxMaintenancePosition, TrxMaintenanceStatus } from "../types/trx";
|
||||
import { TrxMaintenance } from "./trx_maintenances";
|
||||
|
||||
@Entity("trx_maintenance_slas", { schema: "trx" })
|
||||
export class trxMaintenanceSla {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => TrxMaintenance, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
maintenance: TrxMaintenance;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
position: TrxMaintenancePosition;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
status: TrxMaintenanceStatus;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
start_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
start_at: Date;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
nullable: true,
|
||||
})
|
||||
end_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
end_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
duration: 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;
|
||||
}
|
||||
78
src/entity/trx_maintenances.ts
Normal file
78
src/entity/trx_maintenances.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
import { TrxMaintenancePosition, TrxMaintenanceRemark, TrxMaintenanceStatus, TrxMaintenanceType } from "../types/trx";
|
||||
import { TrxCustomer } from "./trx_customers";
|
||||
|
||||
@Entity("trx_maintenances", { schema: "trx" })
|
||||
export class TrxMaintenance {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 64,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" })
|
||||
@JoinTable()
|
||||
customer: TrxCustomer;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
type: TrxMaintenanceType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 4096,
|
||||
})
|
||||
reason: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
file: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
position: TrxMaintenancePosition;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: TrxMaintenanceStatus;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
remark: TrxMaintenanceRemark;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -21,4 +21,7 @@ export * from "../entity/trx_transaction_slas";
|
||||
export * from "../entity/trx_transaction_amls";
|
||||
export * from "../entity/trx_transaction_signatures";
|
||||
export * from "../entity/trx_email_logs";
|
||||
export * from "../entity/trx_maintenances";
|
||||
export * from "../entity/trx_maintenance_details";
|
||||
export * from "../entity/trx_maintenance_slas";
|
||||
export * from "../types/trx";
|
||||
|
||||
@ -100,4 +100,33 @@ export enum TrxMaintenanceType {
|
||||
"business" = "business",
|
||||
}
|
||||
|
||||
export enum TrxMaintenancePosition {
|
||||
"cs" = "cs",
|
||||
"supervisor" = "supervisor",
|
||||
"manager" = "manager",
|
||||
"customer" = "customer",
|
||||
}
|
||||
|
||||
export enum TrxMaintenanceStatus {
|
||||
"submit" = "submit",
|
||||
"process_supervisor" = "process_supervisor",
|
||||
"process_manager" = "process_manager",
|
||||
"reject" = "reject",
|
||||
"complete" = "complete",
|
||||
}
|
||||
|
||||
export enum TrxMaintenanceRemark {
|
||||
"submit" = "Submit",
|
||||
"process_supervisor" = "On Process Supervisor",
|
||||
"process_manager" = "On Process Manager",
|
||||
"reject" = "Reject",
|
||||
"complete" = "Complete",
|
||||
}
|
||||
|
||||
export enum TrxMaintenanceActionType {
|
||||
"create" = "create",
|
||||
"update" = "update",
|
||||
"delete" = "delete",
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
Reference in New Issue
Block a user