feat: groups

This commit is contained in:
Philipinho
2024-03-05 16:22:24 +00:00
parent 181bd78951
commit 528b9d70b1
21 changed files with 596 additions and 7 deletions

View File

@ -0,0 +1,8 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
import { GroupIdDto } from './group-id.dto';
export class AddGroupUserDto extends GroupIdDto {
@IsNotEmpty()
@IsUUID()
userId: string;
}

View File

@ -0,0 +1,12 @@
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
export class CreateGroupDto {
@MinLength(2)
@MaxLength(64)
@IsString()
name: string;
@IsOptional()
@IsString()
description?: string;
}

View File

@ -0,0 +1,7 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
export class GroupIdDto {
@IsNotEmpty()
@IsUUID()
groupId: string;
}

View File

@ -0,0 +1,3 @@
import { AddGroupUserDto } from './add-group-user.dto';
export class RemoveGroupUserDto extends AddGroupUserDto {}

View File

@ -0,0 +1,4 @@
import { PartialType } from '@nestjs/mapped-types';
import { CreateGroupDto } from './create-group.dto';
export class UpdateGroupDto extends PartialType(CreateGroupDto) {}