File

src/histogram/dtos/contributor.dto.ts

Index

Properties

Properties

Readonly Optional orderDirection
Type : OrderDirectionEnum
Default value : OrderDirectionEnum.DESC
Decorators :
@ApiPropertyOptional({enum: OrderDirectionEnum, enumName: 'OrderDirectionEnum', default: undefined})
@IsEnum(OrderDirectionEnum)
@IsOptional()
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'})
@Type(undefined)
@IsIn(['0', '7', '30', '90', '180'])
@IsInt()
@IsOptional()
Readonly range
Type : number
Default value : 30
Decorators :
@ApiProperty({description: 'Range in days', default: 30, type: 'integer'})
@Type(undefined)
@IsIn(['7', '30', '90', '180', '360'])
@IsInt()
Readonly Optional repo
Type : string
Decorators :
@ApiPropertyOptional({description: 'Repo name', type: 'string', example: 'open-sauced/app'})
@Type(undefined)
@IsString()
@IsOptional()
Readonly Optional repoIds
Type : string
Decorators :
@ApiPropertyOptional()
@IsString()
@IsOptional()
Readonly Optional width
Type : number
Default value : 1
Decorators :
@ApiPropertyOptional({description: 'Day width of histogram buckets', default: 1, type: 'integer'})
@Type(undefined)
@IsInt()
@IsOptional()
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 ContributorHistogramDto {
  @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()
  @IsString()
  @IsOptional()
  readonly repoIds?: string;

  @ApiPropertyOptional({ enum: OrderDirectionEnum, enumName: "OrderDirectionEnum", default: OrderDirectionEnum.DESC })
  @IsEnum(OrderDirectionEnum)
  @IsOptional()
  readonly orderDirection?: OrderDirectionEnum = OrderDirectionEnum.DESC;
}

results matching ""

    No results matching ""