chore: migrate minimum from lab1

This commit is contained in:
2026-10-21 09:41:45 +03:00
parent 65003b6119
commit d8fb486709
44 changed files with 11664 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { Injectable } from '@nestjs/common';
import { ApiError } from '../common/filters/api-error';
import { User } from '../common/store/domain';
import { StoreService } from '../common/store/store.service';
@Injectable()
export class UsersService {
constructor(private readonly store: StoreService) {}
register(username: string, displayName: string): User {
const user = this.store.createUser(username, displayName.trim());
if (!user) {
throw new ApiError('conflict', 'username is already taken');
}
return user;
}
}