Skip to content

Commit

Permalink
Refactor: 전체 폴더 구조 및 컨벤션 수정 (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahyuun authored Jan 30, 2024
1 parent 5c8afc9 commit 041dea7
Show file tree
Hide file tree
Showing 174 changed files with 367 additions and 378 deletions.
64 changes: 39 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@

<br/>


안녕하세요😃
안녕하세요😃

업주야놀자의 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: [email protected]

Expand All @@ -36,6 +35,7 @@ password: Abcd1234
---

## 🎯 팀 소개

<table align="center">
<tr>
<td align="center"><img alt="avatar" src="https://github.com/gahyuun.png" width="100"></td>
Expand Down Expand Up @@ -92,39 +92,50 @@ password: Abcd1234
<img src="https://img.shields.io/badge/vercel-ffffff?style=for-the-badge&logo=vercel&logoColor=black"/>
</p>


<br/>

## 🎨 화면 구성

<div style="text-align: center">

<h4>메인 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/81469686/be11c7f0-0c0a-4ddf-81ac-a56e53fcb3f2" alt="메인 페이지">
메인 페이지에서는 쿠폰 현황과 일자별 쿠폰 매출을 차트 형식으로 확인할 수 있습니다.

---

---

<h4>쿠폰 관리 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/ca107a8e-c20a-41f8-b985-273ee923742b" alt="메인 페이지">
쿠폰 관리 페이지에서는 select와 checkbox를 통한 쿠폰 발급 상태를 변경할 수 있습니다 ( 소진은 변경 불가 )
일일 제한 수량, 노출 기준, 쿠폰 적용 기간 또한 사용자가 직접 변경할 수 있습니다
쿠폰 아이템을 선택해서 삭제와 추가 구매를 할 수 있습니다
---


---

<h4>쿠폰 만들기 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/a9b27167-d28b-4713-868f-92918f9f0344" alt="카테고리별 페이지">


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

---

<h4>포인트 내역 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/4630f880-e1ed-4303-96d5-ea15a7ffc7e4" alt="숙박 상세 페이지">


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

---

<h4>객실 관리 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/490e2d41-ba1d-4ad5-8775-f4513f9a2054" alt="장바구니 페이지">

<h4>이용 가이드 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/f523634b-f881-4bf8-8c28-b1e04d923e08">

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

---

<h4>이용 가이드 페이지</h4> <img src="https://github.com/Upjuyanolja/Upjuyanolja_FE/assets/37584686/f523634b-f881-4bf8-8c28-b1e04d923e08">

</div>

<br>

## 📚 주요 기능

<div align="center">
<table>
<tr align="center">
Expand Down Expand Up @@ -153,36 +164,36 @@ password: Abcd1234
```
📂 src
┣ 📂 api
┣ 📂 assets
┣ 📂 assets
┣ 📂 components
┃ ┣ 📂 layout
┃ ┃ ┣ 📂 footer
┃ ┃ ┣ 📂 header
┃ ┃ ┣ ...
┃ ┣ 📂 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
Expand All @@ -193,8 +204,11 @@ password: Abcd1234

<br>

## 📆 기간
```2023.12.26 ~ 2024.01.29```
<br>
### 참고 노션

https://youthful-jump-c97.notion.site/FE-2-f8763ce2d853471ea58f0312e5c5927f?pvs=4

## 📆 기간

`2023.12.26 ~ 2024.01.29`
<br>
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/api/accommodation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { instance } from '..';
import { AccommodationListData } from './type';

export const ACCOMMODATION_API = {
getAccommodationList: () =>
accommodationList: () =>
instance.get<AccommodationListData>('/backoffice-api/accommodations'),
};
20 changes: 10 additions & 10 deletions src/api/coupon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<staticsData | ''>(
statics: (accommodationId: string) =>
instance.get<StaticsData | ''>(
`/api/coupons/backoffice/statistics/${accommodationId}`,
),
getRevenue: (accommodationId: string) =>
instance.get<revenueData | ''>(
revenue: (accommodationId: string) =>
instance.get<RevenueData | ''>(
`/api/coupons/backoffice/revenue/${accommodationId}`,
),
getCoupon: (accommodationId: string) =>
instance.get<coupons>(`/api/coupons/backoffice/manage/${accommodationId}`),
coupon: (accommodationId: string) =>
instance.get<Coupons>(`/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<CouponRoomList>(
`/api/coupons/backoffice/buy/${accommodationId}`,
),
Expand Down
26 changes: 13 additions & 13 deletions src/api/coupon/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -45,18 +45,18 @@ export type EditCoupon = {
dayLimit: number;
couponType: string;
};
export type room<T> = {
export type Room<T> = {
roomId: number;
roomName: string;
roomPrice: number;
coupons: T[];
};

export type coupons = {
export type Coupons = {
accommodationId: number;
accommodationName: string;
expiry: string;
rooms: room<coupon>[];
rooms: Room<Coupon>[];
};
export type CouponDeleteParams = {
accommodationId: number;
Expand All @@ -66,13 +66,13 @@ export type CouponDeleteParams = {
export type CouponEditParams = {
accommodationId: number;
expiry: string;
rooms: Omit<room<EditCoupon>, 'roomPrice' | 'roomName'>[];
rooms: Omit<Room<EditCoupon>, 'roomPrice' | 'roomName'>[];
};

export type CouponRoomList = {
accommodationId: number;
accommodationName: string;
rooms: Pick<room<coupon>, 'roomId' | 'roomName' | 'roomPrice'>[];
rooms: Pick<Room<Coupon>, 'roomId' | 'roomName' | 'roomPrice'>[];
};

export type BuyCouponParams = {
Expand All @@ -99,8 +99,8 @@ export type PurchaseCouponParams = {
expiry: string;
totalPoints: number;
rooms: Omit<
room<
Omit<coupon, 'couponName' | 'appliedPrice' | 'quantity'> & {
Room<
Omit<Coupon, 'couponName' | 'appliedPrice' | 'quantity'> & {
eachPoint: number;
buyQuantity: number;
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
4 changes: 2 additions & 2 deletions src/api/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
} from './type';

export const ACCOMMODATION_REGISTRATION_API = {
postImageFile: (formData: FormData) =>
imageFile: (formData: FormData) =>
instance.post<PostImageFile>('/backoffice-api/images', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
}),

postAccommodationInfo: (params: PostAccommodationParams) =>
accommodationInfo: (params: PostAccommodationParams) =>
instance.post<PostAccommodation>('/backoffice-api/accommodations', params),
};
3 changes: 1 addition & 2 deletions src/api/logout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import { AxiosResponse } from 'axios';
import { instance } from '..';

export const LOGOUT_API = {
deleteLogout: (): Promise<AxiosResponse> =>
instance.delete('/api/auth/logout'),
logout: (): Promise<AxiosResponse> => instance.delete('/api/auth/logout'),
};
2 changes: 1 addition & 1 deletion src/api/member/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { instance } from '..';
import { UserInfoData } from './type';

export const MEMBER_API = {
getUserInfo: () => instance.get<Response<UserInfoData>>('/api/member'),
userInfo: () => instance.get<Response<UserInfoData>>('/api/member'),
};
4 changes: 2 additions & 2 deletions src/api/point-detail/get-point-detail/index.ts
Original file line number Diff line number Diff line change
@@ -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<PointDetailDataType>(
`/api/points/${menuStatus}?page=${page - 1}`,
),
Expand Down
6 changes: 3 additions & 3 deletions src/api/point-detail/get-point-detail/type.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,7 +24,7 @@ export type History = {
id: number;
category: string;
type: string;
status: badgeProps;
status: BadgeProps;
name: string;
description: string;
trade: number;
Expand All @@ -41,4 +41,4 @@ export type PointDetailDataType = {
histories: History[];
};

export type menuStatusType = 'total' | 'charges' | 'usages';
export type MenuStatusType = 'total' | 'charges' | 'usages';
2 changes: 1 addition & 1 deletion src/api/point-detail/orderCancel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { instance } from '../..';
import { CancelType } from './type';

export const ORDER_CANCEL_API = {
deleteOrderCancel: (chargeId: number) =>
orderCancel: (chargeId: number) =>
instance.delete<CancelType>(`/api/points/charges/${chargeId}`),
};
5 changes: 2 additions & 3 deletions src/api/point/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { instance } from '..';
import { PointSummaryData, PointTotalData } from './type';

export const POINT_API = {
getPointSummary: (rangeDate: string) =>
pointSummary: (rangeDate: string) =>
instance.get<PointSummaryData>(
`/api/points/summary?rangeDate=${rangeDate}`,
),

getPointTotal: () =>
instance.get<PointTotalData>('/api/points/total-balance'),
totalPoint: () => instance.get<PointTotalData>('/api/points/total-balance'),
};
2 changes: 1 addition & 1 deletion src/api/refresh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { instance } from '..';
import { PostRefreshData, RefreshData } from './type';

export const REFRESH_API = {
postRefresh: (data: RefreshData) =>
refreshToken: (data: RefreshData) =>
instance.post<PostRefreshData>('/api/auth/refresh', data),
};
Loading

0 comments on commit 041dea7

Please sign in to comment.