- 링크결제 API 수정
- 지급대행 수정
This commit is contained in:
@@ -29,7 +29,7 @@ export const extensionLinkPayHistoryDetail = async (params: ExtensionLinkPayHist
|
||||
buyerName: response.buyerName,
|
||||
sendMethod: response.sendMethod,
|
||||
sendDate: response.sendDate,
|
||||
paymentStatus: response.paymentMethod,
|
||||
paymentStatus: response.paymentStatus,
|
||||
failCount: response.failCount,
|
||||
paymentMethod: response.paymentMethod,
|
||||
paymentDate: response.paymentDate,
|
||||
|
||||
@@ -2,6 +2,13 @@ export const getPaymentStatusText = (status?: string): string => {
|
||||
if (!status) return '';
|
||||
|
||||
const statusMap: Record<string, string> = {
|
||||
// 숫자 문자열 매핑
|
||||
'0': '미완료/활성화',
|
||||
'1': '입금요청',
|
||||
'2': '결제완료',
|
||||
'3': '결제실패',
|
||||
'4': '결제중단',
|
||||
// 문자열 키 매핑 (하위 호환성)
|
||||
'ALL': '전체',
|
||||
'ACTIVE': '미완료/활성화',
|
||||
'DEPOSIT_REQUEST': '입금요청',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from "@/entities/common/model/types";
|
||||
import { AdditionalServiceCategory, ExtensionRequestParams, FilterProps, ListItemProps } from "../types";
|
||||
import { AdditionalServiceCategory, ExtensionRequestParams, FilterProps } from "../types";
|
||||
|
||||
// ========================================
|
||||
// 키인결제 관련 타입들
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { LinkPaymentProcessStatus } from "./types";
|
||||
|
||||
export const ProcessStatusBtnGrouup = [
|
||||
{ name: '전체', value: LinkPaymentProcessStatus.ALL },
|
||||
{ name: '발송요청', value: LinkPaymentProcessStatus.SEND_REQUEST },
|
||||
{ name: '발송취소', value: LinkPaymentProcessStatus.SEND_CANCEL }
|
||||
]
|
||||
@@ -15,13 +15,11 @@ export interface LinkPaymentTabProps {
|
||||
}
|
||||
|
||||
export enum LinkPaymentSearchCl {
|
||||
ALL = "",
|
||||
PHONE = "PHONE_NUMBER",
|
||||
EMAIL = "EMAIL"
|
||||
}
|
||||
|
||||
export enum LinkPaymentPaymentMethod {
|
||||
ALL = "ALL",
|
||||
CARD = "CARD",
|
||||
BANK = "BANK",
|
||||
VIRTURE_BANK = "VIRTURE_BANK",
|
||||
@@ -34,15 +32,15 @@ export enum LinkPaymentPaymentMethod {
|
||||
}
|
||||
|
||||
export enum LinkPaymentSendMethod {
|
||||
ALL = "ALL",
|
||||
ALL = "",
|
||||
SMS = "SMS",
|
||||
EMAIL = "EMAIL",
|
||||
KAKAO = "KAKAO"
|
||||
}
|
||||
|
||||
export enum LinkPaymentPaymentStatus {
|
||||
ALL = "ALL",
|
||||
ACTIVATE = "ACTIVATE",
|
||||
ALL = "",
|
||||
ACTIVATE = "ACTIVE",
|
||||
DEPOSIT_REQUEST = "DEPOSIT_REQUEST",
|
||||
PAYMENT_COMPLETE = "PAYMENT_COMPLETE",
|
||||
PAYMENT_FAIL = "PAYMENT_FAIL",
|
||||
@@ -50,44 +48,60 @@ export enum LinkPaymentPaymentStatus {
|
||||
}
|
||||
|
||||
export enum LinkPaymentSendStatus {
|
||||
ALL = "ALL",
|
||||
ALL = "",
|
||||
SUCCESS = "SUCCESS",
|
||||
FAIL = "FAIL"
|
||||
}
|
||||
|
||||
export enum LinkPaymentProcessStatus {
|
||||
ALL = "",
|
||||
SEND_REQUEST = "SEND_REQUEST",
|
||||
SEND_CANCEL = "SEND_CANCEL"
|
||||
}
|
||||
|
||||
export enum LinkContentType {
|
||||
BASIC = "BASIC",
|
||||
ADDITIONAL = "ADDITIONAL"
|
||||
}
|
||||
|
||||
export interface LinkPaymentHistoryListItem {
|
||||
tid?: string;
|
||||
// TODO : buyerName 필요
|
||||
paymentDate?: string;
|
||||
paymentStatus?: string;
|
||||
requestId?: string;
|
||||
cursorId?: string;
|
||||
subReqId?: string;
|
||||
mid?: string;
|
||||
paymentMethod?: string;
|
||||
detailExposure?: string;
|
||||
sendDate?: string;
|
||||
buyerName?: string;
|
||||
receiverInfo?: string;
|
||||
orderId?: string;
|
||||
sendStatus?: string;
|
||||
sendMethod?: string;
|
||||
amount?: number;
|
||||
paymentStatus?: string;
|
||||
sendMethod?: LinkPaymentSendMethod;
|
||||
}
|
||||
|
||||
export interface LinkPaymentWaitListItem {
|
||||
tid?: string;
|
||||
requestId?: string;
|
||||
scheduledSendDate?: string;
|
||||
sendMethod?: string;
|
||||
processStatus?: string;
|
||||
// TODO: buyerName,phoneNumber 필요
|
||||
sendMethod?: LinkPaymentSendMethod;
|
||||
amount?: number;
|
||||
processStatus?: LinkPaymentProcessStatus;
|
||||
buyerName?: string;
|
||||
receiverInfo?: string;
|
||||
}
|
||||
|
||||
export interface LinkPaymentHistoryListProps {
|
||||
additionalServiceCategory: AdditionalServiceCategory;
|
||||
listItems: Record<string, Array<ListItemProps>>;
|
||||
listItems: Array<LinkPaymentHistoryListItem>;
|
||||
setTarget: (element: HTMLElement | null) => void;
|
||||
mid: string;
|
||||
}
|
||||
|
||||
export interface LinkPaymentWaitListProps {
|
||||
additionalServiceCategory: AdditionalServiceCategory;
|
||||
listItems: Record<string, Array<ListItemProps>>;
|
||||
listItems: Array<LinkPaymentWaitListItem>;
|
||||
setTarget: (element: HTMLElement | null) => void;
|
||||
mid: string;
|
||||
}
|
||||
|
||||
export interface LinkPaymentHistoryFilterProps extends FilterProps {
|
||||
@@ -97,15 +111,15 @@ export interface LinkPaymentHistoryFilterProps extends FilterProps {
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
paymentStatus: LinkPaymentPaymentStatus;
|
||||
processResult: ProcessResult;
|
||||
sendStatus: LinkPaymentSendStatus;
|
||||
sendMethod: LinkPaymentSendMethod;
|
||||
setMid: (mid: string) => void;
|
||||
setSearchType: (searchType: LinkPaymentSearchCl) => void;
|
||||
setSearchKeyword: (searchKeyWorld: string) => void;
|
||||
setStartDate: (startDate: string) => void;
|
||||
setEndDate: (endDate: string) => void;
|
||||
setTransactionStatus: (transactionStatus: LinkPaymentPaymentStatus) => void;
|
||||
setProcessResult: (processResult: ProcessResult) => void;
|
||||
setPaymentStatus: (transactionStatus: LinkPaymentPaymentStatus) => void;
|
||||
setSendStatus: (sendStatus: LinkPaymentSendStatus) => void;
|
||||
setSendMethod: (sendMethod: LinkPaymentSendMethod) => void;
|
||||
}
|
||||
|
||||
@@ -116,35 +130,35 @@ export interface LinkPaymentWaitFilterProps extends FilterProps {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
sendMethod: LinkPaymentSendMethod;
|
||||
sendingStatus: LinkPaymentSendStatus;
|
||||
processStatus: LinkPaymentProcessStatus;
|
||||
setMid: (mid: string) => void;
|
||||
setSearchType: (searchType: LinkPaymentSearchCl) => void;
|
||||
setSearchKeyword: (searchKeyWorld: string) => void;
|
||||
setStartDate: (startDate: string) => void;
|
||||
setEndDate: (endDate: string) => void;
|
||||
setSendMethod: (sendMethod: LinkPaymentSendMethod) => void;
|
||||
setSendingStatus: (sendingStatus: LinkPaymentSendStatus) => void;
|
||||
}
|
||||
setProcessStatus: (sendingStatus: LinkPaymentProcessStatus) => void;
|
||||
}
|
||||
|
||||
// 링크 결제 - 발송,대기 조회 확장 서비스
|
||||
// ========================================
|
||||
export interface ExtensionLinkPayHistoryListParams extends ExtensionRequestParams {
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
paymentMethod: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
paymentStatus: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
paymentStatus: LinkPaymentPaymentStatus;
|
||||
sendStatus: LinkPaymentSendStatus;
|
||||
sendMethod: LinkPaymentSendMethod;
|
||||
page?: DefaultRequestPagination;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryListResponse extends DefaulResponsePagination {
|
||||
content: Array<ListItemProps>
|
||||
content: Array<LinkPaymentHistoryListItem>
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryDownloadExcelParams extends ExtensionRequestParams {
|
||||
email: string;
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
paymentMethod: string;
|
||||
@@ -164,7 +178,7 @@ export interface ExtensionLinkPayRequestParams extends ExtensionRequestParams {
|
||||
goodsName: string;
|
||||
amount: number;
|
||||
moid: string;
|
||||
paymentExpiryDate: string;
|
||||
paymentLimitDate: string;
|
||||
buyerName: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
@@ -186,7 +200,7 @@ export interface LinkPaymentFormData {
|
||||
goodsName: string;
|
||||
amount: number;
|
||||
moid: string;
|
||||
paymentExpiryDate: string;
|
||||
paymentLimitDate: string;
|
||||
// Step 2
|
||||
buyerName: string;
|
||||
email: string;
|
||||
@@ -198,169 +212,10 @@ export interface LinkPaymentFormData {
|
||||
linkContentType: LinkContentType;
|
||||
}
|
||||
|
||||
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;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
processStatus: string;
|
||||
page?: DefaultRequestPagination;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitListResponse extends DefaulResponsePagination {
|
||||
content: Array<ListItemProps>
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDownloadExcelParams extends ExtensionRequestParams {
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
processStatus: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDownloadExcelRespone {
|
||||
status: boolean;
|
||||
}
|
||||
|
||||
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 ExtensionLinkPayWaitDeleteParams extends ExtensionRequestParams {
|
||||
tid: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDeleteRespone {
|
||||
status: boolean
|
||||
}
|
||||
|
||||
|
||||
// 링크 결제 - 발송,대기 조회 확장 서비스
|
||||
// ========================================
|
||||
export interface ExtensionLinkPayHistoryListParams extends ExtensionRequestParams {
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
paymentMethod: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
paymentStatus: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
page?: DefaultRequestPagination;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryListResponse extends DefaulResponsePagination {
|
||||
content: Array<ListItemProps>
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryDownloadExcelParams extends ExtensionRequestParams {
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
paymentMethod: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
paymentStatus: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryDownloadExcelRespone {
|
||||
status: boolean;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayRequestParams extends ExtensionRequestParams {
|
||||
sendMethod: string;
|
||||
goodsName: string;
|
||||
amount: number;
|
||||
moid: string;
|
||||
paymentExpiryDate: string;
|
||||
buyerName: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
isIdentity: boolean;
|
||||
identityType: IdentityType;
|
||||
identityValue: string;
|
||||
language: Language;
|
||||
linkContentType: LinkContentType;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayRequestResponse {
|
||||
status: boolean
|
||||
}
|
||||
|
||||
export interface LinkPaymentFormData {
|
||||
// Step 1
|
||||
export interface ExtensionLinkPayHistoryDetailParams {
|
||||
mid: string;
|
||||
sendMethod: LinkPaymentSendMethod;
|
||||
goodsName: string;
|
||||
amount: number;
|
||||
moid: string;
|
||||
paymentExpiryDate: string;
|
||||
// Step 2
|
||||
buyerName: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
isIdentity: boolean;
|
||||
identityType: IdentityType;
|
||||
identityValue: string;
|
||||
language: Language;
|
||||
linkContentType: LinkContentType;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryDetailParams extends ExtensionRequestParams {
|
||||
tid: string;
|
||||
requestId: string;
|
||||
subReqId: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryDetailResponse {
|
||||
@@ -382,7 +237,8 @@ export interface ExtensionLinkPayHistoryDetailResponse {
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryResendParams extends ExtensionRequestParams {
|
||||
tid: string;
|
||||
requestId: string;
|
||||
sendMethod?: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayHistoryResendResponse {
|
||||
@@ -395,7 +251,6 @@ export interface ExtensionLinkPayWaitListParams extends ExtensionRequestParams {
|
||||
searchValue: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
processStatus: string;
|
||||
page?: DefaultRequestPagination;
|
||||
@@ -406,11 +261,11 @@ export interface ExtensionLinkPayWaitListResponse extends DefaulResponsePaginati
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDownloadExcelParams extends ExtensionRequestParams {
|
||||
email: string;
|
||||
searchCl: string;
|
||||
searchValue: string;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
sendStatus: string;
|
||||
sendMethod: string;
|
||||
processStatus: string;
|
||||
}
|
||||
@@ -420,7 +275,7 @@ export interface ExtensionLinkPayWaitDownloadExcelRespone {
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDetailParams extends ExtensionRequestParams {
|
||||
tid: string;
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDetailResponse {
|
||||
@@ -440,7 +295,7 @@ export interface ExtensionLinkPayWaitDetailResponse {
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDeleteParams extends ExtensionRequestParams {
|
||||
tid: string;
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPayWaitDeleteRespone {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { PayoutSearchCl, PayoutDisbursementStatus } from './types';
|
||||
import { PayoutSearchDateType, PayoutDisbursementStatus } from './types';
|
||||
|
||||
export const PayoutSearchClBtnGroup = [
|
||||
{name: '요청일자', value: PayoutSearchCl.REQUEST_DATE },
|
||||
{name: '지급일자', value: PayoutSearchCl.PROXY_DATE }
|
||||
{name: '요청일자', value: PayoutSearchDateType.REQUEST_DATE },
|
||||
{name: '지급일자', value: PayoutSearchDateType.SETTLEMENT_DATE }
|
||||
];
|
||||
export const PayoutDisbursementStatusBtnGroup = [
|
||||
{name: '전체', value: PayoutDisbursementStatus.ALL},
|
||||
|
||||
@@ -7,22 +7,22 @@ export interface ExtensionPayoutRequestParams {
|
||||
settlementDate: string;
|
||||
};
|
||||
export interface ExtensionPayoutRequestResponse {};
|
||||
export enum PayoutSearchCl {
|
||||
export enum PayoutSearchDateType {
|
||||
REQUEST_DATE = 'REQUEST_DATE',
|
||||
PROXY_DATE = 'PROXY_DATE',
|
||||
SETTLEMENT_DATE = 'SETTLEMENT_DATE',
|
||||
};
|
||||
export enum PayoutDisbursementStatus {
|
||||
ALL = 'ALL',
|
||||
ALL = '',
|
||||
REQUEST = 'REQUEST',
|
||||
SUCCESS = 'SUCCESS',
|
||||
FAIL = 'FAIL',
|
||||
};
|
||||
export interface ExtensionPayoutListParams {
|
||||
mid: string;
|
||||
searchCl: PayoutSearchCl,
|
||||
searchDateType: PayoutSearchDateType,
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
disbursementStatus: PayoutDisbursementStatus;
|
||||
status: PayoutDisbursementStatus;
|
||||
minAmount?: number;
|
||||
maxAmount?: number;
|
||||
page?: DefaultRequestPagination;
|
||||
@@ -54,6 +54,7 @@ export interface ExtensionPayoutDetailResponse {
|
||||
transTypeName: string;
|
||||
requestDate: string;
|
||||
settlementDate: string;
|
||||
settlementDateTime: string;
|
||||
companyName: string;
|
||||
companyNo: string;
|
||||
accountName: string;
|
||||
@@ -62,6 +63,9 @@ export interface ExtensionPayoutDetailResponse {
|
||||
depositName: string;
|
||||
failReason: string;
|
||||
};
|
||||
export interface ExtensionPayoutDetailDownloadCertificateParams extends ExtensionPayoutDetailParams {};
|
||||
export interface ExtensionPayoutDetailDownloadCertificateParams extends ExtensionPayoutDetailParams {
|
||||
requestType: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export interface ExtensionPayoutDetailDownloadCertificateResponse {};
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FilterButtonGroups } from '@/shared/ui/filter/button-groups';
|
||||
import { FilterRangeAmount } from '@/shared/ui/filter/range-amount';
|
||||
import {
|
||||
PayoutDisbursementStatus,
|
||||
PayoutSearchCl
|
||||
PayoutSearchDateType
|
||||
} from '../../model/payout/types';
|
||||
import {
|
||||
PayoutSearchClBtnGroup,
|
||||
@@ -25,47 +25,47 @@ export interface PayoutFilterProps {
|
||||
filterOn: boolean;
|
||||
setFilterOn: (filterOn: boolean) => void;
|
||||
mid: string;
|
||||
searchCl: PayoutSearchCl;
|
||||
searchDateType: PayoutSearchDateType;
|
||||
fromDate: string;
|
||||
toDate: string;
|
||||
disbursementStatus: PayoutDisbursementStatus;
|
||||
minAmount?: number;
|
||||
maxAmount?: number;
|
||||
status: PayoutDisbursementStatus;
|
||||
minAmount: number;
|
||||
maxAmount: number;
|
||||
setMid: (mid: string) => void;
|
||||
setSearchCl: (searchCl: PayoutSearchCl) => void;
|
||||
setSearchDateType: (searchDateType: PayoutSearchDateType) => void;
|
||||
setFromDate: (fromDate: string) => void;
|
||||
setToDate: (toDate: string) => void;
|
||||
setDisbursementStatus: (disbursementStatus: PayoutDisbursementStatus) => void;
|
||||
setMinAmount: (minAmount?: number) => void;
|
||||
setMaxAmount: (maxAmount?: number) => void;
|
||||
setStatus: (status: PayoutDisbursementStatus) => void;
|
||||
setMinAmount: (minAmount: number) => void;
|
||||
setMaxAmount: (maxAmount: number) => void;
|
||||
};
|
||||
|
||||
export const PayoutFilter = ({
|
||||
filterOn,
|
||||
setFilterOn,
|
||||
mid,
|
||||
searchCl,
|
||||
searchDateType,
|
||||
fromDate,
|
||||
toDate,
|
||||
disbursementStatus,
|
||||
status,
|
||||
minAmount,
|
||||
maxAmount,
|
||||
setMid,
|
||||
setSearchCl,
|
||||
setSearchDateType,
|
||||
setFromDate,
|
||||
setToDate,
|
||||
setDisbursementStatus,
|
||||
setStatus,
|
||||
setMinAmount,
|
||||
setMaxAmount
|
||||
}: PayoutFilterProps) => {
|
||||
|
||||
const [filterMid, setFilterMid] = useState<string>(mid);
|
||||
const [filterSearchCl, setFilterSearchCl] = useState<PayoutSearchCl>(searchCl);
|
||||
const [filterSearchDateType, setFilterSearchDateType] = useState<PayoutSearchDateType>(searchDateType);
|
||||
const [filterFromDate, setFilterFromDate] = useState<string>(moment(fromDate).format('YYYY.MM.DD'));
|
||||
const [filterToDate, setFilterToDate] = useState<string>(moment(toDate).format('YYYY.MM.DD'));
|
||||
const [filterDisbursementStatus, setFilterDisbursementStatus] = useState<PayoutDisbursementStatus>(disbursementStatus);
|
||||
const [filterMinAmount, setFilterMinAmount] = useState<number | undefined>(minAmount);
|
||||
const [filterMaxAmount, setFilterMaxAmount] = useState<number | undefined>(maxAmount);
|
||||
const [filterStatus, setFilterStatus] = useState<PayoutDisbursementStatus>(status);
|
||||
const [filterMinAmount, setFilterMinAmount] = useState<number>(minAmount);
|
||||
const [filterMaxAmount, setFilterMaxAmount] = useState<number>(maxAmount);
|
||||
|
||||
const midOptions = useStore.getState().UserStore.selectOptionsMids;
|
||||
|
||||
@@ -75,18 +75,18 @@ export const PayoutFilter = ({
|
||||
|
||||
const onClickToSetFilter = () => {
|
||||
setMid(filterMid);
|
||||
setSearchCl(filterSearchCl);
|
||||
setSearchDateType(filterSearchDateType);
|
||||
setFromDate(filterFromDate);
|
||||
setToDate(filterToDate);
|
||||
setDisbursementStatus(filterDisbursementStatus);
|
||||
setStatus(filterStatus);
|
||||
setMinAmount(filterMinAmount);
|
||||
setMaxAmount(filterMaxAmount);
|
||||
onClickToClose();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setFilterDisbursementStatus(disbursementStatus);
|
||||
}, [disbursementStatus]);
|
||||
setFilterStatus(status);
|
||||
}, [status]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -123,9 +123,9 @@ export const PayoutFilter = ({
|
||||
></FilterSelect>
|
||||
<FilterButtonGroups
|
||||
title='조회기준'
|
||||
activeValue={ filterSearchCl }
|
||||
activeValue={ filterSearchDateType }
|
||||
btnGroups={ PayoutSearchClBtnGroup }
|
||||
setter={ setFilterSearchCl }
|
||||
setter={ setFilterSearchDateType }
|
||||
></FilterButtonGroups>
|
||||
<FilterCalendar
|
||||
title='조회기간'
|
||||
@@ -136,9 +136,9 @@ export const PayoutFilter = ({
|
||||
></FilterCalendar>
|
||||
<FilterButtonGroups
|
||||
title='지급상태'
|
||||
activeValue={ filterDisbursementStatus }
|
||||
activeValue={ filterStatus }
|
||||
btnGroups={ PayoutDisbursementStatusBtnGroup }
|
||||
setter={ setFilterDisbursementStatus }
|
||||
setter={ setFilterStatus }
|
||||
></FilterButtonGroups>
|
||||
<FilterRangeAmount
|
||||
title='거래금액'
|
||||
|
||||
@@ -115,7 +115,6 @@ export const FundAccountTransferListWrap = () => {
|
||||
setNextCursor(null);
|
||||
}
|
||||
});
|
||||
|
||||
callBalance();
|
||||
};
|
||||
|
||||
@@ -177,18 +176,19 @@ export const FundAccountTransferListWrap = () => {
|
||||
date = itemDate;
|
||||
}
|
||||
if (date !== itemDate) {
|
||||
date = itemDate;
|
||||
// 날짜가 바뀌면 이전 리스트를 푸시 (날짜 업데이트 전에!)
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={AdditionalServiceCategory.FundAccountTransfer}
|
||||
mid={mid}
|
||||
key={date + '-' + i}
|
||||
date={date}
|
||||
date={date} // 이전 날짜 사용
|
||||
items={list as any}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
date = itemDate; // 그 다음에 날짜 업데이트
|
||||
list = [];
|
||||
}
|
||||
list.push(listItems[i] as any);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import moment from 'moment';
|
||||
import { AdditionalServiceCategory, DetailInfoSectionProps } from '../../model/types';
|
||||
import { getPaymentStatusText, getSendMethodText } from '../../lib/payment-status-utils';
|
||||
import { getPaymentStatusText, getProcessStatusText, getSendMethodText } from '../../lib/payment-status-utils';
|
||||
|
||||
export const PaymentInfoWrap = ({
|
||||
additionalServiceCategory,
|
||||
@@ -28,7 +28,7 @@ export const PaymentInfoWrap = ({
|
||||
<li className="kv-row">
|
||||
<span className="k">발송일자</span>
|
||||
<span className="v">
|
||||
{paymentInfo?.sendDate && moment(paymentInfo.sendDate).format('YYYY.MM.DD')}
|
||||
{paymentInfo?.sendDate && moment(paymentInfo?.sendDate, 'YYYYMMDDHHmmss').format('YYYY.MM.DD')}
|
||||
</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
@@ -56,7 +56,7 @@ export const PaymentInfoWrap = ({
|
||||
<>
|
||||
<li className="kv-row">
|
||||
<span className="k">진행상태</span>
|
||||
<span className="v">{paymentInfo?.processStatus}</span>
|
||||
<span className="v">{getProcessStatusText(paymentInfo?.processStatus)}</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">요청일자</span>
|
||||
@@ -65,7 +65,7 @@ export const PaymentInfoWrap = ({
|
||||
<li className="kv-row">
|
||||
<span className="k">결제유효일자</span>
|
||||
<span className="v">
|
||||
{paymentInfo?.paymentLimitDate && moment(paymentInfo.paymentLimitDate).format('YYYY.MM.DD')}
|
||||
{paymentInfo?.paymentLimitDate && moment(paymentInfo.paymentLimitDate, 'YYYYMMDDHHmmss').format('YYYY.MM.DD')}
|
||||
</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
|
||||
@@ -54,7 +54,7 @@ export const TitleInfoWrap = ({
|
||||
</span>
|
||||
</div>
|
||||
<div className="num-store">{titleInfo?.corpName}</div>
|
||||
<div className="num-day">{titleInfo?.sendDate && moment(titleInfo.sendDate).format('YYYY.MM.DD')}</div>
|
||||
<div className="num-day">{titleInfo?.sendDate && moment(titleInfo.sendDate,'YYYYMMDDHHmmss').format('YYYY.MM.DD')}</div>
|
||||
</>
|
||||
)}
|
||||
{/*링크결제_발송대기*/}
|
||||
|
||||
@@ -13,7 +13,7 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
useSetOnBack(() => {
|
||||
navigate(PATHS.additionalService.list);
|
||||
navigate(PATHS.additionalService.linkPayment.shippingHistory);
|
||||
});
|
||||
|
||||
const handlePaymentMethodChange = (method: LinkPaymentSendMethod) => {
|
||||
@@ -24,8 +24,16 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
|
||||
setFormData({ ...formData, [field]: value });
|
||||
};
|
||||
|
||||
const handleAmountChange = (value: string) => {
|
||||
// 숫자만 추출
|
||||
const onlyNumbers = value.replace(/[^0-9]/g, '');
|
||||
// 빈 문자열이면 0, 아니면 숫자로 변환 (앞의 0 제거됨)
|
||||
const numericValue = onlyNumbers === '' ? 0 : parseInt(onlyNumbers, 10);
|
||||
setFormData({ ...formData, amount: numericValue });
|
||||
};
|
||||
|
||||
const handleDateChange = (date: string) => {
|
||||
setFormData({ ...formData, paymentExpiryDate: date });
|
||||
setFormData({ ...formData, paymentLimitDate: date });
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -87,9 +95,11 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
|
||||
<div className="issue-field">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=""
|
||||
value={formData.amount}
|
||||
onChange={(e) => handleInputChange('amount', e.target.value)}
|
||||
placeholder="0"
|
||||
value={formData.amount === 0 ? '' : formData.amount}
|
||||
onChange={(e) => handleAmountChange(e.target.value)}
|
||||
inputMode="numeric"
|
||||
pattern="[0-9]*"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,9 +121,10 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
|
||||
<div className="issue-field">
|
||||
<div className="link-apply-date">
|
||||
<SingleDatePicker
|
||||
date={formData.paymentExpiryDate}
|
||||
date={formData.paymentLimitDate}
|
||||
setDate={handleDateChange}
|
||||
placeholder="날짜 선택"
|
||||
minDate={new Date()}
|
||||
/>
|
||||
<span>까지</span>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FilterCalendar } from '@/shared/ui/filter/calendar';
|
||||
import { FilterButtonGroups } from '@/shared/ui/filter/button-groups';
|
||||
import { FilterMotionDuration, FilterMotionStyle, FilterMotionVariants } from '@/entities/common/model/constant';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { LinkPaymentHistoryFilterProps, LinkPaymentPaymentStatus, LinkPaymentSearchCl, LinkPaymentSendMethod } from '@/entities/additional-service/model/link-pay/types';
|
||||
import { LinkPaymentHistoryFilterProps, LinkPaymentPaymentStatus, LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus } from '@/entities/additional-service/model/link-pay/types';
|
||||
|
||||
export const LinkPaymentHistoryFilter = ({
|
||||
filterOn,
|
||||
@@ -24,53 +24,31 @@ export const LinkPaymentHistoryFilter = ({
|
||||
fromDate,
|
||||
toDate,
|
||||
paymentStatus,
|
||||
processResult,
|
||||
sendStatus,
|
||||
sendMethod,
|
||||
setMid,
|
||||
setSearchType,
|
||||
setSearchKeyword,
|
||||
setStartDate,
|
||||
setEndDate,
|
||||
setTransactionStatus,
|
||||
setProcessResult,
|
||||
setPaymentStatus,
|
||||
setSendStatus,
|
||||
setSendMethod
|
||||
}: LinkPaymentHistoryFilterProps) => {
|
||||
|
||||
|
||||
const [filterMid, setFilterMid] = useState<string>(mid);
|
||||
const [filterSearchType, setFilterSearchType] = useState<LinkPaymentSearchCl>(searchCl);
|
||||
const [filterSearchKeyword, setFilterSearchKeyword] = useState<string>(searchValue);
|
||||
const [filterSearchCl, setFilterSearchCl] = useState<LinkPaymentSearchCl>(searchCl);
|
||||
const [filterSearchValue, setFilterSearchValue] = useState<string>(searchValue);
|
||||
const [filterStartDate, setFilterStartDate] = useState<string>(fromDate);
|
||||
const [filterEndDate, setFilterEndDate] = useState<string>(toDate);
|
||||
const [filterTransactionStatus, setFilterTransactionStatus] = useState<LinkPaymentPaymentStatus>(paymentStatus)
|
||||
const [filterProcessResult, setFilterProcessResult] = useState<ProcessResult>(processResult);
|
||||
const [filterSendStatus, setFilterSendStatus] = useState<LinkPaymentSendStatus>(sendStatus);
|
||||
const [filterSendMethod, setFilterSendMethod] = useState<LinkPaymentSendMethod>(sendMethod);
|
||||
const [dateReadOnly, setDateReadyOnly] = useState<boolean>(true);
|
||||
const [filterDateOptionsBtn, setFilterDateOptionsBtn] = useState<FilterDateOptions>(FilterDateOptions.Input);
|
||||
|
||||
const [calendarOpen, setCalendarOpen] = useState<boolean>(false);
|
||||
|
||||
const midOptions = useStore.getState().UserStore.selectOptionsMids;
|
||||
|
||||
const onClickToClose = () => {
|
||||
setFilterOn(false);
|
||||
};
|
||||
|
||||
const setNewDate = (newDate: any) => {
|
||||
console.log(newDate)
|
||||
};
|
||||
|
||||
const onClickToSetFilter = () => {
|
||||
setMid(filterMid);
|
||||
setSearchType(filterSearchType);
|
||||
setSearchKeyword(filterSearchKeyword);
|
||||
setStartDate(filterStartDate);
|
||||
setEndDate(filterEndDate);
|
||||
setTransactionStatus(filterTransactionStatus);
|
||||
setProcessResult(filterProcessResult);
|
||||
setSendMethod(filterSendMethod);
|
||||
onClickToClose();
|
||||
};
|
||||
|
||||
let searchTypeOption = [
|
||||
{ name: '휴대폰번호', value: LinkPaymentSearchCl.PHONE },
|
||||
@@ -87,9 +65,9 @@ export const LinkPaymentHistoryFilter = ({
|
||||
];
|
||||
|
||||
let processResultOption = [
|
||||
{ name: '전체', value: ProcessResult.ALL },
|
||||
{ name: '성공', value: ProcessResult.SUCCESS },
|
||||
{ name: '실패', value: ProcessResult.FAIL },
|
||||
{ name: '전체', value: LinkPaymentSendStatus.ALL },
|
||||
{ name: '성공', value: LinkPaymentSendStatus.SUCCESS },
|
||||
{ name: '실패', value: LinkPaymentSendStatus.FAIL },
|
||||
];
|
||||
|
||||
let sendMethodOption = [
|
||||
@@ -99,15 +77,35 @@ export const LinkPaymentHistoryFilter = ({
|
||||
{ name: '카카오', value: LinkPaymentSendMethod.KAKAO },
|
||||
];
|
||||
|
||||
const onClickToClose = () => {
|
||||
setFilterOn(false);
|
||||
};
|
||||
|
||||
const onClickToSetFilter = () => {
|
||||
setMid(filterMid);
|
||||
setSearchType(filterSearchCl);
|
||||
setSearchKeyword(filterSearchValue);
|
||||
setStartDate(filterStartDate);
|
||||
setEndDate(filterEndDate);
|
||||
setPaymentStatus(filterTransactionStatus);
|
||||
setSendStatus(filterSendStatus);
|
||||
setSendMethod(filterSendMethod);
|
||||
onClickToClose();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
<motion.div
|
||||
className="full-menu-modal"
|
||||
initial="hidden"
|
||||
animate={(filterOn) ? 'visible' : 'hidden'}
|
||||
variants={ FilterMotionVariants }
|
||||
transition={ FilterMotionDuration }
|
||||
style={ FilterMotionStyle }
|
||||
variants={FilterMotionVariants}
|
||||
transition={FilterMotionDuration}
|
||||
style={FilterMotionStyle}
|
||||
>
|
||||
<div className="full-menu-container">
|
||||
<div className="full-menu-header">
|
||||
@@ -136,8 +134,8 @@ export const LinkPaymentHistoryFilter = ({
|
||||
|
||||
<FilterSelectInput
|
||||
title='휴대폰번호/이메일'
|
||||
selectValue={filterSearchType}
|
||||
selectSetter={setFilterSearchType}
|
||||
selectValue={filterSearchCl}
|
||||
selectSetter={setFilterSearchCl}
|
||||
selectOptions={searchTypeOption}
|
||||
inputValue={searchValue}
|
||||
inputSetter={setSearchKeyword}
|
||||
@@ -158,9 +156,9 @@ export const LinkPaymentHistoryFilter = ({
|
||||
|
||||
<FilterButtonGroups
|
||||
title='전송결과'
|
||||
activeValue={filterProcessResult}
|
||||
activeValue={filterSendStatus}
|
||||
btnGroups={processResultOption}
|
||||
setter={setFilterProcessResult}
|
||||
setter={setFilterSendStatus}
|
||||
></FilterButtonGroups>
|
||||
|
||||
<FilterButtonGroups
|
||||
|
||||
@@ -10,7 +10,7 @@ import { FilterCalendar } from '@/shared/ui/filter/calendar';
|
||||
import { FilterButtonGroups } from '@/shared/ui/filter/button-groups';
|
||||
import { FilterMotionDuration, FilterMotionStyle, FilterMotionVariants } from '@/entities/common/model/constant';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus, LinkPaymentWaitFilterProps } from '@/entities/additional-service/model/link-pay/types';
|
||||
import { LinkPaymentProcessStatus, LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus, LinkPaymentWaitFilterProps } from '@/entities/additional-service/model/link-pay/types';
|
||||
|
||||
export const LinkPaymentWaitSendFilter = ({
|
||||
filterOn,
|
||||
@@ -21,14 +21,14 @@ export const LinkPaymentWaitSendFilter = ({
|
||||
startDate,
|
||||
endDate,
|
||||
sendMethod,
|
||||
sendingStatus,
|
||||
processStatus,
|
||||
setMid,
|
||||
setSearchType,
|
||||
setSearchKeyword,
|
||||
setStartDate,
|
||||
setEndDate,
|
||||
setSendMethod,
|
||||
setSendingStatus
|
||||
setProcessStatus
|
||||
}: LinkPaymentWaitFilterProps) => {
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export const LinkPaymentWaitSendFilter = ({
|
||||
const [filterStartDate, setFilterStartDate] = useState<string>(startDate);
|
||||
const [filterEndDate, setFilterEndDate] = useState<string>(endDate);
|
||||
const [filterSendMethod, setFilterSendMethod] = useState<LinkPaymentSendMethod>(sendMethod)
|
||||
const [filterSendingStatus, setFilterSendingStatus] = useState<LinkPaymentSendStatus>(sendingStatus);
|
||||
const [filterProcessStatus, setFilterProcessStatus] = useState<LinkPaymentProcessStatus>(processStatus);
|
||||
const [dateReadOnly, setDateReadyOnly] = useState<boolean>(true);
|
||||
const [filterDateOptionsBtn, setFilterDateOptionsBtn] = useState<FilterDateOptions>(FilterDateOptions.Input);
|
||||
|
||||
@@ -61,7 +61,7 @@ export const LinkPaymentWaitSendFilter = ({
|
||||
setStartDate(filterStartDate);
|
||||
setEndDate(filterEndDate);
|
||||
setSendMethod(filterSendMethod);
|
||||
setSendingStatus(filterSendingStatus);
|
||||
setProcessStatus(filterProcessStatus);
|
||||
onClickToClose();
|
||||
};
|
||||
|
||||
@@ -77,10 +77,10 @@ export const LinkPaymentWaitSendFilter = ({
|
||||
{ name: '카카오', value: LinkPaymentSendMethod.KAKAO },
|
||||
];
|
||||
|
||||
let sendingStatusOption = [
|
||||
{ name: '전체', value: LinkPaymentSendStatus.ALL },
|
||||
{ name: '발송요청', value: LinkPaymentSendStatus.SUCCESS },
|
||||
{ name: '발송취소', value: LinkPaymentSendStatus.FAIL },
|
||||
let processStatusOption = [
|
||||
{ name: '전체', value: LinkPaymentProcessStatus.ALL },
|
||||
{ name: '발송요청', value: LinkPaymentProcessStatus.SEND_REQUEST },
|
||||
{ name: '발송취소', value: LinkPaymentProcessStatus.SEND_CANCEL },
|
||||
];
|
||||
|
||||
return (
|
||||
@@ -142,9 +142,9 @@ export const LinkPaymentWaitSendFilter = ({
|
||||
|
||||
<FilterButtonGroups
|
||||
title='진행상태'
|
||||
activeValue={filterSendingStatus}
|
||||
btnGroups={sendingStatusOption}
|
||||
setter={setFilterSendingStatus}
|
||||
activeValue={filterProcessStatus}
|
||||
btnGroups={processStatusOption}
|
||||
setter={setFilterProcessStatus}
|
||||
></FilterButtonGroups>
|
||||
</div>
|
||||
<div className="apply-row">
|
||||
|
||||
@@ -1,20 +1,50 @@
|
||||
import { LinkPaymentHistoryListProps } from '../../model/link-pay/types';
|
||||
import { JSX } from 'react';
|
||||
import { LinkPaymentHistoryListItem, LinkPaymentHistoryListProps } from '../../model/link-pay/types';
|
||||
import { ListDateGroup } from '../list-date-group';
|
||||
|
||||
export const LinkPaymentHistoryList = ({
|
||||
additionalServiceCategory,
|
||||
listItems
|
||||
listItems,
|
||||
setTarget,
|
||||
mid
|
||||
}: LinkPaymentHistoryListProps) => {
|
||||
|
||||
const getListDateGroup = () => {
|
||||
let rs = [];
|
||||
for (const [key, value] of Object.entries(listItems)) {
|
||||
let rs: JSX.Element[] = [];
|
||||
let date = '';
|
||||
let list: LinkPaymentHistoryListItem[] = [];
|
||||
for (let i = 0; i < listItems.length; i++) {
|
||||
// paymentDate format: "20211018140420" (YYYYMMDDHHmmss)
|
||||
let sendDate = listItems[i]?.sendDate || '';
|
||||
let itemDate = sendDate.substring(0, 8);
|
||||
if (i === 0) {
|
||||
date = itemDate;
|
||||
}
|
||||
if (date !== itemDate) {
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={additionalServiceCategory}
|
||||
key={date + '-' + i}
|
||||
date={date}
|
||||
items={list as any}
|
||||
mid={mid}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
date = itemDate;
|
||||
list = [];
|
||||
}
|
||||
list.push(listItems[i] as any);
|
||||
}
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={additionalServiceCategory}
|
||||
key={key}
|
||||
date={key}
|
||||
items={value}
|
||||
key={date + '-last'}
|
||||
date={date}
|
||||
items={list as any}
|
||||
mid={mid}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
@@ -25,6 +55,7 @@ export const LinkPaymentHistoryList = ({
|
||||
<>
|
||||
<div className="transaction-list">
|
||||
{getListDateGroup()}
|
||||
<div ref={setTarget}></div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -6,37 +6,64 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PATHS } from "@/shared/constants/paths";
|
||||
import { LinkPaymentHistoryList } from "./link-payment-history-list";
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { DefaultRequestPagination, SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { AdditionalServiceCategory, ProcessResult } from "../../model/types";
|
||||
import { useExtensionLinkPayHistoryListMutation } from '../../api/link-payment/use-extension-link-pay-history-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { useExtensionLinkPayHistoryDownloadExcelMutation } from '../../api/link-payment/use-extension-link-pay-history-download-excel-mutation';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { LinkPaymentHistoryListItem, LinkPaymentPaymentStatus, LinkPaymentSearchCl, LinkPaymentSendMethod } from '../../model/link-pay/types';
|
||||
import { ExtensionLinkPayHistoryListParams, LinkPaymentHistoryListItem, LinkPaymentPaymentMethod, LinkPaymentPaymentStatus, LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus } from '../../model/link-pay/types';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
|
||||
const processResultBtnGroup = [
|
||||
{ name: '전체', value: ProcessResult.ALL },
|
||||
{ name: '성공', value: ProcessResult.SUCCESS },
|
||||
{ name: '실패', value: ProcessResult.FAIL }
|
||||
const paymentResultBtnGroup = [
|
||||
{ name: '전체', value: LinkPaymentPaymentStatus.ALL },
|
||||
{ name: '미완료/활성화', value: LinkPaymentPaymentStatus.ACTIVATE },
|
||||
{ name: '입금요청', value: LinkPaymentPaymentStatus.DEPOSIT_REQUEST },
|
||||
{ name: '결제완료', value: LinkPaymentPaymentStatus.PAYMENT_COMPLETE },
|
||||
{ name: '결제실패', value: LinkPaymentPaymentStatus.PAYMENT_FAIL },
|
||||
{ name: '결제중단/비활성화', value: LinkPaymentPaymentStatus.INACTIVE },
|
||||
];
|
||||
|
||||
export const LinkPaymentHistoryWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
|
||||
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
|
||||
entries.forEach((entry: IntersectionObserverEntry) => {
|
||||
if (entry.isIntersecting) {
|
||||
console.log('Element is now intersecting with the root. [' + onActionIntersect + ']');
|
||||
if (onActionIntersect) {
|
||||
callList();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('Element is no longer intersecting with the root.');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const { setTarget } = useIntersectionObserver({
|
||||
threshold: 1,
|
||||
onIntersect
|
||||
});
|
||||
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [listItems, setListItems] = useState<Array<LinkPaymentHistoryListItem>>([]);
|
||||
const [nextCursor, setNextCursor] = useState<string | null>(null);
|
||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchCl, setSearchCl] = useState<LinkPaymentSearchCl>(LinkPaymentSearchCl.ALL)
|
||||
const [searchKeyword, setSearchKeyword] = useState<string>('');
|
||||
const [startDate, setStartDate] = useState(moment().format('YYYY-MM-DD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYY-MM-DD'));
|
||||
const [transactionStatus, setTransactionStatus] = useState<LinkPaymentPaymentStatus>(LinkPaymentPaymentStatus.ALL)
|
||||
const [processResult, setProcessResult] = useState<ProcessResult>(ProcessResult.ALL)
|
||||
const [sendMethod, setSendMethod] = useState<LinkPaymentSendMethod>(LinkPaymentSendMethod.ALL)
|
||||
const [searchCl, setSearchCl] = useState<LinkPaymentSearchCl>(LinkPaymentSearchCl.PHONE);
|
||||
const [searchValue, setSearchValue] = useState<string>('');
|
||||
const [paymentMethod, setPaymentMethod] = useState<LinkPaymentPaymentMethod>(LinkPaymentPaymentMethod.CARD);
|
||||
const [fromDate, setFromDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [toDate, setToDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [paymentStatus, setPaymentStatus] = useState<LinkPaymentPaymentStatus>(LinkPaymentPaymentStatus.ALL);
|
||||
const [sendStatus, setSendStatus] = useState<LinkPaymentSendStatus>(LinkPaymentSendStatus.ALL);
|
||||
const [sendMethod, setSendMethod] = useState<LinkPaymentSendMethod>(LinkPaymentSendMethod.ALL);
|
||||
|
||||
const [email, setEmail] = useState<string>('');
|
||||
|
||||
const { mutateAsync: linkPayHistoryList } = useExtensionLinkPayHistoryListMutation();
|
||||
const { mutateAsync: downloadExcel } = useExtensionLinkPayHistoryDownloadExcelMutation();
|
||||
@@ -47,71 +74,80 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
status?: LinkPaymentPaymentStatus,
|
||||
resetPage?: boolean
|
||||
}) => {
|
||||
pageParam.sortType = (option?.sortType) ? option.sortType : sortType;
|
||||
setPageParam(pageParam);
|
||||
setOnActionIntersect(false);
|
||||
|
||||
let listParams = {
|
||||
const currentPageParam = option?.resetPage
|
||||
? { ...DEFAULT_PAGE_PARAM, sortType: option?.sortType ?? sortType }
|
||||
: { ...pageParam, sortType: option?.sortType ?? sortType };
|
||||
|
||||
setPageParam(currentPageParam); // currentPageParam으로 수정!
|
||||
|
||||
let listParams: ExtensionLinkPayHistoryListParams = {
|
||||
mid: mid,
|
||||
searchCl: searchCl,
|
||||
searchValue: searchKeyword,
|
||||
paymentMethod: '',
|
||||
fromDate: startDate,
|
||||
toDate: endDate,
|
||||
paymentStatus: transactionStatus === LinkPaymentPaymentStatus.ALL ? '' : transactionStatus,
|
||||
sendStatus: processResult === ProcessResult.ALL ? '' : processResult,
|
||||
sendMethod: sendMethod === LinkPaymentSendMethod.ALL ? '' : sendMethod,
|
||||
page: pageParam
|
||||
searchValue: searchValue,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
paymentStatus: option?.status ?? paymentStatus,
|
||||
sendStatus: sendStatus,
|
||||
sendMethod: sendMethod,
|
||||
... {
|
||||
page: currentPageParam
|
||||
}
|
||||
};
|
||||
|
||||
linkPayHistoryList(listParams).then((rs) => {
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<LinkPaymentHistoryListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let sendDate = content[i]?.sendDate?.substring(0, 8);
|
||||
let groupDate = moment(sendDate).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if(!!groupDate && data.hasOwnProperty(groupDate)){
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
setListItems(option?.resetPage ? rs.content : [
|
||||
...listItems,
|
||||
...rs.content
|
||||
]);
|
||||
if (rs.hasNext) {
|
||||
setNextCursor(rs.nextCursor);
|
||||
setPageParam({
|
||||
...currentPageParam, // pageParam이 아니라 currentPageParam 사용
|
||||
cursor: rs.nextCursor
|
||||
});
|
||||
setOnActionIntersect(true)
|
||||
}
|
||||
}
|
||||
console.log('Data : ', data);
|
||||
return data;
|
||||
else {
|
||||
setNextCursor(null);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToDownloadExcel = () => {
|
||||
downloadExcel({
|
||||
mid: mid,
|
||||
email: email,
|
||||
searchCl: searchCl,
|
||||
searchValue: searchKeyword,
|
||||
paymentMethod: '',
|
||||
fromDate: startDate,
|
||||
toDate: endDate,
|
||||
paymentStatus: transactionStatus,
|
||||
sendStatus: (processResult === ProcessResult.ALL)? '': processResult,
|
||||
sendMethod: (sendMethod === LinkPaymentSendMethod.ALL)? '': sendMethod,
|
||||
searchValue: searchValue,
|
||||
paymentMethod: paymentMethod,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
paymentStatus: paymentStatus,
|
||||
sendStatus: sendStatus,
|
||||
sendMethod: sendMethod,
|
||||
}).then((rs) => {
|
||||
console.log('Excel Dowload Status : ' + rs.status);
|
||||
});
|
||||
};
|
||||
|
||||
const onClickProcessResult = (val: ProcessResult) => {
|
||||
setProcessResult(val);
|
||||
const onClickPaymentStatus = (val: LinkPaymentPaymentStatus) => {
|
||||
setPaymentStatus(val);
|
||||
callList({
|
||||
status: val,
|
||||
resetPage: true
|
||||
})
|
||||
}
|
||||
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
sortType: sort,
|
||||
resetPage: true
|
||||
});
|
||||
};
|
||||
|
||||
@@ -120,8 +156,19 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
// 필터 조건이 변경되면 첫 페이지부터 다시 시작
|
||||
callList({ resetPage: true });
|
||||
}, [
|
||||
mid,
|
||||
searchCl,
|
||||
searchValue,
|
||||
paymentMethod,
|
||||
fromDate,
|
||||
toDate,
|
||||
paymentStatus,
|
||||
sendStatus,
|
||||
sendMethod
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -131,7 +178,7 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
<input
|
||||
className="credit-period"
|
||||
type="text"
|
||||
value={moment(startDate).format('YYYY.MM.DD') + '-' + moment(endDate).format('YYYY.MM.DD')}
|
||||
value={moment(fromDate).format('YYYY.MM.DD') + '-' + moment(toDate).format('YYYY.MM.DD')}
|
||||
readOnly={true}
|
||||
/>
|
||||
<button
|
||||
@@ -158,21 +205,21 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
|
||||
<div className="filter-section">
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
sortType={sortType}
|
||||
onClickToSort={onClickToSort}
|
||||
>
|
||||
</SortTypeBox>
|
||||
<div className="excrow">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
processResultBtnGroup.map((value, index) => (
|
||||
<span
|
||||
key={`key-service-code=${index}`}
|
||||
className={`keyword-tag ${(processResult === value.value) ? 'active' : ''}`}
|
||||
onClick={() => onClickProcessResult(value.value)}
|
||||
>{ value.name }</span>
|
||||
))
|
||||
}
|
||||
{
|
||||
paymentResultBtnGroup.map((value, index) => (
|
||||
<span
|
||||
key={`key-service-code=${index}`}
|
||||
className={`keyword-tag ${(paymentStatus === value.value) ? 'active' : ''}`}
|
||||
onClick={() => onClickPaymentStatus(value.value)}
|
||||
>{value.name}</span>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,6 +227,8 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
<LinkPaymentHistoryList
|
||||
listItems={listItems}
|
||||
additionalServiceCategory={AdditionalServiceCategory.LinkPaymentHistory}
|
||||
setTarget={setTarget}
|
||||
mid={mid}
|
||||
></LinkPaymentHistoryList>
|
||||
<div className="apply-row">
|
||||
<button
|
||||
@@ -192,19 +241,19 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
setFilterOn={setFilterOn}
|
||||
mid={mid}
|
||||
searchCl={searchCl}
|
||||
searchValue={searchKeyword}
|
||||
fromDate={startDate}
|
||||
toDate={endDate}
|
||||
paymentStatus={transactionStatus}
|
||||
processResult={processResult}
|
||||
searchValue={searchValue}
|
||||
fromDate={fromDate}
|
||||
toDate={toDate}
|
||||
paymentStatus={paymentStatus}
|
||||
sendStatus={sendStatus}
|
||||
sendMethod={sendMethod}
|
||||
setMid={setMid}
|
||||
setSearchType={setSearchCl}
|
||||
setSearchKeyword={setSearchKeyword}
|
||||
setStartDate={setStartDate}
|
||||
setEndDate={setEndDate}
|
||||
setTransactionStatus={setTransactionStatus}
|
||||
setProcessResult={setProcessResult}
|
||||
setSearchKeyword={setSearchValue}
|
||||
setStartDate={setFromDate}
|
||||
setEndDate={setToDate}
|
||||
setPaymentStatus={setPaymentStatus}
|
||||
setSendStatus={setSendStatus}
|
||||
setSendMethod={setSendMethod}
|
||||
></LinkPaymentHistoryFilter>
|
||||
</>
|
||||
|
||||
@@ -1,20 +1,50 @@
|
||||
import { LinkPaymentWaitListProps } from '../../model/link-pay/types';
|
||||
import { JSX } from 'react';
|
||||
import { LinkPaymentWaitListItem, LinkPaymentWaitListProps } from '../../model/link-pay/types';
|
||||
import { ListDateGroup } from '../list-date-group';
|
||||
|
||||
export const LinkPaymentWaitList = ({
|
||||
additionalServiceCategory,
|
||||
listItems
|
||||
listItems,
|
||||
setTarget,
|
||||
mid
|
||||
}: LinkPaymentWaitListProps) => {
|
||||
|
||||
const getListDateGroup = () => {
|
||||
let rs = [];
|
||||
for (const [key, value] of Object.entries(listItems)) {
|
||||
let rs: JSX.Element[] = [];
|
||||
let date = '';
|
||||
let list: LinkPaymentWaitListItem[] = [];
|
||||
for (let i = 0; i < listItems.length; i++) {
|
||||
// paymentDate format: "20211018140420" (YYYYMMDDHHmmss)
|
||||
let scheduledSendDate = listItems[i]?.scheduledSendDate || '';
|
||||
let itemDate = scheduledSendDate.substring(0, 8);
|
||||
if (i === 0) {
|
||||
date = itemDate;
|
||||
}
|
||||
if (date !== itemDate) {
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={additionalServiceCategory}
|
||||
key={date + '-' + i}
|
||||
date={date}
|
||||
items={list as any}
|
||||
mid={mid}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
date = itemDate;
|
||||
list = [];
|
||||
}
|
||||
list.push(listItems[i] as any);
|
||||
}
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={additionalServiceCategory}
|
||||
key={key}
|
||||
date={key}
|
||||
items={value}
|
||||
key={date + '-last'}
|
||||
date={date}
|
||||
items={list as any}
|
||||
mid={mid}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
@@ -25,6 +55,7 @@ export const LinkPaymentWaitList = ({
|
||||
<>
|
||||
<div className="transaction-list">
|
||||
{getListDateGroup()}
|
||||
<div ref={setTarget}></div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -7,35 +7,56 @@ import { PATHS } from "@/shared/constants/paths";
|
||||
import { LinkPaymentWaitList } from "./link-payment-wait-list";
|
||||
import { AdditionalServiceCategory } from "../../model/types";
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { DefaultRequestPagination, SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { useExtensionLinkPayWaitListMutation } from '../../api/link-payment/use-extension-link-pay-wait-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { useExtensionLinkPayWaitDownloadExcelMutation } from '../../api/link-payment/use-extension-link-pay-wait-download-excel-mutation';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus, LinkPaymentWaitListItem } from '../../model/link-pay/types';
|
||||
import { LinkPaymentProcessStatus, LinkPaymentSearchCl, LinkPaymentSendMethod, LinkPaymentSendStatus, LinkPaymentWaitListItem } from '../../model/link-pay/types';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
import { ProcessStatusBtnGrouup } from '../../model/link-pay/constant';
|
||||
import { useExtensionLinkPayWaitDeleteMutation } from '../../api/link-payment/use-extension-link-pay-wait-delete-mutation';
|
||||
|
||||
|
||||
const sendingStatusBtnGrouup = [
|
||||
{ name: '전체', value: LinkPaymentSendStatus.ALL },
|
||||
{ name: '발송요청', value: LinkPaymentSendStatus.SUCCESS },
|
||||
{ name: '발송취소', value: LinkPaymentSendStatus.FAIL }
|
||||
]
|
||||
|
||||
export const LinkPaymentWaitSendWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
|
||||
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
|
||||
entries.forEach((entry: IntersectionObserverEntry) => {
|
||||
if (entry.isIntersecting) {
|
||||
console.log('Element is now intersecting with the root. [' + onActionIntersect + ']');
|
||||
if (onActionIntersect) {
|
||||
callList();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('Element is no longer intersecting with the root.');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const { setTarget } = useIntersectionObserver({
|
||||
threshold: 1,
|
||||
onIntersect
|
||||
});
|
||||
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchType, setSearchType] = useState<LinkPaymentSearchCl>(LinkPaymentSearchCl.ALL)
|
||||
const [searchKeyword, setSearchKeyword] = useState<string>('');
|
||||
const [startDate, setStartDate] = useState(moment().format('YYYY-MM-DD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYY-MM-DD'));
|
||||
const [searchType, setSearchType] = useState<LinkPaymentSearchCl>(LinkPaymentSearchCl.PHONE)
|
||||
const [searchValue, setSearchValue] = useState<string>('');
|
||||
const [startDate, setStartDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [sendMethod, setSendMethod] = useState<LinkPaymentSendMethod>(LinkPaymentSendMethod.ALL);
|
||||
const [sendingStatus, setSendingStatus] = useState<LinkPaymentSendStatus>(LinkPaymentSendStatus.ALL);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [processStatus, setProcessStatus] = useState<LinkPaymentProcessStatus>(LinkPaymentProcessStatus.ALL);
|
||||
const [listItems, setListItems] = useState<Array<LinkPaymentWaitListItem>>([]);
|
||||
const [nextCursor, setNextCursor] = useState<string | null>(null);
|
||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||
|
||||
const [email, setEmail] = useState<string>('');
|
||||
const { mutateAsync: pendingSendList } = useExtensionLinkPayWaitListMutation();
|
||||
const { mutateAsync: downloadExcel } = useExtensionLinkPayWaitDownloadExcelMutation();
|
||||
|
||||
@@ -48,56 +69,59 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
status?: LinkPaymentProcessStatus,
|
||||
resetPage?: boolean
|
||||
}) => {
|
||||
pageParam.sortType = (option?.sortType) ? option.sortType : sortType;
|
||||
setPageParam(pageParam);
|
||||
setOnActionIntersect(false);
|
||||
|
||||
const currentPageParam = option?.resetPage
|
||||
? { ...DEFAULT_PAGE_PARAM, sortType: option?.sortType ?? sortType }
|
||||
: { ...pageParam, sortType: option?.sortType ?? sortType };
|
||||
|
||||
setPageParam(currentPageParam);
|
||||
|
||||
let listParams = {
|
||||
mid: mid,
|
||||
searchCl: searchType,
|
||||
searchValue: searchKeyword,
|
||||
searchValue: searchValue,
|
||||
fromDate: startDate,
|
||||
toDate: endDate,
|
||||
sendStatus: sendingStatus, // 추후 삭제 필요
|
||||
sendMethod: (sendMethod === LinkPaymentSendMethod.ALL)? '': sendMethod,
|
||||
processStatus: sendingStatus,
|
||||
page: pageParam
|
||||
sendMethod: sendMethod,
|
||||
processStatus: option?.status ?? processStatus,
|
||||
... {
|
||||
page: currentPageParam
|
||||
}
|
||||
}
|
||||
|
||||
pendingSendList(listParams).then((rs) => {
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<LinkPaymentWaitListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for (let i = 0; i < content?.length; i++) {
|
||||
let scheduledSendDate = content[i]?.scheduledSendDate?.substring(0, 8);
|
||||
let groupDate = moment(scheduledSendDate).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if(!!groupDate && data.hasOwnProperty(groupDate)){
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
setListItems(option?.resetPage ? rs.content : [
|
||||
...listItems,
|
||||
...rs.content
|
||||
]);
|
||||
if (rs.hasNext) {
|
||||
setNextCursor(rs.nextCursor);
|
||||
setPageParam({
|
||||
...currentPageParam,
|
||||
cursor: rs.nextCursor
|
||||
});
|
||||
setOnActionIntersect(true);
|
||||
}
|
||||
}
|
||||
console.log('Data : ', data);
|
||||
return data;
|
||||
else {
|
||||
setNextCursor(null);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToDownloadExcel = () => {
|
||||
downloadExcel({
|
||||
mid: mid,
|
||||
searchCl: (searchType === LinkPaymentSearchCl.ALL)? '': searchType,
|
||||
searchValue: searchKeyword,
|
||||
email: email,
|
||||
searchCl: searchType,
|
||||
searchValue: searchValue,
|
||||
fromDate: startDate,
|
||||
toDate: endDate,
|
||||
sendStatus: (sendingStatus === LinkPaymentSendStatus.ALL)? '': sendingStatus, // 추후 삭제 필요
|
||||
sendMethod: (sendMethod === LinkPaymentSendMethod.ALL)? '': sendMethod,
|
||||
processStatus: (sendingStatus === LinkPaymentSendStatus.ALL)? '': sendingStatus,
|
||||
sendMethod: sendMethod,
|
||||
processStatus: processStatus,
|
||||
}).then((rs) => {
|
||||
console.log('Excel Dowload Status : ' + rs.status);
|
||||
});
|
||||
@@ -105,15 +129,32 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort,
|
||||
resetPage: true
|
||||
});
|
||||
};
|
||||
|
||||
const onClickSendingStatus = (val: LinkPaymentSendStatus) => {
|
||||
setSendingStatus(val);
|
||||
const onClickSendingStatus = (val: LinkPaymentProcessStatus) => {
|
||||
setProcessStatus(val);
|
||||
callList({
|
||||
status: val,
|
||||
resetPage: true
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
// 필터 조건이 변경되면 첫 페이지부터 다시 시작
|
||||
callList({ resetPage: true });
|
||||
}, [
|
||||
mid,
|
||||
searchType,
|
||||
searchValue,
|
||||
startDate,
|
||||
endDate,
|
||||
sendMethod,
|
||||
processStatus
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -150,20 +191,20 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
|
||||
<div className="filter-section">
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
sortType={sortType}
|
||||
onClickToSort={onClickToSort}
|
||||
></SortTypeBox>
|
||||
<div className="excrow">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
sendingStatusBtnGrouup.map((value, index) => (
|
||||
<span
|
||||
key={`key-service-code=${index}`}
|
||||
className={`keyword-tag ${(sendingStatus === value.value) ? 'active' : ''}`}
|
||||
onClick={() => onClickSendingStatus(value.value)}
|
||||
>{value.name}</span>
|
||||
))
|
||||
}
|
||||
{
|
||||
ProcessStatusBtnGrouup.map((value, index) => (
|
||||
<span
|
||||
key={`key-service-code=${index}`}
|
||||
className={`keyword-tag ${(processStatus === value.value) ? 'active' : ''}`}
|
||||
onClick={() => onClickSendingStatus(value.value)}
|
||||
>{value.name}</span>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,6 +212,8 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
<LinkPaymentWaitList
|
||||
listItems={listItems}
|
||||
additionalServiceCategory={AdditionalServiceCategory.LinkPaymentWait}
|
||||
setTarget={setTarget}
|
||||
mid={mid}
|
||||
></LinkPaymentWaitList>
|
||||
<div className="apply-row">
|
||||
<button
|
||||
@@ -183,18 +226,18 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
setFilterOn={setFilterOn}
|
||||
mid={mid}
|
||||
searchCl={searchType}
|
||||
searchKeyword={searchKeyword}
|
||||
searchKeyword={searchValue}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
sendMethod={sendMethod}
|
||||
sendingStatus={sendingStatus}
|
||||
processStatus={processStatus}
|
||||
setMid={setMid}
|
||||
setSearchType={setSearchType}
|
||||
setSearchKeyword={setSearchKeyword}
|
||||
setSearchKeyword={setSearchValue}
|
||||
setStartDate={setStartDate}
|
||||
setEndDate={setEndDate}
|
||||
setSendMethod={setSendMethod}
|
||||
setSendingStatus={setSendingStatus}
|
||||
setProcessStatus={setProcessStatus}
|
||||
></LinkPaymentWaitSendFilter>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -55,6 +55,14 @@ export const ListDateGroup = ({
|
||||
orderStatus={ items[i]?.orderStatus }
|
||||
arsPaymentMethod={ items[i]?.arsPaymentMethod }
|
||||
|
||||
buyerName={ items[i]?.buyerName}
|
||||
cursorId={ items[i]?.cursorId}
|
||||
subReqId={ items[i]?.subReqId}
|
||||
requestId={ items[i]?.requestId}
|
||||
detailExposure={ items[i]?.detailExposure}
|
||||
receiverInfo={ items[i]?.receiverInfo}
|
||||
|
||||
|
||||
alimCl={ items[i]?.alimCl }
|
||||
sendType={ items[i]?.sendType }
|
||||
sendCl={ items[i]?.sendCl }
|
||||
|
||||
@@ -26,6 +26,8 @@ export const ListItem = ({
|
||||
|
||||
alimCl, sendType, sendCl,
|
||||
paymentMethod, receiverName,
|
||||
requestId,subReqId,
|
||||
buyerName,receiverInfo,
|
||||
|
||||
smsCl,
|
||||
name,
|
||||
@@ -168,7 +170,9 @@ export const ListItem = ({
|
||||
state: {
|
||||
additionalServiceCategory: additionalServiceCategory,
|
||||
mid: mid,
|
||||
tid: tid
|
||||
tid: tid,
|
||||
requestId: requestId,
|
||||
subReqId: subReqId
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -177,7 +181,8 @@ export const ListItem = ({
|
||||
state: {
|
||||
additionalServiceCategory: additionalServiceCategory,
|
||||
mid: mid,
|
||||
tid: tid
|
||||
tid: tid,
|
||||
requestId: requestId
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -327,11 +332,7 @@ export const ListItem = ({
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentHistory ||
|
||||
additionalServiceCategory === AdditionalServiceCategory.LinkPaymentWait
|
||||
) {
|
||||
if (sendMethod === "SMS") {
|
||||
str = `${"buyerName"}(${"휴대폰 번호"})`;
|
||||
} else {
|
||||
str = `${"buyerName"}(${"이메일"})`;
|
||||
}
|
||||
str = `${buyerName}(${receiverInfo})`;
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.Payout) {
|
||||
str = companyName;
|
||||
@@ -394,7 +395,7 @@ export const ListItem = ({
|
||||
);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentHistory) {
|
||||
if (paymentStatus === "PAYMENT_FAIL" || paymentStatus === "INACTIVE") {
|
||||
if (paymentStatus === "3" || paymentStatus === "4") {
|
||||
rs.push(
|
||||
<div key="link-payment-history" className="transaction-details">
|
||||
<span>{getPaymentStatusText(paymentStatus)}</span>
|
||||
@@ -409,7 +410,7 @@ export const ListItem = ({
|
||||
<span className="separator">|</span>
|
||||
<span>{getSendMethodText(sendMethod)}</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{"결제수단 추가 필요"}</span>
|
||||
<span>{paymentMethod}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,10 +10,13 @@ import {
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { useExtensionAccountHolderSearchRequestMutation } from '@/entities/additional-service/api/account-holder-search/use-extension-account-holder-search-reqeust-mutation';
|
||||
import { ExtensionAccountHolderSearchRequestParams } from '@/entities/additional-service/model/account-holder-search/types';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
|
||||
export const AccountHolderSearchRequestPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const userMid = useStore.getState().UserStore.mid
|
||||
|
||||
useSetHeaderTitle('계좌성명조회_신청');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetFooterMode(false);
|
||||
@@ -24,7 +27,7 @@ export const AccountHolderSearchRequestPage = () => {
|
||||
const { mutateAsync: accountHolderSearchRequest } = useExtensionAccountHolderSearchRequestMutation();
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
mid: 'nictest00m',
|
||||
mid: userMid,
|
||||
bankCode: '',
|
||||
accountNo: ''
|
||||
})
|
||||
|
||||
@@ -30,7 +30,7 @@ export const LinkPaymentApplyConfirmPage = () => {
|
||||
goodsName: formData.goodsName,
|
||||
amount: formData.amount,
|
||||
moid: formData.moid,
|
||||
paymentExpiryDate: formData.paymentExpiryDate.replace(/\./g, ''),
|
||||
paymentLimitDate: formData.paymentLimitDate.replace(/\./g, ''),
|
||||
buyerName: formData.buyerName,
|
||||
email: formData.email,
|
||||
phoneNumber: formData.phoneNumber,
|
||||
|
||||
@@ -8,20 +8,22 @@ import {useNavigate} from '@/shared/lib/hooks/use-navigate';
|
||||
import {PATHS} from "@/shared/constants/paths";
|
||||
import { IdentityType, Language } from '@/entities/additional-service/model/types';
|
||||
import { LinkContentType, LinkPaymentFormData, LinkPaymentSendMethod } from '@/entities/additional-service/model/link-pay/types';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import moment from 'moment';
|
||||
|
||||
|
||||
|
||||
export const LinkPaymentApplyPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
const [processStep, setProcessStep] = useState<ProcessStep>(ProcessStep.One);
|
||||
const [formData, setFormData] = useState<LinkPaymentFormData>({
|
||||
mid: 'nictest00m',
|
||||
mid: userMid,
|
||||
sendMethod: LinkPaymentSendMethod.SMS,
|
||||
goodsName: '',
|
||||
amount: 0,
|
||||
moid: '',
|
||||
paymentExpiryDate: '',
|
||||
paymentLimitDate: moment().format('YYYY.MM.DD'),
|
||||
buyerName: '',
|
||||
email: '',
|
||||
phoneNumber: '',
|
||||
@@ -36,10 +38,52 @@ export const LinkPaymentApplyPage = () => {
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetFooterMode(false);
|
||||
|
||||
// Step1 필수 필드 검증
|
||||
const isStep1Valid = () => {
|
||||
return (
|
||||
formData.mid !== '' &&
|
||||
formData.sendMethod !== '' &&
|
||||
formData.goodsName.trim() !== '' &&
|
||||
formData.amount > 0 &&
|
||||
formData.moid.trim() !== '' &&
|
||||
formData.paymentLimitDate !== ''
|
||||
);
|
||||
};
|
||||
|
||||
// 전화번호 형식 검증
|
||||
const isValidPhoneNumber = (phone: string) => {
|
||||
const phoneRegex = /^01[0|1|6|7|8|9][0-9]{7,8}$/;
|
||||
return phoneRegex.test(phone);
|
||||
};
|
||||
|
||||
// 이메일 형식 검증
|
||||
const isValidEmail = (email: string) => {
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
return emailRegex.test(email);
|
||||
};
|
||||
|
||||
// Step2 필수 필드 검증
|
||||
const isStep2Valid = () => {
|
||||
const basicFieldsValid = (
|
||||
formData.buyerName.trim() !== '' &&
|
||||
formData.email.trim() !== '' &&
|
||||
isValidEmail(formData.email) &&
|
||||
formData.phoneNumber.trim() !== '' &&
|
||||
isValidPhoneNumber(formData.phoneNumber)
|
||||
);
|
||||
|
||||
// isIdentity가 true면 identityValue도 필수
|
||||
if (formData.isIdentity) {
|
||||
return basicFieldsValid && formData.identityValue.trim() !== '';
|
||||
}
|
||||
|
||||
return basicFieldsValid;
|
||||
};
|
||||
|
||||
const onClickToBack = () => {
|
||||
navigate(-1);
|
||||
};
|
||||
|
||||
setProcessStep(ProcessStep.One);
|
||||
};
|
||||
|
||||
const onClickToChangeTab = () => {
|
||||
if(processStep === ProcessStep.One) {
|
||||
setProcessStep(ProcessStep.Two);
|
||||
@@ -93,7 +137,8 @@ export const LinkPaymentApplyPage = () => {
|
||||
<div className="apply-row">
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={() => onClickToChangeTab() }
|
||||
onClick={() => onClickToChangeTab()}
|
||||
disabled={!isStep1Valid()}
|
||||
>다음</button>
|
||||
</div>
|
||||
}
|
||||
@@ -101,11 +146,12 @@ export const LinkPaymentApplyPage = () => {
|
||||
<div className="apply-row two-button">
|
||||
<button
|
||||
className="btn-50 btn-darkgray flex-1"
|
||||
onClick={() => onClickToBack() }
|
||||
>이전</button>
|
||||
onClick={() => onClickToBack()}
|
||||
>이전</button>
|
||||
<button
|
||||
className="btn-50 btn-blue flex-3"
|
||||
onClick={() => onClickToChangeTab() }
|
||||
onClick={() => onClickToChangeTab()}
|
||||
disabled={!isStep2Valid()}
|
||||
>결제 신청</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -18,12 +18,13 @@ import { PaymentInfoWrap } from '@/entities/additional-service/ui/info-wrap/paym
|
||||
import { DetailInfoWrap } from '@/entities/additional-service/ui/info-wrap/detail-info-wrap';
|
||||
import { useExtensionLinkPayHistoryResendMutation } from '@/entities/additional-service/api/link-payment/use-extension-link-pay-history-resend-mutation';
|
||||
import { ExtensionLinkPayHistoryDetailParams, ExtensionLinkPayHistoryResendParams } from '@/entities/additional-service/model/link-pay/types';
|
||||
import moment from 'moment';
|
||||
|
||||
export const LinkPaymentDetailPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
const { mid, tid } = location.state || {};
|
||||
const { mid, tid, requestId, subReqId } = location.state || {};
|
||||
|
||||
const [titleInfo, setTitleInfo] = useState<TitleInfo>();
|
||||
const [detailInfo, setDetailInfo] = useState<DetailInfo>();
|
||||
@@ -34,16 +35,19 @@ export const LinkPaymentDetailPage = () => {
|
||||
useSetHeaderTitle('링크결제 상세');
|
||||
useSetHeaderType(HeaderType.RightClose);
|
||||
useSetOnBack(() => {
|
||||
navigate(PATHS.additionalService.linkPayment.shippingHistory);
|
||||
navigate(-1); // 브라우저 히스토리를 이용한 뒤로가기
|
||||
});
|
||||
useSetFooterMode(false);
|
||||
|
||||
const { mutateAsync: linkPayHistoryDetail } = useExtensionLinkPayHistoryDetailMutation();
|
||||
const { mutateAsync: linkPayHistoryResend } = useExtensionLinkPayHistoryResendMutation();
|
||||
|
||||
// 상세내역 조회
|
||||
const callDetail = () => {
|
||||
let detailParam: ExtensionLinkPayHistoryDetailParams = {
|
||||
mid: mid,
|
||||
tid: tid
|
||||
requestId: requestId,
|
||||
subReqId: subReqId
|
||||
}
|
||||
linkPayHistoryDetail(detailParam).then((rs: DetailResponse) => {
|
||||
console.log("Detail Info: ", rs)
|
||||
@@ -53,15 +57,18 @@ export const LinkPaymentDetailPage = () => {
|
||||
})
|
||||
}
|
||||
|
||||
//제발송 API
|
||||
const resendPayment = () => {
|
||||
let resendParam: ExtensionLinkPayHistoryResendParams = {
|
||||
mid: mid,
|
||||
tid: tid
|
||||
requestId: requestId,
|
||||
sendMethod: paymentInfo?.sendMethod
|
||||
}
|
||||
linkPayHistoryResend(resendParam)
|
||||
.then((response) => {
|
||||
console.log("Resend 성공 응답: ", response);
|
||||
onClickToNavigate(PATHS.additionalService.linkPayment.shippingHistory)
|
||||
// 현재 화면 유지하고 데이터 새로고침
|
||||
callDetail();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Resend 실패: ", error);
|
||||
@@ -103,6 +110,24 @@ export const LinkPaymentDetailPage = () => {
|
||||
state: { mid, tid }
|
||||
});
|
||||
};
|
||||
|
||||
// 재발송 버튼 활성화 조건 체크
|
||||
const isResendEnabled = () => {
|
||||
// paymentStatus가 "ACTIVE"이고
|
||||
if (paymentInfo?.paymentStatus !== 'ACTIVE') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// paymentLimitDate가 오늘 날짜를 지나지 않았을 때
|
||||
if (paymentInfo?.paymentLimitDate) {
|
||||
const limitDate = moment(paymentInfo.paymentLimitDate, 'YYYYMMDD');
|
||||
const today = moment().startOf('day');
|
||||
return limitDate.isSameOrAfter(today);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callDetail();
|
||||
}, []);
|
||||
@@ -129,18 +154,19 @@ export const LinkPaymentDetailPage = () => {
|
||||
detailInfo={detailInfo}
|
||||
></DetailInfoWrap>
|
||||
</div>
|
||||
<div className="apply-row">
|
||||
{/* <div className="apply-row">
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={() => onClickToSeparateApproval()}
|
||||
>분리승인 상세</button>
|
||||
</div>
|
||||
{/* <div className="apply-row">
|
||||
</div> */}
|
||||
<div className="apply-row">
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={() => onClickToResend()}
|
||||
disabled={!isResendEnabled()}
|
||||
>재발송</button>
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main >
|
||||
|
||||
@@ -21,7 +21,7 @@ import { ExtensionLinkPayWaitDeleteParams, ExtensionLinkPayWaitDetailParams } fr
|
||||
export const LinkPaymentWaitDetailPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
const { mid, tid } = location.state || {};
|
||||
const { mid, requestId } = location.state || {};
|
||||
const [titleInfo, setTitleInfo] = useState<TitleInfo>();
|
||||
const [paymentInfo, setPaymentInfo] = useState<PaymentInfo>();
|
||||
|
||||
@@ -34,10 +34,11 @@ export const LinkPaymentWaitDetailPage = () => {
|
||||
|
||||
const { mutateAsync: linkPayWaitDetail } = useExtensionLinkPayWaitDetailMutation();
|
||||
const { mutateAsync: linkPayWaitDelete } = useExtensionLinkPayWaitDeleteMutation();
|
||||
|
||||
const callDetail = () => {
|
||||
let detailParam: ExtensionLinkPayWaitDetailParams = {
|
||||
mid: mid,
|
||||
tid: tid
|
||||
requestId: requestId
|
||||
}
|
||||
|
||||
linkPayWaitDetail(detailParam).then((rs: DetailResponse) => {
|
||||
@@ -51,7 +52,7 @@ export const LinkPaymentWaitDetailPage = () => {
|
||||
const deletePayment = () => {
|
||||
let deleteParam: ExtensionLinkPayWaitDeleteParams = {
|
||||
mid: mid,
|
||||
tid: tid
|
||||
requestId: requestId
|
||||
}
|
||||
linkPayWaitDelete(deleteParam)
|
||||
.then((response) => {
|
||||
|
||||
@@ -21,6 +21,8 @@ export const PayoutDetailPage = () => {
|
||||
const tid = location.state.tid;
|
||||
const mid = location.state.mid;
|
||||
|
||||
const [requestType, setRequestType] = useState<string>('');
|
||||
const [email, setEmail] = useState<string>('');
|
||||
const [detail, setDetail] = useState<ExtensionPayoutDetailResponse>();
|
||||
|
||||
const { mutateAsync: extensionPayoutDetail } = useExtensionPayoutDetailMutation();
|
||||
@@ -48,6 +50,8 @@ export const PayoutDetailPage = () => {
|
||||
let params: ExtensionPayoutDetailDownloadCertificateParams = {
|
||||
tid: tid,
|
||||
mid: mid,
|
||||
requestType: requestType,
|
||||
email: email
|
||||
};
|
||||
extensionPayoutDetailDownloadCertification(params).then((rs: ExtensionPayoutDetailDownloadCertificateResponse) => {
|
||||
console.log(rs);
|
||||
@@ -74,8 +78,8 @@ export const PayoutDetailPage = () => {
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</div>
|
||||
<div className="num-store">나이스테스트가맹점</div>
|
||||
<div className="num-day">2025.08.19</div>
|
||||
<div className="num-store">{detail?.companyName}</div>
|
||||
<div className="num-day">{detail?.settlementDate}</div>
|
||||
<div className="receipt-row">
|
||||
<button
|
||||
className="receipt-btn"
|
||||
@@ -105,7 +109,7 @@ export const PayoutDetailPage = () => {
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">지급일시</span>
|
||||
<span className="v">{ detail?.settlementDate }</span>
|
||||
<span className="v">{ detail?.settlementDateTime }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">사업자번호</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { HeaderType, SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { DefaultRequestPagination, HeaderType, SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { useExtensionPayoutListMutation } from '@/entities/additional-service/api/payout/use-extension-payout-list-mutation';
|
||||
import {
|
||||
@@ -10,11 +10,11 @@ import {
|
||||
ExtensionPayoutListResponse,
|
||||
PayoutContent,
|
||||
PayoutDisbursementStatus,
|
||||
PayoutSearchCl
|
||||
PayoutSearchDateType
|
||||
} from '@/entities/additional-service/model/payout/types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { JSX, useEffect, useState } from 'react';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import {
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
@@ -28,22 +28,44 @@ import { PayoutDisbursementStatusBtnGroup } from '@/entities/additional-service/
|
||||
import { ListDateGroup } from '@/entities/additional-service/ui/list-date-group';
|
||||
import { AdditionalServiceCategory } from '@/entities/additional-service/model/types';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||
|
||||
export const PayoutListPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
|
||||
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
|
||||
entries.forEach((entry: IntersectionObserverEntry) => {
|
||||
if (entry.isIntersecting) {
|
||||
console.log('Element is now intersecting with the root. [' + onActionIntersect + ']');
|
||||
if (onActionIntersect) {
|
||||
callExtensionPayoutList();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('Element is no longer intersecting with the root.');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const { setTarget } = useIntersectionObserver({
|
||||
threshold: 1,
|
||||
onIntersect
|
||||
});
|
||||
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState<Record<string, Array<PayoutContent>>>({});
|
||||
const [listItems, setListItems] = useState<Array<PayoutContent>>([]);
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [nextCursor, setNextCursor] = useState<string | null>(null);
|
||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchCl, setSearchCl] = useState<PayoutSearchCl>(PayoutSearchCl.REQUEST_DATE);
|
||||
const [searchDateType, setSearchDateType] = useState<PayoutSearchDateType>(PayoutSearchDateType.REQUEST_DATE);
|
||||
const [fromDate, setFromDate] = useState<string>(moment().format('YYYYMMDD'));
|
||||
const [toDate, setToDate] = useState<string>(moment().format('YYYYMMDD'));
|
||||
const [disbursementStatus, setDisbursementStatus] = useState<PayoutDisbursementStatus>(PayoutDisbursementStatus.ALL);
|
||||
const [minAmount, setMinAmount] = useState<number>();
|
||||
const [maxAmount, setMaxAmount] = useState<number>();
|
||||
const [status, setStatus] = useState<PayoutDisbursementStatus>(PayoutDisbursementStatus.ALL);
|
||||
const [minAmount, setMinAmount] = useState<number>(0);
|
||||
const [maxAmount, setMaxAmount] = useState<number>(50000000);
|
||||
|
||||
const { mutateAsync: extensionPayoutList } = useExtensionPayoutListMutation();
|
||||
const { mutateAsync: extensionPayoutExcel } = useExtensionPayoutExcelMutation();
|
||||
@@ -58,22 +80,20 @@ export const PayoutListPage = () => {
|
||||
const onClickToNavigation = () => {
|
||||
navigate(PATHS.additionalService.payout.request);
|
||||
};
|
||||
const onClickToGoDetail = (tid?: string) => {
|
||||
if(!!tid){
|
||||
navigate(PATHS.additionalService.payout.detail, {
|
||||
state: {
|
||||
tid: tid
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const callExtensionPayoutList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
sortType?: SortTypeKeys,
|
||||
status?: PayoutDisbursementStatus,
|
||||
resetPage?: boolean
|
||||
}) => {
|
||||
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
|
||||
setPageParam(pageParam);
|
||||
setOnActionIntersect(false);
|
||||
|
||||
const currentPageParam = option?.resetPage
|
||||
? { ...DEFAULT_PAGE_PARAM, sortType: option?.sortType ?? sortType }
|
||||
: { ...pageParam, sortType: option?.sortType ?? sortType };
|
||||
|
||||
setPageParam(currentPageParam);
|
||||
|
||||
let newMinAmount = minAmount;
|
||||
if(!!minAmount && typeof(minAmount) === 'string'){
|
||||
newMinAmount = parseInt(minAmount);
|
||||
@@ -84,26 +104,41 @@ export const PayoutListPage = () => {
|
||||
}
|
||||
let params: ExtensionPayoutListParams = {
|
||||
mid: mid,
|
||||
searchCl: searchCl,
|
||||
searchDateType: searchDateType,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
disbursementStatus: disbursementStatus,
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
page: pageParam
|
||||
status: option?.status ?? status,
|
||||
minAmount: newMinAmount,
|
||||
maxAmount: newMaxAmount,
|
||||
page: currentPageParam
|
||||
};
|
||||
extensionPayoutList(params).then((rs: ExtensionPayoutListResponse) => {
|
||||
setListItems(assembleData(rs.content));
|
||||
// resetPage면 기존 리스트 무시, 아니면 추가
|
||||
setListItems(option?.resetPage ? rs.content : [
|
||||
...listItems,
|
||||
...rs.content
|
||||
]);
|
||||
if (rs.hasNext) {
|
||||
setNextCursor(rs.nextCursor);
|
||||
setPageParam({
|
||||
...currentPageParam,
|
||||
cursor: rs.nextCursor
|
||||
});
|
||||
setOnActionIntersect(true)
|
||||
}
|
||||
else {
|
||||
setNextCursor(null);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const callDownloadExcel = () => {
|
||||
let params: ExtensionPayoutExcelParams = {
|
||||
mid: mid,
|
||||
searchCl: searchCl,
|
||||
searchDateType: searchDateType,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
disbursementStatus: disbursementStatus,
|
||||
status: status,
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
};
|
||||
@@ -112,29 +147,6 @@ export const PayoutListPage = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<PayoutContent>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let date;
|
||||
if(searchCl === PayoutSearchCl.REQUEST_DATE){
|
||||
date = content[i]?.requestDate?.substring(0, 8);
|
||||
}
|
||||
else if(searchCl === PayoutSearchCl.PROXY_DATE){
|
||||
date = content[i]?.settlementDate?.substring(0, 8);
|
||||
}
|
||||
let groupDate = moment(date).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if(!!groupDate && data.hasOwnProperty(groupDate)){
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
const onClickToDownloadExcel = () => {
|
||||
callDownloadExcel();
|
||||
};
|
||||
@@ -143,37 +155,79 @@ export const PayoutListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callExtensionPayoutList({sortType: sort});
|
||||
callExtensionPayoutList({
|
||||
sortType: sort,
|
||||
resetPage: true
|
||||
});
|
||||
};
|
||||
const onClickToDisbursementStatus = (val: PayoutDisbursementStatus) => {
|
||||
setDisbursementStatus(val);
|
||||
setStatus(val);
|
||||
callExtensionPayoutList({
|
||||
val: val
|
||||
status: val,
|
||||
resetPage: true
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
callExtensionPayoutList();
|
||||
}, []);
|
||||
// 필터 조건이 변경되면 첫 페이지부터 다시 시작
|
||||
callExtensionPayoutList({ resetPage: true });
|
||||
}, [
|
||||
mid,
|
||||
searchDateType,
|
||||
fromDate,
|
||||
toDate,
|
||||
status,
|
||||
minAmount,
|
||||
maxAmount
|
||||
]);
|
||||
|
||||
const getPayoutList = () => {
|
||||
let rs = [];
|
||||
if(Object.keys(listItems).length > 0){
|
||||
for (const [key, value] of Object.entries(listItems)) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={ AdditionalServiceCategory.Payout }
|
||||
mid={ mid }
|
||||
key={ key }
|
||||
date={ key }
|
||||
items={ value }
|
||||
></ListDateGroup>
|
||||
);
|
||||
const getListDateGroup = () => {
|
||||
let rs: JSX.Element[] = [];
|
||||
let date = '';
|
||||
let list: PayoutContent[] = [];
|
||||
for (let i = 0; i < listItems.length; i++) {
|
||||
// requestDate 또는 settlementDate format: "20211018140420" (YYYYMMDDHHmmss)
|
||||
let itemDateStr = '';
|
||||
if (searchDateType === PayoutSearchDateType.REQUEST_DATE) {
|
||||
itemDateStr = listItems[i]?.requestDate || '';
|
||||
} else if (searchDateType === PayoutSearchDateType.SETTLEMENT_DATE) {
|
||||
itemDateStr = listItems[i]?.settlementDate || '';
|
||||
}
|
||||
let itemDate = itemDateStr.substring(0, 8);
|
||||
if (i === 0) {
|
||||
date = itemDate;
|
||||
}
|
||||
if (date !== itemDate) {
|
||||
// 날짜가 바뀌면 이전 리스트를 푸시 (날짜 업데이트 전에!)
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={AdditionalServiceCategory.Payout}
|
||||
mid={mid}
|
||||
key={date + '-' + i}
|
||||
date={date}
|
||||
items={list as any}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
date = itemDate; // 그 다음에 날짜 업데이트
|
||||
list = [];
|
||||
}
|
||||
list.push(listItems[i] as any);
|
||||
}
|
||||
if (list.length > 0) {
|
||||
rs.push(
|
||||
<ListDateGroup
|
||||
additionalServiceCategory={AdditionalServiceCategory.Payout}
|
||||
mid={mid}
|
||||
key={date + '-last'}
|
||||
date={date}
|
||||
items={list as any}
|
||||
></ListDateGroup>
|
||||
);
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -234,7 +288,7 @@ export const PayoutListPage = () => {
|
||||
PayoutDisbursementStatusBtnGroup.map((value, index) => (
|
||||
<span
|
||||
key={ `key-service-code=${ index }` }
|
||||
className={ `keyword-tag ${(disbursementStatus === value.value)? 'active': ''}` }
|
||||
className={ `keyword-tag ${(status === value.value)? 'active': ''}` }
|
||||
onClick={ () => onClickToDisbursementStatus(value.value) }
|
||||
>{ value.name }</span>
|
||||
))
|
||||
@@ -242,14 +296,15 @@ export const PayoutListPage = () => {
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div className="transaction-list">
|
||||
{ getPayoutList() }
|
||||
<div className="apply-row">
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={ () => onClickToNavigation() }
|
||||
>지급대행 신청</button>
|
||||
</div>
|
||||
<section className="transaction-list">
|
||||
{ getListDateGroup() }
|
||||
<div ref={setTarget}></div>
|
||||
</section>
|
||||
<div className="apply-row">
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={ () => onClickToNavigation() }
|
||||
>지급대행 신청</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -258,17 +313,17 @@ export const PayoutListPage = () => {
|
||||
filterOn={ filterOn }
|
||||
setFilterOn={ setFilterOn }
|
||||
mid={ mid }
|
||||
searchCl={ searchCl }
|
||||
searchDateType={ searchDateType }
|
||||
fromDate={ fromDate }
|
||||
toDate={ toDate }
|
||||
disbursementStatus= { disbursementStatus }
|
||||
status= { status }
|
||||
minAmount={ minAmount }
|
||||
maxAmount={ maxAmount }
|
||||
setMid={ setMid }
|
||||
setSearchCl={ setSearchCl }
|
||||
setSearchDateType={ setSearchDateType }
|
||||
setFromDate={ setFromDate }
|
||||
setToDate={ setToDate }
|
||||
setDisbursementStatus={ setDisbursementStatus }
|
||||
setStatus={ setStatus }
|
||||
setMinAmount={ setMinAmount }
|
||||
setMaxAmount={ setMaxAmount }
|
||||
></PayoutFilter>
|
||||
|
||||
@@ -13,6 +13,7 @@ import { useExtensionPayoutRequestMutation } from "@/entities/additional-service
|
||||
import { ExtensionPayoutRequestParams, ExtensionPayoutRequestResponse } from "@/entities/additional-service/model/payout/types";
|
||||
import NiceCalendar from "@/shared/ui/calendar/nice-calendar";
|
||||
import { useStore } from "@/shared/model/store";
|
||||
import moment from 'moment';
|
||||
|
||||
export const PayoutRequestPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -54,7 +55,7 @@ export const PayoutRequestPage = () => {
|
||||
};
|
||||
|
||||
const setNewDate = (date: string) => {
|
||||
setSettlementDate(date);
|
||||
setSettlementDate(moment(date).format('YYYYMMDD'));
|
||||
setCalendarOpen(false);
|
||||
};
|
||||
const onClickToOpenCalendar = () => {
|
||||
@@ -68,7 +69,7 @@ export const PayoutRequestPage = () => {
|
||||
<div className="ing-list">
|
||||
<div className="billing-form gap-30">
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">서브ID</div>
|
||||
<div className="billing-label">서브ID<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
@@ -78,7 +79,7 @@ export const PayoutRequestPage = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">지급액</div>
|
||||
<div className="billing-label">지급액<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
@@ -88,7 +89,7 @@ export const PayoutRequestPage = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">지급일</div>
|
||||
<div className="billing-label">지급일<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<div className="input-wrapper date">
|
||||
<input
|
||||
@@ -101,6 +102,7 @@ export const PayoutRequestPage = () => {
|
||||
className="date-btn"
|
||||
type="button"
|
||||
onClick={() => onClickToOpenCalendar()}
|
||||
disabled={!isFormValid}
|
||||
>
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_date.svg'}
|
||||
|
||||
@@ -14,6 +14,8 @@ interface NiceCalendarProps {
|
||||
singleDate?: string;
|
||||
calendarType: CalendarType;
|
||||
setNewDate: (date: string) => void;
|
||||
minDate?: Date;
|
||||
maxDate?: Date;
|
||||
};
|
||||
|
||||
const NiceCalendar = ({
|
||||
@@ -23,7 +25,9 @@ const NiceCalendar = ({
|
||||
endDate,
|
||||
singleDate,
|
||||
calendarType,
|
||||
setNewDate
|
||||
setNewDate,
|
||||
minDate: propMinDate,
|
||||
maxDate: propMaxDate
|
||||
}: NiceCalendarProps) => {
|
||||
const [valueDate, setValueDate] = useState<string>();
|
||||
const [minDate, setMinDate] = useState<Date | undefined>();
|
||||
@@ -38,20 +42,22 @@ const NiceCalendar = ({
|
||||
};
|
||||
const setMinMaxValueDate = () => {
|
||||
if(calendarType === CalendarType.Start){
|
||||
setMinDate(undefined);
|
||||
setMinDate(propMinDate || undefined);
|
||||
if(!!endDate){
|
||||
setMaxDate(new Date(endDate));
|
||||
}
|
||||
setValueDate(startDate);
|
||||
}
|
||||
}
|
||||
else if(calendarType === CalendarType.End){
|
||||
if(!!startDate){
|
||||
setMinDate(new Date(startDate));
|
||||
}
|
||||
setMaxDate(new Date());
|
||||
setMaxDate(propMaxDate || new Date());
|
||||
setValueDate(endDate);
|
||||
}
|
||||
else if(calendarType === CalendarType.Single){
|
||||
setMinDate(propMinDate || undefined);
|
||||
setMaxDate(propMaxDate || undefined);
|
||||
setValueDate(singleDate);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,13 +8,17 @@ interface SingleDatePickerProps {
|
||||
date: string;
|
||||
setDate: (date: string) => void;
|
||||
placeholder?: string;
|
||||
minDate?: Date;
|
||||
maxDate?: Date;
|
||||
}
|
||||
|
||||
export const SingleDatePicker = ({
|
||||
title,
|
||||
date,
|
||||
setDate,
|
||||
placeholder = '날짜 선택'
|
||||
placeholder = '날짜 선택',
|
||||
minDate,
|
||||
maxDate
|
||||
}: SingleDatePickerProps) => {
|
||||
const [calendarOpen, setCalendarOpen] = useState<boolean>(false);
|
||||
|
||||
@@ -84,6 +88,8 @@ export const SingleDatePicker = ({
|
||||
singleDate={date}
|
||||
calendarType={CalendarType.Single}
|
||||
setNewDate={setNewDate}
|
||||
minDate={minDate}
|
||||
maxDate={maxDate}
|
||||
></NiceCalendar>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user