From 259c926e1514a56c6d8579fb0ea3afdb463881c2 Mon Sep 17 00:00:00 2001 From: QuocAnh189 Date: Thu, 10 Oct 2024 21:14:15 +0700 Subject: [PATCH] set up dto --- src/dtos/auth/SignIn.dto.ts | 4 ++++ src/dtos/auth/ValidateUser.dto.ts | 5 +++++ src/dtos/event/Event.dto.ts | 0 src/dtos/pagination/Metadata.dto.ts | 11 +++++++++++ src/dtos/pagination/Search.dto.ts | 4 ++++ src/dtos/review/Review.dto.ts | 9 +++++++++ src/dtos/review/UdpateReview.dto.ts | 4 ++++ src/dtos/user/UpdatePassword.dto.ts | 5 +++++ src/dtos/user/User.dto.ts | 21 +++++++++++++++++++++ 9 files changed, 63 insertions(+) create mode 100644 src/dtos/auth/SignIn.dto.ts create mode 100644 src/dtos/auth/ValidateUser.dto.ts create mode 100644 src/dtos/event/Event.dto.ts create mode 100644 src/dtos/pagination/Metadata.dto.ts create mode 100644 src/dtos/pagination/Search.dto.ts create mode 100644 src/dtos/review/Review.dto.ts create mode 100644 src/dtos/review/UdpateReview.dto.ts create mode 100644 src/dtos/user/UpdatePassword.dto.ts create mode 100644 src/dtos/user/User.dto.ts diff --git a/src/dtos/auth/SignIn.dto.ts b/src/dtos/auth/SignIn.dto.ts new file mode 100644 index 0000000..b692254 --- /dev/null +++ b/src/dtos/auth/SignIn.dto.ts @@ -0,0 +1,4 @@ +export interface SignInDto { + identity: string + password: string +} diff --git a/src/dtos/auth/ValidateUser.dto.ts b/src/dtos/auth/ValidateUser.dto.ts new file mode 100644 index 0000000..2008c2e --- /dev/null +++ b/src/dtos/auth/ValidateUser.dto.ts @@ -0,0 +1,5 @@ +export interface ValidateUserDto { + email: string + phone: string + fullName: string +} diff --git a/src/dtos/event/Event.dto.ts b/src/dtos/event/Event.dto.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/dtos/pagination/Metadata.dto.ts b/src/dtos/pagination/Metadata.dto.ts new file mode 100644 index 0000000..0249889 --- /dev/null +++ b/src/dtos/pagination/Metadata.dto.ts @@ -0,0 +1,11 @@ +export interface MetadataDto { + currentPage: number + totalPages: number + page: number + takeAll: boolean + pageSize: number + totalCount: number + payloadSize: number + hasPrevious: boolean + hasNext: boolean +} diff --git a/src/dtos/pagination/Search.dto.ts b/src/dtos/pagination/Search.dto.ts new file mode 100644 index 0000000..4992f45 --- /dev/null +++ b/src/dtos/pagination/Search.dto.ts @@ -0,0 +1,4 @@ +export interface SearchDto { + searchBy: string + searchValue: string +} diff --git a/src/dtos/review/Review.dto.ts b/src/dtos/review/Review.dto.ts new file mode 100644 index 0000000..9c4e03f --- /dev/null +++ b/src/dtos/review/Review.dto.ts @@ -0,0 +1,9 @@ +export interface ReviewDto { + id: string + content: string + rate: number + event: string + author: string + createdAt: string + updatedAt: string +} diff --git a/src/dtos/review/UdpateReview.dto.ts b/src/dtos/review/UdpateReview.dto.ts new file mode 100644 index 0000000..d3c3bdf --- /dev/null +++ b/src/dtos/review/UdpateReview.dto.ts @@ -0,0 +1,4 @@ +export interface UpdateReviewDto { + content: string + rate: number +} diff --git a/src/dtos/user/UpdatePassword.dto.ts b/src/dtos/user/UpdatePassword.dto.ts new file mode 100644 index 0000000..9c178e1 --- /dev/null +++ b/src/dtos/user/UpdatePassword.dto.ts @@ -0,0 +1,5 @@ +export interface UpdateUserPasswordDto { + userId: string + oldPassword: string + newPassword: string +} diff --git a/src/dtos/user/User.dto.ts b/src/dtos/user/User.dto.ts new file mode 100644 index 0000000..1be3904 --- /dev/null +++ b/src/dtos/user/User.dto.ts @@ -0,0 +1,21 @@ +import { EGender, EUserStatus } from '@constants/enum.constant' + +export interface UserDto { + id?: string + userName: string + email: string + phoneNumber: string + dob: string + fullName: string + gender: EGender + bio: string + avatar: string + status: EUserStatus + numberOfFollowers: number + numberOfFolloweds: number + numberOfFavourites: number + numberOfCreatedEvents: number + roles: string + createdAt: string + updatedAt: string +}