import { Entity, OneToMany, PrimaryGeneratedColumn, Column } from 'typeorm'
import { Catalogo } from './Catalogo'
import { Carrito } from './Carrito'
import { IsString } from 'class-validator'

@Entity()
export class Tipo extends Catalogo {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  @IsString()
  nombre: string

  @OneToMany(
    (type) => Carrito,
    (carrito) => carrito.tipo
  )
  carritos: Carrito[]
}
