import { Connection } from 'typeorm';
import { Factory, Seeder } from 'typeorm-seeding';
import { CreateRunnerOrganization } from '../models/actions/create/CreateRunnerOrganization';
import { RunnerOrganization } from '../models/entities/RunnerOrganization';

/**
 * Seeds the public runner org (named: "Citizen" by default).
 */
export default class SeedPublicOrg implements Seeder {
    public async run(factory: Factory, connection: Connection): Promise<any> {
        let publicOrg = new CreateRunnerOrganization();
        publicOrg.name = "Citizen";
        await connection.getRepository(RunnerOrganization).save(await publicOrg.toEntity());
    }
}