import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { RadioStationSubGenreEntity } from './radio-station-sub-genre.entity';

@Entity('radio_station_genres')
export class RadioStationGenreEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 64 }) name: string;
    @Column() order: number;
    @Column({ type: 'varchar', length: 7 }) color_primary: string;
    @Column({ type: 'varchar', length: 8 }) color_secondary: string;
    @Column({ type: 'varchar', length: 32 }) icon: string;

    @OneToMany(() => RadioStationSubGenreEntity, (subgenre) => subgenre.parent)
    subgenres: RadioStationSubGenreEntity[];
}
