File size: 1,258 Bytes
92c8a69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { IsNotEmpty, IsString, IsOptional, IsInt, IsBoolean, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

export class CreateStudyGroupDto {
  @ApiProperty({ description: 'Course ID to associate the study group with', example: 1 })
  @IsNotEmpty()
  @Type(() => Number)
  @IsInt()
  courseId: number;

  @ApiProperty({ description: 'Name of the study group', example: 'Data Structures Study Group' })
  @IsNotEmpty()
  @IsString()
  groupName: string;

  @ApiPropertyOptional({ description: 'Description of the study group', example: 'Weekly study sessions for DS course' })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiPropertyOptional({ description: 'Maximum number of members allowed', example: 10, default: 10 })
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @Min(2)
  @Max(50)
  maxMembers?: number;

  @ApiPropertyOptional({ description: 'Whether the group is public (anyone can join)', example: true, default: true })
  @IsOptional()
  @IsBoolean()
  isPublic?: boolean;

  @ApiPropertyOptional({ description: 'Meeting schedule text', example: 'Every Monday 5-7 PM' })
  @IsOptional()
  @IsString()
  meetingSchedule?: string;
}