Merge branch 'main' of https://gitea.bpsoft.co.kr/nicepayments/nice-app-web
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ADDITIONAL_SERVICE } from '@/shared/api/api-url-additional-service';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ExtensionFundAccountTransferRequestParams,
|
||||
ExtensionFundAccountTransferRequestResponse
|
||||
} from '../../model/fund-account/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const extensionFundAccountTransferRequest = (params: ExtensionFundAccountTransferRequestParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionFundAccountTransferRequestResponse>(API_URL_ADDITIONAL_SERVICE.extensionFundAccountTransferRequest(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionFundAccountTransferRequestMutation = (options?: UseMutationOptions<ExtensionFundAccountTransferRequestResponse, CBDCAxiosError, ExtensionFundAccountTransferRequestParams>) => {
|
||||
const mutation = useMutation<ExtensionFundAccountTransferRequestResponse, CBDCAxiosError, ExtensionFundAccountTransferRequestParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionFundAccountTransferRequestParams) => extensionFundAccountTransferRequest(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
151
src/entities/additional-service/model/fund-account/types.ts
Normal file
151
src/entities/additional-service/model/fund-account/types.ts
Normal file
@@ -0,0 +1,151 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
export enum FundAccountTabKeys {
|
||||
TransferList = 'TransferList',
|
||||
ResultList = 'ResultList'
|
||||
}
|
||||
|
||||
export interface FundAccountTabProps {
|
||||
activeTab: FundAccountTabKeys;
|
||||
}
|
||||
|
||||
|
||||
export interface ExtensionFundAccountTransferRequestParams {
|
||||
mid: string;
|
||||
transferAmount: number;
|
||||
receiveBankCode: string;
|
||||
receiveAccountNo: string;
|
||||
receiveAccountName: string;
|
||||
transferMemo: string;
|
||||
};
|
||||
export interface ExtensionFundAccountTransferRequestResponse {
|
||||
tid: string;
|
||||
result: string;
|
||||
message: string;
|
||||
};
|
||||
export enum FundAccountStatus {
|
||||
ALL = 'ALL',
|
||||
SUCCESS = 'SUCCESS',
|
||||
FAIL = 'FAIL',
|
||||
PENDING = 'PENDING'
|
||||
};
|
||||
export interface ExtensionFundAccountTransferListParams {
|
||||
mid: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
status: FundAccountStatus;
|
||||
pagination: DefaultRequestPagination;
|
||||
}
|
||||
export interface ExtensionFundAccountTransferListResponse extends DefaulResponsePagination {
|
||||
content: Array<FundAccountTransferContent>;
|
||||
};
|
||||
export interface FundAccountTransferContent {
|
||||
pagination: string;
|
||||
items: Array<FundAccountTransferContentItem>;
|
||||
};
|
||||
export interface FundAccountTransferContentItem {
|
||||
tid: string;
|
||||
requestDate: string;
|
||||
transferAmount: number;
|
||||
receiveBankName: string;
|
||||
receiveAccountNo: string;
|
||||
receiveAccountName: string;
|
||||
status: FundAccountStatus;
|
||||
processDate: string;
|
||||
};
|
||||
export interface FundAccountTransferExcelParams {
|
||||
mid: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
status: FundAccountStatus;
|
||||
};
|
||||
export interface FundAccountTransferExcelResponse {};
|
||||
export interface FundAccountTransferDetailParams {
|
||||
mid: string;
|
||||
tid: string;
|
||||
};
|
||||
export interface FundAccountTransferDetailResponse {
|
||||
tid: string;
|
||||
requestDate: string;
|
||||
transferAmount: number;
|
||||
receiveBankName: string;
|
||||
receiveAccountNo: string;
|
||||
receiveAccountName: string;
|
||||
status: FundAccountStatus;
|
||||
processDate: string;
|
||||
failReason: string;
|
||||
fee: number;
|
||||
afterBalance: number;
|
||||
};
|
||||
export interface FundAccountResultSummaryParams {
|
||||
mid: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
};
|
||||
export interface FundAccountResultSummaryResponse {
|
||||
totalCount: number;
|
||||
totalAmount: number;
|
||||
successCount: number;
|
||||
successAmount: number;
|
||||
failCount: number;
|
||||
failAmount: number;
|
||||
pendingCount: number;
|
||||
pendingAmount: number;
|
||||
};
|
||||
export interface FundAccountResultListParams {
|
||||
mid: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
status: FundAccountStatus;
|
||||
pagination: FundAccountStatus;
|
||||
};
|
||||
export interface FundAccountResultListResponse extends DefaulResponsePagination {
|
||||
content: Array<FundAccountResultContent>;
|
||||
};
|
||||
export interface FundAccountResultContent {
|
||||
pagination: string;
|
||||
items: Array<FundAccountResultContentItem>;
|
||||
};
|
||||
export interface FundAccountResultContentItem {
|
||||
tid: string;
|
||||
requestDate: string;
|
||||
transferAmount: number;
|
||||
receiveBankName: string;
|
||||
receiveAccountNo: string;
|
||||
receiveAccountName: string;
|
||||
status: FundAccountStatus;
|
||||
processDate: string;
|
||||
failReason: string;
|
||||
};
|
||||
export interface FundAccountResultExcelParams {
|
||||
mid: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
status: FundAccountStatus;
|
||||
};
|
||||
export interface FundAccountResultExcelResponse {};
|
||||
export interface FundAccountResultDetailParams {
|
||||
mid: string;
|
||||
tid: string;
|
||||
};
|
||||
export interface FundAccountResultDetailResponse {
|
||||
tid: string;
|
||||
requestDate: string;
|
||||
transferAmount: number;
|
||||
receiveBankName: string;
|
||||
receiveAccountNo: string;
|
||||
receiveAccountName: string;
|
||||
status: FundAccountStatus;
|
||||
processDate: string;
|
||||
failReason: string;
|
||||
fee: number;
|
||||
afterBalance: number;
|
||||
transferMemo: string;
|
||||
bankTid: string;
|
||||
};
|
||||
export interface FundAccountBalanceParams {
|
||||
mid: string;
|
||||
};
|
||||
export interface FundAccountBalanceResponse {
|
||||
balalnce: number;
|
||||
};
|
||||
@@ -29,7 +29,7 @@ export enum AdditionalServiceCategory {
|
||||
AccountHolderSearch = 'AccountHolderSearch',
|
||||
LinkPaymentHistory = 'LinkPaymentHistory',
|
||||
LinkPaymentPending = 'LinkPaymentPending',
|
||||
FundTransfer = 'FundTransfer',
|
||||
FundAccount = 'FundAccount',
|
||||
SettlementAgency = 'SettlementAgency',
|
||||
Payout = 'Payout',
|
||||
}
|
||||
@@ -339,19 +339,6 @@ export interface DetailInfoSectionProps extends DetailResponse {
|
||||
onClickToShowInfo?: (info: DetailInfoSectionKeys) => void;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 자금이체 관련 타입들
|
||||
// ========================================
|
||||
|
||||
export enum FundTransferTabKeys {
|
||||
RequestList = 'RequestList',
|
||||
ResultInquiry = 'ResultInquiry'
|
||||
}
|
||||
|
||||
export interface FundTransferTabProps {
|
||||
activeTab: FundTransferTabKeys;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 정산기관 관련 타입들
|
||||
// ========================================
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||
|
||||
export const FundTransferResultInquiryWrap = () => {
|
||||
export const FundAccountResultListWrap = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
37
src/entities/additional-service/ui/fund-account/tab.tsx
Normal file
37
src/entities/additional-service/ui/fund-account/tab.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import {
|
||||
FundAccountTabKeys,
|
||||
FundAccountTabProps
|
||||
} from '../../model/fund-account/types';
|
||||
export const FundAccountTab = ({
|
||||
activeTab
|
||||
}: FundAccountTabProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const onClickToNavigation = (tab: FundAccountTabKeys) => {
|
||||
if(activeTab !== tab){
|
||||
if(tab === FundAccountTabKeys.TransferList){
|
||||
navigate(PATHS.additionalService.fundAccount.transferList);
|
||||
}
|
||||
else if(tab === FundAccountTabKeys.ResultList){
|
||||
navigate(PATHS.additionalService.fundAccount.resultList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="subTab">
|
||||
<button
|
||||
className={`subtab-btn ${(activeTab === FundAccountTabKeys.TransferList)? 'active': ''}` }
|
||||
onClick={ () => onClickToNavigation(FundAccountTabKeys.TransferList) }
|
||||
>이체 신청</button>
|
||||
<button
|
||||
className={`subtab-btn ${(activeTab === FundAccountTabKeys.ResultList)? 'active': ''}` }
|
||||
onClick={ () => onClickToNavigation(FundAccountTabKeys.ResultList) }
|
||||
>결과 조회</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||
|
||||
export const FundTransferRequestListWrap = () => {
|
||||
export const FundAccountTransferListWrap = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -1,37 +0,0 @@
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import {
|
||||
FundTransferTabKeys,
|
||||
FundTransferTabProps
|
||||
} from '../../model/types';
|
||||
export const FundTransferTab = ({
|
||||
activeTab
|
||||
}: FundTransferTabProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const onClickToNavigation = (tab: FundTransferTabKeys) => {
|
||||
if(activeTab !== tab){
|
||||
if(tab === FundTransferTabKeys.RequestList){
|
||||
navigate(PATHS.additionalService.fundTransfer.requestList);
|
||||
}
|
||||
else if(tab === FundTransferTabKeys.ResultInquiry){
|
||||
navigate(PATHS.additionalService.fundTransfer.resultInquiry);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="subTab">
|
||||
<button
|
||||
className={`subtab-btn ${(activeTab === FundTransferTabKeys.RequestList)? 'active': ''}` }
|
||||
onClick={ () => onClickToNavigation(FundTransferTabKeys.RequestList) }
|
||||
>이체 신청</button>
|
||||
<button
|
||||
className={`subtab-btn ${(activeTab === FundTransferTabKeys.ResultInquiry)? 'active': ''}` }
|
||||
onClick={ () => onClickToNavigation(FundTransferTabKeys.ResultInquiry) }
|
||||
>결과 조회</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -137,7 +137,7 @@ export const ListItem = ({
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.FundTransfer) {
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.FundAccount) {
|
||||
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.SettlementAgency) {
|
||||
|
||||
Reference in New Issue
Block a user