지급대행 중간커밋
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ExtensionPayoutRequestParams,
|
||||
ExtensionPayoutRequestResponse
|
||||
} from '../..model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const extensionPayoutRequestCard = (params: ExtensionPayoutRequestParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionPayoutRequestResponse>(API_URL_PAYMENT.paymentCard(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionPayoutRequestMutation = (options?: UseMutationOptions<ExtensionPayoutRequestResponse, CBDCAxiosError, ExtensionPayoutRequestParams>) => {
|
||||
const mutation = useMutation<ExtensionPayoutRequestResponse, CBDCAxiosError, ExtensionPayoutRequestParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionPayoutRequestParams) => extensionPayoutRequestCard(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
59
src/entities/additional-service/model/payout/types.ts
Normal file
59
src/entities/additional-service/model/payout/types.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
export interface ExtensionPayoutRequestParams {
|
||||
mid: string;
|
||||
submallId: string;
|
||||
disbursementAmount: number;
|
||||
settlementDate: string;
|
||||
};
|
||||
export interface ExtensionPayoutRequestResponse {};
|
||||
export enum PayoutSearchCl {
|
||||
REQUEST_DATE = 'REQUEST_DATE',
|
||||
PROXY_DATE = 'PROXY_DATE',
|
||||
};
|
||||
export enum PayoutDisbursementStatus {
|
||||
ALL = 'ALL',
|
||||
REQUEST = 'REQUEST',
|
||||
SUCCESS = 'SUCCESS',
|
||||
FAIL = 'FAIL',
|
||||
};
|
||||
export interface ExtensionPayoutListParams {
|
||||
mid: string;
|
||||
searchCl: PayoutSearchCl,
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
disbursementStatus: PayoutDisbursementStatus;
|
||||
minAmount: number;
|
||||
maxAmount: number;
|
||||
page: DefaultRequestPagination;
|
||||
};
|
||||
export interface ExtensionPayoutListResponse extends DefaulResponsePagination{
|
||||
content: Array<PayoutContent>
|
||||
};
|
||||
export interface PayoutContent {
|
||||
tid: string;
|
||||
submallId: string;
|
||||
requestDate: string;
|
||||
settlementDate: string;
|
||||
companyName: string;
|
||||
disbursementStatus: PayoutDisbursementStatus;
|
||||
disbursementAmount: number;
|
||||
};
|
||||
export interface ExtensionPayoutExcelParams {
|
||||
mid: string;
|
||||
searchCl: PayoutSearchCl,
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
disbursementStatus: PayoutDisbursementStatus;
|
||||
minAmount: number;
|
||||
maxAmount: number;
|
||||
};
|
||||
export interface ExtensionPayoutExcelResponse {}
|
||||
|
||||
export interface ExtensionPayoutDetailParams {
|
||||
|
||||
};
|
||||
export interface ExtensionPayoutDetailResponse {
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user