Init repo

This commit is contained in:
LeoMortari
2025-08-21 03:29:16 -03:00
commit 44a1625631
26 changed files with 6405 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import {
IsEnum,
IsInt,
IsISO8601,
IsOptional,
IsString,
IsUrl,
MaxLength,
} from 'class-validator';
import { EVideoSituation } from '../../../generated/prisma';
export class CreateVideoDto {
@IsUrl()
@MaxLength(244)
url!: string;
@IsOptional()
@IsEnum(EVideoSituation)
situation?: EVideoSituation;
@IsOptional()
@IsString()
@MaxLength(244)
error_message?: string;
@IsOptional()
@IsInt()
clips_quantity?: number;
@IsOptional()
times?: unknown;
@IsOptional()
@IsString()
@MaxLength(244)
title?: string;
@IsOptional()
@IsString()
@MaxLength(244)
filename?: string;
@IsOptional()
@IsString()
@MaxLength(244)
videoid?: string;
@IsOptional()
@IsISO8601()
datetime_download?: string;
@IsOptional()
@IsISO8601()
datetime_convert?: string;
@IsOptional()
@IsISO8601()
datetime_posted?: string;
}

View File

@@ -0,0 +1,29 @@
import { Type } from 'class-transformer';
import { IsInt, IsOptional, Max, Min } from 'class-validator';
export class PaginatedQueryDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page: number = 1;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
perPage: number = 20;
}
export type PaginatedResponse<T> = {
content: T[];
pagination: {
page: number;
perPage: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
};
};

View File

@@ -0,0 +1,12 @@
import { EVideoSituation } from 'generated/prisma';
export interface VideoResponseDto {
id: number;
title: string | null;
url: string;
situation: EVideoSituation;
clips_quantity: number;
videoid: string;
filename: string;
datetime_download: Date | string;
}