import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { PropertyEntity } from './property.entity';
import { PropertyPermitEntity } from './property-permit.entity';

@Entity('property_permit_types')
export class PropertyPermitTypeEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'varchar', length: 64 }) name: string;
    @Column({ type: 'varchar', length: 512 }) description: string;
    @Column({ type: 'varchar', length: 32, name: 'egp_component' }) menu_component: string;
    @Column({ type: 'varchar', nullable: true, length: 64 }) internal_name: string | null;

    @OneToMany(() => PropertyPermitEntity, (permit) => permit.permitType)
    permits: PropertyPermitEntity[];
}
