22 lines
1.0 KiB
TypeScript
22 lines
1.0 KiB
TypeScript
import { IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Max, MaxLength, Min, MinLength, Matches } from 'class-validator'
|
|
export class BodyMetricDto {
|
|
@IsDateString() @Matches(/^\d{4}-\d{2}-\d{2}$/) recordedAt!: string
|
|
@IsOptional() @IsNumber() @Min(1) @Max(500) weight?: number
|
|
@IsOptional() @IsNumber() @Min(1) @Max(75) bodyFat?: number
|
|
@IsOptional() @IsNumber() @Min(10) @Max(300) waist?: number
|
|
@IsOptional() @IsNumber() @Min(10) @Max(300) hip?: number
|
|
@IsOptional() @IsNumber() @Min(-50) @Max(100) flexibility?: number
|
|
@IsOptional() @IsString() @MaxLength(200) remark?: string
|
|
}
|
|
export class MemberNoteDto {
|
|
@IsString() @MinLength(1) @MaxLength(1000) content!: string
|
|
@IsBoolean() shared!: boolean
|
|
@IsOptional() @IsString() bookingId?: string
|
|
}
|
|
export class ProgressPhotoDto {
|
|
@IsDateString() @Matches(/^\d{4}-\d{2}-\d{2}$/) recordedAt!: string
|
|
@IsString() @MaxLength(200) caption!: string
|
|
@IsString() @MaxLength(100) fileName!: string
|
|
}
|
|
export class PhotoConsentDto { @IsBoolean() consent!: boolean }
|