feat: 支持新版会员档案

This commit is contained in:
richarjiang
2026-10-18 14:59:48 +08:00
parent 21e3ece21c
commit b452de379d
23 changed files with 731 additions and 54 deletions

View File

@@ -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 {