Move to new server
This commit is contained in:
19
src/app/model/event.ts
Normal file
19
src/app/model/event.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import {Registration} from "./registration";
|
||||
import {Group} from "./group";
|
||||
|
||||
export class Event {
|
||||
id: number;
|
||||
type: string;
|
||||
status: string;
|
||||
doublesEvent: boolean;
|
||||
registrations: Registration[];
|
||||
groups: Group[];
|
||||
|
||||
static getType(type: string): string {
|
||||
if (type == "HE") return "Herenenkel";
|
||||
if (type == "HD") return "Herendubbel";
|
||||
if (type == "DD") return "Damesdubbel";
|
||||
if (type == "DE") return "Damesenkel";
|
||||
return "Gemengd dubbel";
|
||||
}
|
||||
}
|
||||
6
src/app/model/eventDivision.ts
Normal file
6
src/app/model/eventDivision.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import {Group} from "./group";
|
||||
|
||||
export class EventDivision {
|
||||
eventId: number;
|
||||
groups: Group[];
|
||||
}
|
||||
4
src/app/model/game.ts
Normal file
4
src/app/model/game.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class Game {
|
||||
score1: number;
|
||||
score2: number;
|
||||
}
|
||||
13
src/app/model/group.ts
Normal file
13
src/app/model/group.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {Team} from "./team";
|
||||
import {Round} from "./round";
|
||||
import {Standings} from "./standings";
|
||||
|
||||
export class Group {
|
||||
id: number;
|
||||
name: string;
|
||||
type: string;
|
||||
status: string;
|
||||
rounds: Round[];
|
||||
teams: Team[];
|
||||
standings: Standings;
|
||||
}
|
||||
14
src/app/model/match.ts
Normal file
14
src/app/model/match.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Team } from "./team";
|
||||
import {Game} from "./game";
|
||||
|
||||
export class Match {
|
||||
id: number;
|
||||
type: string;
|
||||
status: string;
|
||||
team1: Team;
|
||||
team2: Team;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
games: Game[];
|
||||
court: number;
|
||||
}
|
||||
24
src/app/model/player.ts
Normal file
24
src/app/model/player.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export enum Strength {
|
||||
D5 = "5e divisie",
|
||||
D6 = "6e divisie",
|
||||
D7 = "7e divisie",
|
||||
D8 = "8e divisie",
|
||||
D9 = "9e divisie",
|
||||
DR = "recreatief"
|
||||
}
|
||||
|
||||
export class Player {
|
||||
id: number;
|
||||
firstName: string;
|
||||
middleName: string;
|
||||
lastName: string;
|
||||
sex: string;
|
||||
birthday: string;
|
||||
phoneNumber: string
|
||||
email: string;
|
||||
club: string;
|
||||
strength: Strength;
|
||||
|
||||
}
|
||||
|
||||
|
||||
9
src/app/model/registration.ts
Normal file
9
src/app/model/registration.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import {Player} from "./player";
|
||||
|
||||
export class Registration {
|
||||
id: number;
|
||||
tournament: number;
|
||||
event: number;
|
||||
player: Player;
|
||||
partner?: Player;
|
||||
}
|
||||
6
src/app/model/result.ts
Normal file
6
src/app/model/result.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import {Game} from "./game";
|
||||
|
||||
export class Result {
|
||||
matchId: number;
|
||||
games: Game[] = [];
|
||||
}
|
||||
13
src/app/model/round.ts
Normal file
13
src/app/model/round.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {Match} from "./match";
|
||||
import {Team} from "./team";
|
||||
import {Standings} from "./standings";
|
||||
|
||||
export class Round {
|
||||
id: number;
|
||||
name: string;
|
||||
matches: Match[];
|
||||
status: string;
|
||||
quit: Team[];
|
||||
drawnOut: Team;
|
||||
standings: Standings;
|
||||
}
|
||||
18
src/app/model/standings.ts
Normal file
18
src/app/model/standings.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {Team} from "./team";
|
||||
|
||||
export class Standings {
|
||||
entries: StandingEntry[];
|
||||
}
|
||||
|
||||
export class StandingEntry {
|
||||
position: number;
|
||||
team: Team;
|
||||
played: number;
|
||||
won: number;
|
||||
lost: number;
|
||||
points: number;
|
||||
gamesWon: number;
|
||||
gamesLost: number;
|
||||
pointsWon: number;
|
||||
pointsLost: number;
|
||||
}
|
||||
7
src/app/model/team.ts
Normal file
7
src/app/model/team.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import {Player} from "./player";
|
||||
import {FullNamePipe} from "../pipes/fullname-pipe";
|
||||
|
||||
export class Team {
|
||||
player1: Player;
|
||||
player2: Player;
|
||||
}
|
||||
23
src/app/model/tournament.ts
Normal file
23
src/app/model/tournament.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {Event} from "./event";
|
||||
import {TournamentPlayer} from "./tournamentPlayer";
|
||||
|
||||
export class Tournament {
|
||||
id: number;
|
||||
name: string;
|
||||
date: string;
|
||||
status: string;
|
||||
events: Event[];
|
||||
tournamentPlayers: TournamentPlayer[];
|
||||
maxEvents: number;
|
||||
costsPerEvent: number[] = [0, 0, 0];
|
||||
courts: number;
|
||||
|
||||
static getStatus(tournament: Tournament): string {
|
||||
if (tournament.status == "CLOSED") return "Afgerond";
|
||||
if (tournament.status == "DIVIDED") return "Ingedeeld";
|
||||
if (tournament.status == "DRAWN") return "Geloot";
|
||||
if (tournament.status == "ONGOING") return "Bezig";
|
||||
return "Nieuw";
|
||||
}
|
||||
|
||||
}
|
||||
9
src/app/model/tournamentDivision.ts
Normal file
9
src/app/model/tournamentDivision.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import {EventDivision} from "./eventDivision";
|
||||
|
||||
export class TournamentDivision {
|
||||
tournamentId: number;
|
||||
divided: boolean;
|
||||
eventDivisions: EventDivision[];
|
||||
}
|
||||
|
||||
|
||||
8
src/app/model/tournamentPlayer.ts
Normal file
8
src/app/model/tournamentPlayer.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
export class TournamentPlayer {
|
||||
playerId: number;
|
||||
name: string;
|
||||
events: string[];
|
||||
paid: boolean;
|
||||
present: boolean;
|
||||
}
|
||||
34
src/app/model/tournamentRegistration.ts
Normal file
34
src/app/model/tournamentRegistration.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export class TournamentRegistration {
|
||||
id: number;
|
||||
name: string;
|
||||
editable: boolean;
|
||||
date: string;
|
||||
status: string;
|
||||
events: EventRegistration[];
|
||||
|
||||
static getStatus(tournamentRegistration: TournamentRegistration): string {
|
||||
if (tournamentRegistration.status == "CLOSED") return "Afgerond";
|
||||
if (tournamentRegistration.status == "DIVIDED") return "Ingedeeld";
|
||||
if (tournamentRegistration.status == "DRAWN") return "Geloot";
|
||||
if (tournamentRegistration.status == "IN_PROGRESS") return "Bezig";
|
||||
return "Nieuw";
|
||||
}
|
||||
}
|
||||
|
||||
export class EventRegistration {
|
||||
id: number;
|
||||
type: string;
|
||||
doublesEvent: boolean;
|
||||
registered: boolean;
|
||||
player?: number;
|
||||
partner?: number;
|
||||
|
||||
static getType(type: string): string {
|
||||
if (type == "HE") return "Herenenkel";
|
||||
if (type == "HD") return "Herendubbel";
|
||||
if (type == "DD") return "Damesdubbel";
|
||||
if (type == "DE") return "Damesenkel";
|
||||
return "Gemengd dubbel";
|
||||
}
|
||||
|
||||
}
|
||||
24
src/app/model/tournamentValidation.ts
Normal file
24
src/app/model/tournamentValidation.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export class TournamentValidation {
|
||||
id: number;
|
||||
validations : Validation[];
|
||||
eventValidations: EventValidation[];
|
||||
}
|
||||
|
||||
export class EventValidation {
|
||||
eventId: number;
|
||||
validations: Validation[];
|
||||
}
|
||||
|
||||
export class Validation {
|
||||
severity: string;
|
||||
message: string;
|
||||
|
||||
static hasErrors(validations: Validation[] | undefined): boolean {
|
||||
if (validations == null) {
|
||||
return false;
|
||||
} else {
|
||||
return validations.filter(v => v.severity == 'ERROR').length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user