# Conflicts:
#	src/entities/additional-service/model/types.ts
This commit is contained in:
focp212@naver.com
2025-09-22 13:51:41 +09:00
16 changed files with 417 additions and 161 deletions

View File

@@ -0,0 +1,56 @@
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 {
DetailResponse,
TitleInfo,
ExtensionLinkPayHistoryDetailParams, ExtensionLinkPayHistoryDetailResponse,
DetailInfo,
PaymentInfo
} from '../../model/types';
import {
useMutation,
UseMutationOptions
} from '@tanstack/react-query';
export const extensionLinkPayHistoryDetail = async (params: ExtensionLinkPayHistoryDetailParams): Promise<DetailResponse> => {
const response = await resultify(
axios.post<ExtensionLinkPayHistoryDetailResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentHistoryDetail(), params),
);
const detailResponse: DetailResponse = {
titleInfo: {
amount: response.amount,
corpName: response.corpName,
requestDate: response.paymentDate
} as TitleInfo,
paymentInfo: {
buyerName: response.buyerName,
sendMethod: response.sendMethod,
sendDate: response.sendDate,
paymentStatus: response.paymentMethod,
failCount: response.failCount,
paymentMethod: response.paymentMethod,
paymentDate: response.paymentDate,
paymentLimitDate: response.paymentLimitDate
} as PaymentInfo,
detailInfo: {
email: response.email,
phoneNumber: response.phoneNumber,
moid: response.moid
} as DetailInfo
}
return detailResponse
}
export const useExtensionLinkPayHistoryDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, ExtensionLinkPayHistoryDetailParams>) => {
const mutation = useMutation<DetailResponse, CBDCAxiosError, ExtensionLinkPayHistoryDetailParams>({
...options,
mutationFn: (params: ExtensionLinkPayHistoryDetailParams) => extensionLinkPayHistoryDetail(params),
});
return {
...mutation,
};
}

View File

@@ -0,0 +1,26 @@
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 { ExtensionLinkPayHistoryResendParams, ExtensionLinkPayHistoryResendResponse } from '../../model/types';
import {
useMutation,
UseMutationOptions
} from '@tanstack/react-query';
export const extensionLinkPayHistoryResend = (params: ExtensionLinkPayHistoryResendParams) => {
return resultify(
axios.post<ExtensionLinkPayHistoryResendResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentHistoryResend(), params)
);
};
export const useExtensionLinkPayHistoryResendMutation = (options?: UseMutationOptions<ExtensionLinkPayHistoryResendResponse, CBDCAxiosError, ExtensionLinkPayHistoryResendParams>) => {
const mutation = useMutation<ExtensionLinkPayHistoryResendResponse, CBDCAxiosError, ExtensionLinkPayHistoryResendParams>({
...options,
mutationFn: (params: ExtensionLinkPayHistoryResendParams) => extensionLinkPayHistoryResend(params),
});
return {
...mutation,
};
};

View File

@@ -37,9 +37,12 @@ export enum AdditionalServiceCategory {
// ========================================
export interface TitleInfo {
amount?: number,
corpName?: string,
accountNo?: string,
bankName?: string,
requestDate?: string
requestDate?: string,
sendDate?: string
}
export interface DetailInfo {
@@ -50,12 +53,19 @@ export interface DetailInfo {
failureReason?: string; // 실패사유
accountNo?: string; // 계좌번호
requestWay?: string; //요청 구분
email: string;
phoneNumber: string;
//상품명 필요
moid: string;
}
export interface PaymentInfo {
buyerName?: string;
sendMethod?: string;
sendDate?: string;
failCount?: number;
paymentStatus?: string;
paymentMethod?: string;
paymentDate?: string;
@@ -209,7 +219,7 @@ export interface LinkPaymentShippingListItem {
amount?: number;
}
export interface LinkPaymentPendingListItem {
export interface LinkPaymentWaitListItem {
tid?: string;
scheduledSendDate?: string;
sendMethod?: string;
@@ -223,7 +233,7 @@ export interface LinkPaymentShippingListProps {
listItems: Record<string, Array<ListItemProps>>;
}
export interface LinkPaymentPendingListProps {
export interface LinkPaymentWaitListProps {
additionalServiceCategory: AdditionalServiceCategory;
listItems: Record<string, Array<ListItemProps>>;
}
@@ -321,7 +331,7 @@ export interface SettlementAgencyBottomAgreeProps {
export interface ListItemProps extends
KeyInPaymentListItem, AccountHolderSearchListItem,
LinkPaymentShippingListItem, LinkPaymentPendingListItem,
LinkPaymentShippingListItem, LinkPaymentWaitListItem,
PayoutContent
{
additionalServiceCategory?: AdditionalServiceCategory;
@@ -365,6 +375,36 @@ export interface ExtensionLinkPayHistoryListResponse extends DefaulResponsePagin
content: Array<ListItemProps>
}
export interface ExtensionLinkPayHistoryDetailParams extends ExtensionRequestParams {
tid: string;
}
export interface ExtensionLinkPayHistoryDetailResponse {
tid: string;
amount: number;
corpName: string;
sendDate: string;
buyerName: string;
sendMethod: string;
paymentStatus: string;
failCount: number;
paymentMethod: string;
paymentDate: string;
paymentLimitDate: string;
email: string;
phoneNumber: string;
goodsName: string;
moid: string;
}
export interface ExtensionLinkPayHistoryResendParams extends ExtensionRequestParams {
tid: string;
}
export interface ExtensionLinkPayHistoryResendResponse {
status: boolean
}
export interface ExtensionLinkPayWaitListParams extends ExtensionRequestParams {
searchCl: string;
searchValue: string;
@@ -380,6 +420,26 @@ export interface ExtensionLinkPayWaitListResponse extends DefaulResponsePaginati
content: Array<ListItemProps>
}
export interface ExtensionLinkPayWaitDetailParams extends ExtensionRequestParams {
tid: string;
}
export interface ExtensionLinkPayWaitDetailResponse {
tid: string;
amount: number;
corpName: string;
scheduledSendDate: string;
processStatus: string;
requestDate: string;
paymentLimitDate: string;
sendMethod: string;
buyerName: string
email: string;
phoneNumber: string;
goodsName: string;
moid: string;
}
// 계좌 성명 조회 확장 서비스
// ========================================
export interface ExtensionAccountHolderSearchListParams extends ExtensionRequestParams { // Request

View File

@@ -1,6 +1,6 @@
import moment from 'moment';
import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
import { DetailInfoSectionProps } from '../../model/types';
import { AdditionalServiceCategory, DetailInfoSectionProps } from '../../model/types';
import { SlideDown } from 'react-slidedown';
import 'react-slidedown/lib/slidedown.css';
@@ -9,39 +9,35 @@ export const DetailInfoWrap = ({
detailInfo
}: DetailInfoSectionProps) => {
console.log("DetailInfo Check: ", detailInfo)
return (
<>
<div className="detail-title"> </div>
<ul className="kv-list">
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.accountName}</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">{detailInfo?.requestDate}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.resultStatus}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.failureReason}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.bankName}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.accountNo}</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">{detailInfo?.requestWay}</span>
</li>
</ul>
<div className="txn-section">
<div className="section-title"> </div>
<ul className="kv-list">
{(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) &&
<>
< li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.email}</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">{detailInfo?.phoneNumber}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v"> respone </span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{detailInfo?.moid}</span>
</li>
</>
}
</ul >
</div >
</>
)
};

View File

@@ -1,8 +1,71 @@
import { DetailInfoSectionProps } from '../../model/types';
import moment from 'moment';
import { AdditionalServiceCategory, DetailInfoSectionProps } from '../../model/types';
import { getPaymentStatusText, getSendMethodText } from '../../lib/payment-status-utils';
export const PaymentInfoWrap = ({
additionalServiceCategory,
paymentInfo
}: DetailInfoSectionProps) => {
}
const checkValue = (val: any) => {
return (!!val || val === 0);
};
console.log("PaymentInfo Check: ", paymentInfo)
return (
<>
<div className="txn-section">
<div className="section-title"> </div>
<ul className="kv-list">
{(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) &&
<>
<li className="kv-row">
<span className="k"></span>
<span className="v">{paymentInfo?.buyerName}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{getSendMethodText(paymentInfo?.sendMethod)}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">
{paymentInfo?.sendDate && moment(paymentInfo.sendDate).format('YYYY.MM.DD')}
</span>
</li>
<li className="kv-row">
<span className="k">()</span>
<span className="v"> {`${getPaymentStatusText(paymentInfo?.paymentStatus)}(${paymentInfo?.failCount})`}</span>
</li>
{checkValue(paymentInfo?.failCount) && (
<li className="kv-row">
<span className="k"></span>
<span className="v">{paymentInfo?.failCount}</span>
</li>
)}
<li className="kv-row">
<span className="k"></span>
<span className="v">{paymentInfo?.paymentMethod}</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">
{paymentInfo?.paymentDate && paymentInfo.paymentDate}
</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">
{paymentInfo?.paymentLimitDate && moment(paymentInfo.paymentLimitDate).format('YYYY.MM.DD')}
</span>
</li>
</>
}
</ul>
</div>
</>
)
}

View File

@@ -10,11 +10,6 @@ export const TitleInfoWrap = ({
onClickToShowInfo
}: DetailInfoSectionProps) => {
const variants = {
hidden: { height: 0, padding: 0, margin: 0, display: 'none' },
visible: { height: 'auto', padding: '16px', margin: '10px 0', display: 'block' },
};
const onClickToSetShowInfo = () => {
if (!!onClickToShowInfo) {
onClickToShowInfo(DetailInfoSectionKeys.Title);
@@ -32,15 +27,35 @@ export const TitleInfoWrap = ({
return (
<>
{additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch&& (
<>
<div className="num-amount">
<span className="amount">{titleInfo?.accountNo}</span>
</div>
<div className="num-store">{titleInfo?.bankName}</div>
<div className="num-day">{titleInfo?.requestDate}</div>
</>
)}
{additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch && (
<>
<div className="num-amount">
<span className="amount">{titleInfo?.accountNo}</span>
</div>
<div className="num-store">{titleInfo?.bankName}</div>
<div className="num-day">{titleInfo?.requestDate}</div>
</>
)}
{additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping && (
<>
<div className="num-amount">
<span className="amount-text">
<NumericFormat
value={titleInfo?.amount}
thousandSeparator
displayType="text"
suffix={ '원' }
></NumericFormat>
</span>
</div>
<div className="num-store">{titleInfo?.corpName}</div>
<div className="num-day">{titleInfo?.requestDate}</div>
</>
)}
{additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending && (
<>
</>
)}
</>
);
};

View File

@@ -1,10 +1,10 @@
import { LinkPaymentPendingListProps } from '../../model/types';
import { LinkPaymentWaitListProps } from '../../model/types';
import { ListDateGroup } from '../list-date-group';
export const LinkPaymentPendingList = ({
export const LinkPaymentWaitList = ({
additionalServiceCategory,
listItems
}: LinkPaymentPendingListProps) => {
}: LinkPaymentWaitListProps) => {
const getListDateGroup = () => {
let rs = [];

View File

@@ -4,8 +4,8 @@ import { useState, useEffect } from "react";
import { LinkPaymentPendingSendFilter } from "./filter/link-payment-pending-send-filter";
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { PATHS } from "@/shared/constants/paths";
import { LinkPaymentPendingList } from "./link-payment-pending-list";
import { AdditionalServiceCategory, LinkPaymentPendingListItem, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod, SortByKeys } from "../../model/types";
import { LinkPaymentWaitList } from "./link-payment-wait-list";
import { AdditionalServiceCategory, LinkPaymentWaitListItem, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod, SortByKeys } from "../../model/types";
import { SortOptionsBox } from '../sort-options-box';
import { useExtensionLinkPayWaitListMutation } from '../../api/link-payment/use-extension-link-pay-wait-list-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
@@ -15,7 +15,7 @@ const sendingStatusBtnGrouup = [
{ name: '발송취소', value: LinkPaymentSendingStatus.SEND_CANCEL }
]
export const LinkPaymentPendingSendWrap = () => {
export const LinkPaymentWaitSendWrap = () => {
const { navigate } = useNavigate();
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
@@ -63,7 +63,7 @@ export const LinkPaymentPendingSendWrap = () => {
})
};
const assembleData = (content: Array<LinkPaymentPendingListItem>) => {
const assembleData = (content: Array<LinkPaymentWaitListItem>) => {
let data: any = {};
if (content && content.length > 0) {
for (let i = 0; i < content?.length; i++) {
@@ -149,10 +149,10 @@ export const LinkPaymentPendingSendWrap = () => {
</div>
</div>
<LinkPaymentPendingList
<LinkPaymentWaitList
listItems={listItems}
additionalServiceCategory={AdditionalServiceCategory.LinkPaymentPending}
></LinkPaymentPendingList>
></LinkPaymentWaitList>
<div className="apply-row">
<button
className="btn-50 btn-blue flex-1"