지급대행 중간커밋
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 {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
@@ -8,14 +8,14 @@ import {
|
|||||||
useSetOnBack
|
useSetOnBack
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
|
|
||||||
export const PaymentAgencyDetailPage = () => {
|
export const PayoutDetailPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
useSetHeaderTitle('지급대행 상세');
|
useSetHeaderTitle('지급대행 상세');
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
useSetOnBack(() => {
|
useSetOnBack(() => {
|
||||||
navigate(PATHS.additionalService.paymentAgency.list);
|
navigate(PATHS.additionalService.payout.list);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
useSetOnBack
|
useSetOnBack
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
|
|
||||||
export const PaymentAgencyListPage = () => {
|
export const PayoutListPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
useSetHeaderTitle('지급대행');
|
useSetHeaderTitle('지급대행');
|
||||||
@@ -20,10 +20,10 @@ export const PaymentAgencyListPage = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onClickToNavigation = () => {
|
const onClickToNavigation = () => {
|
||||||
navigate(PATHS.additionalService.paymentAgency.request);
|
navigate(PATHS.additionalService.payout.request);
|
||||||
};
|
};
|
||||||
const onClickToGoDetail = (tid?: string) => {
|
const onClickToGoDetail = (tid?: string) => {
|
||||||
navigate(PATHS.additionalService.paymentAgency.detail, {
|
navigate(PATHS.additionalService.payout.detail, {
|
||||||
state: {
|
state: {
|
||||||
tid: 'A123456'
|
tid: 'A123456'
|
||||||
}
|
}
|
||||||
@@ -9,14 +9,14 @@ import {
|
|||||||
useSetOnBack
|
useSetOnBack
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
|
|
||||||
export const PaymentAgencyRequestPage = () => {
|
export const PayoutRequestPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
useSetHeaderTitle('지급대행 신청');
|
useSetHeaderTitle('지급대행 신청');
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
useSetOnBack(() => {
|
useSetOnBack(() => {
|
||||||
navigate(PATHS.additionalService.paymentAgency.list);
|
navigate(PATHS.additionalService.payout.list);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -247,7 +247,7 @@ export const PATHS: RouteNamesType = {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
settlementAgency: {
|
settlementAgency: {
|
||||||
base: generatePath(`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.paymentAgency.base}`),
|
base: generatePath(`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.payout.base}`),
|
||||||
manage: generatePath(
|
manage: generatePath(
|
||||||
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.settlementAgency.base}`,
|
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.settlementAgency.base}`,
|
||||||
ROUTE_NAMES.additionalService.settlementAgency.manage,
|
ROUTE_NAMES.additionalService.settlementAgency.manage,
|
||||||
@@ -269,19 +269,19 @@ export const PATHS: RouteNamesType = {
|
|||||||
ROUTE_NAMES.additionalService.settlementAgency.detail,
|
ROUTE_NAMES.additionalService.settlementAgency.detail,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
paymentAgency: {
|
payout: {
|
||||||
base: generatePath(`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.paymentAgency.base}`),
|
base: generatePath(`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.payout.base}`),
|
||||||
list: generatePath(
|
list: generatePath(
|
||||||
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.paymentAgency.base}`,
|
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.payout.base}`,
|
||||||
ROUTE_NAMES.additionalService.paymentAgency.list,
|
ROUTE_NAMES.additionalService.payout.list,
|
||||||
),
|
),
|
||||||
detail: generatePath(
|
detail: generatePath(
|
||||||
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.paymentAgency.base}`,
|
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.payout.base}`,
|
||||||
ROUTE_NAMES.additionalService.paymentAgency.detail,
|
ROUTE_NAMES.additionalService.payout.detail,
|
||||||
),
|
),
|
||||||
request: generatePath(
|
request: generatePath(
|
||||||
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.paymentAgency.base}`,
|
`${ROUTE_NAMES.additionalService.base}${ROUTE_NAMES.additionalService.payout.base}`,
|
||||||
ROUTE_NAMES.additionalService.paymentAgency.request,
|
ROUTE_NAMES.additionalService.payout.request,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ export const ROUTE_NAMES = {
|
|||||||
register: 'register',
|
register: 'register',
|
||||||
detail: 'detail',
|
detail: 'detail',
|
||||||
},
|
},
|
||||||
paymentAgency: {
|
payout: {
|
||||||
base: '/payment-agency/*',
|
base: '/payout/*',
|
||||||
list: 'list',
|
list: 'list',
|
||||||
detail: 'detail',
|
detail: 'detail',
|
||||||
request: 'request',
|
request: 'request',
|
||||||
|
|||||||
Reference in New Issue
Block a user