update
This commit is contained in:
59
src/entity/trx_maintenance_customers.ts
Normal file
59
src/entity/trx_maintenance_customers.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, JoinTable, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { TrxMaintenancePosition, TrxMaintenanceStatus } from "../types/trx";
|
||||
import { TrxMaintenance } from "./trx_maintenances";
|
||||
import { Status } from "../types/status";
|
||||
import { TrxMaintenanceGroup } from "./trx_maintenance_groups";
|
||||
import { TrxCustomer } from "./trx_customers";
|
||||
|
||||
@Entity("trx_maintenance_customers", { schema: "trx" })
|
||||
export class TrxMaintenanceCustomer {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => TrxMaintenance, { onDelete: "NO ACTION" })
|
||||
@JoinTable()
|
||||
maintenance: TrxMaintenance;
|
||||
|
||||
@ManyToOne(() => TrxCustomer, { onDelete: "NO ACTION" })
|
||||
@JoinTable()
|
||||
customer: TrxCustomer;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
cif_number: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
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;
|
||||
}
|
||||
@ -2,20 +2,18 @@ import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, JoinTab
|
||||
import { TrxMaintenancePosition, TrxMaintenanceStatus } from "../types/trx";
|
||||
import { TrxMaintenance } from "./trx_maintenances";
|
||||
import { Status } from "../types/status";
|
||||
import { TrxMaintenanceGroupStatus } from "../types/trx";
|
||||
|
||||
@Entity("trx_maintenance_groups", { schema: "trx" })
|
||||
export class TrxMaintenanceGroup {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToMany(() => TrxMaintenance, (mg) => mg.maintenance_group)
|
||||
maintenance: TrxMaintenance[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
code: string;
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
@ -32,7 +30,7 @@ export class TrxMaintenanceGroup {
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
status: Status;
|
||||
status: TrxMaintenanceGroupStatus;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
|
||||
@ -19,10 +19,6 @@ export class TrxMaintenance {
|
||||
@JoinTable()
|
||||
maintenance_group: TrxMaintenanceGroup;
|
||||
|
||||
@ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" })
|
||||
@JoinTable()
|
||||
customer: TrxCustomer;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
@ -35,12 +31,6 @@ export class TrxMaintenance {
|
||||
})
|
||||
reason: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
file: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
|
||||
@ -26,4 +26,5 @@ export * from "../entity/trx_maintenances";
|
||||
export * from "../entity/trx_maintenance_details";
|
||||
export * from "../entity/trx_maintenance_slas";
|
||||
export * from "../entity/trx_maintenance_groups";
|
||||
export * from "../entity/trx_maintenance_customers";
|
||||
export * from "../types/trx";
|
||||
|
||||
@ -78,6 +78,12 @@ export enum TrxTransactionStatus {
|
||||
"cancel" = "cancel",
|
||||
}
|
||||
|
||||
export enum TrxMaintenanceGroupStatus {
|
||||
"approve" = "approve",
|
||||
"reject" = "reject",
|
||||
"pending" = "pending",
|
||||
}
|
||||
|
||||
export enum TrxIdentityType {
|
||||
"passport" = "passport",
|
||||
"electoral" = "electoral",
|
||||
|
||||
Reference in New Issue
Block a user