diff --git a/README.md b/README.md index 8bc11fff..9238e214 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,17 @@
- -안녕하세요😃 +안녕하세요😃 업주야놀자의 B2B Self-coupon Admin(Backoffice) 서비스 프로젝트 :computer: 웹 페이지 입니다 -백엔드는 [이곳](https://github.com/Upjuyanolja/Upjuyanolja_BE)을 클릭해 주세요 +백엔드는 [이곳](https://github.com/Upjuyanolja/Upjuyanolja_BE)을 클릭해 주세요 숙박 예약 서비스는 [이곳](https://github.com/Upjuyanolja/FastCatch-FrontEnd)을 클릭해 주세요 ---- +--- -**테스트 계정** +**테스트 계정** emai: pgh123166@naver.com @@ -36,6 +35,7 @@ password: Abcd1234 --- ## 🎯 팀 소개 + @@ -92,39 +92,50 @@ password: Abcd1234

-
## 🎨 화면 구성 +

메인 페이지

메인 페이지 메인 페이지에서는 쿠폰 현황과 일자별 쿠폰 매출을 차트 형식으로 확인할 수 있습니다. ---- - +---

쿠폰 관리 페이지

메인 페이지 쿠폰 관리 페이지에서는 select와 checkbox를 통한 쿠폰 발급 상태를 변경할 수 있습니다 ( 소진은 변경 불가 ) 일일 제한 수량, 노출 기준, 쿠폰 적용 기간 또한 사용자가 직접 변경할 수 있습니다 쿠폰 아이템을 선택해서 삭제와 추가 구매를 할 수 있습니다 - --- - + +--- +

쿠폰 만들기 페이지

카테고리별 페이지 - + +충전한 포인트를 가지고 쿠폰을 구매할 수 있습니다. 구매한 쿠폰은 쿠폰 관리 페이지에서 확인이 가능합니다 + +--- +

포인트 내역 페이지

숙박 상세 페이지 - + +충전한 포인트와 사용한 포인트 내역을 페이지네이션 형태로 확인할 수 있습니다 + +--- +

객실 관리 페이지

장바구니 페이지 - -

이용 가이드 페이지

-
+객실을 무한스크롤 형태로 확인할 수 있고 객실을 수정 , 삭제 , 등록이 가능합니다 +--- + +

이용 가이드 페이지

+
## 📚 주요 기능 +
avatar
@@ -153,7 +164,7 @@ password: Abcd1234 ``` 📂 src ┣ 📂 api -┣ 📂 assets +┣ 📂 assets ┣ 📂 components ┃ ┣ 📂 layout ┃ ┃ ┣ 📂 footer @@ -161,28 +172,28 @@ password: Abcd1234 ┃ ┃ ┣ ... ┃ ┣ 📂 agreement-modal ┃ ┣ 📂 coupon -┃ ┣ ... +┃ ┣ ... ┣ 📂 constants ┃ ┣ 📂 api ┃ ┣ 📂 colors ┃ ┣ 📂 coupon ┃ ┣ ... -┣ 📂 hooks +┣ 📂 hooks ┣ 📂 mocks ┣ 📂 pages ┃ ┣ 📂 coupon ┃ ┣ 📂 coupon-registration ┃ ┣ 📂 init ┃ ┣ 📂 init-accommodation-registration -┃ ┣ ... +┃ ┣ ... ┣ 📂 queries -┣ 📂 stores +┣ 📂 stores ┣ 📂 test ┃ ┣ 📂 coupon ┃ ┣ 📂 init ┃ ┣ 📂 layouts -┃ ┣ ... -┣ 📂 types +┃ ┣ ... +┣ 📂 types ┣ 📂 utils ┃ ┣ 📂 sign-in ┃ ┣ 📂 sign-up @@ -193,8 +204,11 @@ password: Abcd1234
-## 📆 기간 -```2023.12.26 ~ 2024.01.29``` -
+### 참고 노션 + +https://youthful-jump-c97.notion.site/FE-2-f8763ce2d853471ea58f0312e5c5927f?pvs=4 +## 📆 기간 +`2023.12.26 ~ 2024.01.29` +
diff --git a/src/App.tsx b/src/App.tsx index a1d6e817..83c09b30 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,7 +22,7 @@ import { RoomRegistration } from './pages/room-registration'; import { RoomUpdate } from './pages/room-update'; import { RootLayout } from './layout'; import './App.less'; -import { RoomLayout } from '@components/room/room-layout'; +import { RoomLayout } from '@components/domain/room/room-layout'; import { getCookie } from '@hooks/sign-in/useSignIn'; import { InitLayout } from '@components/layout/init-layout/InitLayout'; import { MainRedirect } from '@pages/main-redirect'; diff --git a/src/api/accommodation/index.ts b/src/api/accommodation/index.ts index 4a73c4e8..4fcd02b8 100644 --- a/src/api/accommodation/index.ts +++ b/src/api/accommodation/index.ts @@ -2,6 +2,6 @@ import { instance } from '..'; import { AccommodationListData } from './type'; export const ACCOMMODATION_API = { - getAccommodationList: () => + accommodationList: () => instance.get('/backoffice-api/accommodations'), }; diff --git a/src/api/coupon/index.ts b/src/api/coupon/index.ts index b2acf537..7be5553d 100644 --- a/src/api/coupon/index.ts +++ b/src/api/coupon/index.ts @@ -6,29 +6,29 @@ import { CouponEditParams, CouponRoomList, PurchaseCouponParams, - coupons, - revenueData, - staticsData, + Coupons, + RevenueData, + StaticsData, } from './type'; export const COUPON_API = { - getStatics: (accommodationId: string) => - instance.get( + statics: (accommodationId: string) => + instance.get( `/api/coupons/backoffice/statistics/${accommodationId}`, ), - getRevenue: (accommodationId: string) => - instance.get( + revenue: (accommodationId: string) => + instance.get( `/api/coupons/backoffice/revenue/${accommodationId}`, ), - getCoupon: (accommodationId: string) => - instance.get(`/api/coupons/backoffice/manage/${accommodationId}`), + coupon: (accommodationId: string) => + instance.get(`/api/coupons/backoffice/manage/${accommodationId}`), deleteCoupon: (params: CouponDeleteParams) => instance.delete<''>('/api/coupons/backoffice/manage', { data: params, }), editCoupon: (params: CouponEditParams) => instance.patch<''>('/api/coupons/backoffice/manage', params), - getCouponRoomList: (accommodationId: string) => + couponRoomList: (accommodationId: string) => instance.get( `/api/coupons/backoffice/buy/${accommodationId}`, ), diff --git a/src/api/coupon/type.ts b/src/api/coupon/type.ts index 3e9637e0..e98cc630 100644 --- a/src/api/coupon/type.ts +++ b/src/api/coupon/type.ts @@ -5,27 +5,27 @@ import { BuyCouponQuantity, BuyCouponTotalPoints, RoomId, -} from '@components/coupon-registration/type'; +} from '@components/domain/coupon-registration/type'; -export type staticsData = { +export type StaticsData = { accommodationId: number; total: number; used: number; stock: number; }; -export type dailyRevenue = { +export type DailyRevenue = { revenueDate: string; couponRevenue: number; normalRevenue: number; }; -export type revenueData = { +export type RevenueData = { accommodationId: number; - revenue: dailyRevenue[]; + revenue: DailyRevenue[]; couponMessage: string; }; -export type coupon = { +export type Coupon = { couponId: number; status: string; discountType: 'FLAT' | 'RATE'; @@ -45,18 +45,18 @@ export type EditCoupon = { dayLimit: number; couponType: string; }; -export type room = { +export type Room = { roomId: number; roomName: string; roomPrice: number; coupons: T[]; }; -export type coupons = { +export type Coupons = { accommodationId: number; accommodationName: string; expiry: string; - rooms: room[]; + rooms: Room[]; }; export type CouponDeleteParams = { accommodationId: number; @@ -66,13 +66,13 @@ export type CouponDeleteParams = { export type CouponEditParams = { accommodationId: number; expiry: string; - rooms: Omit, 'roomPrice' | 'roomName'>[]; + rooms: Omit, 'roomPrice' | 'roomName'>[]; }; export type CouponRoomList = { accommodationId: number; accommodationName: string; - rooms: Pick, 'roomId' | 'roomName' | 'roomPrice'>[]; + rooms: Pick, 'roomId' | 'roomName' | 'roomPrice'>[]; }; export type BuyCouponParams = { @@ -99,8 +99,8 @@ export type PurchaseCouponParams = { expiry: string; totalPoints: number; rooms: Omit< - room< - Omit & { + Room< + Omit & { eachPoint: number; buyQuantity: number; } diff --git a/src/api/index.ts b/src/api/index.ts index 3b647bb4..ab9de718 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -46,7 +46,7 @@ instance.interceptors.response.use( } else { const accessToken = getCookie('accessToken'); if (accessToken) { - const res = await REFRESH_API.postRefresh({ + const res = await REFRESH_API.refreshToken({ accessToken: accessToken, refreshToken: getCookie('refreshToken') as string, }); diff --git a/src/api/init/index.ts b/src/api/init/index.ts index 341c02af..d204b963 100644 --- a/src/api/init/index.ts +++ b/src/api/init/index.ts @@ -6,13 +6,13 @@ import { } from './type'; export const ACCOMMODATION_REGISTRATION_API = { - postImageFile: (formData: FormData) => + imageFile: (formData: FormData) => instance.post('/backoffice-api/images', formData, { headers: { 'Content-Type': 'multipart/form-data', }, }), - postAccommodationInfo: (params: PostAccommodationParams) => + accommodationInfo: (params: PostAccommodationParams) => instance.post('/backoffice-api/accommodations', params), }; diff --git a/src/api/logout/index.ts b/src/api/logout/index.ts index 504be899..a6a5025b 100644 --- a/src/api/logout/index.ts +++ b/src/api/logout/index.ts @@ -2,6 +2,5 @@ import { AxiosResponse } from 'axios'; import { instance } from '..'; export const LOGOUT_API = { - deleteLogout: (): Promise => - instance.delete('/api/auth/logout'), + logout: (): Promise => instance.delete('/api/auth/logout'), }; diff --git a/src/api/member/index.ts b/src/api/member/index.ts index fff8aead..2350c072 100644 --- a/src/api/member/index.ts +++ b/src/api/member/index.ts @@ -3,5 +3,5 @@ import { instance } from '..'; import { UserInfoData } from './type'; export const MEMBER_API = { - getUserInfo: () => instance.get>('/api/member'), + userInfo: () => instance.get>('/api/member'), }; diff --git a/src/api/point-detail/get-point-detail/index.ts b/src/api/point-detail/get-point-detail/index.ts index 43e6d4ce..35fca410 100644 --- a/src/api/point-detail/get-point-detail/index.ts +++ b/src/api/point-detail/get-point-detail/index.ts @@ -1,8 +1,8 @@ import { instance } from '../..'; -import { PointDetailDataType, menuStatusType } from './type'; +import { PointDetailDataType, MenuStatusType } from './type'; export const POINT_DETAIL_API = { - getPointDetail: (menuStatus: menuStatusType, page: number) => + pointDetail: (menuStatus: MenuStatusType, page: number) => instance.get( `/api/points/${menuStatus}?page=${page - 1}`, ), diff --git a/src/api/point-detail/get-point-detail/type.ts b/src/api/point-detail/get-point-detail/type.ts index b74135e4..ac9551f6 100644 --- a/src/api/point-detail/get-point-detail/type.ts +++ b/src/api/point-detail/get-point-detail/type.ts @@ -1,4 +1,4 @@ -import { badgeProps } from '@components/point-detail/badge/types'; +import { BadgeProps } from '@components/domain/point-detail/badge/types'; export type Coupons = { name: string; @@ -24,7 +24,7 @@ export type History = { id: number; category: string; type: string; - status: badgeProps; + status: BadgeProps; name: string; description: string; trade: number; @@ -41,4 +41,4 @@ export type PointDetailDataType = { histories: History[]; }; -export type menuStatusType = 'total' | 'charges' | 'usages'; +export type MenuStatusType = 'total' | 'charges' | 'usages'; diff --git a/src/api/point-detail/orderCancel/index.ts b/src/api/point-detail/orderCancel/index.ts index 103a68fb..2b7bd57b 100644 --- a/src/api/point-detail/orderCancel/index.ts +++ b/src/api/point-detail/orderCancel/index.ts @@ -2,6 +2,6 @@ import { instance } from '../..'; import { CancelType } from './type'; export const ORDER_CANCEL_API = { - deleteOrderCancel: (chargeId: number) => + orderCancel: (chargeId: number) => instance.delete(`/api/points/charges/${chargeId}`), }; diff --git a/src/api/point/index.ts b/src/api/point/index.ts index 40f954ff..825521e2 100644 --- a/src/api/point/index.ts +++ b/src/api/point/index.ts @@ -2,11 +2,10 @@ import { instance } from '..'; import { PointSummaryData, PointTotalData } from './type'; export const POINT_API = { - getPointSummary: (rangeDate: string) => + pointSummary: (rangeDate: string) => instance.get( `/api/points/summary?rangeDate=${rangeDate}`, ), - getPointTotal: () => - instance.get('/api/points/total-balance'), + totalPoint: () => instance.get('/api/points/total-balance'), }; diff --git a/src/api/refresh/index.ts b/src/api/refresh/index.ts index 3e0f084a..4cc68615 100644 --- a/src/api/refresh/index.ts +++ b/src/api/refresh/index.ts @@ -2,6 +2,6 @@ import { instance } from '..'; import { PostRefreshData, RefreshData } from './type'; export const REFRESH_API = { - postRefresh: (data: RefreshData) => + refreshToken: (data: RefreshData) => instance.post('/api/auth/refresh', data), }; diff --git a/src/api/room/index.ts b/src/api/room/index.ts index 91963169..a59caaf1 100644 --- a/src/api/room/index.ts +++ b/src/api/room/index.ts @@ -15,7 +15,7 @@ export const ROOM_API = { `/backoffice-api/accommodations/${accommodationId}/rooms`, data, ), - getRoomList: (accommodationId: string, pageSize: number, pageNum: number) => + roomList: (accommodationId: string, pageSize: number, pageNum: number) => instance.get( `/backoffice-api/accommodations/${accommodationId}/rooms?pageSize=${pageSize}&pageNum=${pageNum}`, ), @@ -23,7 +23,7 @@ export const ROOM_API = { instance.delete>( `/backoffice-api/accommodations/${accommodationId}/rooms/${roomId}`, ), - getRoomDetail: (roomId: string, accommodationId: string) => + roomDetail: (roomId: string, accommodationId: string) => instance.get( `/backoffice-api/accommodations/${accommodationId}/rooms/${roomId}`, ), diff --git a/src/api/sign-in/index.ts b/src/api/sign-in/index.ts index 65e05346..f91b0985 100644 --- a/src/api/sign-in/index.ts +++ b/src/api/sign-in/index.ts @@ -3,6 +3,6 @@ import { instance } from '..'; import { SignInData } from './type'; export const SIGN_IN_API = { - postLogin: (data: SignInData) => + login: (data: SignInData) => instance.post('/api/auth/owners/signin', data), }; diff --git a/src/api/sign-up/index.ts b/src/api/sign-up/index.ts index 5152b61e..27e739a5 100644 --- a/src/api/sign-up/index.ts +++ b/src/api/sign-up/index.ts @@ -9,14 +9,14 @@ import { import { instance } from '..'; export const SIGN_UP_API = { - postSignUp: (data: SignUpData) => + signUp: (data: SignUpData) => instance.post('/api/auth/owners/signup', data), - postAuthentication: (data: AuthenticationData) => + authentication: (data: AuthenticationData) => instance.post( '/api/auth/owners/request-email', data, ), - getVerify: (data: VerificationData) => + verify: (data: VerificationData) => instance.get('/api/auth/owners/verify', { params: { email: data.email, diff --git a/src/api/toss/index.ts b/src/api/toss/index.ts index cd58d318..4c27ba77 100644 --- a/src/api/toss/index.ts +++ b/src/api/toss/index.ts @@ -2,6 +2,6 @@ import { instance } from '../'; import { PointChargeType, TossRequestType } from './type'; export const POINT_CHARGE_API = { - postPointCharge: (tossRequest: TossRequestType) => + pointCharge: (tossRequest: TossRequestType) => instance.post('/api/points/charges', tossRequest), }; diff --git a/src/components/spacing/index.tsx b/src/components/atom/spacing/index.tsx similarity index 100% rename from src/components/spacing/index.tsx rename to src/components/atom/spacing/index.tsx diff --git a/src/components/spacing/type.ts b/src/components/atom/spacing/type.ts similarity index 100% rename from src/components/spacing/type.ts rename to src/components/atom/spacing/type.ts diff --git a/src/components/text-box/index.tsx b/src/components/atom/text-box/index.tsx similarity index 100% rename from src/components/text-box/index.tsx rename to src/components/atom/text-box/index.tsx diff --git a/src/components/text-box/type.ts b/src/components/atom/text-box/type.ts similarity index 100% rename from src/components/text-box/type.ts rename to src/components/atom/text-box/type.ts diff --git a/src/components/coupon-registration/coupon-preview/coupon-preview-item/type.ts b/src/components/coupon-registration/coupon-preview/coupon-preview-item/type.ts deleted file mode 100644 index 0dd91ff8..00000000 --- a/src/components/coupon-registration/coupon-preview/coupon-preview-item/type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PendingRoomData } from '@components/coupon-registration/type'; - -export type CouponPreviewItemProps = Partial; diff --git a/src/components/agreement-modal/coupon-agreement-modal/index.tsx b/src/components/domain/agreement-modal/coupon-agreement-modal/index.tsx similarity index 99% rename from src/components/agreement-modal/coupon-agreement-modal/index.tsx rename to src/components/domain/agreement-modal/coupon-agreement-modal/index.tsx index 8fa88db4..f5c1e043 100644 --- a/src/components/agreement-modal/coupon-agreement-modal/index.tsx +++ b/src/components/domain/agreement-modal/coupon-agreement-modal/index.tsx @@ -1,7 +1,8 @@ import { Modal, Button } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; + import { AgreementModalProps } from '../type'; +import { TextBox } from '@components/atom/text-box'; export const CouponAgreementModal = ({ isModalOpen, diff --git a/src/components/agreement-modal/point-agreement-modal/index.tsx b/src/components/domain/agreement-modal/point-agreement-modal/index.tsx similarity index 99% rename from src/components/agreement-modal/point-agreement-modal/index.tsx rename to src/components/domain/agreement-modal/point-agreement-modal/index.tsx index 378fcd0d..a1b61785 100644 --- a/src/components/agreement-modal/point-agreement-modal/index.tsx +++ b/src/components/domain/agreement-modal/point-agreement-modal/index.tsx @@ -1,6 +1,6 @@ import { Modal, Button } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { AgreementModalProps } from '../type'; export const PointAgreementModal = ({ diff --git a/src/components/agreement-modal/type.ts b/src/components/domain/agreement-modal/type.ts similarity index 100% rename from src/components/agreement-modal/type.ts rename to src/components/domain/agreement-modal/type.ts diff --git a/src/components/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx b/src/components/domain/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx similarity index 93% rename from src/components/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx rename to src/components/domain/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx index 79fd9f0c..3badc543 100644 --- a/src/components/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx +++ b/src/components/domain/coupon-registration/coupon-applier/common-quantity-coupon-setter/index.tsx @@ -1,15 +1,15 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Checkbox, Input } from 'antd'; import styled from 'styled-components'; import { InputChangeEvent } from '@/types/event'; import { useEffect, useState } from 'react'; -import { handleEnterKeyDown } from '@/utils/keydown/handleEnterKeyDown'; +import { handleEnterKeyDown } from '@/utils/event/handleEnterKeyDown'; import { useRecoilState, useSetRecoilState } from 'recoil'; import { groupQuantityValueState, isGroupQuantitySelectedState, } from '@stores/coupon-registration/atoms'; -import { isNumber } from '@/utils/isNumber'; +import { isNumber } from '@/utils/check-type'; export const CommonQuantityCouponSetter = () => { const setGroupQuantityValue = useSetRecoilState(groupQuantityValueState); diff --git a/src/components/coupon-registration/coupon-applier/index.tsx b/src/components/domain/coupon-registration/coupon-applier/index.tsx similarity index 100% rename from src/components/coupon-registration/coupon-applier/index.tsx rename to src/components/domain/coupon-registration/coupon-applier/index.tsx diff --git a/src/components/coupon-registration/coupon-applier/room-coupon-applier/index.tsx b/src/components/domain/coupon-registration/coupon-applier/room-coupon-applier/index.tsx similarity index 94% rename from src/components/coupon-registration/coupon-applier/room-coupon-applier/index.tsx rename to src/components/domain/coupon-registration/coupon-applier/room-coupon-applier/index.tsx index 6a9a2bf6..ef158e34 100644 --- a/src/components/coupon-registration/coupon-applier/room-coupon-applier/index.tsx +++ b/src/components/domain/coupon-registration/coupon-applier/room-coupon-applier/index.tsx @@ -1,11 +1,11 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Checkbox, Input } from 'antd'; import styled from 'styled-components'; import { RoomCouponApplierProps } from './type'; import { InputChangeEvent } from '@/types/event'; import { useEffect, useState } from 'react'; -import { isNumber } from '@/utils/is-number'; -import { handleEnterKeyDown } from '@/utils/keydown/handleEnterKeyDown'; +import { isNumber } from '@/utils/check-type'; +import { handleEnterKeyDown } from '@/utils/event/handleEnterKeyDown'; import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; import { determinedPriceState, @@ -17,14 +17,12 @@ import { pendingRoomDataListState, selectedDiscountTypeState, } from '@stores/coupon-registration/atoms'; -import { - PendingRoomData, - PendingRoomDataList, -} from '@components/coupon-registration/type'; -import { removeNumberFormat } from '@/utils/Format/numberFormat'; -import { calculatedCouponPoints } from '@/utils/discountCoupon'; + +import { removeNumberFormat } from '@/utils/formatiing/numberFormat'; +import { calculatedCouponPoints } from '@/utils/coupon/discountCoupon'; import { FLAT_DISCOUNT_TYPE } from '@/constants/coupon-registration'; import { useParams } from 'react-router-dom'; +import { PendingRoomData, PendingRoomDataList } from '../../type'; export const RoomCouponApplier = ({ roomName, diff --git a/src/components/coupon-registration/coupon-applier/room-coupon-applier/type.ts b/src/components/domain/coupon-registration/coupon-applier/room-coupon-applier/type.ts similarity index 100% rename from src/components/coupon-registration/coupon-applier/room-coupon-applier/type.ts rename to src/components/domain/coupon-registration/coupon-applier/room-coupon-applier/type.ts diff --git a/src/components/coupon-registration/coupon-applier/type.ts b/src/components/domain/coupon-registration/coupon-applier/type.ts similarity index 100% rename from src/components/coupon-registration/coupon-applier/type.ts rename to src/components/domain/coupon-registration/coupon-applier/type.ts diff --git a/src/components/coupon-registration/coupon-card/index.tsx b/src/components/domain/coupon-registration/coupon-card/index.tsx similarity index 93% rename from src/components/coupon-registration/coupon-card/index.tsx rename to src/components/domain/coupon-registration/coupon-card/index.tsx index d1efdfa5..7cabe340 100644 --- a/src/components/coupon-registration/coupon-card/index.tsx +++ b/src/components/domain/coupon-registration/coupon-card/index.tsx @@ -1,5 +1,5 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import { CouponCardProps } from './type'; diff --git a/src/components/coupon-registration/coupon-card/type.ts b/src/components/domain/coupon-registration/coupon-card/type.ts similarity index 100% rename from src/components/coupon-registration/coupon-card/type.ts rename to src/components/domain/coupon-registration/coupon-card/type.ts diff --git a/src/components/coupon-registration/coupon-preview/coupon-preview-item/index.tsx b/src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/index.tsx similarity index 93% rename from src/components/coupon-registration/coupon-preview/coupon-preview-item/index.tsx rename to src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/index.tsx index 0658e850..46dd33c3 100644 --- a/src/components/coupon-registration/coupon-preview/coupon-preview-item/index.tsx +++ b/src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/index.tsx @@ -1,10 +1,13 @@ import { colors } from '@/constants/colors'; -import { Spacing } from '@components/spacing'; -import { TextBox } from '@components/text-box'; +import { Spacing } from '@components/atom/spacing'; +import { TextBox } from '@components/atom/text-box'; import { Divider } from 'antd'; import styled from 'styled-components'; import { CouponPreviewItemProps } from './type'; -import { numberFormat, removeNumberFormat } from '@/utils/Format/numberFormat'; +import { + numberFormat, + removeNumberFormat, +} from '@/utils/formatiing/numberFormat'; import { useRecoilValue } from 'recoil'; import { determinedPriceState, @@ -14,7 +17,7 @@ import { FLAT_DISCOUNT_TYPE, RATE_DISCOUNT_TYPE, } from '@/constants/coupon-registration'; -import { calculatedCouponPoints } from '@/utils/discountCoupon'; +import { calculatedCouponPoints } from '@/utils/coupon/discountCoupon'; export const CouponPreviewItem = ({ roomName, diff --git a/src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/type.ts b/src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/type.ts new file mode 100644 index 00000000..ba362e97 --- /dev/null +++ b/src/components/domain/coupon-registration/coupon-preview/coupon-preview-item/type.ts @@ -0,0 +1,3 @@ +import { PendingRoomData } from '../../type'; + +export type CouponPreviewItemProps = Partial; diff --git a/src/components/coupon-registration/coupon-preview/index.tsx b/src/components/domain/coupon-registration/coupon-preview/index.tsx similarity index 95% rename from src/components/coupon-registration/coupon-preview/index.tsx rename to src/components/domain/coupon-registration/coupon-preview/index.tsx index 6b77d35a..22065b12 100644 --- a/src/components/coupon-registration/coupon-preview/index.tsx +++ b/src/components/domain/coupon-registration/coupon-preview/index.tsx @@ -1,11 +1,13 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import { CouponPreviewItem } from './coupon-preview-item'; -import { Spacing } from '@components/spacing'; import { Button, Checkbox } from 'antd'; import { PendingRoomDataList, SelectedDiscountType } from '../type'; -import { numberFormat, removeNumberFormat } from '@/utils/Format/numberFormat'; +import { + numberFormat, + removeNumberFormat, +} from '@/utils/formatiing/numberFormat'; import { useRecoilState, useRecoilValue } from 'recoil'; import { determinedPriceState, @@ -19,8 +21,9 @@ import { import { FLAT_DISCOUNT_TYPE } from '@/constants/coupon-registration'; import { useEffect, useState } from 'react'; import { MouseEvent } from '@/types/event'; -import { CouponAgreementModal } from '@components/agreement-modal/coupon-agreement-modal'; -import { calculatedCouponPoints } from '@/utils/discountCoupon'; +import { CouponAgreementModal } from '@components/domain/agreement-modal/coupon-agreement-modal'; +import { calculatedCouponPoints } from '@/utils/coupon/discountCoupon'; +import { Spacing } from '@components/atom/spacing'; export const CouponPreview = () => { const selectedDiscountType = useRecoilValue(selectedDiscountTypeState); diff --git a/src/components/coupon-registration/coupon-preview/type.ts b/src/components/domain/coupon-registration/coupon-preview/type.ts similarity index 100% rename from src/components/coupon-registration/coupon-preview/type.ts rename to src/components/domain/coupon-registration/coupon-preview/type.ts diff --git a/src/components/coupon-registration/discount-type/index.tsx b/src/components/domain/coupon-registration/discount-type/index.tsx similarity index 95% rename from src/components/coupon-registration/discount-type/index.tsx rename to src/components/domain/coupon-registration/discount-type/index.tsx index 9fcd73a6..24e3813c 100644 --- a/src/components/coupon-registration/discount-type/index.tsx +++ b/src/components/domain/coupon-registration/discount-type/index.tsx @@ -1,8 +1,8 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import { Input } from 'antd'; -import { Spacing } from '@components/spacing'; +import { Spacing } from '@components/atom/spacing'; import { FLAT_DISCOUNT, FLAT_DISCOUNT_TYPE, @@ -10,10 +10,13 @@ import { RATE_DISCOUNT_TYPE, } from '@/constants/coupon-registration'; import { useEffect, useState } from 'react'; -import { numberFormat, removeNumberFormat } from '@/utils/Format/numberFormat'; +import { + numberFormat, + removeNumberFormat, +} from '@/utils/formatiing/numberFormat'; import { InputChangeEvent, MouseEvent } from '@/types/event'; -import { isNumber } from '@/utils/is-number'; -import { handleEnterKeyDown } from '@/utils/keydown/handleEnterKeyDown'; +import { isNumber } from '@/utils/check-type'; +import { handleEnterKeyDown } from '@/utils/event/handleEnterKeyDown'; import { useRecoilState, useSetRecoilState } from 'recoil'; import { determinedPriceState, diff --git a/src/components/coupon-registration/type.ts b/src/components/domain/coupon-registration/type.ts similarity index 100% rename from src/components/coupon-registration/type.ts rename to src/components/domain/coupon-registration/type.ts diff --git a/src/components/coupon/additional-purchase-content/index.tsx b/src/components/domain/coupon/additional-purchase-content/index.tsx similarity index 97% rename from src/components/coupon/additional-purchase-content/index.tsx rename to src/components/domain/coupon/additional-purchase-content/index.tsx index aab9bbff..dd6cd2ce 100644 --- a/src/components/coupon/additional-purchase-content/index.tsx +++ b/src/components/domain/coupon/additional-purchase-content/index.tsx @@ -1,7 +1,6 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Checkbox, Input } from 'antd'; -import React from 'react'; import styled from 'styled-components'; import { AdditionalPurchaseInfo } from '../additional-purchase-info'; import { PurchaseContentProps } from './type'; diff --git a/src/components/coupon/additional-purchase-content/type.ts b/src/components/domain/coupon/additional-purchase-content/type.ts similarity index 100% rename from src/components/coupon/additional-purchase-content/type.ts rename to src/components/domain/coupon/additional-purchase-content/type.ts diff --git a/src/components/coupon/additional-purchase-footer/index.tsx b/src/components/domain/coupon/additional-purchase-footer/index.tsx similarity index 93% rename from src/components/coupon/additional-purchase-footer/index.tsx rename to src/components/domain/coupon/additional-purchase-footer/index.tsx index fac4c422..e4dd6ac6 100644 --- a/src/components/coupon/additional-purchase-footer/index.tsx +++ b/src/components/domain/coupon/additional-purchase-footer/index.tsx @@ -1,10 +1,10 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, Checkbox } from 'antd'; import styled from 'styled-components'; import { PurchaseFooterProps } from './type'; import { useState } from 'react'; -import { CouponAgreementModal } from '@components/agreement-modal/coupon-agreement-modal'; +import { CouponAgreementModal } from '@components/domain/agreement-modal/coupon-agreement-modal'; export const AdditionalPurchaseFooter = ({ totalPoints, diff --git a/src/components/coupon/additional-purchase-footer/type.ts b/src/components/domain/coupon/additional-purchase-footer/type.ts similarity index 100% rename from src/components/coupon/additional-purchase-footer/type.ts rename to src/components/domain/coupon/additional-purchase-footer/type.ts diff --git a/src/components/coupon/additional-purchase-info/index.tsx b/src/components/domain/coupon/additional-purchase-info/index.tsx similarity index 96% rename from src/components/coupon/additional-purchase-info/index.tsx rename to src/components/domain/coupon/additional-purchase-info/index.tsx index 904a4fed..624abc09 100644 --- a/src/components/coupon/additional-purchase-info/index.tsx +++ b/src/components/domain/coupon/additional-purchase-info/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Input } from 'antd'; import styled from 'styled-components'; import { PurchaseInfoProps } from './type'; diff --git a/src/components/coupon/additional-purchase-info/type.ts b/src/components/domain/coupon/additional-purchase-info/type.ts similarity index 100% rename from src/components/coupon/additional-purchase-info/type.ts rename to src/components/domain/coupon/additional-purchase-info/type.ts diff --git a/src/components/coupon/coupon-header/index.tsx b/src/components/domain/coupon/coupon-header/index.tsx similarity index 99% rename from src/components/coupon/coupon-header/index.tsx rename to src/components/domain/coupon/coupon-header/index.tsx index 0fda0e9b..f97ee00e 100644 --- a/src/components/coupon/coupon-header/index.tsx +++ b/src/components/domain/coupon/coupon-header/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { DeleteOutlined, InfoCircleOutlined } from '@ant-design/icons'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, ConfigProvider, DatePicker, Select, Tooltip } from 'antd'; import { RangePickerProps } from 'antd/lib/date-picker'; import AdditionalBuyLogo from '@assets/image/additionalBuyLogo.png'; diff --git a/src/components/coupon/coupon-header/type.ts b/src/components/domain/coupon/coupon-header/type.ts similarity index 100% rename from src/components/coupon/coupon-header/type.ts rename to src/components/domain/coupon/coupon-header/type.ts diff --git a/src/components/coupon/coupon-status-tag/index.tsx b/src/components/domain/coupon/coupon-status-tag/index.tsx similarity index 96% rename from src/components/coupon/coupon-status-tag/index.tsx rename to src/components/domain/coupon/coupon-status-tag/index.tsx index a955f2f2..3667c1a6 100644 --- a/src/components/coupon/coupon-status-tag/index.tsx +++ b/src/components/domain/coupon/coupon-status-tag/index.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; import { CouponTagProps, StyledCouponTagProps } from './type'; import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { COUPON_STATUS_DISABLE, COUPON_STATUS_ENABLE, diff --git a/src/components/coupon/coupon-status-tag/type.ts b/src/components/domain/coupon/coupon-status-tag/type.ts similarity index 100% rename from src/components/coupon/coupon-status-tag/type.ts rename to src/components/domain/coupon/coupon-status-tag/type.ts diff --git a/src/components/coupon/not-found-coupon/index.tsx b/src/components/domain/coupon/not-found-coupon/index.tsx similarity index 96% rename from src/components/coupon/not-found-coupon/index.tsx rename to src/components/domain/coupon/not-found-coupon/index.tsx index 0866f979..efce307f 100644 --- a/src/components/coupon/not-found-coupon/index.tsx +++ b/src/components/domain/coupon/not-found-coupon/index.tsx @@ -1,5 +1,5 @@ import { ROUTES } from '@/constants/routes'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button } from 'antd'; import { useNavigate, useParams } from 'react-router-dom'; import styled from 'styled-components'; diff --git a/src/components/coupon/table-cell/index.tsx b/src/components/domain/coupon/table-cell/index.tsx similarity index 98% rename from src/components/coupon/table-cell/index.tsx rename to src/components/domain/coupon/table-cell/index.tsx index b52626da..328746f0 100644 --- a/src/components/coupon/table-cell/index.tsx +++ b/src/components/domain/coupon/table-cell/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Input, Tooltip } from 'antd'; import styled from 'styled-components'; import { diff --git a/src/components/coupon/table-cell/type.ts b/src/components/domain/coupon/table-cell/type.ts similarity index 100% rename from src/components/coupon/table-cell/type.ts rename to src/components/domain/coupon/table-cell/type.ts diff --git a/src/components/coupon/table/index.tsx b/src/components/domain/coupon/table/index.tsx similarity index 98% rename from src/components/coupon/table/index.tsx rename to src/components/domain/coupon/table/index.tsx index ee15ddc0..cf5339d3 100644 --- a/src/components/coupon/table/index.tsx +++ b/src/components/domain/coupon/table/index.tsx @@ -9,7 +9,7 @@ import { } from '../table-cell'; import { CouponStatusTag } from '../coupon-status-tag'; import { Select } from 'antd'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { TableProps, couponTableProps, tableData } from './type'; import { couponNameContainerProps, diff --git a/src/components/coupon/table/type.ts b/src/components/domain/coupon/table/type.ts similarity index 100% rename from src/components/coupon/table/type.ts rename to src/components/domain/coupon/table/type.ts diff --git a/src/components/init/ButtonContainer.tsx b/src/components/domain/init/ButtonContainer.tsx similarity index 99% rename from src/components/init/ButtonContainer.tsx rename to src/components/domain/init/ButtonContainer.tsx index f20547bb..dd08bd70 100644 --- a/src/components/init/ButtonContainer.tsx +++ b/src/components/domain/init/ButtonContainer.tsx @@ -5,7 +5,7 @@ import { ButtonContainerProps, ButtonContainerStyledWrapperProps, } from './type'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { ROUTES } from '@/constants/routes'; import { useRecoilState, useSetRecoilState } from 'recoil'; import { diff --git a/src/components/init/CheckBoxContainer.tsx b/src/components/domain/init/CheckBoxContainer.tsx similarity index 98% rename from src/components/init/CheckBoxContainer.tsx rename to src/components/domain/init/CheckBoxContainer.tsx index 5b35b859..187dcba7 100644 --- a/src/components/init/CheckBoxContainer.tsx +++ b/src/components/domain/init/CheckBoxContainer.tsx @@ -1,5 +1,5 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Checkbox, Form } from 'antd'; import styled from 'styled-components'; import { CheckBoxContainerProps } from './type'; diff --git a/src/components/init/FormErrorMessage.tsx b/src/components/domain/init/FormErrorMessage.tsx similarity index 78% rename from src/components/init/FormErrorMessage.tsx rename to src/components/domain/init/FormErrorMessage.tsx index 41dbd40f..6eaf1cfc 100644 --- a/src/components/init/FormErrorMessage.tsx +++ b/src/components/domain/init/FormErrorMessage.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; export const FormErrorMessage = ({ errorMessage, diff --git a/src/components/init/ImageUploadContainer.tsx b/src/components/domain/init/ImageUploadContainer.tsx similarity index 99% rename from src/components/init/ImageUploadContainer.tsx rename to src/components/domain/init/ImageUploadContainer.tsx index 3f13f307..6f081fe6 100644 --- a/src/components/init/ImageUploadContainer.tsx +++ b/src/components/domain/init/ImageUploadContainer.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { message } from 'antd'; import { styled } from 'styled-components'; import { CloseCircleTwoTone, PlusOutlined } from '@ant-design/icons'; diff --git a/src/components/init/NameContainer.tsx b/src/components/domain/init/NameContainer.tsx similarity index 97% rename from src/components/init/NameContainer.tsx rename to src/components/domain/init/NameContainer.tsx index 52f6928e..1c52ae1d 100644 --- a/src/components/init/NameContainer.tsx +++ b/src/components/domain/init/NameContainer.tsx @@ -7,7 +7,7 @@ import { ACCOMMODATION_NAME_MIN_LENGTH, } from '@/constants/init/init-accommodation-registration'; import { NAME_REGEX } from '@/constants/init'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; export const NameContainer = ({ header, diff --git a/src/components/init/init-accommodation-registration/AccommodationAddress.tsx b/src/components/domain/init/init-accommodation-registration/AccommodationAddress.tsx similarity index 95% rename from src/components/init/init-accommodation-registration/AccommodationAddress.tsx rename to src/components/domain/init/init-accommodation-registration/AccommodationAddress.tsx index 9afd655b..db7e35d6 100644 --- a/src/components/init/init-accommodation-registration/AccommodationAddress.tsx +++ b/src/components/domain/init/init-accommodation-registration/AccommodationAddress.tsx @@ -1,10 +1,10 @@ import { styled } from 'styled-components'; import { Input, Button, Form } from 'antd'; import { ChangeEvent, useState } from 'react'; -import { AddressFormat } from '@components/init/init-accommodation-registration/type'; +import { AddressFormat } from '@components/domain/init/init-accommodation-registration/type'; import { useDaumPostcodePopup } from 'react-daum-postcode'; import { ADDRESS_TYPE_ROAD } from '@/constants/init/init-accommodation-registration'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { FormInstance } from 'antd/es/form/Form'; export const AccommodationAddress = ({ form }: { form: FormInstance }) => { diff --git a/src/components/init/init-accommodation-registration/AccommodationCategory.tsx b/src/components/domain/init/init-accommodation-registration/AccommodationCategory.tsx similarity index 99% rename from src/components/init/init-accommodation-registration/AccommodationCategory.tsx rename to src/components/domain/init/init-accommodation-registration/AccommodationCategory.tsx index b361e4e8..e983e81c 100644 --- a/src/components/init/init-accommodation-registration/AccommodationCategory.tsx +++ b/src/components/domain/init/init-accommodation-registration/AccommodationCategory.tsx @@ -7,7 +7,7 @@ import grayHotelResortIcon from '@assets/image/grayHotel_resort.png'; import grayMotelIcon from '@assets/image/grayMotel.png'; import grayPensionPoolIcon from '@assets/image/grayPension_pool.png'; import grayGuestHouseIcon from '@assets/image/grayGuestHouse.png'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { useEffect, useState } from 'react'; import { AccommodationCategoryType } from './type'; import { FaCheck } from 'react-icons/fa'; diff --git a/src/components/init/init-accommodation-registration/AccommodationDesc.tsx b/src/components/domain/init/init-accommodation-registration/AccommodationDesc.tsx similarity index 96% rename from src/components/init/init-accommodation-registration/AccommodationDesc.tsx rename to src/components/domain/init/init-accommodation-registration/AccommodationDesc.tsx index 09e1088f..c319ca68 100644 --- a/src/components/init/init-accommodation-registration/AccommodationDesc.tsx +++ b/src/components/domain/init/init-accommodation-registration/AccommodationDesc.tsx @@ -5,7 +5,7 @@ import { ACCOMMODATION_DESC_MAX_LENGTH, ACCOMMODATION_DESC_MIN_LENGTH, } from '@/constants/init/init-accommodation-registration'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { FormInstance } from 'antd/es/form/Form'; export const AccommodationDesc = ({ form }: { form: FormInstance }) => { diff --git a/src/components/init/init-accommodation-registration/RadioButtonCustomContainer.tsx b/src/components/domain/init/init-accommodation-registration/RadioButtonCustomContainer.tsx similarity index 98% rename from src/components/init/init-accommodation-registration/RadioButtonCustomContainer.tsx rename to src/components/domain/init/init-accommodation-registration/RadioButtonCustomContainer.tsx index 07deea1c..7ea60a36 100644 --- a/src/components/init/init-accommodation-registration/RadioButtonCustomContainer.tsx +++ b/src/components/domain/init/init-accommodation-registration/RadioButtonCustomContainer.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { AccommodationDetailCategoryProps } from './type'; import styled from 'styled-components'; import { Form, Radio, RadioChangeEvent } from 'antd'; diff --git a/src/components/init/init-accommodation-registration/type.ts b/src/components/domain/init/init-accommodation-registration/type.ts similarity index 100% rename from src/components/init/init-accommodation-registration/type.ts rename to src/components/domain/init/init-accommodation-registration/type.ts diff --git a/src/components/init/init-info-confirmation/AccommodationInfo.tsx b/src/components/domain/init/init-info-confirmation/AccommodationInfo.tsx similarity index 99% rename from src/components/init/init-info-confirmation/AccommodationInfo.tsx rename to src/components/domain/init/init-info-confirmation/AccommodationInfo.tsx index 265a8015..1073e1a0 100644 --- a/src/components/init/init-info-confirmation/AccommodationInfo.tsx +++ b/src/components/domain/init/init-info-confirmation/AccommodationInfo.tsx @@ -1,5 +1,5 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { List } from 'antd'; import styled from 'styled-components'; import { EditOutlined } from '@ant-design/icons'; diff --git a/src/components/init/init-info-confirmation/CustomButton.tsx b/src/components/domain/init/init-info-confirmation/CustomButton.tsx similarity index 100% rename from src/components/init/init-info-confirmation/CustomButton.tsx rename to src/components/domain/init/init-info-confirmation/CustomButton.tsx diff --git a/src/components/init/init-info-confirmation/ImageCarousel.tsx b/src/components/domain/init/init-info-confirmation/ImageCarousel.tsx similarity index 100% rename from src/components/init/init-info-confirmation/ImageCarousel.tsx rename to src/components/domain/init/init-info-confirmation/ImageCarousel.tsx diff --git a/src/components/init/init-info-confirmation/RoomInfo.tsx b/src/components/domain/init/init-info-confirmation/RoomInfo.tsx similarity index 97% rename from src/components/init/init-info-confirmation/RoomInfo.tsx rename to src/components/domain/init/init-info-confirmation/RoomInfo.tsx index 14897ee9..bdb846b0 100644 --- a/src/components/init/init-info-confirmation/RoomInfo.tsx +++ b/src/components/domain/init/init-info-confirmation/RoomInfo.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button } from 'antd'; import styled from 'styled-components'; import { RoomItem } from './RoomItem'; diff --git a/src/components/init/init-info-confirmation/RoomItem.tsx b/src/components/domain/init/init-info-confirmation/RoomItem.tsx similarity index 99% rename from src/components/init/init-info-confirmation/RoomItem.tsx rename to src/components/domain/init/init-info-confirmation/RoomItem.tsx index cc4df346..58e5d2bb 100644 --- a/src/components/init/init-info-confirmation/RoomItem.tsx +++ b/src/components/domain/init/init-info-confirmation/RoomItem.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Modal, Tag, message } from 'antd'; import styled from 'styled-components'; import { colors } from '@/constants/colors'; diff --git a/src/components/init/init-info-confirmation/type.ts b/src/components/domain/init/init-info-confirmation/type.ts similarity index 100% rename from src/components/init/init-info-confirmation/type.ts rename to src/components/domain/init/init-info-confirmation/type.ts diff --git a/src/components/init/type.ts b/src/components/domain/init/type.ts similarity index 100% rename from src/components/init/type.ts rename to src/components/domain/init/type.ts diff --git a/src/components/main/coupon-navigation-container/index.tsx b/src/components/domain/main/coupon-navigation-container/index.tsx similarity index 96% rename from src/components/main/coupon-navigation-container/index.tsx rename to src/components/domain/main/coupon-navigation-container/index.tsx index d7b4f7aa..870dc620 100644 --- a/src/components/main/coupon-navigation-container/index.tsx +++ b/src/components/domain/main/coupon-navigation-container/index.tsx @@ -2,7 +2,7 @@ import { colors } from '@/constants/colors'; import { Button, Image } from 'antd'; import coinImage from '@assets/image/mainCoinImage.png'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { RightOutlined } from '@ant-design/icons'; import { CouponRegistrationContainerProps } from './type'; diff --git a/src/components/main/coupon-navigation-container/type.ts b/src/components/domain/main/coupon-navigation-container/type.ts similarity index 100% rename from src/components/main/coupon-navigation-container/type.ts rename to src/components/domain/main/coupon-navigation-container/type.ts diff --git a/src/components/main/main-chart/index.tsx b/src/components/domain/main/main-chart/index.tsx similarity index 98% rename from src/components/main/main-chart/index.tsx rename to src/components/domain/main/main-chart/index.tsx index a359946f..c2614424 100644 --- a/src/components/main/main-chart/index.tsx +++ b/src/components/domain/main/main-chart/index.tsx @@ -3,7 +3,7 @@ import { colors } from '@/constants/colors'; import { Column } from '@ant-design/plots'; import { ShapeAttrs } from '@antv/g-base'; import { Space } from 'antd'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { mainChartProps } from './type'; export const MainChart = ({ revenueData, couponMessage }: mainChartProps) => { diff --git a/src/components/main/main-chart/type.ts b/src/components/domain/main/main-chart/type.ts similarity index 100% rename from src/components/main/main-chart/type.ts rename to src/components/domain/main/main-chart/type.ts diff --git a/src/components/main/main-coupon-status-container/index.tsx b/src/components/domain/main/main-coupon-status-container/index.tsx similarity index 98% rename from src/components/main/main-coupon-status-container/index.tsx rename to src/components/domain/main/main-coupon-status-container/index.tsx index d5f324db..f35d7223 100644 --- a/src/components/main/main-coupon-status-container/index.tsx +++ b/src/components/domain/main/main-coupon-status-container/index.tsx @@ -2,7 +2,7 @@ import { colors } from '@/constants/colors'; import { Button } from 'antd'; import { RightOutlined } from '@ant-design/icons'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { MainCouponStatusContainerProps } from './type'; export const MainCouponStatusContainer = ({ diff --git a/src/components/main/main-coupon-status-container/type.ts b/src/components/domain/main/main-coupon-status-container/type.ts similarity index 50% rename from src/components/main/main-coupon-status-container/type.ts rename to src/components/domain/main/main-coupon-status-container/type.ts index 70dd1a28..3c4d9cc8 100644 --- a/src/components/main/main-coupon-status-container/type.ts +++ b/src/components/domain/main/main-coupon-status-container/type.ts @@ -1,6 +1,6 @@ -import { staticsData } from '@api/coupon/type'; +import { StaticsData } from '@api/coupon/type'; export type MainCouponStatusContainerProps = { - staticsData: staticsData | ''; + staticsData: StaticsData | ''; navigateCoupon: VoidFunction; }; diff --git a/src/components/main/user-guide-navigation-container/index.tsx b/src/components/domain/main/user-guide-navigation-container/index.tsx similarity index 96% rename from src/components/main/user-guide-navigation-container/index.tsx rename to src/components/domain/main/user-guide-navigation-container/index.tsx index ac5c6758..50b6a351 100644 --- a/src/components/main/user-guide-navigation-container/index.tsx +++ b/src/components/domain/main/user-guide-navigation-container/index.tsx @@ -1,5 +1,5 @@ import { RightOutlined } from '@ant-design/icons'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, Image } from 'antd'; import womanImage from '@assets/image/mainWomanImage.png'; import styled from 'styled-components'; diff --git a/src/components/main/user-guide-navigation-container/type.ts b/src/components/domain/main/user-guide-navigation-container/type.ts similarity index 100% rename from src/components/main/user-guide-navigation-container/type.ts rename to src/components/domain/main/user-guide-navigation-container/type.ts diff --git a/src/components/point-charge-modal/info-container/index.tsx b/src/components/domain/point-charge-modal/info-container/index.tsx similarity index 95% rename from src/components/point-charge-modal/info-container/index.tsx rename to src/components/domain/point-charge-modal/info-container/index.tsx index dbb22efc..2f9d6387 100644 --- a/src/components/point-charge-modal/info-container/index.tsx +++ b/src/components/domain/point-charge-modal/info-container/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Space } from 'antd'; import styled from 'styled-components'; diff --git a/src/components/point-charge-modal/point-modal/index.tsx b/src/components/domain/point-charge-modal/point-modal/index.tsx similarity index 96% rename from src/components/point-charge-modal/point-modal/index.tsx rename to src/components/domain/point-charge-modal/point-modal/index.tsx index df7794d2..40911a84 100644 --- a/src/components/point-charge-modal/point-modal/index.tsx +++ b/src/components/domain/point-charge-modal/point-modal/index.tsx @@ -10,8 +10,11 @@ import { } from 'antd'; import { useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; -import { numberFormat, removeNumberFormat } from '@/utils/Format/numberFormat'; -import { TextBox } from '@components/text-box'; +import { + numberFormat, + removeNumberFormat, +} from '@/utils/formatiing/numberFormat'; +import { TextBox } from '@components/atom/text-box'; import { InfoContainer } from '../info-container'; import { ExclamationCircleOutlined } from '@ant-design/icons'; import { colors } from '@/constants/colors'; @@ -21,14 +24,13 @@ import { loadPaymentWidget, } from '@tosspayments/payment-widget-sdk'; import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; -import { isNumber } from '@/utils/isNumber'; -import { orderNumber } from '@/utils/orderNumber'; import { ROUTES } from '@/constants/routes'; - import { currentUrlState } from '@stores/point-charge-modal'; import { useSetRecoilState } from 'recoil'; import { useLocation } from 'react-router-dom'; -import { PointAgreementModal } from '@components/agreement-modal/point-agreement-modal'; +import { PointAgreementModal } from '@components/domain/agreement-modal/point-agreement-modal'; +import { orderDate } from '@/utils/formatiing/dateFormat'; +import { isNumber } from '@/utils/check-type'; const MINIMUM_PRICE = 10000; const MAXIMUM_PRICE = 10000000; @@ -161,7 +163,7 @@ export const PointModal = ({ try { await paymentWidget?.requestPayment({ - orderId: orderNumber(), + orderId: orderDate(), orderName: '포인트 충전', successUrl: `${window.location.origin}${ROUTES.TOSS_SUCCESS}`, failUrl: `${window.location.origin}${ROUTES.TOSS_FAIL}`, diff --git a/src/components/point-charge-modal/point-modal/types.ts b/src/components/domain/point-charge-modal/point-modal/types.ts similarity index 100% rename from src/components/point-charge-modal/point-modal/types.ts rename to src/components/domain/point-charge-modal/point-modal/types.ts diff --git a/src/components/point-detail/badge/index.tsx b/src/components/domain/point-detail/badge/index.tsx similarity index 88% rename from src/components/point-detail/badge/index.tsx rename to src/components/domain/point-detail/badge/index.tsx index f8d16dde..76dd92d8 100644 --- a/src/components/point-detail/badge/index.tsx +++ b/src/components/domain/point-detail/badge/index.tsx @@ -1,9 +1,9 @@ import { colors } from '@/constants/colors'; import { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { badgeProps } from './types'; +import { BadgeProps } from './types'; -export const OrderStatusBadge = ({ status }: { status: badgeProps }) => { +export const OrderStatusBadge = ({ status }: { status: BadgeProps }) => { const [color, setColor] = useState(''); useEffect(() => { diff --git a/src/components/domain/point-detail/badge/types.ts b/src/components/domain/point-detail/badge/types.ts new file mode 100644 index 00000000..c7dd6bee --- /dev/null +++ b/src/components/domain/point-detail/badge/types.ts @@ -0,0 +1 @@ +export type BadgeProps = '구매 확정' | '결제 완료' | '취소 완료'; diff --git a/src/components/point-detail/index.tsx b/src/components/domain/point-detail/index.tsx similarity index 94% rename from src/components/point-detail/index.tsx rename to src/components/domain/point-detail/index.tsx index f6b30363..f7e00461 100644 --- a/src/components/point-detail/index.tsx +++ b/src/components/domain/point-detail/index.tsx @@ -4,7 +4,7 @@ import { PageComp } from './page'; import { pointDetailDataState } from '@stores/point-detail/atoms'; import { useRecoilValue } from 'recoil'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; export const PointDetailComp = () => { const pointDetailData = useRecoilValue(pointDetailDataState); diff --git a/src/components/point-detail/page/index.tsx b/src/components/domain/point-detail/page/index.tsx similarity index 100% rename from src/components/point-detail/page/index.tsx rename to src/components/domain/point-detail/page/index.tsx diff --git a/src/components/point-detail/payment/cancel/index.tsx b/src/components/domain/point-detail/payment/cancel/index.tsx similarity index 98% rename from src/components/point-detail/payment/cancel/index.tsx rename to src/components/domain/point-detail/payment/cancel/index.tsx index 174f7025..d5c0fbd2 100644 --- a/src/components/point-detail/payment/cancel/index.tsx +++ b/src/components/domain/point-detail/payment/cancel/index.tsx @@ -1,6 +1,6 @@ import { Button, Layout, Modal } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { OrderInfo } from '../common/order-info'; import { OrderPointInfo } from '../common/order-point-info'; import { CompanyInfo } from '../common/company-info'; diff --git a/src/components/point-detail/payment/common/company-info/index.tsx b/src/components/domain/point-detail/payment/common/company-info/index.tsx similarity index 90% rename from src/components/point-detail/payment/common/company-info/index.tsx rename to src/components/domain/point-detail/payment/common/company-info/index.tsx index b63f69df..7aac9275 100644 --- a/src/components/point-detail/payment/common/company-info/index.tsx +++ b/src/components/domain/point-detail/payment/common/company-info/index.tsx @@ -1,7 +1,7 @@ import { colors } from '@/constants/colors'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; export const CompanyInfo = () => { return ( diff --git a/src/components/point-detail/payment/common/coupon-info/index.tsx b/src/components/domain/point-detail/payment/common/coupon-info/index.tsx similarity index 95% rename from src/components/point-detail/payment/common/coupon-info/index.tsx rename to src/components/domain/point-detail/payment/common/coupon-info/index.tsx index 2221a52c..4a04e167 100644 --- a/src/components/point-detail/payment/common/coupon-info/index.tsx +++ b/src/components/domain/point-detail/payment/common/coupon-info/index.tsx @@ -1,9 +1,9 @@ import { Space } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { pointDetailDataState } from '@stores/point-detail/atoms'; import { useRecoilValue } from 'recoil'; -import { numberFormat } from '@/utils/Format/numberFormat'; +import { numberFormat } from '@/utils/formatiing/numberFormat'; export const CouponInfo = ({ index }: { index: number }) => { const pointDetailData = useRecoilValue(pointDetailDataState); diff --git a/src/components/point-detail/payment/common/order-info/index.tsx b/src/components/domain/point-detail/payment/common/order-info/index.tsx similarity index 95% rename from src/components/point-detail/payment/common/order-info/index.tsx rename to src/components/domain/point-detail/payment/common/order-info/index.tsx index ed5c5e1b..9d346c39 100644 --- a/src/components/point-detail/payment/common/order-info/index.tsx +++ b/src/components/domain/point-detail/payment/common/order-info/index.tsx @@ -1,5 +1,5 @@ import { Space } from 'antd'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import { useRecoilValue } from 'recoil'; import { pointDetailDataState } from '@stores/point-detail/atoms'; diff --git a/src/components/point-detail/payment/common/order-point-info/index.tsx b/src/components/domain/point-detail/payment/common/order-point-info/index.tsx similarity index 91% rename from src/components/point-detail/payment/common/order-point-info/index.tsx rename to src/components/domain/point-detail/payment/common/order-point-info/index.tsx index 837f6464..bcbf5b05 100644 --- a/src/components/point-detail/payment/common/order-point-info/index.tsx +++ b/src/components/domain/point-detail/payment/common/order-point-info/index.tsx @@ -1,18 +1,18 @@ import { Space, Divider } from 'antd'; import { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { colors } from '@/constants/colors'; -import { orderInfoProps } from './types'; +import { OrderInfoProps } from './types'; import { useRecoilValue } from 'recoil'; import { pointDetailDataState } from '@stores/point-detail/atoms'; -import { numberFormat } from '@/utils/Format/numberFormat'; +import { numberFormat } from '@/utils/formatiing/numberFormat'; export const OrderPointInfo = ({ pointCharge, index, status, -}: orderInfoProps) => { +}: OrderInfoProps) => { const [isCancelStatus, setIscancelStatus] = useState(false); useEffect(() => { diff --git a/src/components/point-detail/payment/common/order-point-info/types.tsx b/src/components/domain/point-detail/payment/common/order-point-info/types.ts similarity index 75% rename from src/components/point-detail/payment/common/order-point-info/types.tsx rename to src/components/domain/point-detail/payment/common/order-point-info/types.ts index d4853d96..ac33c7ad 100644 --- a/src/components/point-detail/payment/common/order-point-info/types.tsx +++ b/src/components/domain/point-detail/payment/common/order-point-info/types.ts @@ -1,4 +1,4 @@ -export interface orderInfoProps { +export interface OrderInfoProps { pointCharge: boolean; index: number; status?: '결제 완료' | '취소 완료' | '구매 확정'; diff --git a/src/components/point-detail/payment/receipt/index.tsx b/src/components/domain/point-detail/payment/receipt/index.tsx similarity index 98% rename from src/components/point-detail/payment/receipt/index.tsx rename to src/components/domain/point-detail/payment/receipt/index.tsx index 283df937..8955ac8a 100644 --- a/src/components/point-detail/payment/receipt/index.tsx +++ b/src/components/domain/point-detail/payment/receipt/index.tsx @@ -1,6 +1,6 @@ import { Layout, Modal } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { OrderInfo } from '../common/order-info'; import { CouponInfo } from '../common/coupon-info'; import { OrderPointInfo } from '../common/order-point-info'; diff --git a/src/components/point-detail/payment/receipt/types.ts b/src/components/domain/point-detail/payment/receipt/types.ts similarity index 100% rename from src/components/point-detail/payment/receipt/types.ts rename to src/components/domain/point-detail/payment/receipt/types.ts diff --git a/src/components/point-detail/point-box/index.tsx b/src/components/domain/point-detail/point-box/index.tsx similarity index 97% rename from src/components/point-detail/point-box/index.tsx rename to src/components/domain/point-detail/point-box/index.tsx index 201f8db3..cc633ea5 100644 --- a/src/components/point-detail/point-box/index.tsx +++ b/src/components/domain/point-detail/point-box/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Layout, Space } from 'antd'; import styled from 'styled-components'; import { @@ -10,7 +10,7 @@ import { } from '@stores/point-detail/atoms'; import { useRecoilState } from 'recoil'; -import { numberFormat } from '@/utils/Format/numberFormat'; +import { numberFormat } from '@/utils/formatiing/numberFormat'; const MONTH_JANUARY = 1; const MONTH_DECEMBER = 12; diff --git a/src/components/point-detail/point-detail-list/index.tsx b/src/components/domain/point-detail/point-detail-list/index.tsx similarity index 97% rename from src/components/point-detail/point-detail-list/index.tsx rename to src/components/domain/point-detail/point-detail-list/index.tsx index 339a7b41..e160a2e3 100644 --- a/src/components/point-detail/point-detail-list/index.tsx +++ b/src/components/domain/point-detail/point-detail-list/index.tsx @@ -1,15 +1,15 @@ import { Button, Layout } from 'antd'; import styled from 'styled-components'; import { OrderStatusBadge } from '../badge'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { colors } from '@/constants/colors'; import { useRecoilValue } from 'recoil'; import { pointDetailDataState } from '@stores/point-detail/atoms'; import { ReceiptModal } from '../payment/receipt'; import { useState } from 'react'; -import { numberFormat } from '@/utils/Format/numberFormat'; +import { numberFormat } from '@/utils/formatiing/numberFormat'; import { CancelModal } from '../payment/cancel'; -import { formatDate } from '@/utils/dateFormat/dateFormat'; +import { formatDate } from '@/utils/formatiing/dateFormat'; export const PointDetailList = () => { const pointDetailData = useRecoilValue(pointDetailDataState); diff --git a/src/components/point-detail/point-detail-menu/index.tsx b/src/components/domain/point-detail/point-detail-menu/index.tsx similarity index 93% rename from src/components/point-detail/point-detail-menu/index.tsx rename to src/components/domain/point-detail/point-detail-menu/index.tsx index 9c875155..e6d1b37e 100644 --- a/src/components/point-detail/point-detail-menu/index.tsx +++ b/src/components/domain/point-detail/point-detail-menu/index.tsx @@ -4,13 +4,13 @@ import styled from 'styled-components'; import { colors } from '@/constants/colors'; import { menuStatusState, pageNumState } from '@stores/point-detail/atoms'; import { useRecoilState, useSetRecoilState } from 'recoil'; -import { menuStatusType } from '@api/point-detail/get-point-detail/type'; +import { MenuStatusType } from '@api/point-detail/get-point-detail/type'; export const PointMenu = () => { const [menuStatus, setMenuStatus] = useRecoilState(menuStatusState); const setPageNum = useSetRecoilState(pageNumState); - const handleClickMenuButton = (status: menuStatusType) => { + const handleClickMenuButton = (status: MenuStatusType) => { setMenuStatus(status); setPageNum(1); }; diff --git a/src/components/room/capacity-container/index.tsx b/src/components/domain/room/capacity-container/index.tsx similarity index 97% rename from src/components/room/capacity-container/index.tsx rename to src/components/domain/room/capacity-container/index.tsx index 3f767e11..a327e417 100644 --- a/src/components/room/capacity-container/index.tsx +++ b/src/components/domain/room/capacity-container/index.tsx @@ -1,8 +1,8 @@ import { useState, useEffect } from 'react'; import { InputNumber, Col, Form } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; -import { FormErrorMessage } from '@components/init/FormErrorMessage'; +import { TextBox } from '@components/atom/text-box'; +import { FormErrorMessage } from '@components/domain/init/FormErrorMessage'; import { ValidateInputProps, CapacityContainerProps } from './type'; import { MAX_CAPACITY, diff --git a/src/components/room/capacity-container/type.ts b/src/components/domain/room/capacity-container/type.ts similarity index 100% rename from src/components/room/capacity-container/type.ts rename to src/components/domain/room/capacity-container/type.ts diff --git a/src/components/room/num-of-rooms-container/index.tsx b/src/components/domain/room/num-of-rooms-container/index.tsx similarity index 98% rename from src/components/room/num-of-rooms-container/index.tsx rename to src/components/domain/room/num-of-rooms-container/index.tsx index 30fece58..48e0a1a4 100644 --- a/src/components/room/num-of-rooms-container/index.tsx +++ b/src/components/domain/room/num-of-rooms-container/index.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { InputNumber, Form } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { NumOfRoomsContainerProps } from './type'; export const CountContainer = ({ header, form }: NumOfRoomsContainerProps) => { diff --git a/src/components/room/num-of-rooms-container/type.ts b/src/components/domain/room/num-of-rooms-container/type.ts similarity index 100% rename from src/components/room/num-of-rooms-container/type.ts rename to src/components/domain/room/num-of-rooms-container/type.ts diff --git a/src/components/room/price-container/index.tsx b/src/components/domain/room/price-container/index.tsx similarity index 96% rename from src/components/room/price-container/index.tsx rename to src/components/domain/room/price-container/index.tsx index 508c630b..df15e0f9 100644 --- a/src/components/room/price-container/index.tsx +++ b/src/components/domain/room/price-container/index.tsx @@ -1,9 +1,9 @@ import { styled } from 'styled-components'; import { Input, Form } from 'antd'; -import { FormErrorMessage } from '@components/init/FormErrorMessage'; +import { FormErrorMessage } from '@components/domain/init/FormErrorMessage'; import { PriceContainerProps, PriceHandleInputChangeProps } from './type'; import { MAX_PRICE, MIN_PRICE } from '@/constants/room/room-registration'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { useRecoilState } from 'recoil'; import { priceHasError } from '@stores/room/atoms'; import { useEffect, useState } from 'react'; diff --git a/src/components/room/price-container/type.ts b/src/components/domain/room/price-container/type.ts similarity index 100% rename from src/components/room/price-container/type.ts rename to src/components/domain/room/price-container/type.ts diff --git a/src/components/room/room-buttons/index.tsx b/src/components/domain/room/room-buttons/index.tsx similarity index 100% rename from src/components/room/room-buttons/index.tsx rename to src/components/domain/room/room-buttons/index.tsx diff --git a/src/components/room/room-buttons/type.ts b/src/components/domain/room/room-buttons/type.ts similarity index 100% rename from src/components/room/room-buttons/type.ts rename to src/components/domain/room/room-buttons/type.ts diff --git a/src/components/room/room-card/index.tsx b/src/components/domain/room/room-card/index.tsx similarity index 98% rename from src/components/room/room-card/index.tsx rename to src/components/domain/room/room-card/index.tsx index 7d6e4ce8..7223b58a 100644 --- a/src/components/room/room-card/index.tsx +++ b/src/components/domain/room/room-card/index.tsx @@ -1,13 +1,13 @@ import { Card, Col, Row, Button, Space, Tag, Image } from 'antd'; import COUPON from '@assets/image/coupon.svg'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { EditOutlined, DeleteOutlined } from '@ant-design/icons'; import styled from 'styled-components'; import { colors } from '@/constants/colors'; import { KoreanOptionNamesType, RoomCardProps } from './type'; import { useNavigate, useParams } from 'react-router-dom'; import { ROUTES } from '@/constants/routes'; -import { ImageCarousel } from '@components/init/init-info-confirmation/ImageCarousel'; +import { ImageCarousel } from '@components/domain/init/init-info-confirmation/ImageCarousel'; const RoomCard = ({ data, handleDeleteRoom }: RoomCardProps) => { const navigate = useNavigate(); diff --git a/src/components/room/room-card/type.ts b/src/components/domain/room/room-card/type.ts similarity index 100% rename from src/components/room/room-card/type.ts rename to src/components/domain/room/room-card/type.ts diff --git a/src/components/room/room-layout/index.tsx b/src/components/domain/room/room-layout/index.tsx similarity index 97% rename from src/components/room/room-layout/index.tsx rename to src/components/domain/room/room-layout/index.tsx index 7aa23524..873ae018 100644 --- a/src/components/room/room-layout/index.tsx +++ b/src/components/domain/room/room-layout/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { ROUTES } from '@/constants/routes'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Outlet, useLocation } from 'react-router-dom'; import { styled } from 'styled-components'; import { RouteConfigProps } from './type'; diff --git a/src/components/room/room-layout/type.ts b/src/components/domain/room/room-layout/type.ts similarity index 100% rename from src/components/room/room-layout/type.ts rename to src/components/domain/room/room-layout/type.ts diff --git a/src/components/room/status-container/index.tsx b/src/components/domain/room/status-container/index.tsx similarity index 96% rename from src/components/room/status-container/index.tsx rename to src/components/domain/room/status-container/index.tsx index c025ef23..7559baa2 100644 --- a/src/components/room/status-container/index.tsx +++ b/src/components/domain/room/status-container/index.tsx @@ -1,7 +1,7 @@ import { Switch, Form } from 'antd'; import { useEffect, useState } from 'react'; import { styled } from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; export const StatusContainer = ({ defaultStatus, diff --git a/src/components/room/time-container/index.tsx b/src/components/domain/room/time-container/index.tsx similarity index 98% rename from src/components/room/time-container/index.tsx rename to src/components/domain/room/time-container/index.tsx index 3b7a3cc1..f147b7a7 100644 --- a/src/components/room/time-container/index.tsx +++ b/src/components/domain/room/time-container/index.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { TimePicker, Form } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { TimeContainerProps } from './type'; import locale from 'antd/es/date-picker/locale/de_DE'; import moment, { Moment } from 'moment'; diff --git a/src/components/room/time-container/type.ts b/src/components/domain/room/time-container/type.ts similarity index 100% rename from src/components/room/time-container/type.ts rename to src/components/domain/room/time-container/type.ts diff --git a/src/components/room/type.ts b/src/components/domain/room/type.ts similarity index 100% rename from src/components/room/type.ts rename to src/components/domain/room/type.ts diff --git a/src/components/sign-up/index.tsx b/src/components/domain/sign-up/index.tsx similarity index 96% rename from src/components/sign-up/index.tsx rename to src/components/domain/sign-up/index.tsx index 78cf4e4a..3b66b7c6 100644 --- a/src/components/sign-up/index.tsx +++ b/src/components/domain/sign-up/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import MainLogo from '@assets/image/logo.png'; import React from 'react'; diff --git a/src/components/error/NotFound.tsx b/src/components/error/NotFound.tsx index 5bac5ab1..1f24790f 100644 --- a/src/components/error/NotFound.tsx +++ b/src/components/error/NotFound.tsx @@ -1,6 +1,6 @@ import { ROUTES } from '@/constants/routes'; import { ACCOMMODATION_API } from '@api/accommodation'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { getCookie, setCookie } from '@hooks/sign-in/useSignIn'; import { Button } from 'antd'; import { useNavigate } from 'react-router-dom'; @@ -14,7 +14,7 @@ export const NotFound = () => { navigate(`/${accommodationId}${ROUTES.MAIN}`); return; } - const { data } = await ACCOMMODATION_API.getAccommodationList(); + const { data } = await ACCOMMODATION_API.accommodationList(); const hasAccommodationData = data.accommodations.length > 0; const accommodationIdData = data.accommodations[0].id; if (hasAccommodationData && accommodationIdData) { diff --git a/src/components/error/ServerError.tsx b/src/components/error/ServerError.tsx index 9d5b8be9..f7420266 100644 --- a/src/components/error/ServerError.tsx +++ b/src/components/error/ServerError.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button } from 'antd'; import styled from 'styled-components'; diff --git a/src/components/layout/footer/index.tsx b/src/components/layout/footer/index.tsx index a6454464..940efdc9 100644 --- a/src/components/layout/footer/index.tsx +++ b/src/components/layout/footer/index.tsx @@ -1,5 +1,5 @@ import { colors } from '@/constants/colors'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Layout } from 'antd'; import React from 'react'; import styled from 'styled-components'; diff --git a/src/components/layout/header/index.tsx b/src/components/layout/header/index.tsx index c6b31622..9f4444f1 100644 --- a/src/components/layout/header/index.tsx +++ b/src/components/layout/header/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { MOBILE_BREAKPOINTS } from '@/constants/mobile'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { getCookie } from '@hooks/sign-in/useSignIn'; import { isCouponModifiedState } from '@stores/coupon/atom'; import { isSideBarOpenState } from '@stores/layout'; diff --git a/src/components/layout/init-layout/InitLayout.tsx b/src/components/layout/init-layout/InitLayout.tsx index 58ebfb00..cb2e3d68 100644 --- a/src/components/layout/init-layout/InitLayout.tsx +++ b/src/components/layout/init-layout/InitLayout.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { ROUTES } from '@/constants/routes'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Layout } from 'antd'; import { Outlet, useLocation } from 'react-router-dom'; import { styled } from 'styled-components'; diff --git a/src/components/layout/side-bar/accommodation-list/index.tsx b/src/components/layout/side-bar/accommodation-list/index.tsx index 560b9848..04fe91d2 100644 --- a/src/components/layout/side-bar/accommodation-list/index.tsx +++ b/src/components/layout/side-bar/accommodation-list/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, Modal } from 'antd'; import styled from 'styled-components'; import { colors } from '@/constants/colors'; diff --git a/src/components/layout/side-bar/navigation/index.tsx b/src/components/layout/side-bar/navigation/index.tsx index d3c8ad4b..3de8c8f4 100644 --- a/src/components/layout/side-bar/navigation/index.tsx +++ b/src/components/layout/side-bar/navigation/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { NavigationMap } from '@/constants/navigation'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { isCouponModifiedState } from '@stores/coupon/atom'; import { Modal } from 'antd'; import { useNavigate } from 'react-router-dom'; diff --git a/src/components/layout/side-bar/signout-btn/index.tsx b/src/components/layout/side-bar/signout-btn/index.tsx index 6b4d60bf..4e4b1b96 100644 --- a/src/components/layout/side-bar/signout-btn/index.tsx +++ b/src/components/layout/side-bar/signout-btn/index.tsx @@ -1,7 +1,7 @@ import { RESPONSE_CODE } from '@/constants/api'; import { ROUTES } from '@/constants/routes'; import { LogoutOutlined } from '@ant-design/icons'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { removeCookie } from '@hooks/sign-in/useSignIn'; import { useDeleteLogout } from '@queries/logout'; import { message } from 'antd'; diff --git a/src/components/layout/side-bar/user-profile/index.tsx b/src/components/layout/side-bar/user-profile/index.tsx index 0ff0fcfc..f51507c5 100644 --- a/src/components/layout/side-bar/user-profile/index.tsx +++ b/src/components/layout/side-bar/user-profile/index.tsx @@ -1,11 +1,11 @@ import { Button, Space } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { colors } from '@/constants/colors'; -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { UserProfileProps } from './type'; -import { numberFormat } from '@/utils/Format/numberFormat'; -import { PointModal } from '@components/point-charge-modal/point-modal'; +import { numberFormat } from '@/utils/formatiing/numberFormat'; +import { PointModal } from '@components/domain/point-charge-modal/point-modal'; export const UserProfile = ({ pointTotalData }: UserProfileProps) => { const [isModalOpen, setIsModalOpen] = useState(false); diff --git a/src/components/point-detail/badge/types.ts b/src/components/point-detail/badge/types.ts deleted file mode 100644 index 4cc69c01..00000000 --- a/src/components/point-detail/badge/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type badgeProps = '구매 확정' | '결제 완료' | '취소 완료'; diff --git a/src/hooks/coupon/type.ts b/src/hooks/coupon/type.ts index e1370d29..6d44138f 100644 --- a/src/hooks/coupon/type.ts +++ b/src/hooks/coupon/type.ts @@ -1,12 +1,12 @@ -import { coupon } from '@api/coupon/type'; -import { tableData } from '@components/coupon/table/type'; +import { Coupon } from '@api/coupon/type'; +import { tableData } from '@components/domain/coupon/table/type'; export type CouponData = { expiry: string; coupons: tableData[]; }; -export type PurchaseCoupons = Omit & { +export type PurchaseCoupons = Omit & { buyQuantity: number; eachPoint: number; points: number; diff --git a/src/hooks/coupon/useCoupon.ts b/src/hooks/coupon/useCoupon.ts index b8f3eb2d..862c046d 100644 --- a/src/hooks/coupon/useCoupon.ts +++ b/src/hooks/coupon/useCoupon.ts @@ -13,10 +13,10 @@ import { CouponEditParams, EditCoupon, PurchaseCouponParams, - coupon, - coupons, + Coupon, + Coupons, } from '@api/coupon/type'; -import { calculatedCouponPoints } from '@/utils/discountCoupon'; +import { calculatedCouponPoints } from '@/utils/coupon/discountCoupon'; import { useParams } from 'react-router-dom'; import { RESPONSE_CODE } from '@/constants/api'; import { useRecoilState } from 'recoil'; @@ -164,7 +164,7 @@ export const useCoupon = () => { }; }, []); - const processCouponTableData = (data: coupons) => { + const processCouponTableData = (data: Coupons) => { const couponTableData = []; const originData = []; let key = -1; @@ -527,7 +527,7 @@ export const useCoupon = () => { const room = purchaseData.rooms[index]; if (!room) continue; const coupons: (Omit< - coupon, + Coupon, 'couponName' | 'appliedPrice' | 'quantity' > & { eachPoint: number; diff --git a/src/hooks/main/useMain.ts b/src/hooks/main/useMain.ts index 84cf6c00..0e2ae798 100644 --- a/src/hooks/main/useMain.ts +++ b/src/hooks/main/useMain.ts @@ -1,6 +1,6 @@ import { ROUTES } from '@/constants/routes'; -import { getChartDate } from '@/utils/dateFormat/dateFormat'; -import { revenueData } from '@api/coupon/type'; +import { getChartDate } from '@/utils/formatiing/dateFormat'; +import { RevenueData } from '@api/coupon/type'; import { useGetStatics, useGetRevenue } from '@queries/coupon'; import { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; @@ -31,7 +31,7 @@ export const useMain = () => { revenueRemove(); }, [accommodationId]); - const handleRevenueDataFormat = (data: revenueData | undefined | '') => { + const handleRevenueDataFormat = (data: RevenueData | undefined | '') => { const revenueData = []; const week = 7; if (data === undefined) return undefined; @@ -68,22 +68,6 @@ export const useMain = () => { return revenueData; }; - // const calculateStaleTime = () => { - // const now = new Date(); - // const targetTime = new Date(); - // const targetHour = 6; - // targetTime.setHours(targetHour, 0, 0, 0); - // const day = 24; - // const minute = 60; - // const millisecond = 1000; - // let remainingTime = targetTime.getTime() - now.getTime(); - // if (remainingTime < 0) { - // remainingTime += day * minute * minute * millisecond; - // } - // const hours = Math.floor(remainingTime / (minute * minute * millisecond)); - // return hours; - // }; - const { data: staticsData, error: staticsError, @@ -93,7 +77,6 @@ export const useMain = () => { select(data) { return data.data; }, - // staleTime: calculateStaleTime(), }); const { @@ -105,7 +88,6 @@ export const useMain = () => { select(data) { return data.data; }, - // staleTime: calculateStaleTime(), }); const revenueData = handleRevenueDataFormat(data); @@ -118,7 +100,7 @@ export const useMain = () => { revenueError, isStaticsLoading, isRevenueLoading, - couponMessage: '이업주님. 쿠폰 발급 후 매출이 68% 늘어났어요!', + couponMessage: data ? data.couponMessage : '', navigateUserGuide, navigateBusinessCenter, }; diff --git a/src/pages/coupon-registration/index.tsx b/src/pages/coupon-registration/index.tsx index fd870413..a2eb87a1 100644 --- a/src/pages/coupon-registration/index.tsx +++ b/src/pages/coupon-registration/index.tsx @@ -1,11 +1,11 @@ import { BuyCouponParams } from '@api/coupon/type'; -import { CouponApplier } from '@components/coupon-registration/coupon-applier'; -import { CouponCard } from '@components/coupon-registration/coupon-card'; -import { CouponPreview } from '@components/coupon-registration/coupon-preview'; -import { DiscountType } from '@components/coupon-registration/discount-type'; -import { PointModal } from '@components/point-charge-modal/point-modal'; -import { Spacing } from '@components/spacing'; -import { TextBox } from '@components/text-box'; +import { CouponApplier } from '@components/domain/coupon-registration/coupon-applier'; +import { CouponCard } from '@components/domain/coupon-registration/coupon-card'; +import { CouponPreview } from '@components/domain/coupon-registration/coupon-preview'; +import { DiscountType } from '@components/domain/coupon-registration/discount-type'; +import { PointModal } from '@components/domain/point-charge-modal/point-modal'; +import { Spacing } from '@components/atom/spacing'; +import { TextBox } from '@components/atom/text-box'; import { useCouponRegistration } from '@hooks/coupon-registration/useCouponRegistration'; import { pendingRoomDataListState, diff --git a/src/pages/coupon/index.tsx b/src/pages/coupon/index.tsx index 476a2cf7..77196f0f 100644 --- a/src/pages/coupon/index.tsx +++ b/src/pages/coupon/index.tsx @@ -1,13 +1,13 @@ import { colors } from '@/constants/colors'; -import { CouponHeader } from '@components/coupon/coupon-header'; +import { CouponHeader } from '@components/domain/coupon/coupon-header'; import { Modal, Spin } from 'antd'; import styled from 'styled-components'; -import { AdditionalPurchaseFooter } from '@components/coupon/additional-purchase-footer'; -import { AdditionalPurchaseContent } from '@components/coupon/additional-purchase-content'; +import { AdditionalPurchaseFooter } from '@components/domain/coupon/additional-purchase-footer'; +import { AdditionalPurchaseContent } from '@components/domain/coupon/additional-purchase-content'; import { useCoupon } from '@hooks/coupon/useCoupon'; -import { CouponTable } from '@components/coupon/table'; -import { PointModal } from '@components/point-charge-modal/point-modal'; -import { NotFoundCoupon } from '@components/coupon/not-found-coupon'; +import { CouponTable } from '@components/domain/coupon/table'; +import { PointModal } from '@components/domain/point-charge-modal/point-modal'; +import { NotFoundCoupon } from '@components/domain/coupon/not-found-coupon'; import { RESPONSE_CODE } from '@/constants/api'; import { NotFound } from '@components/error/NotFound'; import { ServerError } from '@components/error/ServerError'; diff --git a/src/pages/init-accommodation-registration/index.tsx b/src/pages/init-accommodation-registration/index.tsx index cce55699..974c0144 100644 --- a/src/pages/init-accommodation-registration/index.tsx +++ b/src/pages/init-accommodation-registration/index.tsx @@ -1,13 +1,13 @@ import { colors } from '@/constants/colors'; import { styled } from 'styled-components'; -import { AccommodationCategory } from '@components/init/init-accommodation-registration/AccommodationCategory'; -import { AccommodationAddress } from '@components/init/init-accommodation-registration/AccommodationAddress'; -import { AccommodationDesc } from '@components/init/init-accommodation-registration/AccommodationDesc'; +import { AccommodationCategory } from '@components/domain/init/init-accommodation-registration/AccommodationCategory'; +import { AccommodationAddress } from '@components/domain/init/init-accommodation-registration/AccommodationAddress'; +import { AccommodationDesc } from '@components/domain/init/init-accommodation-registration/AccommodationDesc'; import { Form, message } from 'antd'; -import { ButtonContainer } from '@components/init/ButtonContainer'; -import { CheckBoxContainer } from '@components/init/CheckBoxContainer'; -import { ImageUploadContainer } from '@components/init/ImageUploadContainer'; -import { NameContainer } from '@components/init/NameContainer'; +import { ButtonContainer } from '@components/domain/init/ButtonContainer'; +import { CheckBoxContainer } from '@components/domain/init/CheckBoxContainer'; +import { ImageUploadContainer } from '@components/domain/init/ImageUploadContainer'; +import { NameContainer } from '@components/domain/init/NameContainer'; import { useEffect, useState } from 'react'; import { checkedAccommodationOptions, @@ -24,8 +24,8 @@ import { AxiosError } from 'axios'; import { UserInputValue, defaultAccommodation, -} from '@components/init/init-accommodation-registration/type'; -import { AccommodationCategoryProps } from '@components/init/type'; +} from '@components/domain/init/init-accommodation-registration/type'; +import { AccommodationCategoryProps } from '@components/domain/init/type'; import { RESPONSE_CODE } from '@/constants/api'; import { getTypeValue } from '@/utils/init'; diff --git a/src/pages/init-info-confirmation/index.tsx b/src/pages/init-info-confirmation/index.tsx index 0497b8aa..e0f994d7 100644 --- a/src/pages/init-info-confirmation/index.tsx +++ b/src/pages/init-info-confirmation/index.tsx @@ -1,7 +1,7 @@ import { ROUTES } from '@/constants/routes'; -import { ButtonContainer } from '@components/init/ButtonContainer'; -import { AccommodationInfo } from '@components/init/init-info-confirmation/AccommodationInfo'; -import { RoomInfo } from '@components/init/init-info-confirmation/RoomInfo'; +import { ButtonContainer } from '@components/domain/init/ButtonContainer'; +import { AccommodationInfo } from '@components/domain/init/init-info-confirmation/AccommodationInfo'; +import { RoomInfo } from '@components/domain/init/init-info-confirmation/RoomInfo'; import { getCookie } from '@hooks/sign-in/useSignIn'; import { addRoomState, diff --git a/src/pages/init-room-registration/index.tsx b/src/pages/init-room-registration/index.tsx index b2d241d0..746d7d8a 100644 --- a/src/pages/init-room-registration/index.tsx +++ b/src/pages/init-room-registration/index.tsx @@ -1,17 +1,17 @@ import { colors } from '@/constants/colors'; import { ROUTES } from '@/constants/routes'; -import { ButtonContainer } from '@components/init/ButtonContainer'; -import { CheckBoxContainer } from '@components/init/CheckBoxContainer'; -import { ImageUploadContainer } from '@components/init/ImageUploadContainer'; -import { NameContainer } from '@components/init/NameContainer'; +import { ButtonContainer } from '@components/domain/init/ButtonContainer'; +import { CheckBoxContainer } from '@components/domain/init/CheckBoxContainer'; +import { ImageUploadContainer } from '@components/domain/init/ImageUploadContainer'; +import { NameContainer } from '@components/domain/init/NameContainer'; import { Room, defaultRoom, -} from '@components/init/init-accommodation-registration/type'; -import { CapacityContainer } from '@components/room/capacity-container'; -import { CountContainer } from '@components/room/num-of-rooms-container'; -import { PriceContainer } from '@components/room/price-container'; -import { TimeContainer } from '@components/room/time-container'; +} from '@components/domain/init/init-accommodation-registration/type'; +import { CapacityContainer } from '@components/domain/room/capacity-container'; +import { CountContainer } from '@components/domain/room/num-of-rooms-container'; +import { PriceContainer } from '@components/domain/room/price-container'; +import { TimeContainer } from '@components/domain/room/time-container'; import { useImageFile } from '@queries/init'; import { addRoomState, @@ -28,7 +28,7 @@ import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useRecoilState, useRecoilValue } from 'recoil'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import moment from 'moment'; import { RESPONSE_CODE } from '@/constants/api'; diff --git a/src/pages/init/index.tsx b/src/pages/init/index.tsx index 55b88d6e..507ab147 100644 --- a/src/pages/init/index.tsx +++ b/src/pages/init/index.tsx @@ -1,6 +1,6 @@ import { colors } from '@/constants/colors'; import { ROUTES } from '@/constants/routes'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Layout, Button } from 'antd'; import { MdOutlineAddHome } from 'react-icons/md'; import styled from 'styled-components'; diff --git a/src/pages/main/index.tsx b/src/pages/main/index.tsx index 5ed04b63..4ea399e2 100644 --- a/src/pages/main/index.tsx +++ b/src/pages/main/index.tsx @@ -1,11 +1,11 @@ -import { MainChart } from '@components/main/main-chart'; -import { MainCouponStatusContainer } from '@components/main/main-coupon-status-container'; -import { CouponRegistrationContainer } from '@components/main/coupon-navigation-container'; +import { MainChart } from '@components/domain/main/main-chart'; +import { MainCouponStatusContainer } from '@components/domain/main/main-coupon-status-container'; +import { CouponRegistrationContainer } from '@components/domain/main/coupon-navigation-container'; import promotionImage from '@assets/image/mainPromotionImage.jpg'; import { Image, Layout, Spin } from 'antd'; import styled from 'styled-components'; import { useMain } from '@hooks/main/useMain'; -import { UserGuidNavigationContainer } from '@components/main/user-guide-navigation-container'; +import { UserGuidNavigationContainer } from '@components/domain/main/user-guide-navigation-container'; import { RESPONSE_CODE } from '@/constants/api'; import { NotFound } from '@components/error/NotFound'; import { ServerError } from '@components/error/ServerError'; diff --git a/src/pages/mobile/index.tsx b/src/pages/mobile/index.tsx index e059db57..813896f5 100644 --- a/src/pages/mobile/index.tsx +++ b/src/pages/mobile/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Image } from 'antd'; import styled from 'styled-components'; import PCImage from '@assets/image/pcImage.png'; diff --git a/src/pages/point-detail/index.tsx b/src/pages/point-detail/index.tsx index b2db5f7f..fbe6cad1 100644 --- a/src/pages/point-detail/index.tsx +++ b/src/pages/point-detail/index.tsx @@ -1,7 +1,7 @@ import { Layout, Spin, message } from 'antd'; import styled from 'styled-components'; -import { PointBox } from '@components/point-detail/point-box'; -import { PointDetailComp } from '@components/point-detail'; +import { PointBox } from '@components/domain/point-detail/point-box'; +import { PointDetailComp } from '@components/domain/point-detail'; import { useEffect } from 'react'; import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { useLocation } from 'react-router-dom'; @@ -15,7 +15,7 @@ import { pointDetailDataState, } from '@stores/point-detail/atoms'; import { useGetPointDetail } from '@queries/point-detail'; -import { menuStatusType } from '@api/point-detail/get-point-detail/type'; +import { MenuStatusType } from '@api/point-detail/get-point-detail/type'; import { useGetPointSummary } from '@queries/point'; import { RESPONSE_CODE } from '@/constants/api'; @@ -23,7 +23,7 @@ export const PointDetail = () => { const currentYear = useRecoilValue(currentYearState); const currentMonth = useRecoilValue(currentMonthState); const pageNum = useRecoilValue(pageNumState); - const menuStatus = useRecoilValue(menuStatusState); + const menuStatus = useRecoilValue(menuStatusState); const setPointSummaryData = useSetRecoilState(pointSummaryDataState); const setPointDetailData = useSetRecoilState(pointDetailDataState); diff --git a/src/pages/room-management/index.tsx b/src/pages/room-management/index.tsx index 3628349f..008d57a4 100644 --- a/src/pages/room-management/index.tsx +++ b/src/pages/room-management/index.tsx @@ -1,12 +1,12 @@ -import RoomCard from '../../components/room/room-card'; import { Card, Button, Row, Modal, message } from 'antd'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import styled from 'styled-components'; import { useNavigate, useParams } from 'react-router-dom'; import { useDeleteRoom, useGetInfiniteRoomList } from '@queries/room'; import InfiniteScroll from 'react-infinite-scroll-component'; import { useEffect, useMemo } from 'react'; import { RESPONSE_CODE } from '@/constants/api'; +import RoomCard from '@components/domain/room/room-card'; export const RoomManagement = () => { const navigate = useNavigate(); diff --git a/src/pages/room-registration/index.tsx b/src/pages/room-registration/index.tsx index f61660aa..98f33872 100644 --- a/src/pages/room-registration/index.tsx +++ b/src/pages/room-registration/index.tsx @@ -1,14 +1,14 @@ import { colors } from '@/constants/colors'; import { styled } from 'styled-components'; import { Form, message } from 'antd'; -import { ButtonContainer } from '@components/room/room-buttons'; -import { CheckBoxContainer } from '@components/init/CheckBoxContainer'; -import { ImageUploadContainer } from '@components/init/ImageUploadContainer'; -import { NameContainer } from '@components/init/NameContainer'; -import { PriceContainer } from '@components/room/price-container'; -import { CapacityContainer } from '@components/room/capacity-container'; -import { CountContainer } from '@components/room/num-of-rooms-container'; -import { TimeContainer } from '@components/room/time-container'; +import { ButtonContainer } from '@components/domain/room/room-buttons'; +import { CheckBoxContainer } from '@components/domain/init/CheckBoxContainer'; +import { ImageUploadContainer } from '@components/domain/init/ImageUploadContainer'; +import { NameContainer } from '@components/domain/init/NameContainer'; +import { PriceContainer } from '@components/domain/room/price-container'; +import { CapacityContainer } from '@components/domain/room/capacity-container'; +import { CountContainer } from '@components/domain/room/num-of-rooms-container'; +import { TimeContainer } from '@components/domain/room/time-container'; import { useRecoilState, useRecoilValue } from 'recoil'; import { RoomData, RoomErrorResponse } from '@api/room/type'; import { useAddRoom } from '@queries/room'; diff --git a/src/pages/room-update/index.tsx b/src/pages/room-update/index.tsx index 1bc88690..2c544f85 100644 --- a/src/pages/room-update/index.tsx +++ b/src/pages/room-update/index.tsx @@ -1,15 +1,15 @@ import { colors } from '@/constants/colors'; import { styled } from 'styled-components'; import { Form, message } from 'antd'; -import { ButtonContainer } from '@components/room/room-buttons'; -import { CheckBoxContainer } from '@components/init/CheckBoxContainer'; -import { ImageUploadContainer } from '@components/init/ImageUploadContainer'; -import { NameContainer } from '@components/init/NameContainer'; -import { PriceContainer } from '@components/room/price-container'; -import { CapacityContainer } from '@components/room/capacity-container'; -import { CountContainer } from '@components/room/num-of-rooms-container'; -import { TimeContainer } from '@components/room/time-container'; -import { StatusContainer } from '@components/room/status-container'; +import { ButtonContainer } from '@components/domain/room/room-buttons'; +import { CheckBoxContainer } from '@components/domain/init/CheckBoxContainer'; +import { ImageUploadContainer } from '@components/domain/init/ImageUploadContainer'; +import { NameContainer } from '@components/domain/init/NameContainer'; +import { PriceContainer } from '@components/domain/room/price-container'; +import { CapacityContainer } from '@components/domain/room/capacity-container'; +import { CountContainer } from '@components/domain/room/num-of-rooms-container'; +import { TimeContainer } from '@components/domain/room/time-container'; +import { StatusContainer } from '@components/domain/room/status-container'; import { useRecoilState } from 'recoil'; import { deletedImageFileState } from '@stores/room/atoms'; import { RoomUpdateData } from '@api/room/type'; diff --git a/src/pages/sign-in-agreement/index.tsx b/src/pages/sign-in-agreement/index.tsx index 1d9be8ce..98e20d3e 100644 --- a/src/pages/sign-in-agreement/index.tsx +++ b/src/pages/sign-in-agreement/index.tsx @@ -2,7 +2,7 @@ import { Footer } from '@components/layout/footer'; import { Layout, Button, Checkbox } from 'antd'; import React, { useState } from 'react'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { CheckboxChangeEvent } from 'antd/lib/checkbox'; import { colors } from '@/constants/colors'; diff --git a/src/pages/sign-in/index.tsx b/src/pages/sign-in/index.tsx index 46f3b63d..c75cf7eb 100644 --- a/src/pages/sign-in/index.tsx +++ b/src/pages/sign-in/index.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; import { Footer } from '@components/layout/footer'; -import { Main } from '@components/sign-up'; +import { Main } from '@components/domain/sign-up'; import { ValidateSchema } from '@/utils/sign-in/ValidateSchema'; import { getCookie, removeCookie, setCookie } from '@hooks/sign-in/useSignIn'; import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { usePostLogin } from '@queries/sign-in'; import { useFormik } from 'formik'; import { Layout, Input, Button, message } from 'antd'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import { AxiosError } from 'axios'; import { HTTP_STATUS_CODE } from '@/constants/api'; @@ -26,7 +26,7 @@ export const SignIn = () => { } setCookie('accessToken', response.data.accessToken); setCookie('refreshToken', response.data.refreshToken); - const { data } = await ACCOMMODATION_API.getAccommodationList(); + const { data } = await ACCOMMODATION_API.accommodationList(); const hasAccommodationData = data.accommodations.length > 0; const memberResponse = response.data.memberResponse; const memberData = JSON.stringify(memberResponse); diff --git a/src/pages/sign-up-success/index.tsx b/src/pages/sign-up-success/index.tsx index d0b90b9c..1bb7a997 100644 --- a/src/pages/sign-up-success/index.tsx +++ b/src/pages/sign-up-success/index.tsx @@ -1,8 +1,8 @@ import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { Layout, Button } from 'antd'; import styled from 'styled-components'; -import { TextBox } from '@components/text-box'; -import { Main } from '@components/sign-up'; +import { TextBox } from '@components/atom/text-box'; +import { Main } from '@components/domain/sign-up'; import { Footer } from '@components/layout/footer'; export const SignUpSuccess = () => { diff --git a/src/pages/sign-up/index.tsx b/src/pages/sign-up/index.tsx index 7395283d..c8faa7d0 100644 --- a/src/pages/sign-up/index.tsx +++ b/src/pages/sign-up/index.tsx @@ -5,7 +5,7 @@ import { getValidateSchema } from '@/utils/sign-up/ValidateSchema'; import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; import { SIGN_UP_API } from '@api/sign-up'; import { Footer } from '@components/layout/footer'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { usePostSignUp, usePostAuthentication } from '@queries/sign-up'; import { Button, Input, Layout, message } from 'antd'; @@ -110,7 +110,7 @@ export const SignUp = () => { const handleVerification = async () => { if (values.verificationCode.length > 0) { try { - const res = await SIGN_UP_API.getVerify({ + const res = await SIGN_UP_API.verify({ // 버튼을 누를 때마다 갱신된 데이터를 받아와야 하기 때문에 쿼리 사용 안했습니다. (staleTime: 0) email: values.email, verificationCode: values.verificationCode, diff --git a/src/pages/user-guide/index.tsx b/src/pages/user-guide/index.tsx index 101cae48..8bc73bb3 100644 --- a/src/pages/user-guide/index.tsx +++ b/src/pages/user-guide/index.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, Image } from 'antd'; import styled from 'styled-components'; import PdfLogo from '@assets/image/pdfLogo.svg'; diff --git a/src/queries/accommodation/index.ts b/src/queries/accommodation/index.ts index 09c5c181..17436c4a 100644 --- a/src/queries/accommodation/index.ts +++ b/src/queries/accommodation/index.ts @@ -14,7 +14,7 @@ export const useGetAccommodationList = ( AxiosResponse, AxiosError, AccommodationListData - >(['getAccommodationList'], () => ACCOMMODATION_API.getAccommodationList(), { + >(['getAccommodationList'], () => ACCOMMODATION_API.accommodationList(), { ...options, }); }; diff --git a/src/queries/coupon-registration/index.ts b/src/queries/coupon-registration/index.ts index 8d57ff72..d278caf2 100644 --- a/src/queries/coupon-registration/index.ts +++ b/src/queries/coupon-registration/index.ts @@ -23,7 +23,7 @@ export const useGetCouponRoomList = ( ) => { return useQuery, AxiosError, CouponRoomList>( ['getCouponRoomList'], - () => COUPON_API.getCouponRoomList(accommodationId), + () => COUPON_API.couponRoomList(accommodationId), { ...options, }, diff --git a/src/queries/coupon/index.ts b/src/queries/coupon/index.ts index c09198f9..897bc3a2 100644 --- a/src/queries/coupon/index.ts +++ b/src/queries/coupon/index.ts @@ -11,24 +11,24 @@ import { CouponDeleteParams, CouponEditParams, PurchaseCouponParams, - coupons, - revenueData, - staticsData, + Coupons, + RevenueData, + StaticsData, } from '@api/coupon/type'; export const useGetStatics = ( accommodationId: string, options?: UseQueryOptions< - AxiosResponse, + AxiosResponse, AxiosError, - staticsData | '' + StaticsData | '' >, ) => { return useQuery< - AxiosResponse, + AxiosResponse, AxiosError, - staticsData | '' - >(['getStatics'], () => COUPON_API.getStatics(accommodationId), { + StaticsData | '' + >(['getStatics'], () => COUPON_API.statics(accommodationId), { ...options, }); }; @@ -36,16 +36,16 @@ export const useGetStatics = ( export const useGetRevenue = ( accommodationId: string, options?: UseQueryOptions< - AxiosResponse, + AxiosResponse, AxiosError, - revenueData | '' + RevenueData | '' >, ) => { return useQuery< - AxiosResponse, + AxiosResponse, AxiosError, - revenueData | '' - >(['getRevenue'], () => COUPON_API.getRevenue(accommodationId), { + RevenueData | '' + >(['getRevenue'], () => COUPON_API.revenue(accommodationId), { ...options, }); }; @@ -53,14 +53,14 @@ export const useGetRevenue = ( export const useGetCoupon = ( accommodationId: string, options?: UseQueryOptions< - AxiosResponse, + AxiosResponse, AxiosError, - coupons + Coupons >, ) => - useQuery, AxiosError, coupons>( + useQuery, AxiosError, Coupons>( ['getCoupon'], - () => COUPON_API.getCoupon(accommodationId), + () => COUPON_API.coupon(accommodationId), { ...options }, ); diff --git a/src/queries/init/index.ts b/src/queries/init/index.ts index 745e3d8d..38a1061c 100644 --- a/src/queries/init/index.ts +++ b/src/queries/init/index.ts @@ -20,8 +20,7 @@ export const useImageFile = ( AxiosError, FormData >( - (formData: FormData) => - ACCOMMODATION_REGISTRATION_API.postImageFile(formData), + (formData: FormData) => ACCOMMODATION_REGISTRATION_API.imageFile(formData), { ...options, }, @@ -41,7 +40,7 @@ export const useAccommodationInfo = ( PostAccommodationParams >( (params: PostAccommodationParams) => - ACCOMMODATION_REGISTRATION_API.postAccommodationInfo(params), + ACCOMMODATION_REGISTRATION_API.accommodationInfo(params), { ...options, }, diff --git a/src/queries/logout/index.ts b/src/queries/logout/index.ts index f2d2e213..63f078e1 100644 --- a/src/queries/logout/index.ts +++ b/src/queries/logout/index.ts @@ -5,10 +5,7 @@ import { AxiosResponse, AxiosError } from 'axios'; export const useDeleteLogout = ( options?: UseMutationOptions, ) => { - return useMutation( - () => LOGOUT_API.deleteLogout(), - { - ...options, - }, - ); + return useMutation(() => LOGOUT_API.logout(), { + ...options, + }); }; diff --git a/src/queries/point-charge-modal/index.tsx b/src/queries/point-charge-modal/index.tsx index 675d1c57..bd099160 100644 --- a/src/queries/point-charge-modal/index.tsx +++ b/src/queries/point-charge-modal/index.tsx @@ -38,7 +38,7 @@ export const usePointCharge = ( AxiosResponse, AxiosError, TossRequestType - >((data: TossRequestType) => POINT_CHARGE_API.postPointCharge(data), { + >((data: TossRequestType) => POINT_CHARGE_API.pointCharge(data), { onSuccess: () => { queryClient.invalidateQueries(['getPointSummary']); diff --git a/src/queries/point-detail/index.ts b/src/queries/point-detail/index.ts index 31a9faa8..4e2aebc9 100644 --- a/src/queries/point-detail/index.ts +++ b/src/queries/point-detail/index.ts @@ -9,7 +9,7 @@ import { AxiosError, AxiosResponse } from 'axios'; import { POINT_DETAIL_API } from '@api/point-detail/get-point-detail'; import { PointDetailDataType, - menuStatusType, + MenuStatusType, } from '@api/point-detail/get-point-detail/type'; import { ORDER_CANCEL_API } from '@api/point-detail/orderCancel'; import { message } from 'antd'; @@ -18,7 +18,7 @@ import { RESPONSE_CODE } from '@/constants/api'; import { CancelType } from '@api/point-detail/orderCancel/type'; export const useGetPointDetail = ( - menuStatus: menuStatusType, + menuStatus: MenuStatusType, page: number, options?: UseQueryOptions< AxiosResponse, @@ -30,13 +30,9 @@ export const useGetPointDetail = ( AxiosResponse, AxiosError, PointDetailDataType - >( - ['getPointDetail'], - () => POINT_DETAIL_API.getPointDetail(menuStatus, page), - { - ...options, - }, - ); + >(['getPointDetail'], () => POINT_DETAIL_API.pointDetail(menuStatus, page), { + ...options, + }); }; export const useDeleteOrderCancel = ( @@ -64,7 +60,7 @@ export const useDeleteOrderCancel = ( AxiosResponse, AxiosError, number - >((chargeId: number) => ORDER_CANCEL_API.deleteOrderCancel(chargeId), { + >((chargeId: number) => ORDER_CANCEL_API.orderCancel(chargeId), { onSuccess: () => { queryClient.invalidateQueries(['getPointSummary']); queryClient.invalidateQueries(['getPointTotal']); diff --git a/src/queries/point/index.ts b/src/queries/point/index.ts index a872e44c..53b0ab88 100644 --- a/src/queries/point/index.ts +++ b/src/queries/point/index.ts @@ -16,7 +16,7 @@ export const useGetPointSummary = ( AxiosResponse, AxiosError, PointSummaryData - >(['getPointSummary'], () => POINT_API.getPointSummary(rangeDate), { + >(['getPointSummary'], () => POINT_API.pointSummary(rangeDate), { ...options, }); }; @@ -30,7 +30,7 @@ export const useGetPointTotal = ( ) => { return useQuery, AxiosError, PointTotalData>( ['getPointTotal'], - () => POINT_API.getPointTotal(), + () => POINT_API.totalPoint(), { ...options, }, diff --git a/src/queries/room/index.ts b/src/queries/room/index.ts index 844e32f3..f76d6bbf 100644 --- a/src/queries/room/index.ts +++ b/src/queries/room/index.ts @@ -48,7 +48,7 @@ export const useGetInfiniteRoomList = ( RoomListResponseData >( ['room-list'], - ({ pageParam = 0 }) => ROOM_API.getRoomList(accommodationId, 8, pageParam), + ({ pageParam = 0 }) => ROOM_API.roomList(accommodationId, 8, pageParam), { getNextPageParam: ({ data: { pageNum, totalPages } }) => { const nextPage = pageNum + 1; @@ -89,7 +89,7 @@ export const useGetRoomDetail = ( AxiosResponse, AxiosError, RoomDeleteResponseData - >(['getRoomDetail'], () => ROOM_API.getRoomDetail(roomId, accommodationId), { + >(['getRoomDetail'], () => ROOM_API.roomDetail(roomId, accommodationId), { ...options, }); }; diff --git a/src/queries/sign-in/index.ts b/src/queries/sign-in/index.ts index 9b2d38ff..ae63a0f5 100644 --- a/src/queries/sign-in/index.ts +++ b/src/queries/sign-in/index.ts @@ -15,7 +15,7 @@ export const usePostLogin = ( AxiosResponse, AxiosError, SignInData - >((data: SignInData) => SIGN_IN_API.postLogin(data), { + >((data: SignInData) => SIGN_IN_API.login(data), { ...options, }); }; diff --git a/src/queries/sign-up/index.ts b/src/queries/sign-up/index.ts index 6ec44124..af417c34 100644 --- a/src/queries/sign-up/index.ts +++ b/src/queries/sign-up/index.ts @@ -16,7 +16,7 @@ export const usePostSignUp = ( >, ) => { return useMutation, AxiosError, SignUpData>( - (data: SignUpData) => SIGN_UP_API.postSignUp(data), + (data: SignUpData) => SIGN_UP_API.signUp(data), { ...options, }, @@ -34,7 +34,7 @@ export const usePostAuthentication = ( AxiosResponse, AxiosError, AuthenticationData - >((data: AuthenticationData) => SIGN_UP_API.postAuthentication(data), { + >((data: AuthenticationData) => SIGN_UP_API.authentication(data), { ...options, }); }; diff --git a/src/stores/coupon-registration/atoms.ts b/src/stores/coupon-registration/atoms.ts index 332aa1c4..9f6c1776 100644 --- a/src/stores/coupon-registration/atoms.ts +++ b/src/stores/coupon-registration/atoms.ts @@ -7,7 +7,7 @@ import { DiscountValue, GroupQuantityValue, PendingRoomDataList, -} from '@components/coupon-registration/type'; +} from '@components/domain/coupon-registration/type'; import { atom } from 'recoil'; import { FLAT_DISCOUNT_TYPE } from '@/constants/coupon-registration'; import { CouponRoomList } from '@api/coupon/type'; diff --git a/src/stores/init/atoms.ts b/src/stores/init/atoms.ts index 1340dc2a..6d5fdfe8 100644 --- a/src/stores/init/atoms.ts +++ b/src/stores/init/atoms.ts @@ -2,7 +2,7 @@ import { AccommodationOptions, RoomOptions, UserInputValue, -} from '@components/init/init-accommodation-registration/type'; +} from '@components/domain/init/init-accommodation-registration/type'; import { atom } from 'recoil'; import { recoilPersist } from 'recoil-persist'; import { ImageFile } from './type'; diff --git a/src/stores/point-detail/atoms.ts b/src/stores/point-detail/atoms.ts index 80ef9412..e336a694 100644 --- a/src/stores/point-detail/atoms.ts +++ b/src/stores/point-detail/atoms.ts @@ -1,7 +1,7 @@ import { atom } from 'recoil'; import { PointDetailDataType, - menuStatusType, + MenuStatusType, } from '@api/point-detail/get-point-detail/type'; import { PointSummaryData } from '@api/point/type'; @@ -25,7 +25,7 @@ export const totalPagesState = atom({ default: 10, }); -export const menuStatusState = atom({ +export const menuStatusState = atom({ key: 'menuStatusState', default: 'total', }); diff --git a/src/test/init/ButtonContainer.test.tsx b/src/test/init/ButtonContainer.test.tsx index 58de05e9..cc467764 100644 --- a/src/test/init/ButtonContainer.test.tsx +++ b/src/test/init/ButtonContainer.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import { BrowserRouter } from 'react-router-dom'; -import { ButtonContainer } from '@components/init/ButtonContainer'; +import { ButtonContainer } from '@components/domain/init/ButtonContainer'; import { RecoilRoot } from 'recoil'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; diff --git a/src/test/init/ImageUploadContainer.test.tsx b/src/test/init/ImageUploadContainer.test.tsx index 4618b1fe..ef868fad 100644 --- a/src/test/init/ImageUploadContainer.test.tsx +++ b/src/test/init/ImageUploadContainer.test.tsx @@ -1,7 +1,7 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { BrowserRouter } from 'react-router-dom'; -import { ImageUploadContainer } from '@components/init/ImageUploadContainer'; +import { ImageUploadContainer } from '@components/domain/init/ImageUploadContainer'; import { message } from 'antd'; import { IMAGE_MAX_CAPACITY } from '@/constants/init'; import { RecoilRoot } from 'recoil'; diff --git a/src/test/init/NameContainer.test.tsx b/src/test/init/NameContainer.test.tsx index 29c4defc..ba7e6841 100644 --- a/src/test/init/NameContainer.test.tsx +++ b/src/test/init/NameContainer.test.tsx @@ -1,7 +1,7 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { BrowserRouter } from 'react-router-dom'; -import { NameContainer } from '@components/init/NameContainer'; +import { NameContainer } from '@components/domain/init/NameContainer'; import { ACCOMMODATION_NAME_MIN_LENGTH } from '@/constants/init/init-accommodation-registration'; import { Form } from 'antd'; import { RecoilRoot } from 'recoil'; diff --git a/src/test/init/init-accommodation-registration/InitAccommodationRegistration.test.tsx b/src/test/init/init-accommodation-registration/InitAccommodationRegistration.test.tsx index 4f101cba..32610a30 100644 --- a/src/test/init/init-accommodation-registration/InitAccommodationRegistration.test.tsx +++ b/src/test/init/init-accommodation-registration/InitAccommodationRegistration.test.tsx @@ -1,8 +1,8 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { BrowserRouter } from 'react-router-dom'; -import { AccommodationDesc } from '@components/init/init-accommodation-registration/AccommodationDesc'; -import { AccommodationAddress } from '@components/init/init-accommodation-registration/AccommodationAddress'; +import { AccommodationDesc } from '@components/domain/init/init-accommodation-registration/AccommodationDesc'; +import { AccommodationAddress } from '@components/domain/init/init-accommodation-registration/AccommodationAddress'; import { ACCOMMODATION_DESC_MIN_LENGTH } from '@/constants/init/init-accommodation-registration'; import { Form } from 'antd'; import { RecoilRoot } from 'recoil'; diff --git a/src/test/init/init-info-confirmation/InitInfoConfirmation.test.tsx b/src/test/init/init-info-confirmation/InitInfoConfirmation.test.tsx index cc87d619..9a91b8cc 100644 --- a/src/test/init/init-info-confirmation/InitInfoConfirmation.test.tsx +++ b/src/test/init/init-info-confirmation/InitInfoConfirmation.test.tsx @@ -1,8 +1,8 @@ import { ROUTES } from '@/constants/routes'; import { DeleteOutlined } from '@ant-design/icons'; -import { AccommodationInfo } from '@components/init/init-info-confirmation/AccommodationInfo'; -import { CustomButton } from '@components/init/init-info-confirmation/CustomButton'; -import { RoomInfo } from '@components/init/init-info-confirmation/RoomInfo'; +import { AccommodationInfo } from '@components/domain/init/init-info-confirmation/AccommodationInfo'; +import { CustomButton } from '@components/domain/init/init-info-confirmation/CustomButton'; +import { RoomInfo } from '@components/domain/init/init-info-confirmation/RoomInfo'; import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { BrowserRouter } from 'react-router-dom'; diff --git a/src/test/init/init-info-confirmation/WelcomModalForTest.tsx b/src/test/init/init-info-confirmation/WelcomModalForTest.tsx index 95a2bb96..f3f3a8e6 100644 --- a/src/test/init/init-info-confirmation/WelcomModalForTest.tsx +++ b/src/test/init/init-info-confirmation/WelcomModalForTest.tsx @@ -1,4 +1,4 @@ -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { Button, Modal } from 'antd'; import { useNavigate } from 'react-router-dom'; import styled from 'styled-components'; diff --git a/src/test/init/init-room-registration/InitRoomRegistration.test.tsx b/src/test/init/init-room-registration/InitRoomRegistration.test.tsx index 957e3f90..7b188122 100644 --- a/src/test/init/init-room-registration/InitRoomRegistration.test.tsx +++ b/src/test/init/init-room-registration/InitRoomRegistration.test.tsx @@ -1,6 +1,6 @@ import { MAX_PRICE, MIN_PRICE } from '@/constants/room/room-registration'; -import { CapacityContainer } from '@components/room/capacity-container'; -import { PriceContainer } from '@components/room/price-container'; +import { CapacityContainer } from '@components/domain/room/capacity-container'; +import { PriceContainer } from '@components/domain/room/price-container'; import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Form } from 'antd'; diff --git a/src/test/sign-in/index.tsx b/src/test/sign-in/index.tsx index 8de887fe..66106f5e 100644 --- a/src/test/sign-in/index.tsx +++ b/src/test/sign-in/index.tsx @@ -5,7 +5,7 @@ import { useCustomNavigate } from '@hooks/sign-up/useSignUp'; import { Input, Button, message } from 'antd'; import { useFormik } from 'formik'; import React from 'react'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { usePostLogin } from '@queries/sign-in'; import { useSideBar } from '@hooks/side-bar/useSideBar'; import { AxiosError } from 'axios'; diff --git a/src/test/sign-up/index.tsx b/src/test/sign-up/index.tsx index 2369fa17..48130931 100644 --- a/src/test/sign-up/index.tsx +++ b/src/test/sign-up/index.tsx @@ -6,7 +6,7 @@ import { useFormik } from 'formik'; import React, { useEffect, useState } from 'react'; import { getValidateSchema } from '@/utils/sign-up/ValidateSchema'; import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; -import { TextBox } from '@components/text-box'; +import { TextBox } from '@components/atom/text-box'; import { SIGN_UP_API } from '@api/sign-up/index'; import { AxiosError } from 'axios'; import { RESPONSE_CODE } from '@/constants/api'; @@ -94,7 +94,7 @@ export const SignUp = () => { ]); try { - const res = await SIGN_UP_API.getVerify({ + const res = await SIGN_UP_API.verify({ // 버튼을 누를 때마다 갱신된 데이터를 받아와야 하기 때문에 쿼리 사용 안했습니다. (staleTime: 0) email: values.email, verificationCode: values.verificationCode, diff --git a/src/utils/is-number/index.ts b/src/utils/check-type/index.ts similarity index 100% rename from src/utils/is-number/index.ts rename to src/utils/check-type/index.ts diff --git a/src/utils/discountCoupon.ts b/src/utils/coupon/discountCoupon.ts similarity index 87% rename from src/utils/discountCoupon.ts rename to src/utils/coupon/discountCoupon.ts index 12f2fbc6..49744d8e 100644 --- a/src/utils/discountCoupon.ts +++ b/src/utils/coupon/discountCoupon.ts @@ -1,10 +1,10 @@ import { DISCOUNT_TYPE } from '@/constants/coupon'; -import { coupon } from '@api/coupon/type'; +import { Coupon } from '@api/coupon/type'; export const calculatedCouponPoints = ( price: number, discount: number, - discountType: coupon['discountType'], + discountType: Coupon['discountType'], ) => { const rateTypeRoundingUnit = 1000; const roundingUnit = 10; diff --git a/src/utils/keydown/handleEnterKeyDown.ts b/src/utils/event/handleEnterKeyDown.ts similarity index 100% rename from src/utils/keydown/handleEnterKeyDown.ts rename to src/utils/event/handleEnterKeyDown.ts diff --git a/src/utils/dateFormat/dateFormat.ts b/src/utils/formatiing/dateFormat.ts similarity index 63% rename from src/utils/dateFormat/dateFormat.ts rename to src/utils/formatiing/dateFormat.ts index af41c0f3..fb4de9af 100644 --- a/src/utils/dateFormat/dateFormat.ts +++ b/src/utils/formatiing/dateFormat.ts @@ -30,3 +30,18 @@ export const getChartDate = (index: number) => { )}/${String(pastDate.getDate()).padStart(targetLength, fillChar)}`; return formattedDate; }; + +export const orderDate = () => { + const currentDate = new Date(); + + const year = currentDate.getFullYear(); + const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); + const day = currentDate.getDate().toString().padStart(2, '0'); + const hours = currentDate.getHours().toString().padStart(2, '0'); + const minutes = currentDate.getMinutes().toString().padStart(2, '0'); + const seconds = currentDate.getSeconds().toString().padStart(2, '0'); + + const orderNumber = `O-${year}${month}${day}${hours}${minutes}${seconds}`; + + return orderNumber; +}; diff --git a/src/utils/Format/numberFormat.ts b/src/utils/formatiing/numberFormat.ts similarity index 100% rename from src/utils/Format/numberFormat.ts rename to src/utils/formatiing/numberFormat.ts diff --git a/src/utils/isNumber.ts b/src/utils/isNumber.ts deleted file mode 100644 index 7966f0d3..00000000 --- a/src/utils/isNumber.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const isNumber = (value: string | number) => { - if (typeof value === 'number') { - return /^[0-9]+$/.test(value.toString()); - } else { - return /^[0-9]+$/.test(value); - } -}; diff --git a/src/utils/orderNumber/index.ts b/src/utils/orderNumber/index.ts deleted file mode 100644 index c98a5ac6..00000000 --- a/src/utils/orderNumber/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const orderNumber = () => { - const currentDate = new Date(); - - const year = currentDate.getFullYear(); - const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); - const day = currentDate.getDate().toString().padStart(2, '0'); - const hours = currentDate.getHours().toString().padStart(2, '0'); - const minutes = currentDate.getMinutes().toString().padStart(2, '0'); - const seconds = currentDate.getSeconds().toString().padStart(2, '0'); - - const orderNumber = `O-${year}${month}${day}${hours}${minutes}${seconds}`; - - return orderNumber; -};