chore: port lab4 solution as lab5 base

This commit is contained in:
2026-11-15 14:42:12 +03:00
parent 276dbdad8a
commit 19dda6e286
90 changed files with 18537 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { Matches } from 'class-validator';
import { CodePointLength } from '../../common/dto/code-point-length.validator';
import { NotBlank } from '../../common/dto/not-blank.validator';
export class CreateUserDto {
@Matches(/^[a-z0-9_]{3,32}$/, {
message: 'username must match [a-z0-9_]{3,32}',
})
username!: string;
@NotBlank()
@CodePointLength(1, 100)
display_name!: string;
@NotBlank()
@CodePointLength(12, 128)
password!: string;
}
+17
View File
@@ -0,0 +1,17 @@
import { User } from '../../common/domain';
export interface UserResponse {
id: string;
username: string;
display_name: string;
created_at: string;
}
export function toUserResponse(user: User): UserResponse {
return {
id: user.id,
username: user.username,
display_name: user.displayName,
created_at: user.createdAt,
};
}