mirror of
https://github.com/apricote/Listory.git
synced 2026-02-07 02:07:03 +00:00
feat(api): add listen report endpoint
This commit is contained in:
parent
ddcdfff89b
commit
3828b841c2
9 changed files with 179 additions and 0 deletions
16
src/reports/dto/get-listen-report.dto.ts
Normal file
16
src/reports/dto/get-listen-report.dto.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { IsEnum, IsISO8601 } from "class-validator";
|
||||
import { User } from "../../users/user.entity";
|
||||
import { Timeframe } from "../timeframe.enum";
|
||||
|
||||
export class GetListenReportDto {
|
||||
user: User;
|
||||
|
||||
@IsEnum(Timeframe)
|
||||
timeFrame: Timeframe;
|
||||
|
||||
@IsISO8601()
|
||||
timeStart: string;
|
||||
|
||||
@IsISO8601()
|
||||
timeEnd: string;
|
||||
}
|
||||
14
src/reports/dto/listen-report.dto.ts
Normal file
14
src/reports/dto/listen-report.dto.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { Timeframe } from "../timeframe.enum";
|
||||
|
||||
export class ListenReportDto {
|
||||
items: {
|
||||
date: string;
|
||||
count: number;
|
||||
}[];
|
||||
|
||||
timeFrame: Timeframe;
|
||||
|
||||
timeStart: string;
|
||||
|
||||
timeEnd: string;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue