src/histogram/dtos/base.dto.ts
Properties |
|
Readonly Optional contributor |
Type : string
|
Decorators :
@ApiPropertyOptional({type: 'string', example: 'bdougie'})
|
Defined in src/histogram/dtos/base.dto.ts:54
|
Readonly Optional orderDirection |
Type : OrderDirectionEnum
|
Default value : OrderDirectionEnum.DESC
|
Decorators :
@ApiPropertyOptional({enum: OrderDirectionEnum, enumName: 'OrderDirectionEnum', default: undefined})
|
Defined in src/histogram/dtos/base.dto.ts:64
|
Readonly Optional prev_days_start_date |
Type : number
|
Default value : 0
|
Decorators :
@ApiPropertyOptional({description: 'Number of days in the past to start range block', default: 0, type: 'integer'})
|
Defined in src/histogram/dtos/base.dto.ts:26
|
Readonly range |
Type : number
|
Default value : 30
|
Decorators :
@ApiProperty({description: 'Range in days', default: 30, type: 'integer'})
|
Defined in src/histogram/dtos/base.dto.ts:15
|
Readonly Optional repo |
Type : string
|
Decorators :
@ApiPropertyOptional({description: 'Repo name', type: 'string', example: 'open-sauced/app'})
|
Defined in src/histogram/dtos/base.dto.ts:46
|
Readonly Optional repoIds |
Type : string
|
Decorators :
@ApiPropertyOptional()
|
Defined in src/histogram/dtos/base.dto.ts:59
|
Readonly Optional width |
Type : number
|
Default value : 1
|
Decorators :
@ApiPropertyOptional({description: 'Day width of histogram buckets', default: 1, type: 'integer'})
|
Defined in src/histogram/dtos/base.dto.ts:36
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsEnum, IsIn, IsInt, IsOptional, IsString } from "class-validator";
import { OrderDirectionEnum } from "../../common/constants/order-direction.constant";
export class BaseHistogramDto {
@ApiProperty({
description: "Range in days",
default: 30,
type: "integer",
})
@Type(() => Number)
@IsIn([7, 30, 90, 180, 360])
@IsInt()
readonly range: number = 30;
@ApiPropertyOptional({
description: "Number of days in the past to start range block",
default: 0,
type: "integer",
})
@Type(() => Number)
@IsIn([0, 7, 30, 90, 180])
@IsInt()
@IsOptional()
readonly prev_days_start_date?: number = 0;
@ApiPropertyOptional({
description: "Day width of histogram buckets",
default: 1,
type: "integer",
})
@Type(() => Number)
@IsInt()
@IsOptional()
readonly width?: number = 1;
@ApiPropertyOptional({
description: "Repo name",
type: "string",
example: "open-sauced/app",
})
@Type(() => String)
@IsString()
@IsOptional()
readonly repo?: string;
@ApiPropertyOptional({
type: "string",
example: "bdougie",
})
@IsString()
@IsOptional()
readonly contributor?: string;
@ApiPropertyOptional()
@IsString()
@IsOptional()
readonly repoIds?: string;
@ApiPropertyOptional({ enum: OrderDirectionEnum, enumName: "OrderDirectionEnum", default: OrderDirectionEnum.DESC })
@IsEnum(OrderDirectionEnum)
@IsOptional()
readonly orderDirection?: OrderDirectionEnum = OrderDirectionEnum.DESC;
}