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