import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, } from "typeorm"; import { Category } from "./Category"; @Entity("category_date", { comment: "Fechas específicas donde se pueden agregar horarios.", }) export class CategoryDate { @PrimaryGeneratedColumn({ type: "int", comment: "Número de identificación (ID) único de cada registro.", }) id: number; @ManyToOne(() => Category, (category) => category.category_dates, { onDelete: "CASCADE", onUpdate: "NO ACTION", }) @JoinColumn({ name: "category" }) category: Category; @Column({ type: "date", comment: "Fecha en la que va a estar disponible la categoría.", }) date: string; @Column({ type: "varchar", length: 5, comment: "Hora de inicio." }) start_time: string; @Column({ type: "varchar", length: 5, comment: "Hora de finalización." }) end_time: string; }