Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Column
lineId: number;
@BelongsTo(() => Line)
line: Line;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@HasMany(() => Project)
projects: Project[];
}
})
export class Customer extends Model {
@AllowNull(false)
@Column
name: string;
@Column
active: boolean;
@Column
image: string;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@ForeignKey(() => Domain)
@Column
domainId: number;
@BelongsTo(() => Domain)
name: string;
@Column
active: boolean;
@AllowNull(false)
@ForeignKey(() => Line)
@Column
lineId: number;
@BelongsTo(() => Line)
line: Line;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@HasMany(() => Project)
projects: Project[];
}
@Table({
timestamps: true,
tableName: Tables.DOMAINS
})
export class Domain extends Model {
@AllowNull(false)
@Column
name: string;
@Column
active: boolean;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@HasMany(() => Project)
projects: Project[];
@HasMany(() => Customer)
customers: Customer[];
@Table
export class TemporarySave extends Model {
@Unique
@Column(DataType.STRING)
saveString: string;
@Column(DataType.STRING)
version: string;
@Column(DataType.STRING)
arch: string;
@Column(DataType.STRING)
platform: string;
@Column(DataType.DATE)
date: Date;
@Column(DataType.STRING)
cipherPassword: string;
@ForeignKey(() => Channel)
@Column(DataType.INTEGER)
channelId: number;
@BelongsTo(() => Channel)
channel: Channel;
@HasMany(() => TemporarySaveFile)
files: TemporarySaveFile[];
}
@Column
name: string;
@Column
active: boolean;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@HasMany(() => Project)
projects: Project[];
@HasMany(() => Customer)
customers: Customer[];
}
export class Employee extends Model {
@AllowNull(false)
@Column
firstname: string;
@AllowNull(false)
@Column
lastname: string;
@Column
active: boolean;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@HasMany(() => Schedule)
schedules: Schedule[];
@BelongsToMany(() => Technology, () => EmployeeTechnology)
technologies: Technology[];
@Column
roleId: number;
@BelongsTo(() => Role)
role: Role;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
}
@Column
image: string;
@Column
version: string;
@CreatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
createdAt: Date;
@UpdatedAt
@Column({
type: DataType.DATE,
defaultValue: DataType.NOW
})
updatedAt: Date;
@BelongsToMany(() => Employee, () => EmployeeTechnology)
employees: Employee[];
@BelongsToMany(() => Project, () => ProjectTechnology)
projects: Project[];
}