feat: add monthly card periods and apparatus lesson feedback

This commit is contained in:
richarjiang
2026-10-18 15:47:29 +08:00
parent b452de379d
commit a3d58fa8f2
40 changed files with 968 additions and 170 deletions

View File

@@ -1,5 +1,5 @@
import { IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Max, MaxLength, Min, MinLength, Matches, ValidateBy } from 'class-validator'
import { isPostureAssessment, PostureAssessment } from '@mp-pilates/shared'
import { IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Max, MaxLength, Min, MinLength, Matches, ValidateBy, ValidateIf } from 'class-validator'
import { ApparatusNotes, isApparatusNotes, isPostureAssessment, LESSON_NOTE_MAX_LENGTH, PostureAssessment } from '@mp-pilates/shared'
export class BodyMetricDto {
@IsDateString() @Matches(/^\d{4}-\d{2}-\d{2}$/) recordedAt!: string
@IsOptional() @IsNumber() @Min(30) @Max(250) height?: number | null
@@ -12,9 +12,12 @@ export class BodyMetricDto {
@IsOptional() @IsString() @MaxLength(200) remark?: string
}
export class MemberNoteDto {
@IsString() @MinLength(1) @MaxLength(1000) content!: string
@IsOptional() @IsString() @MaxLength(LESSON_NOTE_MAX_LENGTH) content?: string
@ValidateIf((_object, value) => value !== undefined)
@ValidateBy({ name: 'apparatusNotes', validator: { validate: isApparatusNotes, defaultMessage: () => '器械记录无效,每项最多填写1000字' } })
apparatusNotes?: ApparatusNotes
@IsBoolean() shared!: boolean
@IsOptional() @IsString() bookingId?: string
@IsOptional() @IsString() @MinLength(1) bookingId?: string
}
export class ProgressPhotoDto {
@IsDateString() @Matches(/^\d{4}-\d{2}-\d{2}$/) recordedAt!: string