From 8b0d182cb34752efba3a8f991d9c5352a5895d7c Mon Sep 17 00:00:00 2001 From: Aaron William Po Date: Sun, 10 Dec 2023 18:15:35 -0500 Subject: [PATCH] Update casing for services and controllers directories. --- src/components/Account/AccountInfo.tsx | 2 +- src/components/Account/Security.tsx | 2 +- src/components/Account/UpdateProfileForm.tsx | 4 ++-- src/components/Account/UserAvatar.tsx | 2 +- src/components/BeerById/BeerCommentForm.tsx | 2 +- src/components/BeerById/BeerInfoHeader.tsx | 2 +- .../BeerById/BeerPostCommentsSection.tsx | 2 +- src/components/BeerById/BeerRecommendations.tsx | 2 +- src/components/BeerIndex/BeerCard.tsx | 2 +- .../BeerStyleById/BeerStyleBeerSection.tsx | 2 +- .../BeerStyleById/BeerStyleCommentForm.tsx | 2 +- .../BeerStyleById/BeerStyleCommentSection.tsx | 2 +- src/components/BeerStyleById/BeerStyleHeader.tsx | 2 +- src/components/BeerStyleIndex/BeerStyleCard.tsx | 2 +- .../BreweryById/BreweryBeerSection.tsx | 2 +- .../BreweryById/BreweryCommentForm.tsx | 2 +- .../BreweryById/BreweryCommentsSection.tsx | 2 +- src/components/BreweryById/BreweryInfoHeader.tsx | 2 +- src/components/BreweryIndex/BreweryCard.tsx | 2 +- .../BreweryPost/CreateBreweryPostForm.tsx | 2 +- src/components/CreateBeerPostForm.tsx | 4 ++-- src/components/EditBeerPostForm.tsx | 2 +- src/components/Login/LoginForm.tsx | 2 +- src/components/RegisterUserForm.tsx | 2 +- src/components/UserPage/UserFollowButton.tsx | 2 +- src/components/UserPage/UserHeader.tsx | 2 +- src/config/auth/localStrat.ts | 2 +- src/config/auth/types.ts | 2 +- .../nextConnect/middleware/getCurrentUser.ts | 2 +- src/contexts/UserContext.tsx | 2 +- .../{beerComments => beer-comments}/index.ts | 8 ++++---- .../index.ts | 6 +++--- .../index.ts | 6 +++--- .../images/{beerImages => beer-images}/index.ts | 2 +- .../{breweryImages => brewery-images}/index.ts | 2 +- .../{beerPostLikes => beer-posts-likes}/index.ts | 10 +++++----- .../index.ts | 10 +++++----- .../index.ts | 0 .../posts/{beerPosts => beer-posts}/index.ts | 14 +++++++------- .../{beerPosts => beer-posts}/types/index.ts | 4 ++-- .../posts/{beerStyles => beer-styles}/index.ts | 6 +++--- .../{beerStyles => beer-styles}/types/index.ts | 2 +- src/controllers/posts/breweries/index.ts | 10 +++++----- src/controllers/posts/breweries/types/index.ts | 2 +- src/controllers/users/auth/index.ts | 16 ++++++++-------- src/controllers/users/auth/types/index.ts | 4 ++-- src/controllers/users/profile/index.ts | 11 ++++++----- src/controllers/users/profile/types/index.ts | 2 +- src/hooks/auth/useUser.ts | 2 +- .../beer-posts/useBeerPostSearch.ts | 2 +- .../data-fetching/beer-posts/useBeerPosts.ts | 2 +- .../beer-posts/useBeerPostsByBeerStyles.ts | 2 +- .../beer-posts/useBeerPostsByBrewery.ts | 2 +- .../beer-posts/useBeerPostsByUser.ts | 2 +- .../beer-posts/useBeerRecommendations.ts | 2 +- .../data-fetching/beer-styles/useBeerStyles.ts | 2 +- .../brewery-posts/useBreweryMapPagePosts.ts | 2 +- .../brewery-posts/useBreweryPosts.ts | 2 +- .../brewery-posts/useBreweryPostsByUser.ts | 2 +- .../user-follows/useGetUsersFollowedByUser.ts | 2 +- .../user-follows/useGetUsersFollowingUser.ts | 2 +- src/pages/api/beer-comments/[id].ts | 2 +- src/pages/api/beer-style-comments/[id].ts | 2 +- src/pages/api/beers/[id]/comments/index.ts | 2 +- src/pages/api/beers/[id]/images/index.ts | 2 +- src/pages/api/beers/[id]/index.ts | 6 +++--- src/pages/api/beers/[id]/like/index.ts | 2 +- src/pages/api/beers/[id]/like/is-liked.ts | 2 +- src/pages/api/beers/[id]/recommendations.ts | 4 ++-- src/pages/api/beers/create.ts | 6 +++--- src/pages/api/beers/index.ts | 4 ++-- src/pages/api/beers/search.ts | 2 +- src/pages/api/beers/styles/[id]/beers/index.ts | 2 +- .../api/beers/styles/[id]/comments/index.ts | 2 +- src/pages/api/beers/styles/[id]/index.ts | 4 ++-- src/pages/api/beers/styles/[id]/like/index.ts | 2 +- src/pages/api/beers/styles/[id]/like/is-liked.ts | 2 +- src/pages/api/beers/styles/create.ts | 6 +++--- src/pages/api/beers/styles/index.ts | 2 +- src/pages/api/breweries/[id]/comments/index.ts | 2 +- src/pages/api/breweries/[id]/images/index.ts | 2 +- src/pages/api/breweries/[id]/index.ts | 4 ++-- src/pages/api/breweries/[id]/like/index.ts | 2 +- src/pages/api/breweries/[id]/like/is-liked.ts | 2 +- src/pages/api/breweries/create.ts | 4 ++-- src/pages/api/breweries/map/index.ts | 2 +- src/pages/api/brewery-comments/[id].ts | 2 +- src/pages/api/users/[id]/index.ts | 3 ++- src/pages/api/users/[id]/posts/beers.ts | 2 +- src/pages/api/users/confirm.ts | 2 +- src/pages/api/users/edit-password.ts | 3 ++- src/pages/api/users/login.ts | 3 ++- src/pages/api/users/register.ts | 3 ++- src/pages/beers/[id]/edit.tsx | 4 ++-- src/pages/beers/[id]/index.tsx | 4 ++-- src/pages/beers/styles/[id]/index.tsx | 4 ++-- src/pages/breweries/[id]/beers/create.tsx | 4 ++-- src/pages/breweries/[id]/edit.tsx | 6 +++--- src/pages/breweries/[id]/index.tsx | 4 ++-- src/pages/breweries/index.tsx | 2 +- src/pages/breweries/map.tsx | 2 +- src/pages/users/[id].tsx | 4 ++-- src/pages/users/account/edit-profile.tsx | 2 +- src/pages/users/forgot-password.tsx | 2 +- src/pages/users/reset-password.tsx | 2 +- src/prisma/seed/create/createAdminUser.ts | 2 +- .../Account/sendUpdateUserProfileRequest.ts | 2 +- .../BeerImage/sendUploadBeerImageRequest.ts | 2 +- .../BeerPost/sendCreateBeerPostRequest.ts | 4 ++-- src/requests/BeerPost/sendEditBeerPostRequest.ts | 2 +- .../sendUploadBreweryImageRequest.ts | 2 +- .../BreweryPost/sendCreateBreweryPostRequest.ts | 4 ++-- src/requests/User/sendEditUserRequest.ts | 2 +- src/requests/User/sendRegisterUserRequest.ts | 4 ++-- src/requests/User/sendUpdatePasswordRequest.ts | 2 +- .../createNewBeerComment.ts | 0 .../editBeerCommentById.ts | 0 .../findBeerCommentById.ts | 0 .../getAllBeerComments.ts | 0 .../getBeerCommentCount.ts | 0 .../createNewBeerStyleComment.ts | 0 .../getAllBeerStyleComments.ts | 0 .../getBeerStyleCommentCount.ts | 0 .../updateBeerStyleCommentById.ts | 0 .../createNewBreweryComment.ts | 0 .../getAllBreweryComments.ts | 0 .../getBreweryCommentById.ts | 0 .../addBeerImageToDB.ts | 0 .../addBreweryImageToDB.ts | 0 .../createBeerPostLike.ts | 2 +- .../findBeerPostLikeById.ts | 0 .../getBeerPostLikeCount.ts | 0 .../removeBeerPostLikeById.ts | 0 .../createBeerStyleLike.ts | 2 +- .../findBeerStyleLikeById.ts | 0 .../getBeerStyleLikeCount.ts | 0 .../removeBeerStyleLikeById.ts | 0 .../{BeerPost => beer-post}/createNewBeerPost.ts | 0 .../deleteBeerPostById.ts | 0 .../{BeerPost => beer-post}/editBeerPostById.ts | 0 .../{BeerPost => beer-post}/getAllBeerPosts.ts | 2 +- .../{BeerPost => beer-post}/getBeerPostById.ts | 2 +- .../getBeerPostsByBeerStyleId.ts | 0 .../getBeerPostsByBreweryId.ts | 0 .../getBeerPostsByPostedById.ts | 0 .../getBeerRecommendations.ts | 2 +- .../schema/BeerPostQueryResult.ts | 0 .../schema/CreateBeerPostValidationSchema.ts | 0 .../schema/EditBeerPostValidationSchema.ts | 0 .../deleteBeerStyleById.ts | 0 .../editBeerStyleById.ts | 0 .../getAllBeerStyles.ts | 0 .../getBeerStyleById.ts | 0 .../schema/BeerStyleQueryResult.ts | 0 .../schema/CreateBeerStyleValidationSchema.ts | 0 .../createNewBreweryPost.ts | 0 .../getAllBreweryPosts.ts | 2 +- .../getAllBreweryPostsByPostedById.ts | 2 +- .../getBreweryPostById.ts | 2 +- .../schema/BreweryPostMapQueryResult.ts | 0 .../schema/BreweryPostQueryResult.ts | 0 .../schema/CreateBreweryPostSchema.ts | 0 .../schema/EditBreweryPostValidationSchema.ts | 0 .../UpdateUserAvatarByIdParams.ts | 2 +- .../users/{User => auth}/createNewUser.ts | 0 .../users/{User => auth}/deleteUserById.ts | 0 .../users/{User => auth}/findUserByEmail.ts | 0 .../users/{User => auth}/findUserById.ts | 0 .../users/{User => auth}/findUserByIdPublic.ts | 0 .../users/{User => auth}/findUserByUsername.ts | 0 .../schema/CreateUserValidationSchemas.ts | 0 .../{User => auth}/schema/EditUserSchema.ts | 0 .../users/{User => auth}/schema/GetUserSchema.ts | 0 .../schema/LoginValidationSchema.ts | 0 .../{User => auth}/schema/PublicUserSchema.ts | 2 +- .../schema/TokenValidationSchema.ts | 0 .../{User => auth}/schema/UpdateProfileSchema.ts | 0 .../{User => auth}/sendConfirmationEmail.ts | 0 .../{User => auth}/sendResetPasswordEmail.ts | 0 .../{User => auth}/updateUserProfileById.ts | 0 .../updateUserToBeConfirmedById.ts | 2 +- .../getUsersFollowedByUser.ts | 0 .../getUsersFollowingUser.ts | 0 .../schema/FollowInfoSchema.ts | 2 +- 184 files changed, 195 insertions(+), 190 deletions(-) rename src/controllers/comments/{beerComments => beer-comments}/index.ts (89%) rename src/controllers/comments/{beerStyleComments => beer-style-comments}/index.ts (91%) rename src/controllers/comments/{breweryComments => brewery-comments}/index.ts (91%) rename src/controllers/images/{beerImages => beer-images}/index.ts (92%) rename src/controllers/images/{breweryImages => brewery-images}/index.ts (91%) rename src/controllers/likes/{beerPostLikes => beer-posts-likes}/index.ts (82%) rename src/controllers/likes/{beerStyleLikes => beer-style-likes}/index.ts (82%) rename src/controllers/likes/{breweryPostLikes => brewery-post-likes}/index.ts (100%) rename src/controllers/posts/{beerPosts => beer-posts}/index.ts (88%) rename src/controllers/posts/{beerPosts => beer-posts}/types/index.ts (77%) rename src/controllers/posts/{beerStyles => beer-styles}/index.ts (91%) rename src/controllers/posts/{beerStyles => beer-styles}/types/index.ts (75%) rename src/services/comments/{BeerComment => beer-comment}/createNewBeerComment.ts (100%) rename src/services/comments/{BeerComment => beer-comment}/editBeerCommentById.ts (100%) rename src/services/comments/{BeerComment => beer-comment}/findBeerCommentById.ts (100%) rename src/services/comments/{BeerComment => beer-comment}/getAllBeerComments.ts (100%) rename src/services/comments/{BeerComment => beer-comment}/getBeerCommentCount.ts (100%) rename src/services/comments/{BeerStyleComment => beer-style-comment}/createNewBeerStyleComment.ts (100%) rename src/services/comments/{BeerStyleComment => beer-style-comment}/getAllBeerStyleComments.ts (100%) rename src/services/comments/{BeerStyleComment => beer-style-comment}/getBeerStyleCommentCount.ts (100%) rename src/services/comments/{BeerStyleComment => beer-style-comment}/updateBeerStyleCommentById.ts (100%) rename src/services/comments/{BreweryComment => brewery-comment}/createNewBreweryComment.ts (100%) rename src/services/comments/{BreweryComment => brewery-comment}/getAllBreweryComments.ts (100%) rename src/services/comments/{BreweryComment => brewery-comment}/getBreweryCommentById.ts (100%) rename src/services/images/{BeerImage => beer-image}/addBeerImageToDB.ts (100%) rename src/services/images/{BreweryImage => brewery-image}/addBreweryImageToDB.ts (100%) rename src/services/likes/{BeerPostLike => beer-post-like}/createBeerPostLike.ts (86%) rename src/services/likes/{BeerPostLike => beer-post-like}/findBeerPostLikeById.ts (100%) rename src/services/likes/{BeerPostLike => beer-post-like}/getBeerPostLikeCount.ts (100%) rename src/services/likes/{BeerPostLike => beer-post-like}/removeBeerPostLikeById.ts (100%) rename src/services/likes/{BeerStyleLike => beer-style-like}/createBeerStyleLike.ts (86%) rename src/services/likes/{BeerStyleLike => beer-style-like}/findBeerStyleLikeById.ts (100%) rename src/services/likes/{BeerStyleLike => beer-style-like}/getBeerStyleLikeCount.ts (100%) rename src/services/likes/{BeerStyleLike => beer-style-like}/removeBeerStyleLikeById.ts (100%) rename src/services/posts/{BeerPost => beer-post}/createNewBeerPost.ts (100%) rename src/services/posts/{BeerPost => beer-post}/deleteBeerPostById.ts (100%) rename src/services/posts/{BeerPost => beer-post}/editBeerPostById.ts (100%) rename src/services/posts/{BeerPost => beer-post}/getAllBeerPosts.ts (91%) rename src/services/posts/{BeerPost => beer-post}/getBeerPostById.ts (90%) rename src/services/posts/{BeerPost => beer-post}/getBeerPostsByBeerStyleId.ts (100%) rename src/services/posts/{BeerPost => beer-post}/getBeerPostsByBreweryId.ts (100%) rename src/services/posts/{BeerPost => beer-post}/getBeerPostsByPostedById.ts (100%) rename src/services/posts/{BeerPost => beer-post}/getBeerRecommendations.ts (94%) rename src/services/posts/{BeerPost => beer-post}/schema/BeerPostQueryResult.ts (100%) rename src/services/posts/{BeerPost => beer-post}/schema/CreateBeerPostValidationSchema.ts (100%) rename src/services/posts/{BeerPost => beer-post}/schema/EditBeerPostValidationSchema.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/deleteBeerStyleById.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/editBeerStyleById.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/getAllBeerStyles.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/getBeerStyleById.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/schema/BeerStyleQueryResult.ts (100%) rename src/services/posts/{BeerStyles => beer-style-post}/schema/CreateBeerStyleValidationSchema.ts (100%) rename src/services/posts/{BreweryPost => brewery-post}/createNewBreweryPost.ts (100%) rename src/services/posts/{BreweryPost => brewery-post}/getAllBreweryPosts.ts (92%) rename src/services/posts/{BreweryPost => brewery-post}/getAllBreweryPostsByPostedById.ts (93%) rename src/services/posts/{BreweryPost => brewery-post}/getBreweryPostById.ts (91%) rename src/services/posts/{BreweryPost => brewery-post}/schema/BreweryPostMapQueryResult.ts (100%) rename src/services/posts/{BreweryPost => brewery-post}/schema/BreweryPostQueryResult.ts (100%) rename src/services/posts/{BreweryPost => brewery-post}/schema/CreateBreweryPostSchema.ts (100%) rename src/services/posts/{BreweryPost => brewery-post}/schema/EditBreweryPostValidationSchema.ts (100%) rename src/services/users/{UserAccount => account}/UpdateUserAvatarByIdParams.ts (95%) rename src/services/users/{User => auth}/createNewUser.ts (100%) rename src/services/users/{User => auth}/deleteUserById.ts (100%) rename src/services/users/{User => auth}/findUserByEmail.ts (100%) rename src/services/users/{User => auth}/findUserById.ts (100%) rename src/services/users/{User => auth}/findUserByIdPublic.ts (100%) rename src/services/users/{User => auth}/findUserByUsername.ts (100%) rename src/services/users/{User => auth}/schema/CreateUserValidationSchemas.ts (100%) rename src/services/users/{User => auth}/schema/EditUserSchema.ts (100%) rename src/services/users/{User => auth}/schema/GetUserSchema.ts (100%) rename src/services/users/{User => auth}/schema/LoginValidationSchema.ts (100%) rename src/services/users/{User => auth}/schema/PublicUserSchema.ts (72%) rename src/services/users/{User => auth}/schema/TokenValidationSchema.ts (100%) rename src/services/users/{User => auth}/schema/UpdateProfileSchema.ts (100%) rename src/services/users/{User => auth}/sendConfirmationEmail.ts (100%) rename src/services/users/{User => auth}/sendResetPasswordEmail.ts (100%) rename src/services/users/{User => auth}/updateUserProfileById.ts (100%) rename src/services/users/{User => auth}/updateUserToBeConfirmedById.ts (92%) rename src/services/users/{UserFollows => follows}/getUsersFollowedByUser.ts (100%) rename src/services/users/{UserFollows => follows}/getUsersFollowingUser.ts (100%) rename src/services/users/{UserFollows => follows}/schema/FollowInfoSchema.ts (69%) diff --git a/src/components/Account/AccountInfo.tsx b/src/components/Account/AccountInfo.tsx index 01b1cb9..63cf7c5 100644 --- a/src/components/Account/AccountInfo.tsx +++ b/src/components/Account/AccountInfo.tsx @@ -1,6 +1,6 @@ import validateEmailRequest from '@/requests/User/validateEmailRequest'; import validateUsernameRequest from '@/requests/validateUsernameRequest'; -import { BaseCreateUserSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { BaseCreateUserSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; import { Switch } from '@headlessui/react'; import { zodResolver } from '@hookform/resolvers/zod'; import { Dispatch, FC, useContext } from 'react'; diff --git a/src/components/Account/Security.tsx b/src/components/Account/Security.tsx index cde42bd..f9e0b79 100644 --- a/src/components/Account/Security.tsx +++ b/src/components/Account/Security.tsx @@ -3,7 +3,7 @@ import { Dispatch, FunctionComponent } from 'react'; import { SubmitHandler, useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; -import { UpdatePasswordSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { UpdatePasswordSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; import sendUpdatePasswordRequest from '@/requests/User/sendUpdatePasswordRequest'; import { AccountPageState, AccountPageAction } from '@/reducers/accountPageReducer'; import toast from 'react-hot-toast'; diff --git a/src/components/Account/UpdateProfileForm.tsx b/src/components/Account/UpdateProfileForm.tsx index effbcb7..039626a 100644 --- a/src/components/Account/UpdateProfileForm.tsx +++ b/src/components/Account/UpdateProfileForm.tsx @@ -5,7 +5,7 @@ import FormSegment from '@/components/ui/forms/FormSegment'; import Link from 'next/link'; import FormTextArea from '@/components/ui/forms/FormTextArea'; import { FC } from 'react'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import type { UseFormHandleSubmit, SubmitHandler, @@ -13,7 +13,7 @@ import type { UseFormRegister, } from 'react-hook-form'; import { z } from 'zod'; -import UpdateProfileSchema from '../../services/users/User/schema/UpdateProfileSchema'; +import UpdateProfileSchema from '@/services/users/auth/schema/UpdateProfileSchema'; type UpdateProfileSchemaT = z.infer; diff --git a/src/components/Account/UserAvatar.tsx b/src/components/Account/UserAvatar.tsx index 1696881..470d8eb 100644 --- a/src/components/Account/UserAvatar.tsx +++ b/src/components/Account/UserAvatar.tsx @@ -1,7 +1,7 @@ import { FC } from 'react'; import { CldImage } from 'next-cloudinary'; import { z } from 'zod'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import { FaUser } from 'react-icons/fa'; interface UserAvatarProps { diff --git a/src/components/BeerById/BeerCommentForm.tsx b/src/components/BeerById/BeerCommentForm.tsx index 19fd302..ce7d752 100644 --- a/src/components/BeerById/BeerCommentForm.tsx +++ b/src/components/BeerById/BeerCommentForm.tsx @@ -1,6 +1,6 @@ import sendCreateBeerCommentRequest from '@/requests/BeerComment/sendCreateBeerCommentRequest'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { zodResolver } from '@hookform/resolvers/zod'; import { FunctionComponent } from 'react'; diff --git a/src/components/BeerById/BeerInfoHeader.tsx b/src/components/BeerById/BeerInfoHeader.tsx index 73381c3..c44d027 100644 --- a/src/components/BeerById/BeerInfoHeader.tsx +++ b/src/components/BeerById/BeerInfoHeader.tsx @@ -4,7 +4,7 @@ import { FC, useContext } from 'react'; import UserContext from '@/contexts/UserContext'; import { FaRegEdit } from 'react-icons/fa'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount'; import useTimeDistance from '@/hooks/utilities/useTimeDistance'; diff --git a/src/components/BeerById/BeerPostCommentsSection.tsx b/src/components/BeerById/BeerPostCommentsSection.tsx index fe53bf2..5f83c91 100644 --- a/src/components/BeerById/BeerPostCommentsSection.tsx +++ b/src/components/BeerById/BeerPostCommentsSection.tsx @@ -1,6 +1,6 @@ import UserContext from '@/contexts/UserContext'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { FC, MutableRefObject, useContext, useRef } from 'react'; import { z } from 'zod'; diff --git a/src/components/BeerById/BeerRecommendations.tsx b/src/components/BeerById/BeerRecommendations.tsx index 66c3154..96d0887 100644 --- a/src/components/BeerById/BeerRecommendations.tsx +++ b/src/components/BeerById/BeerRecommendations.tsx @@ -3,7 +3,7 @@ import { FC, MutableRefObject, useRef } from 'react'; import { useInView } from 'react-intersection-observer'; import { z } from 'zod'; import useBeerRecommendations from '@/hooks/data-fetching/beer-posts/useBeerRecommendations'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import debounce from 'lodash/debounce'; import BeerRecommendationLoadingComponent from './BeerRecommendationLoadingComponent'; diff --git a/src/components/BeerIndex/BeerCard.tsx b/src/components/BeerIndex/BeerCard.tsx index df0ff8d..3f27613 100644 --- a/src/components/BeerIndex/BeerCard.tsx +++ b/src/components/BeerIndex/BeerCard.tsx @@ -1,7 +1,7 @@ import Link from 'next/link'; import { FC, useContext } from 'react'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; import UserContext from '@/contexts/UserContext'; import useGetBeerPostLikeCount from '@/hooks/data-fetching/beer-likes/useBeerPostLikeCount'; diff --git a/src/components/BeerStyleById/BeerStyleBeerSection.tsx b/src/components/BeerStyleById/BeerStyleBeerSection.tsx index 38e6d3a..bed62c4 100644 --- a/src/components/BeerStyleById/BeerStyleBeerSection.tsx +++ b/src/components/BeerStyleById/BeerStyleBeerSection.tsx @@ -3,7 +3,7 @@ import { FC, MutableRefObject, useRef } from 'react'; import { useInView } from 'react-intersection-observer'; import { z } from 'zod'; -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import useBeerPostsByBeerStyle from '@/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles'; import BeerRecommendationLoadingComponent from '../BeerById/BeerRecommendationLoadingComponent'; diff --git a/src/components/BeerStyleById/BeerStyleCommentForm.tsx b/src/components/BeerStyleById/BeerStyleCommentForm.tsx index 0436428..7e9f0e4 100644 --- a/src/components/BeerStyleById/BeerStyleCommentForm.tsx +++ b/src/components/BeerStyleById/BeerStyleCommentForm.tsx @@ -8,7 +8,7 @@ import CreateCommentValidationSchema from '@/services/schema/CommentSchema/Creat import toast from 'react-hot-toast'; import createErrorToast from '@/util/createErrorToast'; -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments'; import sendCreateBeerStyleCommentRequest from '@/requests/BeerStyleComment/sendCreateBeerStyleCommentRequest'; import CommentForm from '../ui/CommentForm'; diff --git a/src/components/BeerStyleById/BeerStyleCommentSection.tsx b/src/components/BeerStyleById/BeerStyleCommentSection.tsx index 7d1d665..5716327 100644 --- a/src/components/BeerStyleById/BeerStyleCommentSection.tsx +++ b/src/components/BeerStyleById/BeerStyleCommentSection.tsx @@ -5,7 +5,7 @@ import { z } from 'zod'; import { useRouter } from 'next/router'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import useBeerStyleComments from '@/hooks/data-fetching/beer-style-comments/useBeerStyleComments'; import LoadingComponent from '../BeerById/LoadingComponent'; import CommentsComponent from '../ui/CommentsComponent'; diff --git a/src/components/BeerStyleById/BeerStyleHeader.tsx b/src/components/BeerStyleById/BeerStyleHeader.tsx index c68312a..7285ae8 100644 --- a/src/components/BeerStyleById/BeerStyleHeader.tsx +++ b/src/components/BeerStyleById/BeerStyleHeader.tsx @@ -7,7 +7,7 @@ import { FaRegEdit } from 'react-icons/fa'; import { z } from 'zod'; import useTimeDistance from '@/hooks/utilities/useTimeDistance'; -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import useBeerStyleLikeCount from '@/hooks/data-fetching/beer-style-likes/useBeerStyleLikeCount'; import BeerStyleLikeButton from './BeerStyleLikeButton'; diff --git a/src/components/BeerStyleIndex/BeerStyleCard.tsx b/src/components/BeerStyleIndex/BeerStyleCard.tsx index bd76c95..6ce2fe2 100644 --- a/src/components/BeerStyleIndex/BeerStyleCard.tsx +++ b/src/components/BeerStyleIndex/BeerStyleCard.tsx @@ -1,4 +1,4 @@ -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import Link from 'next/link'; import { FC } from 'react'; diff --git a/src/components/BreweryById/BreweryBeerSection.tsx b/src/components/BreweryById/BreweryBeerSection.tsx index 7d11225..843efb5 100644 --- a/src/components/BreweryById/BreweryBeerSection.tsx +++ b/src/components/BreweryById/BreweryBeerSection.tsx @@ -1,5 +1,5 @@ import UseBeerPostsByBrewery from '@/hooks/data-fetching/beer-posts/useBeerPostsByBrewery'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import Link from 'next/link'; import { FC, MutableRefObject, useContext, useRef } from 'react'; import { useInView } from 'react-intersection-observer'; diff --git a/src/components/BreweryById/BreweryCommentForm.tsx b/src/components/BreweryById/BreweryCommentForm.tsx index aa58d4a..162302c 100644 --- a/src/components/BreweryById/BreweryCommentForm.tsx +++ b/src/components/BreweryById/BreweryCommentForm.tsx @@ -1,5 +1,5 @@ import useBreweryPostComments from '@/hooks/data-fetching/brewery-comments/useBreweryPostComments'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; import { zodResolver } from '@hookform/resolvers/zod'; import { FC } from 'react'; diff --git a/src/components/BreweryById/BreweryCommentsSection.tsx b/src/components/BreweryById/BreweryCommentsSection.tsx index f87ec82..e7b6c2e 100644 --- a/src/components/BreweryById/BreweryCommentsSection.tsx +++ b/src/components/BreweryById/BreweryCommentsSection.tsx @@ -1,5 +1,5 @@ import UserContext from '@/contexts/UserContext'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { FC, MutableRefObject, useContext, useRef } from 'react'; import { z } from 'zod'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; diff --git a/src/components/BreweryById/BreweryInfoHeader.tsx b/src/components/BreweryById/BreweryInfoHeader.tsx index c2fcb00..e5d3b81 100644 --- a/src/components/BreweryById/BreweryInfoHeader.tsx +++ b/src/components/BreweryById/BreweryInfoHeader.tsx @@ -1,7 +1,7 @@ import UserContext from '@/contexts/UserContext'; import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount'; import useTimeDistance from '@/hooks/utilities/useTimeDistance'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { format } from 'date-fns'; import { FC, useContext } from 'react'; diff --git a/src/components/BreweryIndex/BreweryCard.tsx b/src/components/BreweryIndex/BreweryCard.tsx index 39cda05..39ae8e2 100644 --- a/src/components/BreweryIndex/BreweryCard.tsx +++ b/src/components/BreweryIndex/BreweryCard.tsx @@ -1,6 +1,6 @@ import UserContext from '@/contexts/UserContext'; import useGetBreweryPostLikeCount from '@/hooks/data-fetching/brewery-likes/useGetBreweryPostLikeCount'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { FC, useContext } from 'react'; import Link from 'next/link'; import { z } from 'zod'; diff --git a/src/components/BreweryPost/CreateBreweryPostForm.tsx b/src/components/BreweryPost/CreateBreweryPostForm.tsx index d2dbb24..4b1d2b6 100644 --- a/src/components/BreweryPost/CreateBreweryPostForm.tsx +++ b/src/components/BreweryPost/CreateBreweryPostForm.tsx @@ -1,6 +1,6 @@ import sendUploadBreweryImagesRequest from '@/requests/BreweryImage/sendUploadBreweryImageRequest'; import sendCreateBreweryPostRequest from '@/requests/BreweryPost/sendCreateBreweryPostRequest'; -import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema'; +import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema'; import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema'; import createErrorToast from '@/util/createErrorToast'; import { Tab } from '@headlessui/react'; diff --git a/src/components/CreateBeerPostForm.tsx b/src/components/CreateBeerPostForm.tsx index 5156154..fdba62f 100644 --- a/src/components/CreateBeerPostForm.tsx +++ b/src/components/CreateBeerPostForm.tsx @@ -4,8 +4,8 @@ import router from 'next/router'; import { FunctionComponent } from 'react'; import { useForm, SubmitHandler, FieldError } from 'react-hook-form'; import { z } from 'zod'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; -import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; +import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema'; import sendCreateBeerPostRequest from '@/requests/BeerPost/sendCreateBeerPostRequest'; import UploadImageValidationSchema from '@/services/schema/ImageSchema/UploadImageValidationSchema'; import sendUploadBeerImagesRequest from '@/requests/BeerImage/sendUploadBeerImageRequest'; diff --git a/src/components/EditBeerPostForm.tsx b/src/components/EditBeerPostForm.tsx index d78604f..63727a8 100644 --- a/src/components/EditBeerPostForm.tsx +++ b/src/components/EditBeerPostForm.tsx @@ -7,7 +7,7 @@ import { useForm, SubmitHandler } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import deleteBeerPostRequest from '@/requests/BeerPost/deleteBeerPostRequest'; -import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema'; +import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema'; import sendEditBeerPostRequest from '@/requests/BeerPost/sendEditBeerPostRequest'; import createErrorToast from '@/util/createErrorToast'; import Button from './ui/forms/Button'; diff --git a/src/components/Login/LoginForm.tsx b/src/components/Login/LoginForm.tsx index d25f687..1c7fec9 100644 --- a/src/components/Login/LoginForm.tsx +++ b/src/components/Login/LoginForm.tsx @@ -1,5 +1,5 @@ import sendLoginUserRequest from '@/requests/User/sendLoginUserRequest'; -import LoginValidationSchema from '@/services/users/User/schema/LoginValidationSchema'; +import LoginValidationSchema from '@/services/users/auth/schema/LoginValidationSchema'; import { zodResolver } from '@hookform/resolvers/zod'; import { useRouter } from 'next/router'; import { useContext } from 'react'; diff --git a/src/components/RegisterUserForm.tsx b/src/components/RegisterUserForm.tsx index 1589cd0..588338e 100644 --- a/src/components/RegisterUserForm.tsx +++ b/src/components/RegisterUserForm.tsx @@ -1,5 +1,5 @@ import sendRegisterUserRequest from '@/requests/User/sendRegisterUserRequest'; -import { CreateUserValidationSchemaWithUsernameAndEmailCheck } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { CreateUserValidationSchemaWithUsernameAndEmailCheck } from '@/services/users/auth/schema/CreateUserValidationSchemas'; import { zodResolver } from '@hookform/resolvers/zod'; import { useRouter } from 'next/router'; import { FC } from 'react'; diff --git a/src/components/UserPage/UserFollowButton.tsx b/src/components/UserPage/UserFollowButton.tsx index 4813639..1f1dc58 100644 --- a/src/components/UserPage/UserFollowButton.tsx +++ b/src/components/UserPage/UserFollowButton.tsx @@ -2,7 +2,7 @@ import useFollowStatus from '@/hooks/data-fetching/user-follows/useFollowStatus' import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser'; import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser'; import sendUserFollowRequest from '@/requests/UserFollow/sendUserFollowRequest'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import { FC, useState } from 'react'; import { FaUserCheck, FaUserPlus } from 'react-icons/fa'; import { z } from 'zod'; diff --git a/src/components/UserPage/UserHeader.tsx b/src/components/UserPage/UserHeader.tsx index cf0481c..bf17d5a 100644 --- a/src/components/UserPage/UserHeader.tsx +++ b/src/components/UserPage/UserHeader.tsx @@ -3,7 +3,7 @@ import useTimeDistance from '@/hooks/utilities/useTimeDistance'; import { FC, useContext } from 'react'; import { z } from 'zod'; import { format } from 'date-fns'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser'; import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser'; import UserContext from '@/contexts/UserContext'; diff --git a/src/config/auth/localStrat.ts b/src/config/auth/localStrat.ts index d74efb6..614bd45 100644 --- a/src/config/auth/localStrat.ts +++ b/src/config/auth/localStrat.ts @@ -1,4 +1,4 @@ -import findUserByUsername from '@/services/users/User/findUserByUsername'; +import findUserByUsername from '@/services/users/auth/findUserByUsername'; import Local from 'passport-local'; import ServerError from '../util/ServerError'; import { validatePassword } from './passwordFns'; diff --git a/src/config/auth/types.ts b/src/config/auth/types.ts index 96e4962..0a28928 100644 --- a/src/config/auth/types.ts +++ b/src/config/auth/types.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import { IncomingMessage } from 'http'; import { NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/config/nextConnect/middleware/getCurrentUser.ts b/src/config/nextConnect/middleware/getCurrentUser.ts index e7aba93..24f5f43 100644 --- a/src/config/nextConnect/middleware/getCurrentUser.ts +++ b/src/config/nextConnect/middleware/getCurrentUser.ts @@ -1,6 +1,6 @@ import { NextApiResponse } from 'next'; import { NextHandler } from 'next-connect'; -import findUserById from '@/services/users/User/findUserById'; +import findUserById from '@/services/users/auth/findUserById'; import ServerError from '@/config/util/ServerError'; import { getLoginSession } from '../../auth/session'; import { UserExtendedNextApiRequest } from '../../auth/types'; diff --git a/src/contexts/UserContext.tsx b/src/contexts/UserContext.tsx index f1cc76f..00e1506 100644 --- a/src/contexts/UserContext.tsx +++ b/src/contexts/UserContext.tsx @@ -1,5 +1,5 @@ import useUser from '@/hooks/auth/useUser'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import { ReactNode, createContext } from 'react'; import { z } from 'zod'; diff --git a/src/controllers/comments/beerComments/index.ts b/src/controllers/comments/beer-comments/index.ts similarity index 89% rename from src/controllers/comments/beerComments/index.ts rename to src/controllers/comments/beer-comments/index.ts index 35b1df0..d2fbf4c 100644 --- a/src/controllers/comments/beerComments/index.ts +++ b/src/controllers/comments/beer-comments/index.ts @@ -1,13 +1,13 @@ import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; -import editBeerCommentById from '@/services/comments/BeerComment/editBeerCommentById'; -import findBeerCommentById from '@/services/comments/BeerComment/findBeerCommentById'; +import editBeerCommentById from '@/services/comments/beer-comment/editBeerCommentById'; +import findBeerCommentById from '@/services/comments/beer-comment/findBeerCommentById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { NextHandler } from 'next-connect'; import { z } from 'zod'; -import createNewBeerComment from '@/services/comments/BeerComment/createNewBeerComment'; -import getAllBeerComments from '@/services/comments/BeerComment/getAllBeerComments'; +import createNewBeerComment from '@/services/comments/beer-comment/createNewBeerComment'; +import getAllBeerComments from '@/services/comments/beer-comment/getAllBeerComments'; import { CommentRequest, EditAndCreateCommentRequest, diff --git a/src/controllers/comments/beerStyleComments/index.ts b/src/controllers/comments/beer-style-comments/index.ts similarity index 91% rename from src/controllers/comments/beerStyleComments/index.ts rename to src/controllers/comments/beer-style-comments/index.ts index 5e88f76..f50dc59 100644 --- a/src/controllers/comments/beerStyleComments/index.ts +++ b/src/controllers/comments/beer-style-comments/index.ts @@ -1,14 +1,14 @@ import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; -import updateBeerStyleCommentById from '@/services/comments/BeerStyleComment/updateBeerStyleCommentById'; +import updateBeerStyleCommentById from '@/services/comments/beer-style-comment/updateBeerStyleCommentById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { NextHandler } from 'next-connect'; import { z } from 'zod'; import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult'; -import createNewBeerStyleComment from '@/services/comments/BeerStyleComment/createNewBeerStyleComment'; -import getAllBeerStyleComments from '@/services/comments/BeerStyleComment/getAllBeerStyleComments'; +import createNewBeerStyleComment from '@/services/comments/beer-style-comment/createNewBeerStyleComment'; +import getAllBeerStyleComments from '@/services/comments/beer-style-comment/getAllBeerStyleComments'; import { CommentRequest, diff --git a/src/controllers/comments/breweryComments/index.ts b/src/controllers/comments/brewery-comments/index.ts similarity index 91% rename from src/controllers/comments/breweryComments/index.ts rename to src/controllers/comments/brewery-comments/index.ts index 8251814..86484fc 100644 --- a/src/controllers/comments/breweryComments/index.ts +++ b/src/controllers/comments/brewery-comments/index.ts @@ -1,13 +1,13 @@ import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; -import getBreweryCommentById from '@/services/comments/BreweryComment/getBreweryCommentById'; +import getBreweryCommentById from '@/services/comments/brewery-comment/getBreweryCommentById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { NextHandler } from 'next-connect'; import { z } from 'zod'; import CommentQueryResult from '@/services/schema/CommentSchema/CommentQueryResult'; -import createNewBreweryComment from '@/services/comments/BreweryComment/createNewBreweryComment'; -import getAllBreweryComments from '@/services/comments/BreweryComment/getAllBreweryComments'; +import createNewBreweryComment from '@/services/comments/brewery-comment/createNewBreweryComment'; +import getAllBreweryComments from '@/services/comments/brewery-comment/getAllBreweryComments'; import { CommentRequest, EditAndCreateCommentRequest, diff --git a/src/controllers/images/beerImages/index.ts b/src/controllers/images/beer-images/index.ts similarity index 92% rename from src/controllers/images/beerImages/index.ts rename to src/controllers/images/beer-images/index.ts index afce7d5..92ce733 100644 --- a/src/controllers/images/beerImages/index.ts +++ b/src/controllers/images/beer-images/index.ts @@ -1,5 +1,5 @@ import ServerError from '@/config/util/ServerError'; -import addBeerImageToDB from '@/services/images/BeerImage/addBeerImageToDB'; +import addBeerImageToDB from '@/services/images/beer-image/addBeerImageToDB'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/images/breweryImages/index.ts b/src/controllers/images/brewery-images/index.ts similarity index 91% rename from src/controllers/images/breweryImages/index.ts rename to src/controllers/images/brewery-images/index.ts index eb217d6..3c7c910 100644 --- a/src/controllers/images/breweryImages/index.ts +++ b/src/controllers/images/brewery-images/index.ts @@ -1,5 +1,5 @@ import ServerError from '@/config/util/ServerError'; -import addBreweryImageToDB from '@/services/images/BreweryImage/addBreweryImageToDB'; +import addBreweryImageToDB from '@/services/images/brewery-image/addBreweryImageToDB'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/likes/beerPostLikes/index.ts b/src/controllers/likes/beer-posts-likes/index.ts similarity index 82% rename from src/controllers/likes/beerPostLikes/index.ts rename to src/controllers/likes/beer-posts-likes/index.ts index 9a77de9..9b21e2d 100644 --- a/src/controllers/likes/beerPostLikes/index.ts +++ b/src/controllers/likes/beer-posts-likes/index.ts @@ -1,10 +1,10 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; import ServerError from '@/config/util/ServerError'; -import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById'; -import createBeerPostLike from '@/services/likes/BeerPostLike/createBeerPostLike'; -import findBeerPostLikeById from '@/services/likes/BeerPostLike/findBeerPostLikeById'; -import getBeerPostLikeCountByBeerPostId from '@/services/likes/BeerPostLike/getBeerPostLikeCount'; -import removeBeerPostLikeById from '@/services/likes/BeerPostLike/removeBeerPostLikeById'; +import getBeerPostById from '@/services/posts/beer-post/getBeerPostById'; +import createBeerPostLike from '@/services/likes/beer-post-like/createBeerPostLike'; +import findBeerPostLikeById from '@/services/likes/beer-post-like/findBeerPostLikeById'; +import getBeerPostLikeCountByBeerPostId from '@/services/likes/beer-post-like/getBeerPostLikeCount'; +import removeBeerPostLikeById from '@/services/likes/beer-post-like/removeBeerPostLikeById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse, NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/likes/beerStyleLikes/index.ts b/src/controllers/likes/beer-style-likes/index.ts similarity index 82% rename from src/controllers/likes/beerStyleLikes/index.ts rename to src/controllers/likes/beer-style-likes/index.ts index 3f18705..1b18ea3 100644 --- a/src/controllers/likes/beerStyleLikes/index.ts +++ b/src/controllers/likes/beer-style-likes/index.ts @@ -1,9 +1,9 @@ import ServerError from '@/config/util/ServerError'; -import createBeerStyleLike from '@/services/likes/BeerStyleLike/createBeerStyleLike'; -import findBeerStyleLikeById from '@/services/likes/BeerStyleLike/findBeerStyleLikeById'; -import getBeerStyleLikeCount from '@/services/likes/BeerStyleLike/getBeerStyleLikeCount'; -import removeBeerStyleLikeById from '@/services/likes/BeerStyleLike/removeBeerStyleLikeById'; -import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById'; +import createBeerStyleLike from '@/services/likes/beer-style-like/createBeerStyleLike'; +import findBeerStyleLikeById from '@/services/likes/beer-style-like/findBeerStyleLikeById'; +import getBeerStyleLikeCount from '@/services/likes/beer-style-like/getBeerStyleLikeCount'; +import removeBeerStyleLikeById from '@/services/likes/beer-style-like/removeBeerStyleLikeById'; +import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse, NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/likes/breweryPostLikes/index.ts b/src/controllers/likes/brewery-post-likes/index.ts similarity index 100% rename from src/controllers/likes/breweryPostLikes/index.ts rename to src/controllers/likes/brewery-post-likes/index.ts diff --git a/src/controllers/posts/beerPosts/index.ts b/src/controllers/posts/beer-posts/index.ts similarity index 88% rename from src/controllers/posts/beerPosts/index.ts rename to src/controllers/posts/beer-posts/index.ts index decce5c..b853c44 100644 --- a/src/controllers/posts/beerPosts/index.ts +++ b/src/controllers/posts/beer-posts/index.ts @@ -1,16 +1,16 @@ import ServerError from '@/config/util/ServerError'; -import deleteBeerPostById from '@/services/posts/BeerPost/deleteBeerPostById'; -import editBeerPostById from '@/services/posts/BeerPost/editBeerPostById'; -import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById'; +import deleteBeerPostById from '@/services/posts/beer-post/deleteBeerPostById'; +import editBeerPostById from '@/services/posts/beer-post/editBeerPostById'; +import getBeerPostById from '@/services/posts/beer-post/getBeerPostById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { NextHandler } from 'next-connect'; import { z } from 'zod'; -import getBeerRecommendations from '@/services/posts/BeerPost/getBeerRecommendations'; -import getAllBeerPosts from '@/services/posts/BeerPost/getAllBeerPosts'; +import getBeerRecommendations from '@/services/posts/beer-post/getBeerRecommendations'; +import getAllBeerPosts from '@/services/posts/beer-post/getAllBeerPosts'; import DBClient from '@/prisma/DBClient'; -import createNewBeerPost from '@/services/posts/BeerPost/createNewBeerPost'; -import getBeerPostsByPostedById from '@/services/posts/BeerPost/getBeerPostsByPostedById'; +import createNewBeerPost from '@/services/posts/beer-post/createNewBeerPost'; +import getBeerPostsByPostedById from '@/services/posts/beer-post/getBeerPostsByPostedById'; import { BeerPostRequest, CreateBeerPostRequest, diff --git a/src/controllers/posts/beerPosts/types/index.ts b/src/controllers/posts/beer-posts/types/index.ts similarity index 77% rename from src/controllers/posts/beerPosts/types/index.ts rename to src/controllers/posts/beer-posts/types/index.ts index 9bfca22..a1b5977 100644 --- a/src/controllers/posts/beerPosts/types/index.ts +++ b/src/controllers/posts/beer-posts/types/index.ts @@ -1,6 +1,6 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; -import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema'; -import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema'; +import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema'; +import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema'; import { NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/posts/beerStyles/index.ts b/src/controllers/posts/beer-styles/index.ts similarity index 91% rename from src/controllers/posts/beerStyles/index.ts rename to src/controllers/posts/beer-styles/index.ts index 3cebe50..e59c21c 100644 --- a/src/controllers/posts/beerStyles/index.ts +++ b/src/controllers/posts/beer-styles/index.ts @@ -5,9 +5,9 @@ import DBClient from '@/prisma/DBClient'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; -import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById'; -import getBeerPostsByBeerStyleId from '@/services/posts/BeerPost/getBeerPostsByBeerStyleId'; -import getAllBeerStyles from '@/services/posts/BeerStyles/getAllBeerStyles'; +import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById'; +import getBeerPostsByBeerStyleId from '@/services/posts/beer-post/getBeerPostsByBeerStyleId'; +import getAllBeerStyles from '@/services/posts/beer-style-post/getAllBeerStyles'; import ServerError from '@/config/util/ServerError'; import { CreateBeerStyleRequest, GetBeerStyleByIdRequest } from './types'; diff --git a/src/controllers/posts/beerStyles/types/index.ts b/src/controllers/posts/beer-styles/types/index.ts similarity index 75% rename from src/controllers/posts/beerStyles/types/index.ts rename to src/controllers/posts/beer-styles/types/index.ts index d4deb87..1b848d6 100644 --- a/src/controllers/posts/beerStyles/types/index.ts +++ b/src/controllers/posts/beer-styles/types/index.ts @@ -2,7 +2,7 @@ import { NextApiRequest } from 'next'; import { UserExtendedNextApiRequest } from '@/config/auth/types'; import { z } from 'zod'; -import CreateBeerStyleValidationSchema from '@/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema'; +import CreateBeerStyleValidationSchema from '@/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema'; export interface GetBeerStyleByIdRequest extends NextApiRequest { query: { id: string }; diff --git a/src/controllers/posts/breweries/index.ts b/src/controllers/posts/breweries/index.ts index 59fa617..67fbd97 100644 --- a/src/controllers/posts/breweries/index.ts +++ b/src/controllers/posts/breweries/index.ts @@ -1,14 +1,14 @@ import DBClient from '@/prisma/DBClient'; -import getAllBreweryPostsByPostedById from '@/services/posts/BreweryPost/getAllBreweryPostsByPostedById'; +import getAllBreweryPostsByPostedById from '@/services/posts/brewery-post/getAllBreweryPostsByPostedById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { z } from 'zod'; -import getAllBreweryPosts from '@/services/posts/BreweryPost/getAllBreweryPosts'; -import createNewBreweryPost from '@/services/posts/BreweryPost/createNewBreweryPost'; +import getAllBreweryPosts from '@/services/posts/brewery-post/getAllBreweryPosts'; +import createNewBreweryPost from '@/services/posts/brewery-post/createNewBreweryPost'; import geocode from '@/config/mapbox/geocoder'; import ServerError from '@/config/util/ServerError'; -import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { CreateBreweryPostRequest, GetBreweryPostsRequest } from './types'; import { GetAllPostsByConnectedPostId } from '../types'; diff --git a/src/controllers/posts/breweries/types/index.ts b/src/controllers/posts/breweries/types/index.ts index c37b558..f20425f 100644 --- a/src/controllers/posts/breweries/types/index.ts +++ b/src/controllers/posts/breweries/types/index.ts @@ -1,5 +1,5 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; -import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema'; +import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema'; import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema'; import { NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/users/auth/index.ts b/src/controllers/users/auth/index.ts index a056c59..d012315 100644 --- a/src/controllers/users/auth/index.ts +++ b/src/controllers/users/auth/index.ts @@ -3,24 +3,24 @@ import localStrat from '@/config/auth/localStrat'; import { getLoginSession, setLoginSession } from '@/config/auth/session'; import { UserExtendedNextApiRequest } from '@/config/auth/types'; import ServerError from '@/config/util/ServerError'; -import createNewUser from '@/services/users/User/createNewUser'; -import findUserByEmail from '@/services/users/User/findUserByEmail'; +import createNewUser from '@/services/users/auth/createNewUser'; +import findUserByEmail from '@/services/users/auth/findUserByEmail'; import { NextApiRequest, NextApiResponse } from 'next'; import { expressWrapper } from 'next-connect'; import passport from 'passport'; import { z } from 'zod'; -import findUserByUsername from '@/services/users/User/findUserByUsername'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; -import sendConfirmationEmail from '@/services/users/User/sendConfirmationEmail'; +import findUserByUsername from '@/services/users/auth/findUserByUsername'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; +import sendConfirmationEmail from '@/services/users/auth/sendConfirmationEmail'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import type { NextFunction } from 'express'; import { verifyConfirmationToken } from '@/config/jwt'; -import updateUserToBeConfirmedById from '@/services/users/User/updateUserToBeConfirmedById'; +import updateUserToBeConfirmedById from '@/services/users/auth/updateUserToBeConfirmedById'; import DBClient from '@/prisma/DBClient'; -import sendResetPasswordEmail from '@/services/users/User/sendResetPasswordEmail'; +import sendResetPasswordEmail from '@/services/users/auth/sendResetPasswordEmail'; import { hashPassword } from '@/config/auth/passwordFns'; -import deleteUserById from '@/services/users/User/deleteUserById'; +import deleteUserById from '@/services/users/auth/deleteUserById'; import { CheckEmailRequest, CheckUsernameRequest, diff --git a/src/controllers/users/auth/types/index.ts b/src/controllers/users/auth/types/index.ts index 48d51fd..a8292e6 100644 --- a/src/controllers/users/auth/types/index.ts +++ b/src/controllers/users/auth/types/index.ts @@ -2,8 +2,8 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; import { CreateUserValidationSchema, UpdatePasswordSchema, -} from '@/services/users/User/schema/CreateUserValidationSchemas'; -import TokenValidationSchema from '@/services/users/User/schema/TokenValidationSchema'; +} from '@/services/users/auth/schema/CreateUserValidationSchemas'; +import TokenValidationSchema from '@/services/users/auth/schema/TokenValidationSchema'; import { NextApiRequest } from 'next'; import { z } from 'zod'; diff --git a/src/controllers/users/profile/index.ts b/src/controllers/users/profile/index.ts index c5db3b4..ffcf253 100644 --- a/src/controllers/users/profile/index.ts +++ b/src/controllers/users/profile/index.ts @@ -1,17 +1,16 @@ import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; -import findUserById from '@/services/users/User/findUserById'; +import findUserById from '@/services/users/auth/findUserById'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { z } from 'zod'; -import getUsersFollowingUser from '@/services/users/UserFollows/getUsersFollowingUser'; -import getUsersFollowedByUser from '@/services/users/UserFollows/getUsersFollowedByUser'; import { NextHandler } from 'next-connect'; import updateUserAvatarById, { UpdateUserAvatarByIdParams, -} from '@/services/users/UserAccount/UpdateUserAvatarByIdParams'; +} from '@/services/users/account/UpdateUserAvatarByIdParams'; import { UserExtendedNextApiRequest } from '@/config/auth/types'; -import updateUserProfileById from '@/services/users/User/updateUserProfileById'; +import updateUserProfileById from '@/services/users/auth/updateUserProfileById'; + import { UserRouteRequest, GetUserFollowInfoRequest, @@ -19,6 +18,8 @@ import { UpdateAvatarRequest, UpdateProfileRequest, } from './types'; +import getUsersFollowingUser from '@/services/users/follows/getUsersFollowingUser'; +import getUsersFollowedByUser from '@/services/users/follows/getUsersFollowedByUser'; export const followUser = async ( req: UserRouteRequest, diff --git a/src/controllers/users/profile/types/index.ts b/src/controllers/users/profile/types/index.ts index 7daf5c3..5c4f600 100644 --- a/src/controllers/users/profile/types/index.ts +++ b/src/controllers/users/profile/types/index.ts @@ -1,5 +1,5 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; -import EditUserSchema from '@/services/users/User/schema/EditUserSchema'; +import EditUserSchema from '@/services/users/auth/schema/EditUserSchema'; import { z } from 'zod'; export interface UserRouteRequest extends UserExtendedNextApiRequest { diff --git a/src/hooks/auth/useUser.ts b/src/hooks/auth/useUser.ts index 0c82de9..66e4ef4 100644 --- a/src/hooks/auth/useUser.ts +++ b/src/hooks/auth/useUser.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWR from 'swr'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerPostSearch.ts b/src/hooks/data-fetching/beer-posts/useBeerPostSearch.ts index c81e4d3..89be302 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerPostSearch.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerPostSearch.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import useSWR from 'swr'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerPosts.ts b/src/hooks/data-fetching/beer-posts/useBeerPosts.ts index f72764c..ab62440 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerPosts.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerPosts.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles.ts b/src/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles.ts index 9585bdf..7e1a3b0 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerPostsByBeerStyles.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerPostsByBrewery.ts b/src/hooks/data-fetching/beer-posts/useBeerPostsByBrewery.ts index 33875d6..c58616a 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerPostsByBrewery.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerPostsByBrewery.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerPostsByUser.ts b/src/hooks/data-fetching/beer-posts/useBeerPostsByUser.ts index 7422ad5..b5d25f3 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerPostsByUser.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerPostsByUser.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-posts/useBeerRecommendations.ts b/src/hooks/data-fetching/beer-posts/useBeerRecommendations.ts index ec9aacb..2157058 100644 --- a/src/hooks/data-fetching/beer-posts/useBeerRecommendations.ts +++ b/src/hooks/data-fetching/beer-posts/useBeerRecommendations.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/beer-styles/useBeerStyles.ts b/src/hooks/data-fetching/beer-styles/useBeerStyles.ts index 21581b8..9d17cc8 100644 --- a/src/hooks/data-fetching/beer-styles/useBeerStyles.ts +++ b/src/hooks/data-fetching/beer-styles/useBeerStyles.ts @@ -1,4 +1,4 @@ -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/brewery-posts/useBreweryMapPagePosts.ts b/src/hooks/data-fetching/brewery-posts/useBreweryMapPagePosts.ts index 4a905d4..cc4d259 100644 --- a/src/hooks/data-fetching/brewery-posts/useBreweryMapPagePosts.ts +++ b/src/hooks/data-fetching/brewery-posts/useBreweryMapPagePosts.ts @@ -1,4 +1,4 @@ -import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult'; +import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/brewery-posts/useBreweryPosts.ts b/src/hooks/data-fetching/brewery-posts/useBreweryPosts.ts index 4c3725e..a319afd 100644 --- a/src/hooks/data-fetching/brewery-posts/useBreweryPosts.ts +++ b/src/hooks/data-fetching/brewery-posts/useBreweryPosts.ts @@ -1,4 +1,4 @@ -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/brewery-posts/useBreweryPostsByUser.ts b/src/hooks/data-fetching/brewery-posts/useBreweryPostsByUser.ts index ecf34ab..f986d34 100644 --- a/src/hooks/data-fetching/brewery-posts/useBreweryPostsByUser.ts +++ b/src/hooks/data-fetching/brewery-posts/useBreweryPostsByUser.ts @@ -1,4 +1,4 @@ -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/user-follows/useGetUsersFollowedByUser.ts b/src/hooks/data-fetching/user-follows/useGetUsersFollowedByUser.ts index 58365b8..85cbbc9 100644 --- a/src/hooks/data-fetching/user-follows/useGetUsersFollowedByUser.ts +++ b/src/hooks/data-fetching/user-follows/useGetUsersFollowedByUser.ts @@ -17,7 +17,7 @@ * - `mutate` A function to mutate the data. * - `error` The error object, if any. */ -import FollowInfoSchema from '@/services/users/UserFollows/schema/FollowInfoSchema'; +import FollowInfoSchema from '@/services/users/follows/schema/FollowInfoSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/hooks/data-fetching/user-follows/useGetUsersFollowingUser.ts b/src/hooks/data-fetching/user-follows/useGetUsersFollowingUser.ts index 85f57f2..b1e7fb9 100644 --- a/src/hooks/data-fetching/user-follows/useGetUsersFollowingUser.ts +++ b/src/hooks/data-fetching/user-follows/useGetUsersFollowingUser.ts @@ -1,4 +1,4 @@ -import FollowInfoSchema from '@/services/users/UserFollows/schema/FollowInfoSchema'; +import FollowInfoSchema from '@/services/users/follows/schema/FollowInfoSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import useSWRInfinite from 'swr/infinite'; import { z } from 'zod'; diff --git a/src/pages/api/beer-comments/[id].ts b/src/pages/api/beer-comments/[id].ts index 93ae8ab..8acf718 100644 --- a/src/pages/api/beer-comments/[id].ts +++ b/src/pages/api/beer-comments/[id].ts @@ -13,7 +13,7 @@ import { checkIfBeerCommentOwner, deleteBeerPostComment, editBeerPostComment, -} from '@/controllers/comments/beerComments'; +} from '@/controllers/comments/beer-comments'; const router = createRouter< CommentRequest, diff --git a/src/pages/api/beer-style-comments/[id].ts b/src/pages/api/beer-style-comments/[id].ts index 61d7680..ec6dc8f 100644 --- a/src/pages/api/beer-style-comments/[id].ts +++ b/src/pages/api/beer-style-comments/[id].ts @@ -5,7 +5,7 @@ import { checkIfBeerStyleCommentOwner, deleteBeerStyleComment, editBeerStyleComment, -} from '@/controllers/comments/beerStyleComments'; +} from '@/controllers/comments/beer-style-comments'; import { CommentRequest } from '@/controllers/comments/types'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; diff --git a/src/pages/api/beers/[id]/comments/index.ts b/src/pages/api/beers/[id]/comments/index.ts index a9a5c87..f9bc088 100644 --- a/src/pages/api/beers/[id]/comments/index.ts +++ b/src/pages/api/beers/[id]/comments/index.ts @@ -10,7 +10,7 @@ import CreateCommentValidationSchema from '@/services/schema/CommentSchema/Creat import { createBeerPostComment, getAllBeerPostComments, -} from '@/controllers/comments/beerComments'; +} from '@/controllers/comments/beer-comments'; const router = createRouter< // @TODO: Fix this any type diff --git a/src/pages/api/beers/[id]/images/index.ts b/src/pages/api/beers/[id]/images/index.ts index 10739f2..a7170ee 100644 --- a/src/pages/api/beers/[id]/images/index.ts +++ b/src/pages/api/beers/[id]/images/index.ts @@ -10,7 +10,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema'; import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware'; import { UploadImagesRequest } from '@/controllers/images/types'; -import { processBeerImageData } from '@/controllers/images/beerImages'; +import { processBeerImageData } from '@/controllers/images/beer-images'; const router = createRouter< UploadImagesRequest, diff --git a/src/pages/api/beers/[id]/index.ts b/src/pages/api/beers/[id]/index.ts index 1a82fc1..8a67ec7 100644 --- a/src/pages/api/beers/[id]/index.ts +++ b/src/pages/api/beers/[id]/index.ts @@ -6,14 +6,14 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; -import { EditBeerPostRequest } from '@/controllers/posts/beerPosts/types'; +import { EditBeerPostRequest } from '@/controllers/posts/beer-posts/types'; import { checkIfBeerPostOwner, editBeerPost, deleteBeerPost, -} from '@/controllers/posts/beerPosts'; +} from '@/controllers/posts/beer-posts'; -import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema'; +import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; diff --git a/src/pages/api/beers/[id]/like/index.ts b/src/pages/api/beers/[id]/like/index.ts index 22e600c..a6e7eb8 100644 --- a/src/pages/api/beers/[id]/like/index.ts +++ b/src/pages/api/beers/[id]/like/index.ts @@ -9,7 +9,7 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import { sendBeerPostLikeRequest, getBeerPostLikeCount, -} from '@/controllers/likes/beerPostLikes'; +} from '@/controllers/likes/beer-posts-likes'; import { LikeRequest } from '@/controllers/likes/types'; const router = createRouter< diff --git a/src/pages/api/beers/[id]/like/is-liked.ts b/src/pages/api/beers/[id]/like/is-liked.ts index 7d44bc2..aa0f9a3 100644 --- a/src/pages/api/beers/[id]/like/is-liked.ts +++ b/src/pages/api/beers/[id]/like/is-liked.ts @@ -7,7 +7,7 @@ import { NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; import { z } from 'zod'; -import { checkIfBeerPostIsLiked } from '@/controllers/likes/beerPostLikes'; +import { checkIfBeerPostIsLiked } from '@/controllers/likes/beer-posts-likes'; const router = createRouter< UserExtendedNextApiRequest, diff --git a/src/pages/api/beers/[id]/recommendations.ts b/src/pages/api/beers/[id]/recommendations.ts index 0766a32..15b5d36 100644 --- a/src/pages/api/beers/[id]/recommendations.ts +++ b/src/pages/api/beers/[id]/recommendations.ts @@ -1,7 +1,7 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getBeerPostRecommendations } from '@/controllers/posts/beerPosts'; -import { GetBeerRecommendationsRequest } from '@/controllers/posts/beerPosts/types'; +import { getBeerPostRecommendations } from '@/controllers/posts/beer-posts'; +import { GetBeerRecommendationsRequest } from '@/controllers/posts/beer-posts/types'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; diff --git a/src/pages/api/beers/create.ts b/src/pages/api/beers/create.ts index 29c0bb9..4c55237 100644 --- a/src/pages/api/beers/create.ts +++ b/src/pages/api/beers/create.ts @@ -1,14 +1,14 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { createRouter } from 'next-connect'; -import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema'; +import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { z } from 'zod'; import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; -import { createBeerPost } from '@/controllers/posts/beerPosts'; -import { CreateBeerPostRequest } from '@/controllers/posts/beerPosts/types'; +import { createBeerPost } from '@/controllers/posts/beer-posts'; +import { CreateBeerPostRequest } from '@/controllers/posts/beer-posts/types'; const router = createRouter< CreateBeerPostRequest, diff --git a/src/pages/api/beers/index.ts b/src/pages/api/beers/index.ts index 2d3fe0f..6616805 100644 --- a/src/pages/api/beers/index.ts +++ b/src/pages/api/beers/index.ts @@ -1,6 +1,6 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getBeerPosts } from '@/controllers/posts/beerPosts'; -import { GetAllBeerPostsRequest } from '@/controllers/posts/beerPosts/types'; +import { getBeerPosts } from '@/controllers/posts/beer-posts'; +import { GetAllBeerPostsRequest } from '@/controllers/posts/beer-posts/types'; import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; diff --git a/src/pages/api/beers/search.ts b/src/pages/api/beers/search.ts index dd2cca1..780a583 100644 --- a/src/pages/api/beers/search.ts +++ b/src/pages/api/beers/search.ts @@ -5,7 +5,7 @@ import { NextApiRequest, NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; import { z } from 'zod'; import DBClient from '@/prisma/DBClient'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; const SearchSchema = z.object({ search: z.string().min(1), diff --git a/src/pages/api/beers/styles/[id]/beers/index.ts b/src/pages/api/beers/styles/[id]/beers/index.ts index 73492de..5d89585 100644 --- a/src/pages/api/beers/styles/[id]/beers/index.ts +++ b/src/pages/api/beers/styles/[id]/beers/index.ts @@ -1,6 +1,6 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getAllBeersByBeerStyle } from '@/controllers/posts/beerStyles'; +import { getAllBeersByBeerStyle } from '@/controllers/posts/beer-styles'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiRequest, NextApiResponse } from 'next'; diff --git a/src/pages/api/beers/styles/[id]/comments/index.ts b/src/pages/api/beers/styles/[id]/comments/index.ts index 2a88610..174d413 100644 --- a/src/pages/api/beers/styles/[id]/comments/index.ts +++ b/src/pages/api/beers/styles/[id]/comments/index.ts @@ -7,7 +7,7 @@ import { z } from 'zod'; import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import { NextApiResponse } from 'next'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; -import { createComment, getAll } from '@/controllers/comments/beerStyleComments'; +import { createComment, getAll } from '@/controllers/comments/beer-style-comments'; const router = createRouter< // I don't want to use any, but I can't figure out how to get the types to work diff --git a/src/pages/api/beers/styles/[id]/index.ts b/src/pages/api/beers/styles/[id]/index.ts index 82cc746..c392ab7 100644 --- a/src/pages/api/beers/styles/[id]/index.ts +++ b/src/pages/api/beers/styles/[id]/index.ts @@ -1,6 +1,6 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getBeerStyle } from '@/controllers/posts/beerStyles'; -import { GetBeerStyleByIdRequest } from '@/controllers/posts/beerStyles/types'; +import { getBeerStyle } from '@/controllers/posts/beer-styles'; +import { GetBeerStyleByIdRequest } from '@/controllers/posts/beer-styles/types'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; diff --git a/src/pages/api/beers/styles/[id]/like/index.ts b/src/pages/api/beers/styles/[id]/like/index.ts index aa078af..87ff024 100644 --- a/src/pages/api/beers/styles/[id]/like/index.ts +++ b/src/pages/api/beers/styles/[id]/like/index.ts @@ -10,7 +10,7 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import { getBeerStyleLikeCountRequest, sendBeerStyleLikeRequest, -} from '@/controllers/likes/beerStyleLikes'; +} from '@/controllers/likes/beer-style-likes'; import { LikeRequest } from '@/controllers/likes/types'; const router = createRouter< diff --git a/src/pages/api/beers/styles/[id]/like/is-liked.ts b/src/pages/api/beers/styles/[id]/like/is-liked.ts index 74e5067..3289cb6 100644 --- a/src/pages/api/beers/styles/[id]/like/is-liked.ts +++ b/src/pages/api/beers/styles/[id]/like/is-liked.ts @@ -6,7 +6,7 @@ import APIResponseValidationSchema from '@/validation/APIResponseValidationSchem import { NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; import { z } from 'zod'; -import { checkIfBeerStyleIsLiked } from '@/controllers/likes/beerStyleLikes'; +import { checkIfBeerStyleIsLiked } from '@/controllers/likes/beer-style-likes'; const router = createRouter< UserExtendedNextApiRequest, diff --git a/src/pages/api/beers/styles/create.ts b/src/pages/api/beers/styles/create.ts index 5c51c89..5b956e3 100644 --- a/src/pages/api/beers/styles/create.ts +++ b/src/pages/api/beers/styles/create.ts @@ -1,8 +1,8 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { createBeerStyle } from '@/controllers/posts/beerStyles'; -import { CreateBeerStyleRequest } from '@/controllers/posts/beerStyles/types'; -import CreateBeerStyleValidationSchema from '@/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema'; +import { createBeerStyle } from '@/controllers/posts/beer-styles'; +import { CreateBeerStyleRequest } from '@/controllers/posts/beer-styles/types'; +import CreateBeerStyleValidationSchema from '@/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; diff --git a/src/pages/api/beers/styles/index.ts b/src/pages/api/beers/styles/index.ts index 9acc879..cc518a6 100644 --- a/src/pages/api/beers/styles/index.ts +++ b/src/pages/api/beers/styles/index.ts @@ -1,5 +1,5 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getBeerStyles } from '@/controllers/posts/beerStyles'; +import { getBeerStyles } from '@/controllers/posts/beer-styles'; import { GetAllPostsRequest } from '@/controllers/posts/types'; import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema'; diff --git a/src/pages/api/breweries/[id]/comments/index.ts b/src/pages/api/breweries/[id]/comments/index.ts index a2ae7b9..2e0175d 100644 --- a/src/pages/api/breweries/[id]/comments/index.ts +++ b/src/pages/api/breweries/[id]/comments/index.ts @@ -8,7 +8,7 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import { NextApiResponse } from 'next'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; -import { createComment, getAll } from '@/controllers/comments/breweryComments'; +import { createComment, getAll } from '@/controllers/comments/brewery-comments'; const router = createRouter< // I don't want to use any, but I can't figure out how to get the types to work diff --git a/src/pages/api/breweries/[id]/images/index.ts b/src/pages/api/breweries/[id]/images/index.ts index 02f88f0..66c3317 100644 --- a/src/pages/api/breweries/[id]/images/index.ts +++ b/src/pages/api/breweries/[id]/images/index.ts @@ -10,7 +10,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import ImageMetadataValidationSchema from '@/services/schema/ImageSchema/ImageMetadataValidationSchema'; import { uploadMiddlewareMultiple } from '@/config/multer/uploadMiddleware'; import { UploadImagesRequest } from '@/controllers/images/types'; -import { processBreweryImageData } from '@/controllers/images/breweryImages'; +import { processBreweryImageData } from '@/controllers/images/brewery-images'; const router = createRouter< UploadImagesRequest, diff --git a/src/pages/api/breweries/[id]/index.ts b/src/pages/api/breweries/[id]/index.ts index b359552..8366698 100644 --- a/src/pages/api/breweries/[id]/index.ts +++ b/src/pages/api/breweries/[id]/index.ts @@ -7,8 +7,8 @@ import { createRouter, NextHandler } from 'next-connect'; import { z } from 'zod'; import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; -import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById'; -import EditBreweryPostValidationSchema from '@/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema'; +import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById'; +import EditBreweryPostValidationSchema from '@/services/posts/brewery-post/schema/EditBreweryPostValidationSchema'; interface BreweryPostRequest extends UserExtendedNextApiRequest { query: { id: string }; diff --git a/src/pages/api/breweries/[id]/like/index.ts b/src/pages/api/breweries/[id]/like/index.ts index 3ac2890..40b6c14 100644 --- a/src/pages/api/breweries/[id]/like/index.ts +++ b/src/pages/api/breweries/[id]/like/index.ts @@ -5,7 +5,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { sendBreweryPostLikeRequest, getBreweryPostLikeCount, -} from '@/controllers/likes/breweryPostLikes'; +} from '@/controllers/likes/brewery-post-likes'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; diff --git a/src/pages/api/breweries/[id]/like/is-liked.ts b/src/pages/api/breweries/[id]/like/is-liked.ts index aa59509..4a41897 100644 --- a/src/pages/api/breweries/[id]/like/is-liked.ts +++ b/src/pages/api/breweries/[id]/like/is-liked.ts @@ -2,7 +2,7 @@ import { UserExtendedNextApiRequest } from '@/config/auth/types'; import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; -import { getBreweryPostLikeStatus } from '@/controllers/likes/breweryPostLikes'; +import { getBreweryPostLikeStatus } from '@/controllers/likes/brewery-post-likes'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; diff --git a/src/pages/api/breweries/create.ts b/src/pages/api/breweries/create.ts index 0291b4e..275b467 100644 --- a/src/pages/api/breweries/create.ts +++ b/src/pages/api/breweries/create.ts @@ -5,8 +5,8 @@ import { NextApiResponse } from 'next'; import { z } from 'zod'; import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; -import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema'; -import createNewBreweryPost from '@/services/posts/BreweryPost/createNewBreweryPost'; +import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema'; +import createNewBreweryPost from '@/services/posts/brewery-post/createNewBreweryPost'; import geocode from '@/config/mapbox/geocoder'; import ServerError from '@/config/util/ServerError'; import DBClient from '@/prisma/DBClient'; diff --git a/src/pages/api/breweries/map/index.ts b/src/pages/api/breweries/map/index.ts index 8781c54..a31579b 100644 --- a/src/pages/api/breweries/map/index.ts +++ b/src/pages/api/breweries/map/index.ts @@ -1,6 +1,6 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import DBClient from '@/prisma/DBClient'; -import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult'; +import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult'; import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; diff --git a/src/pages/api/brewery-comments/[id].ts b/src/pages/api/brewery-comments/[id].ts index ae26802..57e13c4 100644 --- a/src/pages/api/brewery-comments/[id].ts +++ b/src/pages/api/brewery-comments/[id].ts @@ -6,7 +6,7 @@ import { checkIfBreweryCommentOwner, deleteBreweryPostComment, editBreweryPostComment, -} from '@/controllers/comments/breweryComments'; +} from '@/controllers/comments/brewery-comments'; import { CommentRequest } from '@/controllers/comments/types'; import CreateCommentValidationSchema from '@/services/schema/CommentSchema/CreateCommentValidationSchema'; diff --git a/src/pages/api/users/[id]/index.ts b/src/pages/api/users/[id]/index.ts index 5572129..cc62439 100644 --- a/src/pages/api/users/[id]/index.ts +++ b/src/pages/api/users/[id]/index.ts @@ -4,7 +4,8 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { editUserInfo, deleteAccount } from '@/controllers/users/auth'; import { checkIfUserCanEditUser } from '@/controllers/users/profile'; import { EditUserRequest } from '@/controllers/users/profile/types'; -import EditUserSchema from '@/services/users/User/schema/EditUserSchema'; +import EditUserSchema from '@/services/users/auth/schema/EditUserSchema'; + import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; diff --git a/src/pages/api/users/[id]/posts/beers.ts b/src/pages/api/users/[id]/posts/beers.ts index 7bdd47e..ced48d3 100644 --- a/src/pages/api/users/[id]/posts/beers.ts +++ b/src/pages/api/users/[id]/posts/beers.ts @@ -6,7 +6,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import PaginatedQueryResponseSchema from '@/services/schema/PaginatedQueryResponseSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { GetAllPostsByConnectedPostId } from '@/controllers/posts/types'; -import { getBeerPostsByUserId } from '@/controllers/posts/beerPosts'; +import { getBeerPostsByUserId } from '@/controllers/posts/beer-posts'; const router = createRouter< GetAllPostsByConnectedPostId, diff --git a/src/pages/api/users/confirm.ts b/src/pages/api/users/confirm.ts index 8e7cff3..1c81926 100644 --- a/src/pages/api/users/confirm.ts +++ b/src/pages/api/users/confirm.ts @@ -9,7 +9,7 @@ import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { TokenValidationRequest } from '@/controllers/users/auth/types'; import { confirmUser } from '@/controllers/users/auth'; -import TokenValidationSchema from '@/services/users/User/schema/TokenValidationSchema'; +import TokenValidationSchema from '@/services/users/auth/schema/TokenValidationSchema'; const router = createRouter< TokenValidationRequest, diff --git a/src/pages/api/users/edit-password.ts b/src/pages/api/users/edit-password.ts index 7701184..8a651d8 100644 --- a/src/pages/api/users/edit-password.ts +++ b/src/pages/api/users/edit-password.ts @@ -3,7 +3,8 @@ import getCurrentUser from '@/config/nextConnect/middleware/getCurrentUser'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { updatePassword } from '@/controllers/users/auth'; import { UpdatePasswordRequest } from '@/controllers/users/auth/types'; -import { UpdatePasswordSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { UpdatePasswordSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; + import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { NextApiResponse } from 'next'; import { createRouter } from 'next-connect'; diff --git a/src/pages/api/users/login.ts b/src/pages/api/users/login.ts index 7fef08c..c001094 100644 --- a/src/pages/api/users/login.ts +++ b/src/pages/api/users/login.ts @@ -3,10 +3,11 @@ import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import { createRouter } from 'next-connect'; import { NextApiResponse } from 'next'; import { z } from 'zod'; -import LoginValidationSchema from '@/services/users/User/schema/LoginValidationSchema'; + import { UserExtendedNextApiRequest } from '@/config/auth/types'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import { authenticateUser, loginUser } from '@/controllers/users/auth'; +import LoginValidationSchema from '@/services/users/auth/schema/LoginValidationSchema'; const router = createRouter< UserExtendedNextApiRequest, diff --git a/src/pages/api/users/register.ts b/src/pages/api/users/register.ts index 5ee8ef1..78e1c79 100644 --- a/src/pages/api/users/register.ts +++ b/src/pages/api/users/register.ts @@ -1,12 +1,13 @@ import { NextApiResponse } from 'next'; import { z } from 'zod'; import { createRouter } from 'next-connect'; -import { CreateUserValidationSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; + import NextConnectOptions from '@/config/nextConnect/NextConnectOptions'; import validateRequest from '@/config/nextConnect/middleware/validateRequest'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { registerUser } from '@/controllers/users/auth'; import { RegisterUserRequest } from '@/controllers/users/auth/types'; +import { CreateUserValidationSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; const router = createRouter< RegisterUserRequest, diff --git a/src/pages/beers/[id]/edit.tsx b/src/pages/beers/[id]/edit.tsx index 30c2fdf..0b69343 100644 --- a/src/pages/beers/[id]/edit.tsx +++ b/src/pages/beers/[id]/edit.tsx @@ -3,8 +3,8 @@ import Head from 'next/head'; import React from 'react'; import withPageAuthRequired from '@/util/withPageAuthRequired'; -import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import getBeerPostById from '@/services/posts/beer-post/getBeerPostById'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import EditBeerPostForm from '@/components/EditBeerPostForm'; import FormPageLayout from '@/components/ui/forms/FormPageLayout'; import { BiBeer } from 'react-icons/bi'; diff --git a/src/pages/beers/[id]/index.tsx b/src/pages/beers/[id]/index.tsx index dc79abc..467f109 100644 --- a/src/pages/beers/[id]/index.tsx +++ b/src/pages/beers/[id]/index.tsx @@ -1,8 +1,8 @@ import { NextPage, GetServerSideProps } from 'next'; import Head from 'next/head'; -import getBeerPostById from '@/services/posts/BeerPost/getBeerPostById'; +import getBeerPostById from '@/services/posts/beer-post/getBeerPostById'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; diff --git a/src/pages/beers/styles/[id]/index.tsx b/src/pages/beers/styles/[id]/index.tsx index 3d652e8..69b7e16 100644 --- a/src/pages/beers/styles/[id]/index.tsx +++ b/src/pages/beers/styles/[id]/index.tsx @@ -5,9 +5,9 @@ import { z } from 'zod'; import useMediaQuery from '@/hooks/utilities/useMediaQuery'; import { Tab } from '@headlessui/react'; -import getBeerStyleById from '@/services/posts/BeerStyles/getBeerStyleById'; +import getBeerStyleById from '@/services/posts/beer-style-post/getBeerStyleById'; import BeerStyleHeader from '@/components/BeerStyleById/BeerStyleHeader'; -import BeerStyleQueryResult from '@/services/posts/BeerStyles/schema/BeerStyleQueryResult'; +import BeerStyleQueryResult from '@/services/posts/beer-style-post/schema/BeerStyleQueryResult'; import BeerStyleCommentSection from '@/components/BeerStyleById/BeerStyleCommentSection'; import BeerStyleBeerSection from '@/components/BeerStyleById/BeerStyleBeerSection'; diff --git a/src/pages/breweries/[id]/beers/create.tsx b/src/pages/breweries/[id]/beers/create.tsx index a55190c..eb3f45c 100644 --- a/src/pages/breweries/[id]/beers/create.tsx +++ b/src/pages/breweries/[id]/beers/create.tsx @@ -3,12 +3,12 @@ import FormPageLayout from '@/components/ui/forms/FormPageLayout'; import withPageAuthRequired from '@/util/withPageAuthRequired'; import DBClient from '@/prisma/DBClient'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { BeerStyle } from '@prisma/client'; import { NextPage } from 'next'; import { BiBeer } from 'react-icons/bi'; import { z } from 'zod'; -import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById'; +import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById'; interface CreateBeerPageProps { brewery: z.infer; diff --git a/src/pages/breweries/[id]/edit.tsx b/src/pages/breweries/[id]/edit.tsx index 11d5807..d1f6aae 100644 --- a/src/pages/breweries/[id]/edit.tsx +++ b/src/pages/breweries/[id]/edit.tsx @@ -5,9 +5,9 @@ import FormPageLayout from '@/components/ui/forms/FormPageLayout'; import FormSegment from '@/components/ui/forms/FormSegment'; import FormTextArea from '@/components/ui/forms/FormTextArea'; import FormTextInput from '@/components/ui/forms/FormTextInput'; -import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; -import EditBreweryPostValidationSchema from '@/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema'; +import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; +import EditBreweryPostValidationSchema from '@/services/posts/brewery-post/schema/EditBreweryPostValidationSchema'; import withPageAuthRequired from '@/util/withPageAuthRequired'; import { zodResolver } from '@hookform/resolvers/zod'; import { NextPage } from 'next'; diff --git a/src/pages/breweries/[id]/index.tsx b/src/pages/breweries/[id]/index.tsx index 7dc3998..ae2b281 100644 --- a/src/pages/breweries/[id]/index.tsx +++ b/src/pages/breweries/[id]/index.tsx @@ -1,5 +1,5 @@ -import getBreweryPostById from '@/services/posts/BreweryPost/getBreweryPostById'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import getBreweryPostById from '@/services/posts/brewery-post/getBreweryPostById'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { GetServerSideProps, NextPage } from 'next'; import { z } from 'zod'; diff --git a/src/pages/breweries/index.tsx b/src/pages/breweries/index.tsx index 65e720f..3accbaf 100644 --- a/src/pages/breweries/index.tsx +++ b/src/pages/breweries/index.tsx @@ -3,7 +3,7 @@ import LoadingCard from '@/components/ui/LoadingCard'; import Spinner from '@/components/ui/Spinner'; import UserContext from '@/contexts/UserContext'; import useBreweryPosts from '@/hooks/data-fetching/brewery-posts/useBreweryPosts'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { NextPage } from 'next'; import Head from 'next/head'; import { useContext, MutableRefObject, useRef } from 'react'; diff --git a/src/pages/breweries/map.tsx b/src/pages/breweries/map.tsx index 4033493..f82b90f 100644 --- a/src/pages/breweries/map.tsx +++ b/src/pages/breweries/map.tsx @@ -7,7 +7,7 @@ import LocationMarker from '@/components/ui/LocationMarker'; import Link from 'next/link'; import Head from 'next/head'; import useGeolocation from '@/hooks/utilities/useGeolocation'; -import BreweryPostMapQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostMapQueryResult'; +import BreweryPostMapQueryResult from '@/services/posts/brewery-post/schema/BreweryPostMapQueryResult'; import { z } from 'zod'; import useBreweryMapPagePosts from '@/hooks/data-fetching/brewery-posts/useBreweryMapPagePosts'; import ControlPanel from '@/components/ui/maps/ControlPanel'; diff --git a/src/pages/users/[id].tsx b/src/pages/users/[id].tsx index 7c2f05d..fa48c0f 100644 --- a/src/pages/users/[id].tsx +++ b/src/pages/users/[id].tsx @@ -1,6 +1,6 @@ import useMediaQuery from '@/hooks/utilities/useMediaQuery'; -import findUserById from '@/services/users/User/findUserById'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import findUserById from '@/services/users/auth/findUserById'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import Head from 'next/head'; import { FC } from 'react'; diff --git a/src/pages/users/account/edit-profile.tsx b/src/pages/users/account/edit-profile.tsx index 1d69c9c..70703c5 100644 --- a/src/pages/users/account/edit-profile.tsx +++ b/src/pages/users/account/edit-profile.tsx @@ -21,7 +21,7 @@ import UpdateProfileForm from '@/components/Account/UpdateProfileForm'; import useGetUsersFollowedByUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowedByUser'; import useGetUsersFollowingUser from '@/hooks/data-fetching/user-follows/useGetUsersFollowingUser'; -import UpdateProfileSchema from '@/services/users/User/schema/UpdateProfileSchema'; +import UpdateProfileSchema from '@/services/users/auth/schema/UpdateProfileSchema'; import sendUpdateUserAvatarRequest from '@/requests/Account/sendUpdateUserAvatarRequest'; import sendUpdateUserProfileRequest from '@/requests/Account/sendUpdateUserProfileRequest'; import Spinner from '@/components/ui/Spinner'; diff --git a/src/pages/users/forgot-password.tsx b/src/pages/users/forgot-password.tsx index 72023cd..a68adc3 100644 --- a/src/pages/users/forgot-password.tsx +++ b/src/pages/users/forgot-password.tsx @@ -4,7 +4,7 @@ import FormInfo from '@/components/ui/forms/FormInfo'; import FormLabel from '@/components/ui/forms/FormLabel'; import FormSegment from '@/components/ui/forms/FormSegment'; import FormTextInput from '@/components/ui/forms/FormTextInput'; -import { BaseCreateUserSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { BaseCreateUserSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; import createErrorToast from '@/util/createErrorToast'; import { zodResolver } from '@hookform/resolvers/zod'; import { NextPage } from 'next'; diff --git a/src/pages/users/reset-password.tsx b/src/pages/users/reset-password.tsx index e464987..0c426ba 100644 --- a/src/pages/users/reset-password.tsx +++ b/src/pages/users/reset-password.tsx @@ -1,7 +1,7 @@ import { setLoginSession } from '@/config/auth/session'; import { verifyResetPasswordToken } from '@/config/jwt'; import ServerError from '@/config/util/ServerError'; -import findUserById from '@/services/users/User/findUserById'; +import findUserById from '@/services/users/auth/findUserById'; import { GetServerSideProps, NextApiResponse, NextPage } from 'next'; diff --git a/src/prisma/seed/create/createAdminUser.ts b/src/prisma/seed/create/createAdminUser.ts index d81db79..803f5f7 100644 --- a/src/prisma/seed/create/createAdminUser.ts +++ b/src/prisma/seed/create/createAdminUser.ts @@ -4,7 +4,7 @@ import { hashPassword } from '../../../config/auth/passwordFns'; import { ADMIN_PASSWORD } from '../../../config/env'; import DBClient from '../../DBClient'; -import GetUserSchema from '../../../services/users/User/schema/GetUserSchema'; +import GetUserSchema from '../../../services/users/auth/schema/GetUserSchema'; import imageUrls from '../util/imageUrls'; const createAdminUser = async () => { diff --git a/src/requests/Account/sendUpdateUserProfileRequest.ts b/src/requests/Account/sendUpdateUserProfileRequest.ts index 5846156..c38ed00 100644 --- a/src/requests/Account/sendUpdateUserProfileRequest.ts +++ b/src/requests/Account/sendUpdateUserProfileRequest.ts @@ -1,4 +1,4 @@ -import UpdateProfileSchema from '@/services/users/User/schema/UpdateProfileSchema'; +import UpdateProfileSchema from '@/services/users/auth/schema/UpdateProfileSchema'; import { z } from 'zod'; interface UpdateProfileRequestParams { diff --git a/src/requests/BeerImage/sendUploadBeerImageRequest.ts b/src/requests/BeerImage/sendUploadBeerImageRequest.ts index 67b2e8c..1cf8637 100644 --- a/src/requests/BeerImage/sendUploadBeerImageRequest.ts +++ b/src/requests/BeerImage/sendUploadBeerImageRequest.ts @@ -1,4 +1,4 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/BeerPost/sendCreateBeerPostRequest.ts b/src/requests/BeerPost/sendCreateBeerPostRequest.ts index 9e04ada..7e36b1f 100644 --- a/src/requests/BeerPost/sendCreateBeerPostRequest.ts +++ b/src/requests/BeerPost/sendCreateBeerPostRequest.ts @@ -1,5 +1,5 @@ -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; -import CreateBeerPostValidationSchema from '@/services/posts/BeerPost/schema/CreateBeerPostValidationSchema'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; +import CreateBeerPostValidationSchema from '@/services/posts/beer-post/schema/CreateBeerPostValidationSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/BeerPost/sendEditBeerPostRequest.ts b/src/requests/BeerPost/sendEditBeerPostRequest.ts index 37d0366..57fb68a 100644 --- a/src/requests/BeerPost/sendEditBeerPostRequest.ts +++ b/src/requests/BeerPost/sendEditBeerPostRequest.ts @@ -1,4 +1,4 @@ -import EditBeerPostValidationSchema from '@/services/posts/BeerPost/schema/EditBeerPostValidationSchema'; +import EditBeerPostValidationSchema from '@/services/posts/beer-post/schema/EditBeerPostValidationSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/BreweryImage/sendUploadBreweryImageRequest.ts b/src/requests/BreweryImage/sendUploadBreweryImageRequest.ts index 0821c6d..be6ec7a 100644 --- a/src/requests/BreweryImage/sendUploadBreweryImageRequest.ts +++ b/src/requests/BreweryImage/sendUploadBreweryImageRequest.ts @@ -1,4 +1,4 @@ -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { z } from 'zod'; interface SendUploadBeerImagesRequestArgs { diff --git a/src/requests/BreweryPost/sendCreateBreweryPostRequest.ts b/src/requests/BreweryPost/sendCreateBreweryPostRequest.ts index 9b14b74..5477035 100644 --- a/src/requests/BreweryPost/sendCreateBreweryPostRequest.ts +++ b/src/requests/BreweryPost/sendCreateBreweryPostRequest.ts @@ -1,5 +1,5 @@ -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; -import CreateBreweryPostSchema from '@/services/posts/BreweryPost/schema/CreateBreweryPostSchema'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; +import CreateBreweryPostSchema from '@/services/posts/brewery-post/schema/CreateBreweryPostSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/User/sendEditUserRequest.ts b/src/requests/User/sendEditUserRequest.ts index 7a0ecbf..1ff9feb 100644 --- a/src/requests/User/sendEditUserRequest.ts +++ b/src/requests/User/sendEditUserRequest.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/User/sendRegisterUserRequest.ts b/src/requests/User/sendRegisterUserRequest.ts index 66cc069..3cb6c11 100644 --- a/src/requests/User/sendRegisterUserRequest.ts +++ b/src/requests/User/sendRegisterUserRequest.ts @@ -1,5 +1,5 @@ -import { CreateUserValidationSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import { CreateUserValidationSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/requests/User/sendUpdatePasswordRequest.ts b/src/requests/User/sendUpdatePasswordRequest.ts index 407e8e7..d565c30 100644 --- a/src/requests/User/sendUpdatePasswordRequest.ts +++ b/src/requests/User/sendUpdatePasswordRequest.ts @@ -1,4 +1,4 @@ -import { UpdatePasswordSchema } from '@/services/users/User/schema/CreateUserValidationSchemas'; +import { UpdatePasswordSchema } from '@/services/users/auth/schema/CreateUserValidationSchemas'; import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema'; import { z } from 'zod'; diff --git a/src/services/comments/BeerComment/createNewBeerComment.ts b/src/services/comments/beer-comment/createNewBeerComment.ts similarity index 100% rename from src/services/comments/BeerComment/createNewBeerComment.ts rename to src/services/comments/beer-comment/createNewBeerComment.ts diff --git a/src/services/comments/BeerComment/editBeerCommentById.ts b/src/services/comments/beer-comment/editBeerCommentById.ts similarity index 100% rename from src/services/comments/BeerComment/editBeerCommentById.ts rename to src/services/comments/beer-comment/editBeerCommentById.ts diff --git a/src/services/comments/BeerComment/findBeerCommentById.ts b/src/services/comments/beer-comment/findBeerCommentById.ts similarity index 100% rename from src/services/comments/BeerComment/findBeerCommentById.ts rename to src/services/comments/beer-comment/findBeerCommentById.ts diff --git a/src/services/comments/BeerComment/getAllBeerComments.ts b/src/services/comments/beer-comment/getAllBeerComments.ts similarity index 100% rename from src/services/comments/BeerComment/getAllBeerComments.ts rename to src/services/comments/beer-comment/getAllBeerComments.ts diff --git a/src/services/comments/BeerComment/getBeerCommentCount.ts b/src/services/comments/beer-comment/getBeerCommentCount.ts similarity index 100% rename from src/services/comments/BeerComment/getBeerCommentCount.ts rename to src/services/comments/beer-comment/getBeerCommentCount.ts diff --git a/src/services/comments/BeerStyleComment/createNewBeerStyleComment.ts b/src/services/comments/beer-style-comment/createNewBeerStyleComment.ts similarity index 100% rename from src/services/comments/BeerStyleComment/createNewBeerStyleComment.ts rename to src/services/comments/beer-style-comment/createNewBeerStyleComment.ts diff --git a/src/services/comments/BeerStyleComment/getAllBeerStyleComments.ts b/src/services/comments/beer-style-comment/getAllBeerStyleComments.ts similarity index 100% rename from src/services/comments/BeerStyleComment/getAllBeerStyleComments.ts rename to src/services/comments/beer-style-comment/getAllBeerStyleComments.ts diff --git a/src/services/comments/BeerStyleComment/getBeerStyleCommentCount.ts b/src/services/comments/beer-style-comment/getBeerStyleCommentCount.ts similarity index 100% rename from src/services/comments/BeerStyleComment/getBeerStyleCommentCount.ts rename to src/services/comments/beer-style-comment/getBeerStyleCommentCount.ts diff --git a/src/services/comments/BeerStyleComment/updateBeerStyleCommentById.ts b/src/services/comments/beer-style-comment/updateBeerStyleCommentById.ts similarity index 100% rename from src/services/comments/BeerStyleComment/updateBeerStyleCommentById.ts rename to src/services/comments/beer-style-comment/updateBeerStyleCommentById.ts diff --git a/src/services/comments/BreweryComment/createNewBreweryComment.ts b/src/services/comments/brewery-comment/createNewBreweryComment.ts similarity index 100% rename from src/services/comments/BreweryComment/createNewBreweryComment.ts rename to src/services/comments/brewery-comment/createNewBreweryComment.ts diff --git a/src/services/comments/BreweryComment/getAllBreweryComments.ts b/src/services/comments/brewery-comment/getAllBreweryComments.ts similarity index 100% rename from src/services/comments/BreweryComment/getAllBreweryComments.ts rename to src/services/comments/brewery-comment/getAllBreweryComments.ts diff --git a/src/services/comments/BreweryComment/getBreweryCommentById.ts b/src/services/comments/brewery-comment/getBreweryCommentById.ts similarity index 100% rename from src/services/comments/BreweryComment/getBreweryCommentById.ts rename to src/services/comments/brewery-comment/getBreweryCommentById.ts diff --git a/src/services/images/BeerImage/addBeerImageToDB.ts b/src/services/images/beer-image/addBeerImageToDB.ts similarity index 100% rename from src/services/images/BeerImage/addBeerImageToDB.ts rename to src/services/images/beer-image/addBeerImageToDB.ts diff --git a/src/services/images/BreweryImage/addBreweryImageToDB.ts b/src/services/images/brewery-image/addBreweryImageToDB.ts similarity index 100% rename from src/services/images/BreweryImage/addBreweryImageToDB.ts rename to src/services/images/brewery-image/addBreweryImageToDB.ts diff --git a/src/services/likes/BeerPostLike/createBeerPostLike.ts b/src/services/likes/beer-post-like/createBeerPostLike.ts similarity index 86% rename from src/services/likes/BeerPostLike/createBeerPostLike.ts rename to src/services/likes/beer-post-like/createBeerPostLike.ts index 6c2ebe8..14a18b7 100644 --- a/src/services/likes/BeerPostLike/createBeerPostLike.ts +++ b/src/services/likes/beer-post-like/createBeerPostLike.ts @@ -1,6 +1,6 @@ import DBClient from '@/prisma/DBClient'; import { z } from 'zod'; -import GetUserSchema from '../../users/User/schema/GetUserSchema'; +import GetUserSchema from '../../users/auth/schema/GetUserSchema'; interface CreateBeerPostLikeArgs { id: string; diff --git a/src/services/likes/BeerPostLike/findBeerPostLikeById.ts b/src/services/likes/beer-post-like/findBeerPostLikeById.ts similarity index 100% rename from src/services/likes/BeerPostLike/findBeerPostLikeById.ts rename to src/services/likes/beer-post-like/findBeerPostLikeById.ts diff --git a/src/services/likes/BeerPostLike/getBeerPostLikeCount.ts b/src/services/likes/beer-post-like/getBeerPostLikeCount.ts similarity index 100% rename from src/services/likes/BeerPostLike/getBeerPostLikeCount.ts rename to src/services/likes/beer-post-like/getBeerPostLikeCount.ts diff --git a/src/services/likes/BeerPostLike/removeBeerPostLikeById.ts b/src/services/likes/beer-post-like/removeBeerPostLikeById.ts similarity index 100% rename from src/services/likes/BeerPostLike/removeBeerPostLikeById.ts rename to src/services/likes/beer-post-like/removeBeerPostLikeById.ts diff --git a/src/services/likes/BeerStyleLike/createBeerStyleLike.ts b/src/services/likes/beer-style-like/createBeerStyleLike.ts similarity index 86% rename from src/services/likes/BeerStyleLike/createBeerStyleLike.ts rename to src/services/likes/beer-style-like/createBeerStyleLike.ts index 6af1e71..e4c1813 100644 --- a/src/services/likes/BeerStyleLike/createBeerStyleLike.ts +++ b/src/services/likes/beer-style-like/createBeerStyleLike.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; import DBClient from '@/prisma/DBClient'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; interface CreateBeerStyleLikeArgs { beerStyleId: string; diff --git a/src/services/likes/BeerStyleLike/findBeerStyleLikeById.ts b/src/services/likes/beer-style-like/findBeerStyleLikeById.ts similarity index 100% rename from src/services/likes/BeerStyleLike/findBeerStyleLikeById.ts rename to src/services/likes/beer-style-like/findBeerStyleLikeById.ts diff --git a/src/services/likes/BeerStyleLike/getBeerStyleLikeCount.ts b/src/services/likes/beer-style-like/getBeerStyleLikeCount.ts similarity index 100% rename from src/services/likes/BeerStyleLike/getBeerStyleLikeCount.ts rename to src/services/likes/beer-style-like/getBeerStyleLikeCount.ts diff --git a/src/services/likes/BeerStyleLike/removeBeerStyleLikeById.ts b/src/services/likes/beer-style-like/removeBeerStyleLikeById.ts similarity index 100% rename from src/services/likes/BeerStyleLike/removeBeerStyleLikeById.ts rename to src/services/likes/beer-style-like/removeBeerStyleLikeById.ts diff --git a/src/services/posts/BeerPost/createNewBeerPost.ts b/src/services/posts/beer-post/createNewBeerPost.ts similarity index 100% rename from src/services/posts/BeerPost/createNewBeerPost.ts rename to src/services/posts/beer-post/createNewBeerPost.ts diff --git a/src/services/posts/BeerPost/deleteBeerPostById.ts b/src/services/posts/beer-post/deleteBeerPostById.ts similarity index 100% rename from src/services/posts/BeerPost/deleteBeerPostById.ts rename to src/services/posts/beer-post/deleteBeerPostById.ts diff --git a/src/services/posts/BeerPost/editBeerPostById.ts b/src/services/posts/beer-post/editBeerPostById.ts similarity index 100% rename from src/services/posts/BeerPost/editBeerPostById.ts rename to src/services/posts/beer-post/editBeerPostById.ts diff --git a/src/services/posts/BeerPost/getAllBeerPosts.ts b/src/services/posts/beer-post/getAllBeerPosts.ts similarity index 91% rename from src/services/posts/BeerPost/getAllBeerPosts.ts rename to src/services/posts/beer-post/getAllBeerPosts.ts index dd37b8d..a19f344 100644 --- a/src/services/posts/BeerPost/getAllBeerPosts.ts +++ b/src/services/posts/beer-post/getAllBeerPosts.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; const prisma = DBClient.instance; diff --git a/src/services/posts/BeerPost/getBeerPostById.ts b/src/services/posts/beer-post/getBeerPostById.ts similarity index 90% rename from src/services/posts/BeerPost/getBeerPostById.ts rename to src/services/posts/beer-post/getBeerPostById.ts index 36fd1a2..f7e5c53 100644 --- a/src/services/posts/BeerPost/getBeerPostById.ts +++ b/src/services/posts/beer-post/getBeerPostById.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; const prisma = DBClient.instance; diff --git a/src/services/posts/BeerPost/getBeerPostsByBeerStyleId.ts b/src/services/posts/beer-post/getBeerPostsByBeerStyleId.ts similarity index 100% rename from src/services/posts/BeerPost/getBeerPostsByBeerStyleId.ts rename to src/services/posts/beer-post/getBeerPostsByBeerStyleId.ts diff --git a/src/services/posts/BeerPost/getBeerPostsByBreweryId.ts b/src/services/posts/beer-post/getBeerPostsByBreweryId.ts similarity index 100% rename from src/services/posts/BeerPost/getBeerPostsByBreweryId.ts rename to src/services/posts/beer-post/getBeerPostsByBreweryId.ts diff --git a/src/services/posts/BeerPost/getBeerPostsByPostedById.ts b/src/services/posts/beer-post/getBeerPostsByPostedById.ts similarity index 100% rename from src/services/posts/BeerPost/getBeerPostsByPostedById.ts rename to src/services/posts/beer-post/getBeerPostsByPostedById.ts diff --git a/src/services/posts/BeerPost/getBeerRecommendations.ts b/src/services/posts/beer-post/getBeerRecommendations.ts similarity index 94% rename from src/services/posts/BeerPost/getBeerRecommendations.ts rename to src/services/posts/beer-post/getBeerRecommendations.ts index 6353e06..654af53 100644 --- a/src/services/posts/BeerPost/getBeerRecommendations.ts +++ b/src/services/posts/beer-post/getBeerRecommendations.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BeerPostQueryResult from '@/services/posts/BeerPost/schema/BeerPostQueryResult'; +import BeerPostQueryResult from '@/services/posts/beer-post/schema/BeerPostQueryResult'; import { z } from 'zod'; diff --git a/src/services/posts/BeerPost/schema/BeerPostQueryResult.ts b/src/services/posts/beer-post/schema/BeerPostQueryResult.ts similarity index 100% rename from src/services/posts/BeerPost/schema/BeerPostQueryResult.ts rename to src/services/posts/beer-post/schema/BeerPostQueryResult.ts diff --git a/src/services/posts/BeerPost/schema/CreateBeerPostValidationSchema.ts b/src/services/posts/beer-post/schema/CreateBeerPostValidationSchema.ts similarity index 100% rename from src/services/posts/BeerPost/schema/CreateBeerPostValidationSchema.ts rename to src/services/posts/beer-post/schema/CreateBeerPostValidationSchema.ts diff --git a/src/services/posts/BeerPost/schema/EditBeerPostValidationSchema.ts b/src/services/posts/beer-post/schema/EditBeerPostValidationSchema.ts similarity index 100% rename from src/services/posts/BeerPost/schema/EditBeerPostValidationSchema.ts rename to src/services/posts/beer-post/schema/EditBeerPostValidationSchema.ts diff --git a/src/services/posts/BeerStyles/deleteBeerStyleById.ts b/src/services/posts/beer-style-post/deleteBeerStyleById.ts similarity index 100% rename from src/services/posts/BeerStyles/deleteBeerStyleById.ts rename to src/services/posts/beer-style-post/deleteBeerStyleById.ts diff --git a/src/services/posts/BeerStyles/editBeerStyleById.ts b/src/services/posts/beer-style-post/editBeerStyleById.ts similarity index 100% rename from src/services/posts/BeerStyles/editBeerStyleById.ts rename to src/services/posts/beer-style-post/editBeerStyleById.ts diff --git a/src/services/posts/BeerStyles/getAllBeerStyles.ts b/src/services/posts/beer-style-post/getAllBeerStyles.ts similarity index 100% rename from src/services/posts/BeerStyles/getAllBeerStyles.ts rename to src/services/posts/beer-style-post/getAllBeerStyles.ts diff --git a/src/services/posts/BeerStyles/getBeerStyleById.ts b/src/services/posts/beer-style-post/getBeerStyleById.ts similarity index 100% rename from src/services/posts/BeerStyles/getBeerStyleById.ts rename to src/services/posts/beer-style-post/getBeerStyleById.ts diff --git a/src/services/posts/BeerStyles/schema/BeerStyleQueryResult.ts b/src/services/posts/beer-style-post/schema/BeerStyleQueryResult.ts similarity index 100% rename from src/services/posts/BeerStyles/schema/BeerStyleQueryResult.ts rename to src/services/posts/beer-style-post/schema/BeerStyleQueryResult.ts diff --git a/src/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema.ts b/src/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema.ts similarity index 100% rename from src/services/posts/BeerStyles/schema/CreateBeerStyleValidationSchema.ts rename to src/services/posts/beer-style-post/schema/CreateBeerStyleValidationSchema.ts diff --git a/src/services/posts/BreweryPost/createNewBreweryPost.ts b/src/services/posts/brewery-post/createNewBreweryPost.ts similarity index 100% rename from src/services/posts/BreweryPost/createNewBreweryPost.ts rename to src/services/posts/brewery-post/createNewBreweryPost.ts diff --git a/src/services/posts/BreweryPost/getAllBreweryPosts.ts b/src/services/posts/brewery-post/getAllBreweryPosts.ts similarity index 92% rename from src/services/posts/BreweryPost/getAllBreweryPosts.ts rename to src/services/posts/brewery-post/getAllBreweryPosts.ts index 39db838..b3540f5 100644 --- a/src/services/posts/BreweryPost/getAllBreweryPosts.ts +++ b/src/services/posts/brewery-post/getAllBreweryPosts.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { z } from 'zod'; diff --git a/src/services/posts/BreweryPost/getAllBreweryPostsByPostedById.ts b/src/services/posts/brewery-post/getAllBreweryPostsByPostedById.ts similarity index 93% rename from src/services/posts/BreweryPost/getAllBreweryPostsByPostedById.ts rename to src/services/posts/brewery-post/getAllBreweryPostsByPostedById.ts index d8a3dc7..b4820d1 100644 --- a/src/services/posts/BreweryPost/getAllBreweryPostsByPostedById.ts +++ b/src/services/posts/brewery-post/getAllBreweryPostsByPostedById.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { z } from 'zod'; diff --git a/src/services/posts/BreweryPost/getBreweryPostById.ts b/src/services/posts/brewery-post/getBreweryPostById.ts similarity index 91% rename from src/services/posts/BreweryPost/getBreweryPostById.ts rename to src/services/posts/brewery-post/getBreweryPostById.ts index 0c8399b..46886fe 100644 --- a/src/services/posts/BreweryPost/getBreweryPostById.ts +++ b/src/services/posts/brewery-post/getBreweryPostById.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import BreweryPostQueryResult from '@/services/posts/BreweryPost/schema/BreweryPostQueryResult'; +import BreweryPostQueryResult from '@/services/posts/brewery-post/schema/BreweryPostQueryResult'; import { z } from 'zod'; const prisma = DBClient.instance; diff --git a/src/services/posts/BreweryPost/schema/BreweryPostMapQueryResult.ts b/src/services/posts/brewery-post/schema/BreweryPostMapQueryResult.ts similarity index 100% rename from src/services/posts/BreweryPost/schema/BreweryPostMapQueryResult.ts rename to src/services/posts/brewery-post/schema/BreweryPostMapQueryResult.ts diff --git a/src/services/posts/BreweryPost/schema/BreweryPostQueryResult.ts b/src/services/posts/brewery-post/schema/BreweryPostQueryResult.ts similarity index 100% rename from src/services/posts/BreweryPost/schema/BreweryPostQueryResult.ts rename to src/services/posts/brewery-post/schema/BreweryPostQueryResult.ts diff --git a/src/services/posts/BreweryPost/schema/CreateBreweryPostSchema.ts b/src/services/posts/brewery-post/schema/CreateBreweryPostSchema.ts similarity index 100% rename from src/services/posts/BreweryPost/schema/CreateBreweryPostSchema.ts rename to src/services/posts/brewery-post/schema/CreateBreweryPostSchema.ts diff --git a/src/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema.ts b/src/services/posts/brewery-post/schema/EditBreweryPostValidationSchema.ts similarity index 100% rename from src/services/posts/BreweryPost/schema/EditBreweryPostValidationSchema.ts rename to src/services/posts/brewery-post/schema/EditBreweryPostValidationSchema.ts diff --git a/src/services/users/UserAccount/UpdateUserAvatarByIdParams.ts b/src/services/users/account/UpdateUserAvatarByIdParams.ts similarity index 95% rename from src/services/users/UserAccount/UpdateUserAvatarByIdParams.ts rename to src/services/users/account/UpdateUserAvatarByIdParams.ts index 9002c47..56ab286 100644 --- a/src/services/users/UserAccount/UpdateUserAvatarByIdParams.ts +++ b/src/services/users/account/UpdateUserAvatarByIdParams.ts @@ -1,5 +1,5 @@ import DBClient from '@/prisma/DBClient'; -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import { z } from 'zod'; export interface UpdateUserAvatarByIdParams { diff --git a/src/services/users/User/createNewUser.ts b/src/services/users/auth/createNewUser.ts similarity index 100% rename from src/services/users/User/createNewUser.ts rename to src/services/users/auth/createNewUser.ts diff --git a/src/services/users/User/deleteUserById.ts b/src/services/users/auth/deleteUserById.ts similarity index 100% rename from src/services/users/User/deleteUserById.ts rename to src/services/users/auth/deleteUserById.ts diff --git a/src/services/users/User/findUserByEmail.ts b/src/services/users/auth/findUserByEmail.ts similarity index 100% rename from src/services/users/User/findUserByEmail.ts rename to src/services/users/auth/findUserByEmail.ts diff --git a/src/services/users/User/findUserById.ts b/src/services/users/auth/findUserById.ts similarity index 100% rename from src/services/users/User/findUserById.ts rename to src/services/users/auth/findUserById.ts diff --git a/src/services/users/User/findUserByIdPublic.ts b/src/services/users/auth/findUserByIdPublic.ts similarity index 100% rename from src/services/users/User/findUserByIdPublic.ts rename to src/services/users/auth/findUserByIdPublic.ts diff --git a/src/services/users/User/findUserByUsername.ts b/src/services/users/auth/findUserByUsername.ts similarity index 100% rename from src/services/users/User/findUserByUsername.ts rename to src/services/users/auth/findUserByUsername.ts diff --git a/src/services/users/User/schema/CreateUserValidationSchemas.ts b/src/services/users/auth/schema/CreateUserValidationSchemas.ts similarity index 100% rename from src/services/users/User/schema/CreateUserValidationSchemas.ts rename to src/services/users/auth/schema/CreateUserValidationSchemas.ts diff --git a/src/services/users/User/schema/EditUserSchema.ts b/src/services/users/auth/schema/EditUserSchema.ts similarity index 100% rename from src/services/users/User/schema/EditUserSchema.ts rename to src/services/users/auth/schema/EditUserSchema.ts diff --git a/src/services/users/User/schema/GetUserSchema.ts b/src/services/users/auth/schema/GetUserSchema.ts similarity index 100% rename from src/services/users/User/schema/GetUserSchema.ts rename to src/services/users/auth/schema/GetUserSchema.ts diff --git a/src/services/users/User/schema/LoginValidationSchema.ts b/src/services/users/auth/schema/LoginValidationSchema.ts similarity index 100% rename from src/services/users/User/schema/LoginValidationSchema.ts rename to src/services/users/auth/schema/LoginValidationSchema.ts diff --git a/src/services/users/User/schema/PublicUserSchema.ts b/src/services/users/auth/schema/PublicUserSchema.ts similarity index 72% rename from src/services/users/User/schema/PublicUserSchema.ts rename to src/services/users/auth/schema/PublicUserSchema.ts index 08895f3..ba51010 100644 --- a/src/services/users/User/schema/PublicUserSchema.ts +++ b/src/services/users/auth/schema/PublicUserSchema.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; const PublicUserSchema = GetUserSchema.pick({ id: true, diff --git a/src/services/users/User/schema/TokenValidationSchema.ts b/src/services/users/auth/schema/TokenValidationSchema.ts similarity index 100% rename from src/services/users/User/schema/TokenValidationSchema.ts rename to src/services/users/auth/schema/TokenValidationSchema.ts diff --git a/src/services/users/User/schema/UpdateProfileSchema.ts b/src/services/users/auth/schema/UpdateProfileSchema.ts similarity index 100% rename from src/services/users/User/schema/UpdateProfileSchema.ts rename to src/services/users/auth/schema/UpdateProfileSchema.ts diff --git a/src/services/users/User/sendConfirmationEmail.ts b/src/services/users/auth/sendConfirmationEmail.ts similarity index 100% rename from src/services/users/User/sendConfirmationEmail.ts rename to src/services/users/auth/sendConfirmationEmail.ts diff --git a/src/services/users/User/sendResetPasswordEmail.ts b/src/services/users/auth/sendResetPasswordEmail.ts similarity index 100% rename from src/services/users/User/sendResetPasswordEmail.ts rename to src/services/users/auth/sendResetPasswordEmail.ts diff --git a/src/services/users/User/updateUserProfileById.ts b/src/services/users/auth/updateUserProfileById.ts similarity index 100% rename from src/services/users/User/updateUserProfileById.ts rename to src/services/users/auth/updateUserProfileById.ts diff --git a/src/services/users/User/updateUserToBeConfirmedById.ts b/src/services/users/auth/updateUserToBeConfirmedById.ts similarity index 92% rename from src/services/users/User/updateUserToBeConfirmedById.ts rename to src/services/users/auth/updateUserToBeConfirmedById.ts index 650b42d..2db875f 100644 --- a/src/services/users/User/updateUserToBeConfirmedById.ts +++ b/src/services/users/auth/updateUserToBeConfirmedById.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; import DBClient from '@/prisma/DBClient'; import { z } from 'zod'; diff --git a/src/services/users/UserFollows/getUsersFollowedByUser.ts b/src/services/users/follows/getUsersFollowedByUser.ts similarity index 100% rename from src/services/users/UserFollows/getUsersFollowedByUser.ts rename to src/services/users/follows/getUsersFollowedByUser.ts diff --git a/src/services/users/UserFollows/getUsersFollowingUser.ts b/src/services/users/follows/getUsersFollowingUser.ts similarity index 100% rename from src/services/users/UserFollows/getUsersFollowingUser.ts rename to src/services/users/follows/getUsersFollowingUser.ts diff --git a/src/services/users/UserFollows/schema/FollowInfoSchema.ts b/src/services/users/follows/schema/FollowInfoSchema.ts similarity index 69% rename from src/services/users/UserFollows/schema/FollowInfoSchema.ts rename to src/services/users/follows/schema/FollowInfoSchema.ts index 7151448..a073006 100644 --- a/src/services/users/UserFollows/schema/FollowInfoSchema.ts +++ b/src/services/users/follows/schema/FollowInfoSchema.ts @@ -1,4 +1,4 @@ -import GetUserSchema from '@/services/users/User/schema/GetUserSchema'; +import GetUserSchema from '@/services/users/auth/schema/GetUserSchema'; const FollowInfoSchema = GetUserSchema.pick({ userAvatar: true,