feat: add top-artists report

This commit is contained in:
Julian Tölle 2020-05-31 23:26:06 +02:00
parent 6a6ba493f6
commit 6fc10c40ca
18 changed files with 345 additions and 30 deletions

View file

@ -0,0 +1,18 @@
import { IsEnum, IsISO8601, ValidateIf } from "class-validator";
import { User } from "../../users/user.entity";
import { TimePreset } from "../timePreset.enum";
export class GetTopArtistsReportDto {
user: User;
@IsEnum(TimePreset)
timePreset: TimePreset;
@ValidateIf((o) => o.timePreset === TimePreset.CUSTOM)
@IsISO8601()
customTimeStart: string;
@ValidateIf((o) => o.timePreset === TimePreset.CUSTOM)
@IsISO8601()
customTimeEnd: string;
}

View file

@ -0,0 +1,8 @@
import { Artist } from "../../music-library/artist.entity";
export class TopArtistsReportDto {
items: {
artist: Artist;
count: number;
}[];
}