import { Transform } from 'class-transformer';
import { IsInt, IsNotEmpty } from 'class-validator';

export class UserStepDto {
  @IsNotEmpty({ message: 'Date Should Not be Empty.' })
  date: Date;

  @IsNotEmpty({ message: 'Steps Should Not be Empty.' })
  @Transform(({ value }) => value.trim().replace(/\s+/g, ' '))
  @IsInt({ message: 'Steps Should be an Integer.' })
  steps: string;
}

export class MultipleAppUsersStepDto {
  @IsNotEmpty({ message: 'User id Should Not be Empty.' })
  app_user_id: string;

  @IsNotEmpty({ message: 'User Steps Should Not be Empty.' })
  user_steps: UserStepDto[];
}
