-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user module #2
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DATABASE_URL= | ||
|
||
MYSQL_DATABASE= | ||
MYSQL_ROOT_PASSWORD= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
"worldId" TEXT NOT NULL, | ||
"username" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_worldId_key" ON "User"("worldId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
Warnings: | ||
|
||
- You are about to drop the column `name` on the `User` table. All the data in the column will be lost. | ||
|
||
*/ | ||
-- AlterTable | ||
ALTER TABLE "User" DROP COLUMN "name", | ||
ADD COLUMN "pollsCreatedCount" INTEGER NOT NULL DEFAULT 0, | ||
ADD COLUMN "profilePicture" TEXT; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,68 @@ | ||||||||||||||||||||||||||||||||||||||||||
-- CreateTable | ||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE "Poll" ( | ||||||||||||||||||||||||||||||||||||||||||
"id" SERIAL NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"userId" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"title" TEXT NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"description" TEXT, | ||||||||||||||||||||||||||||||||||||||||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||||||||||||||||||||||||||||||||||||||||
"startDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||||||||||||||||||||||||||||||||||||||||
"endDate" TIMESTAMP(3) NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"isAnonymous" BOOLEAN NOT NULL DEFAULT false, | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
CONSTRAINT "Poll_pkey" PRIMARY KEY ("id") | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- CreateTable | ||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE "Option" ( | ||||||||||||||||||||||||||||||||||||||||||
"id" SERIAL NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"optionText" TEXT NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"pollId" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
CONSTRAINT "Option_pkey" PRIMARY KEY ("id") | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- CreateTable | ||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE "Tag" ( | ||||||||||||||||||||||||||||||||||||||||||
"id" SERIAL NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"content" TEXT, | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
CONSTRAINT "Tag_pkey" PRIMARY KEY ("id") | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- CreateTable | ||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE "Vote" ( | ||||||||||||||||||||||||||||||||||||||||||
"id" SERIAL NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"weight" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"optionId" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||||||||||||||||||||||||||||||||||||||||
"proof" TEXT[], | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
CONSTRAINT "Vote_pkey" PRIMARY KEY ("id") | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+34
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add constraints and index to Vote table. Consider adding:
CREATE TABLE "Vote" (
"id" SERIAL NOT NULL,
"weight" INTEGER NOT NULL,
"optionId" INTEGER NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
- "proof" TEXT[],
+ "proof" JSONB,
- CONSTRAINT "Vote_pkey" PRIMARY KEY ("id")
+ CONSTRAINT "Vote_pkey" PRIMARY KEY ("id"),
+ CONSTRAINT "Vote_weight_check" CHECK ("weight" > 0)
);
+CREATE INDEX "Vote_optionId_idx" ON "Vote"("optionId"); 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- CreateTable | ||||||||||||||||||||||||||||||||||||||||||
CREATE TABLE "_PollToTag" ( | ||||||||||||||||||||||||||||||||||||||||||
"A" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
"B" INTEGER NOT NULL, | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
CONSTRAINT "_PollToTag_AB_pkey" PRIMARY KEY ("A","B") | ||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- CreateIndex | ||||||||||||||||||||||||||||||||||||||||||
CREATE INDEX "_PollToTag_B_index" ON "_PollToTag"("B"); | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- AddForeignKey | ||||||||||||||||||||||||||||||||||||||||||
ALTER TABLE "Poll" ADD CONSTRAINT "Poll_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- AddForeignKey | ||||||||||||||||||||||||||||||||||||||||||
ALTER TABLE "Option" ADD CONSTRAINT "Option_pollId_fkey" FOREIGN KEY ("pollId") REFERENCES "Poll"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- AddForeignKey | ||||||||||||||||||||||||||||||||||||||||||
ALTER TABLE "Vote" ADD CONSTRAINT "Vote_optionId_fkey" FOREIGN KEY ("optionId") REFERENCES "Option"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- AddForeignKey | ||||||||||||||||||||||||||||||||||||||||||
ALTER TABLE "_PollToTag" ADD CONSTRAINT "_PollToTag_A_fkey" FOREIGN KEY ("A") REFERENCES "Poll"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
-- AddForeignKey | ||||||||||||||||||||||||||||||||||||||||||
ALTER TABLE "_PollToTag" ADD CONSTRAINT "_PollToTag_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (e.g., Git) | ||
provider = "postgresql" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,3 +12,55 @@ datasource db { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
provider = "postgresql" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
url = env("DATABASE_URL") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model User{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id Int @id @default(autoincrement()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
worldId String @unique() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
username String @unique() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
profilePicture String? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pollsCreatedCount Int @default(0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt DateTime @default(now()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
poll Poll[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model Poll{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id Int @id @default(autoincrement()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user User @relation(fields: [userId],references: [id]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
userId Int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title String | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description String? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options Option[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tags Tag[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt DateTime @default(now()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
startDate DateTime @default(now()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
endDate DateTime | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isAnonymous Boolean @default(false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+28
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation and indexes to Poll model. Consider the following improvements:
model Poll{
id Int @id @default(autoincrement())
- user User @relation(fields: [userId],references: [id])
+ user User @relation("UserPolls", fields: [userId],references: [id])
userId Int
title String
description String?
- options Option[]
+ options Option[] @relation("PollOptions", onDelete: Cascade)
- tags Tag[]
+ tags Tag[] @relation("PollTags")
createdAt DateTime @default(now())
startDate DateTime @default(now())
endDate DateTime
isAnonymous Boolean @default(false)
+ @@index([userId])
+ @@check(startDate <= endDate)
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model Option { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id Int @id @default(autoincrement()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optionText String | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
poll Poll @relation(fields: [pollId], references: [id]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pollId Int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
votes Vote[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt DateTime @default(now()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model Tag{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id Int @id @default(autoincrement()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
content String? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
poll Poll[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
model Vote{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id Int @id @default(autoincrement()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
weight Int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
option Option @relation(fields: [optionId], references: [id]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
optionId Int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt DateTime @default(now()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
proof String[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+59
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation and index to Vote model. Consider the following improvements:
model Vote{
id Int @id @default(autoincrement())
- weight Int
+ weight Int @check(weight > 0)
- option Option @relation(fields: [optionId], references: [id])
+ option Option @relation("OptionVotes", fields: [optionId], references: [id])
optionId Int
createdAt DateTime @default(now())
- proof String[]
+ proof String[] @db.JsonB
+ @@index([optionId])
} 📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
import { UsersService } from './users/users.service'; | ||
import { UsersController } from './users/users.controller'; | ||
import { UsersModule } from './users/users.module'; | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove unused imports and fix module configuration.
Apply this diff to fix the issues: -import { UsersService } from './users/users.service';
-import { UsersController } from './users/users.controller';
import { UsersModule } from './users/users.module';
@Module({
imports: [UsersModule],
- controllers: [AppController, UsersController],
+ controllers: [AppController],
providers: [AppService],
}) Also applies to: 9-10 🧰 Tools🪛 ESLint[error] 4-4: 'UsersService' is defined but never used. (@typescript-eslint/no-unused-vars) |
||
|
||
@Module({ | ||
imports: [], | ||
controllers: [AppController], | ||
imports: [UsersModule], | ||
controllers: [AppController, UsersController], | ||
providers: [AppService], | ||
}) | ||
export class AppModule {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Injectable, OnModuleInit } from '@nestjs/common'; | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
@Injectable() | ||
export class PrismaService extends PrismaClient implements OnModuleInit { | ||
async onModuleInit() { | ||
await this.$connect() | ||
.then(() => console.log('Connected to DB')) | ||
.catch((err) => console.log(err)); | ||
} | ||
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance error handling and logging.
Apply this diff: - async onModuleInit() {
- await this.$connect()
- .then(() => console.log('Connected to DB'))
- .catch((err) => console.log(err));
+ private readonly logger = new Logger(PrismaService.name);
+
+ async onModuleInit() {
+ try {
+ await this.$connect();
+ this.logger.log('Successfully connected to database');
+ } catch (error) {
+ this.logger.error('Failed to connect to database', error);
+ throw error;
+ }
} Don't forget to import Logger: import { Injectable, Logger, OnModuleInit } from '@nestjs/common'; |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; | ||
|
||
export class CreateUserDto { | ||
@IsString() | ||
@IsNotEmpty() | ||
worldId: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
username: string; | ||
|
||
@IsString() | ||
@IsOptional() | ||
profilePicture?: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
Body, | ||
Controller, | ||
Post, | ||
UsePipes, | ||
ValidationPipe, | ||
} from '@nestjs/common'; | ||
import { UsersService } from './users.service'; | ||
import { CreateUserDto } from './dtos/CreateUser.dto'; | ||
|
||
@Controller('users') | ||
export class UsersController { | ||
constructor(private userService: UsersService) {} | ||
|
||
@Post() | ||
@UsePipes(ValidationPipe) | ||
async createUser(@Body() createUserDto: CreateUserDto) { | ||
return await this.userService.createUser(createUserDto); | ||
} | ||
Comment on lines
+15
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance method implementation with response type and error handling.
Apply this diff: @Post()
@UsePipes(ValidationPipe)
- async createUser(@Body() createUserDto: CreateUserDto) {
- return await this.userService.createUser(createUserDto);
+ async createUser(@Body() createUserDto: CreateUserDto): Promise<User> {
+ try {
+ return await this.usersService.createUser(createUserDto);
+ } catch (error) {
+ if (error.code === 'P2002') {
+ throw new ConflictException('User with this worldId or username already exists');
+ }
+ throw error;
+ }
} Don't forget to add these imports: import { ConflictException } from '@nestjs/common';
import { User } from '@prisma/client'; |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PrismaService } from 'src/prisma.service'; | ||
import { UsersController } from './users.controller'; | ||
import { UsersService } from './users.service'; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [UsersController], | ||
providers: [UsersService, PrismaService], | ||
exports: [UsersService], | ||
}) | ||
export class UsersModule {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { Prisma } from '@prisma/client'; | ||
import { PrismaService } from 'src/prisma.service'; | ||
|
||
@Injectable() | ||
export class UsersService { | ||
constructor(private prisma: PrismaService) {} | ||
|
||
async createUser(data: Prisma.UserCreateInput) { | ||
console.log(data); | ||
return this.prisma.user.create({ data }); | ||
} | ||
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve error handling, logging, and type safety.
Apply this diff: + private readonly logger = new Logger(UsersService.name);
+
- async createUser(data: Prisma.UserCreateInput) {
- console.log(data);
- return this.prisma.user.create({ data });
+ async createUser(data: Prisma.UserCreateInput): Promise<Prisma.User> {
+ this.logger.debug('Creating user', data);
+ try {
+ return await this.prisma.user.create({ data });
+ } catch (error) {
+ this.logger.error('Failed to create user', error);
+ throw new InternalServerErrorException('Failed to create user');
+ }
} Don't forget to import: import { Injectable, InternalServerErrorException, Logger } from '@nestjs/common'; |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1063,6 +1063,11 @@ | |
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" | ||
integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== | ||
|
||
"@prisma/client@^6.3.1": | ||
version "6.3.1" | ||
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-6.3.1.tgz#4e4b05b27f4541ea541a601c57a8ada10b526848" | ||
integrity sha512-ARAJaPs+eBkemdky/XU3cvGRl+mIPHCN2lCXsl5Vlb0E2gV+R6IN7aCI8CisRGszEZondwIsW9Iz8EJkTdykyA== | ||
|
||
"@prisma/[email protected]": | ||
version "6.3.1" | ||
resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-6.3.1.tgz#08730461dab4fe147efa70637952b942dc1961b5" | ||
|
@@ -1466,6 +1471,11 @@ | |
"@types/methods" "^1.1.4" | ||
"@types/superagent" "^8.1.0" | ||
|
||
"@types/validator@^13.11.8": | ||
version "13.12.2" | ||
resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.12.2.tgz#760329e756e18a4aab82fc502b51ebdfebbe49f5" | ||
integrity sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA== | ||
|
||
"@types/yargs-parser@*": | ||
version "21.0.3" | ||
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" | ||
|
@@ -2278,6 +2288,20 @@ cjs-module-lexer@^1.0.0: | |
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d" | ||
integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== | ||
|
||
class-transformer@^0.5.1: | ||
version "0.5.1" | ||
resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" | ||
integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== | ||
|
||
class-validator@^0.14.1: | ||
version "0.14.1" | ||
resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.1.tgz#ff2411ed8134e9d76acfeb14872884448be98110" | ||
integrity sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ== | ||
dependencies: | ||
"@types/validator" "^13.11.8" | ||
libphonenumber-js "^1.10.53" | ||
validator "^13.9.0" | ||
|
||
cli-cursor@^3.1.0: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" | ||
|
@@ -4087,6 +4111,11 @@ levn@^0.4.1: | |
prelude-ls "^1.2.1" | ||
type-check "~0.4.0" | ||
|
||
libphonenumber-js@^1.10.53: | ||
version "1.11.19" | ||
resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.11.19.tgz#de6437b15d23d9e3b16e5b14c6f2d6d65f58c9b7" | ||
integrity sha512-bW/Yp/9dod6fmyR+XqSUL1N5JE7QRxQ3KrBIbYS1FTv32e5i3SEtQVX+71CYNv8maWNSOgnlCoNp9X78f/cKiA== | ||
|
||
lines-and-columns@^1.1.6: | ||
version "1.2.4" | ||
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" | ||
|
@@ -5581,6 +5610,11 @@ v8-to-istanbul@^9.0.1: | |
"@types/istanbul-lib-coverage" "^2.0.1" | ||
convert-source-map "^2.0.0" | ||
|
||
validator@^13.9.0: | ||
version "13.12.0" | ||
resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f" | ||
integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg== | ||
|
||
vary@^1, vary@~1.1.2: | ||
version "1.1.2" | ||
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add missing indexes and constraints to Poll table.
Consider adding: