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