feat: 支持新版会员档案
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Max, MaxLength, Min, MinLength, Matches } from 'class-validator'
|
||||
import { IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Max, MaxLength, Min, MinLength, Matches, ValidateBy } from 'class-validator'
|
||||
import { isPostureAssessment, PostureAssessment } from '@mp-pilates/shared'
|
||||
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() @IsNumber() @Min(30) @Max(250) height?: number | null
|
||||
@IsOptional() @IsNumber() @Min(1) @Max(500) weight?: number | null
|
||||
@IsOptional() @IsNumber() @Min(1) @Max(75) bodyFat?: number | null
|
||||
@IsOptional() @IsNumber() @Min(10) @Max(300) waist?: number | null
|
||||
@IsOptional() @IsNumber() @Min(10) @Max(300) hip?: number | null
|
||||
@IsOptional() @IsNumber() @Min(-50) @Max(100) flexibility?: number | null
|
||||
@IsOptional() @ValidateBy({ name: 'postureAssessment', validator: { validate: isPostureAssessment, defaultMessage: () => '体态检查内容无效,请检查选项及左右侧标记' } }) assessment?: PostureAssessment | null
|
||||
@IsOptional() @IsString() @MaxLength(200) remark?: string
|
||||
}
|
||||
export class MemberNoteDto {
|
||||
|
||||
Reference in New Issue
Block a user