2024-09-04 11:36:52 +02:00
|
|
|
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
|
|
|
import { communication } from "./communication";
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class communicationType {
|
|
|
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
|
|
|
id: number;
|
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
|
|
|
type: string;
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
type: "varchar",
|
|
|
|
length: 255,
|
|
|
|
default: "",
|
|
|
|
transformer: {
|
|
|
|
from(value: string): Array<string> {
|
|
|
|
return value.split(",");
|
|
|
|
},
|
|
|
|
to(value: Array<string>): string {
|
|
|
|
return value.join(",");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
useColumns: Array<string>;
|
|
|
|
|
2024-09-14 11:32:34 +02:00
|
|
|
@OneToMany(() => communication, (communication) => communication.type)
|
2024-09-04 11:36:52 +02:00
|
|
|
communications: communication[];
|
|
|
|
}
|