import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { FactionEntity } from './faction.entity';

@Entity('faction_ranks')
export class FactionRankEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int' }) faction_id: number;
    @Column({ type: 'int' }) sort_id: number;
    @Column({ type: 'int' }) needed_modify_power: number;
    @Column({ type: 'int' }) modify_power: number;
    @Column({ type: 'varchar', length: 34 }) name: string;
    @Column({ type: 'int' }) hourly_pay: number;

    @ManyToOne(() => FactionEntity, (faction) => faction.ranks)
    @JoinColumn({ name: 'faction_id' })
    faction: FactionEntity;

    permissions: {
        id: number;
        name: string;
        description: string;
    }[] = [];
}
