Skip to content

Commit

Permalink
chore: add previous.txt to gitignore
Browse files Browse the repository at this point in the history
chore: code clean up and refactor
  • Loading branch information
invaderb committed Jun 27, 2024
1 parent bbe0394 commit 2269657
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 317 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
indent: ['warn', 'tab', { SwitchCase: 1 }],
indent: ['warn', 'tab', { SwitchCase: 1, "ignoredNodes": [
`FunctionExpression > .params[decorators.length > 0]`,
`FunctionExpression > .params > :matches(Decorator, :not(:first-child))`,
`ClassBody.body > PropertyDefinition[decorators.length > 0] > .key`,
], }],
},
};
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json

previous.txt
3 changes: 2 additions & 1 deletion nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"assets": ["assets/**/*"]
"assets": ["assets/**/*"],
"plugins": ["@nestjs/swagger"]
}
}
8 changes: 0 additions & 8 deletions src/models/dto/error.dto.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/* eslint-disable indent */
import { ApiProperty } from '@nestjs/swagger';

export class DefaultExceptionDto {
@ApiProperty()
statusCode: number;

@ApiProperty()
message: string;

@ApiProperty()
error: string;
}
22 changes: 0 additions & 22 deletions src/models/dto/events/events.dto.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
/* eslint-disable indent */
import { ApiProperty } from "@nestjs/swagger";

export class Event {
@ApiProperty()
category: string;

@ApiProperty()
details: string;

@ApiProperty()
end_date: string;

@ApiProperty()
event: string;

@ApiProperty()
name: string;

@ApiProperty()
registration: string | null;

@ApiProperty()
start_date: string;

}

export class EventList {
@ApiProperty()
categories: Array<string>;


@ApiProperty()
data: Array<Event>;

}
48 changes: 0 additions & 48 deletions src/models/dto/games/games.dto.ts
Original file line number Diff line number Diff line change
@@ -1,81 +1,33 @@
/* eslint-disable indent */
import { ApiProperty } from "@nestjs/swagger";
export class Game {
@ApiProperty()
id: number;

@ApiProperty()
capstones: number;

@ApiProperty()
date:number;

@ApiProperty()
komi:number;

@ApiProperty()
notation: string;

@ApiProperty()
pieces: number;

@ApiProperty()
player_black: string;

@ApiProperty()
player_white: string;

@ApiProperty()
rating_black: number;

@ApiProperty()
rating_change_black: number;

@ApiProperty()
rating_change_white: number;

@ApiProperty()
rating_white: number;

@ApiProperty()
result: string;

@ApiProperty()
size:number;

@ApiProperty()
timerinc: number;

@ApiProperty()
timertime: number;

@ApiProperty()
tournament: number;

@ApiProperty()
unrated: number;

@ApiProperty()
extra_time_amount: number;

@ApiProperty()
extra_time_trigger: number;
}

export class GamesList {
@ApiProperty()
items: Array<Game>;

@ApiProperty()
total: number;

@ApiProperty()
perPage: number;

@ApiProperty()
page: number;

@ApiProperty()
totalPages: number;
}

Expand Down
30 changes: 2 additions & 28 deletions src/models/dto/players/player.dto.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,20 @@
/* eslint-disable indent */
import { ApiProperty } from "@nestjs/swagger";

// Fatigue type with key of type string and value of type number
// Fatigue contains past games played by the player with the
// opponent id as the key and the calculated game factor as the value
export type Fatigue = {
[key: string]: number;
}

export class Player {
@ApiProperty()
id: number;

@ApiProperty()
name: string;

@ApiProperty()
rating: number;

@ApiProperty()
boost: number;

@ApiProperty()
maxrating: number;

@ApiProperty()
ratedgames: number;

@ApiProperty()
isbot: boolean;

@ApiProperty()
ratingage: number;

@ApiProperty()
ratingbase: number;

@ApiProperty()
participation_rating: number;

@ApiProperty()
fatigue: Fatigue | string | null;

@ApiProperty()
changed?: boolean;

}
25 changes: 1 addition & 24 deletions src/models/dto/rating/ratings.dto.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,20 @@
/* eslint-disable indent */
import { ApiProperty } from "@nestjs/swagger";

export class Rating {
@ApiProperty()
id: number;

@ApiProperty()
name: string;

@ApiProperty()
rating: number;

@ApiProperty()
maxrating: number;

@ApiProperty()
ratedgames: number;

@ApiProperty()
ratedgames: number;
participation_rating: number;

@ApiProperty()
isbot: boolean;
}

export class RatingList {
@ApiProperty()
items: Array<Rating>;

@ApiProperty()
total: number;

@ApiProperty()
perPage: number;

@ApiProperty()
page: number;

@ApiProperty()
totalPages: number;
}

Expand Down
6 changes: 0 additions & 6 deletions src/models/dto/response.dto.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/* eslint-disable indent */
import { ApiProperty } from '@nestjs/swagger';

export class DefaultResponseDto {
@ApiProperty()
status: number;

@ApiProperty()
message: string;
}
Loading

0 comments on commit 2269657

Please sign in to comment.