자금ㅇㅣㅊㅔ api
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,
|
||||
};
|
||||
};
|
||||
141
src/entities/additional-service/model/fund-account/types.ts
Normal file
141
src/entities/additional-service/model/fund-account/types.ts
Normal file
@@ -0,0 +1,141 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
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;
|
||||
};
|
||||
@@ -121,7 +121,8 @@ export const API_URL_ADDITIONAL_SERVICE = {
|
||||
// POST: 알림톡 결제 통보 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/detail`;
|
||||
},
|
||||
// Payou tManagement 부가서비스 > 지급대행 API
|
||||
|
||||
// Payout Management 부가서비스 > 지급대행 API
|
||||
extensionPayoutRequest: () => {
|
||||
// POST: 지급대행 신청
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/payout/request`;
|
||||
@@ -142,4 +143,42 @@ export const API_URL_ADDITIONAL_SERVICE = {
|
||||
// POST: 지급대행 상세 조회 > 입출금 확인증 다운로드
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/payout/detail/download/certificate`;
|
||||
},
|
||||
|
||||
// Fund Account Management 부가서비스 > 자금이체 API
|
||||
extensionFundAccountTransferRequest: () => {
|
||||
// POST: 자금이체 > 이체신청
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/transfer/request`;
|
||||
},
|
||||
extensionFundAccountTransferList: () => {
|
||||
// POST: 자금이체 이체내역 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/transfer/list`;
|
||||
},
|
||||
extensionFundAccountTransferExcel: () => {
|
||||
// POST: 자금이체 이체내역 엑셀 다운
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/transfer/excel`;
|
||||
},
|
||||
extensionFundAccountTransferDetail: () => {
|
||||
// POST: 자금이체 이체내역 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/transfer/detail`;
|
||||
},
|
||||
extensionFundAccountResultSummary: () => {
|
||||
// POST: 자금이체 처리결과 요약 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/result/summary`;
|
||||
},
|
||||
extensionFundAccountResultList: () => {
|
||||
// POST: 자금이체 처리결과 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/result/list`;
|
||||
},
|
||||
extensionFundAccountResultExcel: () => {
|
||||
// POST: 자금이체 이체내역 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/result/excel`;
|
||||
},
|
||||
extensionFundAccountResultDetail: () => {
|
||||
// POST: 자금이체 처리결과 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/result/detail`;
|
||||
},
|
||||
extensionFundAccountBalance: () => {
|
||||
// POST: 자금이체 이체내역 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/fund-account/balance`;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user