generated from pricelees/issue-pr-template
[#35] 결제 스키마 재정의 & 예약 조회 페이지 개선 #36
@ -1,5 +1,5 @@
|
|||||||
export interface MemberRetrieveResponse {
|
export interface MemberRetrieveResponse {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,6 +14,6 @@ export interface SignupRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SignupResponse {
|
export interface SignupResponse {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export const searchReservations = async (params: ReservationSearchQuery): Promis
|
|||||||
};
|
};
|
||||||
|
|
||||||
// DELETE /reservations/{id}
|
// DELETE /reservations/{id}
|
||||||
export const cancelReservationByAdmin = async (id: number): Promise<void> => {
|
export const cancelReservationByAdmin = async (id: string): Promise<void> => {
|
||||||
return await apiClient.del(`/reservations/${id}`, true);
|
return await apiClient.del(`/reservations/${id}`, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,16 +55,16 @@ export const createWaiting = async (data: WaitingCreateRequest): Promise<Reserva
|
|||||||
};
|
};
|
||||||
|
|
||||||
// DELETE /reservations/waiting/{id}
|
// DELETE /reservations/waiting/{id}
|
||||||
export const cancelWaiting = async (id: number): Promise<void> => {
|
export const cancelWaiting = async (id: string): Promise<void> => {
|
||||||
return await apiClient.del(`/reservations/waiting/${id}`, true);
|
return await apiClient.del(`/reservations/waiting/${id}`, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// POST /reservations/waiting/{id}/confirm
|
// POST /reservations/waiting/{id}/confirm
|
||||||
export const confirmWaiting = async (id: number): Promise<void> => {
|
export const confirmWaiting = async (id: string): Promise<void> => {
|
||||||
return await apiClient.post(`/reservations/waiting/${id}/confirm`, {}, true);
|
return await apiClient.post(`/reservations/waiting/${id}/confirm`, {}, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// POST /reservations/waiting/{id}/reject
|
// POST /reservations/waiting/{id}/reject
|
||||||
export const rejectWaiting = async (id: number): Promise<void> => {
|
export const rejectWaiting = async (id: string): Promise<void> => {
|
||||||
return await apiClient.post(`/reservations/waiting/${id}/reject`, {}, true);
|
return await apiClient.post(`/reservations/waiting/${id}/reject`, {}, true);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export type ReservationStatus =
|
|||||||
| typeof ReservationStatus.WAITING;
|
| typeof ReservationStatus.WAITING;
|
||||||
|
|
||||||
export interface MyReservationRetrieveResponse {
|
export interface MyReservationRetrieveResponse {
|
||||||
id: number;
|
id: string;
|
||||||
themeName: string;
|
themeName: string;
|
||||||
date: string;
|
date: string;
|
||||||
time: string;
|
time: string;
|
||||||
@ -29,7 +29,7 @@ export interface MyReservationRetrieveListResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ReservationRetrieveResponse {
|
export interface ReservationRetrieveResponse {
|
||||||
id: number;
|
id: string;
|
||||||
date: string;
|
date: string;
|
||||||
member: MemberRetrieveResponse;
|
member: MemberRetrieveResponse;
|
||||||
time: TimeRetrieveResponse;
|
time: TimeRetrieveResponse;
|
||||||
@ -43,15 +43,15 @@ export interface ReservationRetrieveListResponse {
|
|||||||
|
|
||||||
export interface AdminReservationCreateRequest {
|
export interface AdminReservationCreateRequest {
|
||||||
date: string;
|
date: string;
|
||||||
timeId: number;
|
timeId: string;
|
||||||
themeId: number;
|
themeId: string;
|
||||||
memberId: number;
|
memberId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReservationCreateWithPaymentRequest {
|
export interface ReservationCreateWithPaymentRequest {
|
||||||
date: string;
|
date: string;
|
||||||
timeId: number;
|
timeId: string;
|
||||||
themeId: number;
|
themeId: string;
|
||||||
paymentKey: string;
|
paymentKey: string;
|
||||||
orderId: string;
|
orderId: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
@ -60,13 +60,13 @@ export interface ReservationCreateWithPaymentRequest {
|
|||||||
|
|
||||||
export interface WaitingCreateRequest {
|
export interface WaitingCreateRequest {
|
||||||
date: string;
|
date: string;
|
||||||
timeId: number;
|
timeId: string;
|
||||||
themeId: number;
|
themeId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReservationSearchQuery {
|
export interface ReservationSearchQuery {
|
||||||
themeId?: number;
|
themeId?: string;
|
||||||
memberId?: number;
|
memberId?: string;
|
||||||
dateFrom?: string;
|
dateFrom?: string;
|
||||||
dateTo?: string;
|
dateTo?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,6 @@ export const mostReservedThemes = async (count: number = 10): Promise<ThemeRetri
|
|||||||
return await apiClient.get<ThemeRetrieveListResponse>(`/themes/most-reserved-last-week?count=${count}`, false);
|
return await apiClient.get<ThemeRetrieveListResponse>(`/themes/most-reserved-last-week?count=${count}`, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const delTheme = async (id: number): Promise<void> => {
|
export const delTheme = async (id: string): Promise<void> => {
|
||||||
return await apiClient.del(`/themes/${id}`, true);
|
return await apiClient.del(`/themes/${id}`, true);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,14 +5,14 @@ export interface ThemeCreateRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ThemeCreateResponse {
|
export interface ThemeCreateResponse {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
thumbnail: string;
|
thumbnail: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ThemeRetrieveResponse {
|
export interface ThemeRetrieveResponse {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
thumbnail: string;
|
thumbnail: string;
|
||||||
|
|||||||
@ -9,10 +9,10 @@ export const fetchTimes = async (): Promise<TimeRetrieveListResponse> => {
|
|||||||
return await apiClient.get<TimeRetrieveListResponse>('/times', true);
|
return await apiClient.get<TimeRetrieveListResponse>('/times', true);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const delTime = async (id: number): Promise<void> => {
|
export const delTime = async (id: string): Promise<void> => {
|
||||||
return await apiClient.del(`/times/${id}`, true);
|
return await apiClient.del(`/times/${id}`, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchTimesWithAvailability = async (date: string, themeId: number): Promise<TimeWithAvailabilityListResponse> => {
|
export const fetchTimesWithAvailability = async (date: string, themeId: string): Promise<TimeWithAvailabilityListResponse> => {
|
||||||
return await apiClient.get<TimeWithAvailabilityListResponse>(`/times/search?date=${date}&themeId=${themeId}`, true);
|
return await apiClient.get<TimeWithAvailabilityListResponse>(`/times/search?date=${date}&themeId=${themeId}`, true);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,12 +3,12 @@ export interface TimeCreateRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TimeCreateResponse {
|
export interface TimeCreateResponse {
|
||||||
id: number;
|
id: string;
|
||||||
startAt: string;
|
startAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TimeRetrieveResponse {
|
export interface TimeRetrieveResponse {
|
||||||
id: number;
|
id: string;
|
||||||
startAt: string;
|
startAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ export interface TimeRetrieveListResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TimeWithAvailabilityResponse {
|
export interface TimeWithAvailabilityResponse {
|
||||||
id: number;
|
id: string;
|
||||||
startAt: string;
|
startAt: string;
|
||||||
isAvailable: boolean;
|
isAvailable: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,11 +26,11 @@ const MyReservationPage: React.FC = () => {
|
|||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const _cancelWaiting = (id: number) => {
|
const _cancelWaiting = (id: string) => {
|
||||||
cancelWaiting(id)
|
cancelWaiting(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
alert('예약 대기가 취소되었습니다.');
|
alert('예약 대기가 취소되었습니다.');
|
||||||
setReservations(reservations.filter(r => r.id !== id));
|
setReservations(reservations.filter(r => r.id.toString() !== id));
|
||||||
})
|
})
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
};
|
};
|
||||||
@ -74,7 +74,7 @@ const MyReservationPage: React.FC = () => {
|
|||||||
<td>{getStatusText(r.status, r.rank)}</td>
|
<td>{getStatusText(r.status, r.rank)}</td>
|
||||||
<td>
|
<td>
|
||||||
{r.status === ReservationStatus.WAITING &&
|
{r.status === ReservationStatus.WAITING &&
|
||||||
<button className="btn btn-danger" onClick={() => _cancelWaiting(r.id)}>취소</button>}
|
<button className="btn btn-danger" onClick={() => _cancelWaiting(r.id.toString())}>취소</button>}
|
||||||
</td>
|
</td>
|
||||||
<td>{r.paymentKey}</td>
|
<td>{r.paymentKey}</td>
|
||||||
<td>{r.amount}</td>
|
<td>{r.amount}</td>
|
||||||
|
|||||||
@ -18,9 +18,9 @@ declare global {
|
|||||||
const ReservationPage: React.FC = () => {
|
const ReservationPage: React.FC = () => {
|
||||||
const [selectedDate, setSelectedDate] = useState<Date | null>(new Date());
|
const [selectedDate, setSelectedDate] = useState<Date | null>(new Date());
|
||||||
const [themes, setThemes] = useState<ThemeRetrieveResponse[]>([]);
|
const [themes, setThemes] = useState<ThemeRetrieveResponse[]>([]);
|
||||||
const [selectedTheme, setSelectedTheme] = useState<number | null>(null);
|
const [selectedTheme, setSelectedTheme] = useState<string | null>(null);
|
||||||
const [times, setTimes] = useState<TimeWithAvailabilityResponse[]>([]);
|
const [times, setTimes] = useState<TimeWithAvailabilityResponse[]>([]);
|
||||||
const [selectedTime, setSelectedTime] = useState<{ id: number, isAvailable: boolean } | null>(null);
|
const [selectedTime, setSelectedTime] = useState<{ id: string, isAvailable: boolean } | null>(null);
|
||||||
const paymentWidgetRef = useRef<any>(null);
|
const paymentWidgetRef = useRef<any>(null);
|
||||||
const paymentMethodsRef = useRef<any>(null);
|
const paymentMethodsRef = useRef<any>(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@ -90,7 +90,7 @@ const AdminReservationPage: React.FC = () => {
|
|||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteReservation = async(id: number) => {
|
const deleteReservation = async(id: string) => {
|
||||||
if (!window.confirm('정말 삭제하시겠어요?')) {
|
if (!window.confirm('정말 삭제하시겠어요?')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ const AdminThemePage: React.FC = () => {
|
|||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteTheme = async (id: number) => {
|
const deleteTheme = async (id: string) => {
|
||||||
if (!window.confirm('정말 삭제하시겠어요?')) {
|
if (!window.confirm('정말 삭제하시겠어요?')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ const AdminTimePage: React.FC = () => {
|
|||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteTime = async (id: number) => {
|
const deleteTime = async (id: string) => {
|
||||||
if (!window.confirm('정말 삭제하시겠어요?')) {
|
if (!window.confirm('정말 삭제하시겠어요?')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ const AdminWaitingPage: React.FC = () => {
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const approveWaiting = async (id: number) => {
|
const approveWaiting = async (id: string) => {
|
||||||
await confirmWaiting(id)
|
await confirmWaiting(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
alert('대기 중인 예약을 승인했어요. 결제는 별도로 진행해주세요.');
|
alert('대기 중인 예약을 승인했어요. 결제는 별도로 진행해주세요.');
|
||||||
@ -38,7 +38,7 @@ const AdminWaitingPage: React.FC = () => {
|
|||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
};
|
};
|
||||||
|
|
||||||
const denyWaiting = async (id: number) => {
|
const denyWaiting = async (id: string) => {
|
||||||
await rejectWaiting(id)
|
await rejectWaiting(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
alert('대기 중인 예약을 거절했어요.');
|
alert('대기 중인 예약을 거절했어요.');
|
||||||
|
|||||||
4
src/main/resources/test.http
Normal file
4
src/main/resources/test.http
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
### GET request to example server
|
||||||
|
POST localhost:8080/savetest
|
||||||
|
|
||||||
|
###
|
||||||
Loading…
x
Reference in New Issue
Block a user