29 lines
588 B
TypeScript
29 lines
588 B
TypeScript
import { tenant_status } from '@prisma/client';
|
|
import { Type } from 'class-transformer';
|
|
import { IsIn, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
|
|
const STATUSES: tenant_status[] = ['trial', 'ativo', 'inadimplente', 'suspenso', 'cancelado'];
|
|
|
|
export class ListTenantsQueryDto {
|
|
@IsOptional()
|
|
@IsIn(STATUSES)
|
|
status?: tenant_status;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
busca?: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page?: number = 1;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(100)
|
|
limit?: number = 20;
|
|
}
|