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 { TrxMaintenancePosition, TrxMaintenanceStatus } from "../types/trx";
|
||||||
import { TrxMaintenance } from "./trx_maintenances";
|
import { TrxMaintenance } from "./trx_maintenances";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
|
import { TrxMaintenanceGroupStatus } from "../types/trx";
|
||||||
|
|
||||||
@Entity("trx_maintenance_groups", { schema: "trx" })
|
@Entity("trx_maintenance_groups", { schema: "trx" })
|
||||||
export class TrxMaintenanceGroup {
|
export class TrxMaintenanceGroup {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@OneToMany(() => TrxMaintenance, (mg) => mg.maintenance_group)
|
|
||||||
maintenance: TrxMaintenance[];
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
code: string;
|
name: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
@ -32,7 +30,7 @@ export class TrxMaintenanceGroup {
|
|||||||
@Column({
|
@Column({
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
status: Status;
|
status: TrxMaintenanceGroupStatus;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
|
|||||||
@ -19,10 +19,6 @@ export class TrxMaintenance {
|
|||||||
@JoinTable()
|
@JoinTable()
|
||||||
maintenance_group: TrxMaintenanceGroup;
|
maintenance_group: TrxMaintenanceGroup;
|
||||||
|
|
||||||
@ManyToOne(() => TrxCustomer, { onDelete: "RESTRICT" })
|
|
||||||
@JoinTable()
|
|
||||||
customer: TrxCustomer;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
@ -35,12 +31,6 @@ export class TrxMaintenance {
|
|||||||
})
|
})
|
||||||
reason: string;
|
reason: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 256,
|
|
||||||
})
|
|
||||||
file: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
|
|||||||
@ -26,4 +26,5 @@ export * from "../entity/trx_maintenances";
|
|||||||
export * from "../entity/trx_maintenance_details";
|
export * from "../entity/trx_maintenance_details";
|
||||||
export * from "../entity/trx_maintenance_slas";
|
export * from "../entity/trx_maintenance_slas";
|
||||||
export * from "../entity/trx_maintenance_groups";
|
export * from "../entity/trx_maintenance_groups";
|
||||||
|
export * from "../entity/trx_maintenance_customers";
|
||||||
export * from "../types/trx";
|
export * from "../types/trx";
|
||||||
|
|||||||
@ -78,6 +78,12 @@ export enum TrxTransactionStatus {
|
|||||||
"cancel" = "cancel",
|
"cancel" = "cancel",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum TrxMaintenanceGroupStatus {
|
||||||
|
"approve" = "approve",
|
||||||
|
"reject" = "reject",
|
||||||
|
"pending" = "pending",
|
||||||
|
}
|
||||||
|
|
||||||
export enum TrxIdentityType {
|
export enum TrxIdentityType {
|
||||||
"passport" = "passport",
|
"passport" = "passport",
|
||||||
"electoral" = "electoral",
|
"electoral" = "electoral",
|
||||||
|
|||||||
Reference in New Issue
Block a user