Alpha Release 0.2.1 #119

Merged
niggl merged 34 commits from dev into main 2021-01-21 17:31:51 +00:00
Showing only changes of commit 1837336865 - Show all commits

View File

@ -1,9 +1,11 @@
import { Connection } from 'typeorm';
import { Factory, Seeder } from 'typeorm-seeding';
import { CreateGroupContact } from '../models/actions/create/CreateGroupContact';
import { CreateRunner } from '../models/actions/create/CreateRunner';
import { CreateRunnerOrganisation } from '../models/actions/create/CreateRunnerOrganisation';
import { CreateRunnerTeam } from '../models/actions/create/CreateRunnerTeam';
import { Address } from '../models/entities/Address';
import { GroupContact } from '../models/entities/GroupContact';
import { Runner } from '../models/entities/Runner';
import { RunnerGroup } from '../models/entities/RunnerGroup';
import { RunnerOrganisation } from '../models/entities/RunnerOrganisation';
@ -17,6 +19,7 @@ export default class SeedTestRunners implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
let testOrg: RunnerOrganisation = await this.createTestOrg(connection);
let testTeam: RunnerTeam = await this.createTestTeam(connection, testOrg);
await this.createTestContact(connection, testOrg);
await this.createTestRunners(connection, testOrg);
await this.createTestRunners(connection, testTeam);
}
@ -55,6 +58,22 @@ export default class SeedTestRunners implements Seeder {
}
}
public async createTestContact(connection: Connection, group: RunnerGroup) {
let contact = new CreateGroupContact;
contact.firstname = "Test";
contact.lastname = "Contact";
contact.email = "test.contact@dev.lauf-fuer-kaya.de";
contact.groups = group.id;
contact.address = new Address();
contact.address.address1 = "First Contact Street 100";
contact.address.city = "Herzogenaurach";
contact.address.country = "Germany";
contact.address.postalcode = "90174";
await connection.getRepository(GroupContact).save(await contact.toEntity());
}
private firstnames = [
"Peter",
"Matze",