통합거래조회 UI api
This commit is contained in:
@@ -4,7 +4,7 @@ import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
BillingDetailParams,
|
||||
DetailResponse
|
||||
BillingDetailResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
@@ -13,12 +13,12 @@ import {
|
||||
|
||||
export const billingDetail = (params: BillingDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<DetailResponse>(API_URL.billingDetail(), params),
|
||||
axios.post<BillingDetailResponse>(API_URL.billingDetail(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useBillingDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, BillingDetailParams>) => {
|
||||
const mutation = useMutation<DetailResponse, CBDCAxiosError, BillingDetailParams>({
|
||||
export const useBillingDetailMutation = (options?: UseMutationOptions<BillingDetailResponse, CBDCAxiosError, BillingDetailParams>) => {
|
||||
const mutation = useMutation<BillingDetailResponse, CBDCAxiosError, BillingDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: BillingDetailParams) => billingDetail(params),
|
||||
});
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface SortOptionsBoxProps {
|
||||
sortBy: SortByKeys;
|
||||
onCliCkToSort: (sortBy: SortByKeys) => void;
|
||||
};
|
||||
export interface ListItemProps extends ListItem{
|
||||
export interface ListItemProps extends AllTransactionListItem, CashReceiptListItem, EscrowListItem, BillingListItem {
|
||||
transactionCategory?: TransactionCategory;
|
||||
};
|
||||
export interface ListDateGroupProps {
|
||||
@@ -61,10 +61,8 @@ export interface BillingListProps {
|
||||
transactionCategory: TransactionCategory;
|
||||
listItems: Record<string, Array<ListItemProps>>
|
||||
};
|
||||
export interface ListItem {
|
||||
export interface AllTransactionListItem {
|
||||
tid?: string;
|
||||
issueNumber?: number;
|
||||
billKey?: string;
|
||||
mid?: string;
|
||||
stateDate?: string;
|
||||
stateCode?: string;
|
||||
@@ -75,11 +73,35 @@ export interface ListItem {
|
||||
serviceDetailName?: string;
|
||||
goodsAmount?: number;
|
||||
};
|
||||
export interface CashReceiptListItem {
|
||||
id?: number;
|
||||
amount?: number;
|
||||
customerName?: string;
|
||||
issueNumber?: number;
|
||||
issueStatus?: string;
|
||||
paymentMethod?: string;
|
||||
processResult?: string;
|
||||
transactionDateTime?: string;
|
||||
};
|
||||
export interface EscrowListItem {
|
||||
id?: number;
|
||||
mid?: string;
|
||||
transactionDateTime?: string;
|
||||
customerName?: string;
|
||||
issueNumber?: number;
|
||||
transactionAmount?: number;
|
||||
deliveryStatus?: string;
|
||||
settlementStatus?: string;
|
||||
cancelStatus?: string;
|
||||
};
|
||||
export interface BillingListItem extends BillingItem {
|
||||
|
||||
};
|
||||
|
||||
export interface BillingItem {
|
||||
billKey: string;
|
||||
tid: string;
|
||||
orderNumber: string;
|
||||
billKey?: string;
|
||||
tid?: string;
|
||||
orderNumber?: string;
|
||||
approvalNumber?: string;
|
||||
approvalDate?: string;
|
||||
transactionDateTime?: string;
|
||||
@@ -142,28 +164,28 @@ export interface CashReceiptListParams {
|
||||
};
|
||||
|
||||
export interface EscrowListParams {
|
||||
mid: string;
|
||||
searchType: string;
|
||||
searchKeyword: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
deliveryStatus: string;
|
||||
settlementStatus: string;
|
||||
minAmount: number;
|
||||
maxAmount: number;
|
||||
pagination: DefaultRequestPagination;
|
||||
mid?: string;
|
||||
searchType?: string;
|
||||
searchKeyword?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
deliveryStatus?: string;
|
||||
settlementStatus?: string;
|
||||
minAmount?: number;
|
||||
maxAmount?: number;
|
||||
pagination?: DefaultRequestPagination;
|
||||
};
|
||||
|
||||
export interface BillingListParams {
|
||||
mid: string;
|
||||
searchType: string;
|
||||
searchKeyword: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
requestStatus: string;
|
||||
processResult: string;
|
||||
paymentMethod: string;
|
||||
pagination: DefaultRequestPagination
|
||||
mid?: string;
|
||||
searchType?: string;
|
||||
searchKeyword?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
requestStatus?: string;
|
||||
processResult?: string;
|
||||
paymentMethod?: string;
|
||||
pagination?: DefaultRequestPagination
|
||||
};
|
||||
|
||||
export interface AllTransactionDetailParams {
|
||||
@@ -309,18 +331,7 @@ export interface EscrowInfo {
|
||||
deliveryAddress: string;
|
||||
};
|
||||
|
||||
export interface DetailResponse {
|
||||
amountInfo?: AmountInfo;
|
||||
importantInfo?: ImportantInfo;
|
||||
paymentInfo?: PaymentInfo;
|
||||
transactionInfo?: TransactionInfo;
|
||||
settlementInfo?: SettlementInfo;
|
||||
partCancelInfo?: PartCancelInfo;
|
||||
issueInfo?: IssueInfo;
|
||||
detailInfo?: DetailInfo;
|
||||
escrowInfo?: EscrowInfo;
|
||||
};
|
||||
export interface BillingDetailResponse {
|
||||
export interface BillingInfo {
|
||||
billKey: string;
|
||||
tid: string;
|
||||
orderNumber: string;
|
||||
@@ -333,10 +344,27 @@ export interface BillingDetailResponse {
|
||||
buyerName: string;
|
||||
}
|
||||
|
||||
export interface DetailInfoProps extends DetailResponse{
|
||||
export interface DetailResponse {
|
||||
amountInfo?: AmountInfo;
|
||||
importantInfo?: ImportantInfo;
|
||||
paymentInfo?: PaymentInfo;
|
||||
transactionInfo?: TransactionInfo;
|
||||
settlementInfo?: SettlementInfo;
|
||||
partCancelInfo?: PartCancelInfo;
|
||||
issueInfo?: IssueInfo;
|
||||
detailInfo?: DetailInfo;
|
||||
escrowInfo?: EscrowInfo;
|
||||
billingInfo?: BillingInfo;
|
||||
};
|
||||
export interface BillingDetailResponse extends BillingInfo {
|
||||
|
||||
}
|
||||
|
||||
export interface DetailInfoProps extends DetailResponse {
|
||||
transactionCategory: TransactionCategory;
|
||||
show?: boolean;
|
||||
tid?: string;
|
||||
serviceCode?: string;
|
||||
issueNumber?: number;
|
||||
onClickToShowInfo?: (info: InfoWrapKeys) => void;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
@@ -9,9 +10,93 @@ export const AmountInfoWrap = ({
|
||||
amountInfo,
|
||||
show,
|
||||
tid,
|
||||
serviceCode,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation();
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
mid: {name: 'MID', type: 'string'},
|
||||
amount: {name: '거래금액', type: 'number'},
|
||||
cardAmount: {name: '신용카드금액', type: 'number'},
|
||||
pointAmount: {name: '포인트금액', type: 'number'},
|
||||
couponAmount: {name: '쿠폰금액', type: 'number'},
|
||||
kakaoMoney: {name: '카카오머니', type: 'number'},
|
||||
kakaoPoint: {name: '카카오포인트', type: 'number'},
|
||||
kakaoInstantDiscount: {name: '카카오 즉시할인', type: 'number'},
|
||||
naverPoint: {name: '네이버 포인트', type: 'number'},
|
||||
tossMoney: {name: '토스머니', type: 'number'},
|
||||
tossDiscount: {name: '토스할인', type: 'number'},
|
||||
paycoPoint: {name: '페이코 포인트', type: 'number'},
|
||||
paycoCoupon: {name: '페이코 쿠폰', type: 'number'},
|
||||
escrowFee: {name: '에스크로수수료', type: 'number'}
|
||||
};
|
||||
|
||||
const showTop = ['01', '02', '03', '26'];
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['mid', 'cardAmount', 'pointAmount',
|
||||
'couponAmount', 'escrowFee', 'kakaoMoney',
|
||||
'kakaoPoint', 'kakaoInstantDiscount', 'naverPoint',
|
||||
'tossMoney', 'tossDiscount', 'paycoPoint', 'paycoCoupon'
|
||||
],
|
||||
// 계좌이체
|
||||
'02': ['amount', 'mid', 'escrowFee'],
|
||||
// 가상계좌
|
||||
'03': ['amount', 'mid'],
|
||||
// 휴대폰
|
||||
'04': ['amount', 'mid'],
|
||||
// 계좌간편결제
|
||||
'26': ['amount', 'mid', 'escrowFee'],
|
||||
// SSG머니
|
||||
'21': ['amount', 'mid'],
|
||||
// SSG은행계좌
|
||||
'24': ['amount', 'mid'],
|
||||
// 문화상품권
|
||||
'14': ['amount', 'mid'],
|
||||
// 티머니페이
|
||||
'31': ['amount', 'mid'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newAmountInfo: Record<string, any> | undefined = amountInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
if(!!newAmountInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-amount-item-${i}`}
|
||||
className="amount-item"
|
||||
>
|
||||
<span className="label">· { subItems[k]?.name }</span>
|
||||
<span className="value">
|
||||
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newAmountInfo[k]
|
||||
}
|
||||
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newAmountInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newAmountInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, margin: 0, display: 'none' },
|
||||
visible: { height: 'auto', padding: '16px', margin: '10px 0', display: 'block' },
|
||||
@@ -62,46 +147,7 @@ export const AmountInfoWrap = ({
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<ul className="amount-list">
|
||||
<li className="amount-item">
|
||||
<span className="label">· 신용카드</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.cardAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 포인트</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.pointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 쿠폰</span>
|
||||
<span className="value minus">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.couponAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 에스크로</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.escrowFee }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
{ subLi() }
|
||||
</ul>
|
||||
</motion.div>
|
||||
|
||||
|
||||
70
src/entities/transaction/ui/info-wrap/billing-info-wrap.tsx
Normal file
70
src/entities/transaction/ui/info-wrap/billing-info-wrap.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import moment from 'moment';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
|
||||
export const BillingInfoWrap = ({
|
||||
transactionCategory,
|
||||
billingInfo,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
if(!!onClickToShowInfo){
|
||||
onClickToShowInfo(InfoWrapKeys.Important);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="txn-section">
|
||||
<div className="section-title">중요 정보</div>
|
||||
<ul className="kv-list">
|
||||
<li className="kv-row">
|
||||
<span className="k">빌키</span>
|
||||
<span className="v">{ billingInfo?.billKey }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">TID</span>
|
||||
<span className="v">{ billingInfo?.tid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">주분번호</span>
|
||||
<span className="v">{ billingInfo?.orderNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인번호</span>
|
||||
<span className="v">{ billingInfo?.approvalNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인일자</span>
|
||||
<span className="v">{ moment(billingInfo?.approvalDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">요청상태</span>
|
||||
<span className="v">{ billingInfo?.requestStatus }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">처리결과</span>
|
||||
<span className="v">{ billingInfo?.processResult }</span>
|
||||
</li>
|
||||
{ (!!billingInfo?.installmentMonth && parseInt(billingInfo?.installmentMonth) > 1) &&
|
||||
<li className="kv-row">
|
||||
<span className="k">할부개월</span>
|
||||
<span className="v">{ billingInfo?.installmentMonth }개월 할부</span>
|
||||
</li>
|
||||
}
|
||||
<li className="kv-row">
|
||||
<span className="k">상품명</span>
|
||||
<span className="v">{ billingInfo?.productName }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">구매자</span>
|
||||
<span className="v">{ billingInfo?.buyerName }</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
|
||||
@@ -9,11 +8,7 @@ export const DetailInfoWrap = ({
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
};
|
||||
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
if(!!onClickToShowInfo){
|
||||
onClickToShowInfo(InfoWrapKeys.Issue);
|
||||
@@ -27,17 +22,46 @@ export const DetailInfoWrap = ({
|
||||
className="section-title with-toggle"
|
||||
onClick={ () => onClickToSetShowInfo() }
|
||||
>
|
||||
정산 정보 <DetailArrow show={ show }></DetailArrow>
|
||||
상세 정보 <DetailArrow show={ show }></DetailArrow>
|
||||
</div>
|
||||
<motion.ul
|
||||
className="kv-list"
|
||||
initial="hidden"
|
||||
animate={ (show)? 'visible': 'hidden' }
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
|
||||
</motion.ul>
|
||||
<ul className="kv-list">
|
||||
<li className="kv-row">
|
||||
<span className="k">취소일자</span>
|
||||
<span className="v">{ moment(detailInfo?.cancelDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">취소승인번호</span>
|
||||
<span className="v">{ detailInfo?.cancelApprovalNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">현금영수증</span>
|
||||
<span className="v">{ detailInfo?.receiptInfo }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">TID</span>
|
||||
<span className="v">{ detailInfo?.tid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">거래ID</span>
|
||||
<span className="v">{ detailInfo?.merchantTid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">서브몰명</span>
|
||||
<span className="v">{ detailInfo?.subMallName }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">서브몰 사업자 번호</span>
|
||||
<span className="v">{ detailInfo?.subMallBusinessNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">발행경로</span>
|
||||
<span className="v">{ detailInfo?.issueChannel }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">실패사유</span>
|
||||
<span className="v">{ detailInfo?.failureReason }</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -10,8 +10,8 @@ export const EscrowInfoWrap = ({
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
hidden: { height: 0, display: 'none' },
|
||||
visible: { height: 'auto', display: 'block' },
|
||||
};
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
@@ -36,7 +36,46 @@ export const EscrowInfoWrap = ({
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
|
||||
<li className="kv-row">
|
||||
<span className="k">배송상태</span>
|
||||
<span className="v">{ escrowInfo?.deliveryStatus }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">배송등록</span>
|
||||
<span className="v">{ moment(escrowInfo?.deliveryRegistrationDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">배송완료</span>
|
||||
<span className="v">{ moment(escrowInfo?.deliveryCompleteDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">구매확인</span>
|
||||
<span className="v">{ moment(escrowInfo?.purchaseConfirmDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">구매거절</span>
|
||||
<span className="v">{ escrowInfo?.purchaseRejectReason }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">거절사유</span>
|
||||
<span className="v">{ escrowInfo?.rejectReason }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">에스크로인증번호</span>
|
||||
<span className="v">{ escrowInfo?.escrowCertNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">택배사</span>
|
||||
<span className="v">{ escrowInfo?.deliveryCompany }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">운송장번호</span>
|
||||
<span className="v">{ escrowInfo?.trackingNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">배송주소</span>
|
||||
<span className="v">{ escrowInfo?.deliveryAddress }</span>
|
||||
</li>
|
||||
</motion.ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,56 +1,138 @@
|
||||
import moment from 'moment';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
|
||||
|
||||
export const ImportantInfoWrap = ({
|
||||
transactionCategory,
|
||||
importantInfo,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
if(!!onClickToShowInfo){
|
||||
onClickToShowInfo(InfoWrapKeys.Important);
|
||||
}
|
||||
serviceCode
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
ordNo: {name: '주문번호', type: 'string'},
|
||||
tid: {name: 'TID', type: 'string'},
|
||||
tradeStatus: {name: '거래상태', type: 'string'},
|
||||
tradeMethod: {name: '거래수단', type: 'string'},
|
||||
approvalDate: {name: '승인일', type: 'date'},
|
||||
tradeDate: {name: '거래일', type: 'date'},
|
||||
requestDate: {name: '요청일', type: 'date'},
|
||||
cancelDate: {name: '취소일', type: 'date'},
|
||||
productName: {name: '상품명', type: 'string'}
|
||||
};
|
||||
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'approvalDate', 'cancelDate', 'productName'],
|
||||
// 계좌이체
|
||||
'02': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// 가상계좌
|
||||
'03': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'requestDate', 'cancelDate', 'productName'],
|
||||
// 휴대폰
|
||||
'04': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// 계좌간편결제
|
||||
'26': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// SSG머니
|
||||
'21': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// SSG은행계좌
|
||||
'24': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// 문화상품권
|
||||
'14': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
// 티머니페이
|
||||
'31': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
|
||||
'tradeDate', 'cancelDate', 'productName'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newImportantInfo: Record<string, any> | undefined = importantInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
|
||||
if(!!newImportantInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-important-item-${i}`}
|
||||
className="kv-row"
|
||||
>
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newImportantInfo[k]
|
||||
}
|
||||
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newImportantInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newImportantInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="txn-section">
|
||||
<div className="section-title">중요 정보</div>
|
||||
<ul className="kv-list">
|
||||
<li className="kv-row">
|
||||
<span className="k">주문번호</span>
|
||||
<span className="v">{ importantInfo?.ordNo }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">TID</span>
|
||||
<span className="v">{ importantInfo?.tid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">결제상태</span>
|
||||
<span className="v">{ importantInfo?.tradeStatus }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">결제수단</span>
|
||||
<span className="v">{ importantInfo?.tradeMethod }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인일</span>
|
||||
<span className="v">{ moment(importantInfo?.approvalDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
{
|
||||
/*
|
||||
<li className="kv-row">
|
||||
<span className="k">취소일</span>
|
||||
<span className="v">2025.06.08</span>
|
||||
</li>
|
||||
*/
|
||||
{ (transactionCategory === TransactionCategory.AllTransaction) &&
|
||||
subLi()
|
||||
}
|
||||
<li className="kv-row">
|
||||
<span className="k">상품명</span>
|
||||
<span className="v">{ importantInfo?.productName }</span>
|
||||
</li>
|
||||
{ (transactionCategory === TransactionCategory.Escrow) &&
|
||||
<>
|
||||
<li className="kv-row">
|
||||
<span className="k">주문번호</span>
|
||||
<span className="v">{ importantInfo?.orderNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">TID</span>
|
||||
<span className="v">{ importantInfo?.tid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">거래상태</span>
|
||||
<span className="v">{ importantInfo?.transactionStatus }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">결제수단</span>
|
||||
<span className="v">{ importantInfo?.paymentMethod }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인일</span>
|
||||
<span className="v">{ moment(importantInfo?.approvalDateTime).format('YYYY.MM.DD HH:mm:ss') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">취소일</span>
|
||||
<span className="v">{ importantInfo?.cancelDate }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">상품명</span>
|
||||
<span className="v">{ importantInfo?.productName }</span>
|
||||
</li>
|
||||
</>
|
||||
}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
import moment from 'moment';
|
||||
|
||||
export const IssueInfoWrap = ({
|
||||
transactionCategory,
|
||||
@@ -9,10 +8,7 @@ export const IssueInfoWrap = ({
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
};
|
||||
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
if(!!onClickToShowInfo){
|
||||
@@ -27,17 +23,42 @@ export const IssueInfoWrap = ({
|
||||
className="section-title with-toggle"
|
||||
onClick={ () => onClickToSetShowInfo() }
|
||||
>
|
||||
정산 정보 <DetailArrow show={ show }></DetailArrow>
|
||||
발급 정보 <DetailArrow show={ show }></DetailArrow>
|
||||
</div>
|
||||
<motion.ul
|
||||
className="kv-list"
|
||||
initial="hidden"
|
||||
animate={ (show)? 'visible': 'hidden' }
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
|
||||
</motion.ul>
|
||||
<ul className="kv-list">
|
||||
<li className="kv-row">
|
||||
<span className="k">승인번호</span>
|
||||
<span className="v">{ issueInfo?.approvalNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">발행번호</span>
|
||||
<span className="v">{ issueInfo?.issueNumber }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">발행일시</span>
|
||||
<span className="v">{ moment(issueInfo?.issueDateTime).format('YYYY.MM.DD HH:mm:ss') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">용도</span>
|
||||
<span className="v">{ issueInfo?.purpose }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">결제수단</span>
|
||||
<span className="v">{ issueInfo?.paymentMethod }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">상품명</span>
|
||||
<span className="v">{ issueInfo?.productName }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">진행상태</span>
|
||||
<span className="v">{ issueInfo?.transmissionStatus }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">거래구분</span>
|
||||
<span className="v">{ issueInfo?.transactionType }</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
@@ -6,13 +7,93 @@ import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
export const PartCancelInfoWrap = ({
|
||||
transactionCategory,
|
||||
partCancelInfo,
|
||||
serviceCode,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
originalTid: {name: '원거래 TID', type: 'string'},
|
||||
originalAmount: {name: '원거래 금액', type: 'number'},
|
||||
partCancelTid: {name: (serviceCode === '05')? '재승인 TID': '부분취소 TID', type: 'string'},
|
||||
partCancelAmount: {name: '부분취소 금액', type: 'number'},
|
||||
remainingAmount: {name: (serviceCode === '05')? '재승인 금액': '부분취소 후 잔액', type: 'number'},
|
||||
};
|
||||
console.log(serviceCode)
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 계좌이체
|
||||
'02': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 가상계좌
|
||||
'03': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 휴대폰
|
||||
'04': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 계좌간편결제
|
||||
'26': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// SSG머니
|
||||
'21': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// SSG은행계좌
|
||||
'24': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 문화상품권
|
||||
'14': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
// 티머니페이
|
||||
'31': ['originalTid', 'originalAmount', 'partCancelTid',
|
||||
'partCancelAmount', 'remainingAmount'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newPartCancelInfo: Record<string, any> | undefined = partCancelInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
|
||||
if(!!newPartCancelInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-important-item-${i}`}
|
||||
className="kv-row"
|
||||
>
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newPartCancelInfo[k]
|
||||
}
|
||||
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newPartCancelInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newPartCancelInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
hidden: { height: 0, display: 'none' },
|
||||
visible: { height: 'auto', display: 'block' },
|
||||
};
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
@@ -37,40 +118,7 @@ export const PartCancelInfoWrap = ({
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<li className="kv-row">
|
||||
<span className="k">원거래 TID</span>
|
||||
<span className="v">{ partCancelInfo?.originalTid }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">원거래 금액</span>
|
||||
<span className="v">
|
||||
<NumericFormat
|
||||
value={ partCancelInfo?.originalAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ '원' }
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">부분취소 TID</span>
|
||||
<span className="v">nictest00m01012506171629294150</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">부분취소 금액</span>
|
||||
<span className="v">50,000원</span>
|
||||
</li>
|
||||
<li className="kv-row nopadding">
|
||||
<span className="k">부분취소 후 잔액</span>
|
||||
<span className="v">
|
||||
<NumericFormat
|
||||
value={ partCancelInfo?.remainingAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ '원' }
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
{ subLi() }
|
||||
</motion.ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,16 +1,122 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
|
||||
export const PaymentInfoWrap = ({
|
||||
transactionCategory,
|
||||
paymentInfo,
|
||||
serviceCode,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
approvalAcquire: {name: '승인매입', type: 'string'},
|
||||
approvalReturn: {name: '승인반송(횟수)', type: 'number'},
|
||||
approvalReAcquire: {name: '승인재매입(횟수)', type: 'number'},
|
||||
approvalVAN: {name: '승인VAN', type: 'string'},
|
||||
cancelAcquire: {name: '취소매입', type: 'string'},
|
||||
cancelReturn: {name: '취소반송', type: 'string'},
|
||||
cancelReAcquire: {name: '취소재매입', type: 'string'},
|
||||
acquireVAN: {name: '매입VAN', type: 'string'},
|
||||
acquireCompany: {name: '매입사(발급사)', type: 'string'},
|
||||
cardNumber: {name: '카드번호', type: 'string'},
|
||||
approvalNumber: {name: '승인번호', type: 'string'},
|
||||
installmentPeriod: {name: '할부기간', type: 'number'},
|
||||
authentication: {name: '인증', type: 'string'},
|
||||
accountType: {name: '유형', type: 'string'},
|
||||
bankName: {name: '은행명', type: 'string'},
|
||||
accountNumber: {name: '계좌번호', type: 'string'},
|
||||
depositBankName: {name: '입금금융기관명', type: 'string'},
|
||||
depositorName: {name: '입금자명', type: 'string'},
|
||||
depositDeadline: {name: '입금기한', type: 'date'},
|
||||
depositDate: {name: '입금일', type: 'date'},
|
||||
refundScheduleDate: {name: '환불예정일', type: 'date'},
|
||||
refundBankName: {name: '환불은행명', type: 'string'},
|
||||
refundAccountNumber: {name: '환불계좌번호', type: 'string'},
|
||||
accountHolder: {name: '예금주', type: 'string'},
|
||||
refundCompleteDate: {name: '환불완료일', type: 'date'},
|
||||
partner: {name: '제휴사', type: 'string'},
|
||||
cpid: {name: 'CPID', type: 'string'},
|
||||
productCategory: {name: '상품구분', type: 'string'},
|
||||
phoneNumber: {name: '휴대폰번호', type: 'string'},
|
||||
customerId: {name: '고객ID', type: 'string'},
|
||||
giftCardNumber: {name: '상품권번호', type: 'string'},
|
||||
culturelandId: {name: '컬처랜드ID', type: 'string'},
|
||||
};
|
||||
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['approvalAcquire', 'approvalReturn', 'approvalReAcquire',
|
||||
'approvalVAN', 'cancelAcquire', 'cancelReturn', 'cancelReAcquire',
|
||||
'acquireVAN', 'acquireCompany', 'cardNumber', 'approvalNumber',
|
||||
'installmentPeriod', 'authentication'],
|
||||
// 계좌이체
|
||||
'02': ['accountType', 'bankName', 'accountNumber'],
|
||||
// 가상계좌
|
||||
'03': ['bankName', 'accountNumber', 'depositBankName', 'depositorName',
|
||||
'depositDeadline', 'depositDate', 'refundScheduleDate',
|
||||
'refundBankName', 'refundAccountNumber', 'accountHolder'],
|
||||
// 휴대폰
|
||||
'04': ['refundCompleteDate', 'partner', 'cpid', 'productCategory', 'phoneNumber'],
|
||||
// 계좌간편결제
|
||||
'26': ['bankName', 'refundCompleteDate', 'accountHolder', 'accountType', 'customerId'],
|
||||
// SSG머니
|
||||
'21': ['giftCardNumber'],
|
||||
// SSG은행계좌
|
||||
'24': [],
|
||||
// 문화상품권
|
||||
'14': ['culturelandId'],
|
||||
// 티머니페이
|
||||
'31': ['cardNumber', 'approvalNumber', 'cpid'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newPaymentInfo: Record<string, any> | undefined = paymentInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
|
||||
if(!!newPaymentInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-important-item-${i}`}
|
||||
className="kv-row"
|
||||
>
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newPaymentInfo[k]
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newPaymentInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newPaymentInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
hidden: { height: 0, display: 'none' },
|
||||
visible: { height: 'auto', display: 'block' },
|
||||
};
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
@@ -35,14 +141,28 @@ export const PaymentInfoWrap = ({
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인 금액</span>
|
||||
<span className="v">10,000,000원</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">부가세</span>
|
||||
<span className="v">0원</span>
|
||||
</li>
|
||||
{ (transactionCategory === TransactionCategory.AllTransaction) &&
|
||||
subLi()
|
||||
}
|
||||
{ (transactionCategory === TransactionCategory.Escrow) &&
|
||||
<>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인 금액</span>
|
||||
<span className="v">
|
||||
<NumericFormat
|
||||
value={ paymentInfo?.paymentAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">승인 번호</span>
|
||||
<span className="v">{ paymentInfo?.approvalNumber }</span>
|
||||
</li>
|
||||
</>
|
||||
}
|
||||
</motion.ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import moment from 'moment';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
@@ -6,12 +7,92 @@ import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
export const SettlementInfoWrap = ({
|
||||
transactionCategory,
|
||||
settlementInfo,
|
||||
serviceCode,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
approvalSettleDate: {name: '승인정산일', type: 'date'},
|
||||
approvalSettleAmount: {name: '승인정산금액', type: 'number'},
|
||||
cancelSettleDate: {name: '취소정산일', type: 'date'},
|
||||
cancelSettleAmount: {name: '취소정산금액', type: 'number'},
|
||||
};
|
||||
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 계좌이체
|
||||
'02': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 가상계좌
|
||||
'03': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 휴대폰
|
||||
'04': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 계좌간편결제
|
||||
'26': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// SSG머니
|
||||
'21': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// SSG은행계좌
|
||||
'24': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 문화상품권
|
||||
'14': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
// 티머니페이
|
||||
'31': ['approvalSettleDate', 'approvalSettleAmount',
|
||||
'cancelSettleDate', 'cancelSettleAmount'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newSettlementInfo: Record<string, any> | undefined = settlementInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
|
||||
if(!!newSettlementInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-important-item-${i}`}
|
||||
className="kv-row"
|
||||
>
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newSettlementInfo[k]
|
||||
}
|
||||
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newSettlementInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newSettlementInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
hidden: { height: 0, display: 'none' },
|
||||
visible: { height: 'auto', display: 'block' },
|
||||
};
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
@@ -36,14 +117,7 @@ export const SettlementInfoWrap = ({
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<li className="kv-row">
|
||||
<span className="k">정산 예정일</span>
|
||||
<span className="v">{ moment(settlementInfo?.approvalSettleDate).format('YYYY.MM.DD') }</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">정산 상태</span>
|
||||
<span className="v">예정</span>
|
||||
</li>
|
||||
{ subLi() }
|
||||
</motion.ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,16 +1,102 @@
|
||||
import moment from 'moment';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DetailArrow } from '../detail-arrow';
|
||||
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
|
||||
import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
|
||||
export const TransactionInfoWrap = ({
|
||||
transactionCategory,
|
||||
transactionInfo,
|
||||
serviceCode,
|
||||
show,
|
||||
onClickToShowInfo
|
||||
}: DetailInfoProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
buyerName: {name: '구매자명', type: 'string'},
|
||||
email: {name: '이메일', type: 'string'},
|
||||
phoneNumber: {name: '전화번호', type: 'string'},
|
||||
cancelReason: {name: '취소사유', type: 'string'},
|
||||
cancelRequestor: {name: '취소요청자', type: 'string'},
|
||||
partialCancel: {name: '부분취소', type: 'string'},
|
||||
cashReceiptIssue: {name: '현금영수증발행', type: 'string'},
|
||||
};
|
||||
|
||||
const showSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor', 'partialCancel'],
|
||||
// 계좌이체
|
||||
'02': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
|
||||
// 가상계좌
|
||||
'03': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
|
||||
// 휴대폰
|
||||
'04': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor'],
|
||||
// 계좌간편결제
|
||||
'26': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
|
||||
// SSG머니
|
||||
'21': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor'],
|
||||
// SSG은행계좌
|
||||
'24': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor'],
|
||||
// 문화상품권
|
||||
'14': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor'],
|
||||
// 티머니페이
|
||||
'31': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
|
||||
'cancelRequestor'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
return (!!val || val === 0);
|
||||
};
|
||||
let newTransactionInfo: Record<string, any> | undefined = transactionInfo;
|
||||
const subLi = () => {
|
||||
let rs = [];
|
||||
|
||||
if(!!newTransactionInfo && !!serviceCode && !!showSubItems[serviceCode]){
|
||||
for(let i=0;i<showSubItems[serviceCode].length;i++){
|
||||
let k = showSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
rs.push(
|
||||
<li
|
||||
key={`key-important-item-${i}`}
|
||||
className="kv-row"
|
||||
>
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newTransactionInfo[k]
|
||||
}
|
||||
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newTransactionInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
moment(newTransactionInfo[k]).format('YYYY.MM.DD')
|
||||
}
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
|
||||
const variants = {
|
||||
hidden: { height: 0, padding: 0, display: 'none' },
|
||||
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
|
||||
hidden: { height: 0, display: 'none' },
|
||||
visible: { height: 'auto', display: 'block' },
|
||||
};
|
||||
|
||||
const onClickToSetShowInfo = () => {
|
||||
@@ -35,14 +121,22 @@ export const TransactionInfoWrap = ({
|
||||
variants={ variants }
|
||||
transition={{ duration: 0.3 }}
|
||||
>
|
||||
<li className="kv-row">
|
||||
<span className="k">가맹점명</span>
|
||||
<span className="v">NICE PAY</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">사업자번호</span>
|
||||
<span className="v">123-45-67890</span>
|
||||
</li>
|
||||
{ (transactionCategory === TransactionCategory.AllTransaction) &&
|
||||
subLi()
|
||||
}
|
||||
{ (transactionCategory === TransactionCategory.Escrow) &&
|
||||
<>
|
||||
<li className="kv-row">
|
||||
<span className="k">가맹점명</span>
|
||||
<span className="v">NICE PAY</span>
|
||||
</li>
|
||||
<li className="kv-row">
|
||||
<span className="k">사업자번호</span>
|
||||
<span className="v">123-45-67890</span>
|
||||
</li>
|
||||
</>
|
||||
}
|
||||
|
||||
</motion.ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -24,8 +24,6 @@ export const ListDateGroup = ({
|
||||
transactionCategory={ transactionCategory }
|
||||
key={ key }
|
||||
tid={ items[i]?.tid }
|
||||
issueNumber={ items[i]?.issueNumber }
|
||||
billKey={ items[i]?.billKey }
|
||||
mid={ items[i]?.mid }
|
||||
stateDate={ items[i]?.stateDate }
|
||||
stateCode={ items[i]?.stateCode }
|
||||
@@ -35,6 +33,23 @@ export const ListDateGroup = ({
|
||||
serviceName={ items[i]?.serviceName }
|
||||
serviceDetailName={ items[i]?.serviceDetailName }
|
||||
goodsAmount={ items[i]?.goodsAmount }
|
||||
|
||||
id={ items[i]?.id }
|
||||
amount={ items[i]?.amount }
|
||||
customerName={ items[i]?.customerName }
|
||||
issueNumber={ items[i]?.issueNumber }
|
||||
issueStatus={ items[i]?.issueStatus }
|
||||
paymentMethod={ items[i]?.paymentMethod }
|
||||
processResult={ items[i]?.processResult }
|
||||
transactionDateTime={ items[i]?.transactionDateTime }
|
||||
|
||||
transactionAmount={ items[i]?.transactionAmount }
|
||||
deliveryStatus={ items[i]?.deliveryStatus }
|
||||
settlementStatus={ items[i]?.settlementStatus }
|
||||
cancelStatus={ items[i]?.cancelStatus }
|
||||
|
||||
billKey={ items[i]?.billKey }
|
||||
orderNumber={ items[i]?.orderNumber }
|
||||
></ListItem>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,21 +2,18 @@ import { NumericFormat } from 'react-number-format';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { ListItemProps, TransactionCategory } from '../model/types';
|
||||
import moment from 'moment';
|
||||
|
||||
export const ListItem = ({
|
||||
transactionCategory,
|
||||
tid,
|
||||
issueNumber,
|
||||
billKey,
|
||||
mid,
|
||||
stateDate,
|
||||
stateCode,
|
||||
stateName,
|
||||
installmentMonth,
|
||||
serviceCode,
|
||||
serviceName,
|
||||
serviceDetailName,
|
||||
goodsAmount
|
||||
tid, mid, stateDate, stateCode, stateName,
|
||||
installmentMonth, serviceCode, serviceName,
|
||||
serviceDetailName, goodsAmount,
|
||||
id, amount, customerName, issueNumber,
|
||||
issueStatus, paymentMethod, processResult,
|
||||
transactionDateTime, transactionAmount,
|
||||
deliveryStatus, settlementStatus,
|
||||
cancelStatus, billKey, orderNumber
|
||||
}: ListItemProps) => {
|
||||
const { navigate } = useNavigate();
|
||||
const getItemClass = () => {
|
||||
@@ -51,7 +48,8 @@ export const ListItem = ({
|
||||
if(transactionCategory === TransactionCategory.AllTransaction){
|
||||
navigate(PATHS.transaction.allTransaction.detail, {
|
||||
state: {
|
||||
tid: tid
|
||||
tid: tid,
|
||||
serviceCode: serviceCode
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -82,9 +80,85 @@ export const ListItem = ({
|
||||
};
|
||||
|
||||
const getTime = () => {
|
||||
let time = stateDate?.substring(8, 12);
|
||||
let timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4);
|
||||
return timeStr;
|
||||
let timeStr = '';
|
||||
if(transactionCategory === TransactionCategory.AllTransaction){
|
||||
let time = stateDate?.substring(8, 12);
|
||||
timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4);
|
||||
}
|
||||
else{
|
||||
timeStr = moment(transactionDateTime).format('HH:mm');
|
||||
}
|
||||
return timeStr
|
||||
};
|
||||
|
||||
const getTitle = () => {
|
||||
let str = '';
|
||||
if(transactionCategory === TransactionCategory.AllTransaction){
|
||||
str = `${serviceName}(${serviceDetailName})`;
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.CashReceipt){
|
||||
str = `${customerName}(${issueNumber})`
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.Escrow){
|
||||
str = `${customerName}(${issueNumber})`
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.Billing){
|
||||
str = `${billKey}`
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
const getDetail = () => {
|
||||
let rs = [];
|
||||
if(transactionCategory === TransactionCategory.AllTransaction){
|
||||
rs.push(
|
||||
<>
|
||||
<span>{ getTime() }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ stateName }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ mid }</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.CashReceipt){
|
||||
rs.push(
|
||||
<>
|
||||
<span>{ getTime() }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ issueStatus }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ paymentMethod }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ processResult }</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.Escrow){
|
||||
rs.push(
|
||||
<>
|
||||
<span>{ getTime() }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ deliveryStatus }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ settlementStatus }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ cancelStatus }</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
else if(transactionCategory === TransactionCategory.Billing){
|
||||
rs.push(
|
||||
<>
|
||||
<span>{ getTime() }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ processResult }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ paymentMethod }</span>
|
||||
</>
|
||||
);
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -97,13 +171,9 @@ export const ListItem = ({
|
||||
<div className={ `status-dot ${getDotClass()}`}></div>
|
||||
</div>
|
||||
<div className="transaction-content">
|
||||
<div className="transaction-title">{ `${serviceName}(${serviceDetailName})` }</div>
|
||||
<div className="transaction-title">{ getTitle() }</div>
|
||||
<div className="transaction-details">
|
||||
<span>{ stateName }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ getTime() }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ mid }</span>
|
||||
{ getDetail() }
|
||||
{ (!!installmentMonth && parseInt(installmentMonth) > 1) &&
|
||||
<>
|
||||
<span className="separator">|</span>
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useUserInfo = () => {
|
||||
accessTokenExpiresIn,
|
||||
refreshTokenExpiresIn,
|
||||
menuGrants,
|
||||
usrid,
|
||||
// usrid,
|
||||
// clientAddressIP,
|
||||
// requires2FA
|
||||
} = result;
|
||||
@@ -33,10 +33,10 @@ export const useUserInfo = () => {
|
||||
setLocalStorage(StorageKeys.AccessTokenExpiresIn, accessTokenExpiresIn);
|
||||
setLocalStorage(StorageKeys.RefreshTokenExpiresIn, refreshTokenExpiresIn);
|
||||
setLocalStorage(StorageKeys.MenuGrants, menuGrants);
|
||||
setLocalStorage(StorageKeys.Usrid, usrid);
|
||||
// setLocalStorage(StorageKeys.Usrid, usrid);
|
||||
// setLocalStorage(StorageKeys.ClientAddressIP, clientAddressIP);
|
||||
// setLocalStorage(StorageKeys.Requires2FA, requires2FA);
|
||||
|
||||
console.log(result)
|
||||
useStore.getState().UserStore.setUserInfo(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface LoginResponse {
|
||||
accessTokenExpiresIn?: number;
|
||||
refreshTokenExpiresIn?: number;
|
||||
menuGrants?: Array<MenuGrantsItem>;
|
||||
usrid?: string;
|
||||
// usrid?: string;
|
||||
clientAddressIP?: string;
|
||||
tempToken?: string,
|
||||
tempTokenExpiresIn?: number;
|
||||
|
||||
@@ -56,7 +56,7 @@ export const HomePage = () => {
|
||||
let accessTokenExpiresIn = getLocalStorage(StorageKeys.AccessTokenExpiresIn);
|
||||
let refreshTokenExpiresIn = getLocalStorage(StorageKeys.RefreshTokenExpiresIn);
|
||||
let menuGrants = getLocalStorage(StorageKeys.TokenType);
|
||||
let usrid = getLocalStorage(StorageKeys.Usrid);
|
||||
// let usrid = getLocalStorage(StorageKeys.Usrid);
|
||||
|
||||
useStore.getState().UserStore.setUserInfo({
|
||||
tokenType: tokenType,
|
||||
@@ -65,7 +65,7 @@ export const HomePage = () => {
|
||||
accessTokenExpiresIn: accessTokenExpiresIn,
|
||||
refreshTokenExpiresIn: refreshTokenExpiresIn,
|
||||
menuGrants: menuGrants,
|
||||
usrid: usrid
|
||||
// usrid: usrid
|
||||
});
|
||||
setLoginSuccess(true);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ export const AllTransactionDetailPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
const tid = location.state.tid;
|
||||
const serviceCode = location.state.serviceCode;
|
||||
|
||||
const [amountInfo, setAmountInfo] = useState<AmountInfo>();
|
||||
const [importantInfo, setImportantInfo] = useState<ImportantInfo>();
|
||||
@@ -136,18 +137,21 @@ export const AllTransactionDetailPage = () => {
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
amountInfo={ amountInfo }
|
||||
show={ showAmountInfo }
|
||||
tid={ tid }
|
||||
tid={ tid }
|
||||
serviceCode={ serviceCode }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></AmountInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<div className="txn-divider"></div>
|
||||
<ImportantInfoWrap
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
importantInfo={ importantInfo }
|
||||
serviceCode={ serviceCode }
|
||||
></ImportantInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<div className="txn-divider"></div>
|
||||
<PaymentInfoWrap
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
paymentInfo={ paymentInfo }
|
||||
serviceCode={ serviceCode }
|
||||
show={ showPaymentInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></PaymentInfoWrap>
|
||||
@@ -155,6 +159,7 @@ export const AllTransactionDetailPage = () => {
|
||||
<TransactionInfoWrap
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
transactionInfo={ transactionInfo }
|
||||
serviceCode={ serviceCode }
|
||||
show={ showTransactionInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></TransactionInfoWrap>
|
||||
@@ -162,6 +167,7 @@ export const AllTransactionDetailPage = () => {
|
||||
<SettlementInfoWrap
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
settlementInfo={ settlementInfo }
|
||||
serviceCode={ serviceCode }
|
||||
show={ showSettlementInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></SettlementInfoWrap>
|
||||
@@ -169,6 +175,7 @@ export const AllTransactionDetailPage = () => {
|
||||
<PartCancelInfoWrap
|
||||
transactionCategory={ TransactionCategory.AllTransaction }
|
||||
partCancelInfo={ partCancelInfo }
|
||||
serviceCode={ serviceCode }
|
||||
show={ showPartCancelInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></PartCancelInfoWrap>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { AllTransactionList } from '@/entities/transaction/ui/all-transaction-list';
|
||||
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { AllTransactionListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { useAllTransactionListMutation } from '@/entities/transaction/api/use-all-transaction-list-mutation';
|
||||
import { useAllTransactionListSummaryMutation } from '@/entities/transaction/api/use-all-transaction-list-summary-mutation';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
@@ -84,12 +84,12 @@ export const AllTransactionListPage = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<ListItem>) => {
|
||||
const assembleData = (content: Array<AllTransactionListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let stateDate = content[i]?.stateDate;
|
||||
let groupDate = stateDate?.substring(0, 8);
|
||||
let stateDate = content[i]?.stateDate?.substring(0, 8);
|
||||
let groupDate = moment(stateDate).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
@@ -141,7 +141,10 @@ export const AllTransactionListPage = () => {
|
||||
if(!!serviceCodeOptions && serviceCodeOptions.length > 0)
|
||||
for(let i=0;i<serviceCodeOptions.length;i++){
|
||||
rs.push(
|
||||
<option value={serviceCodeOptions[i]?.value}>{ serviceCodeOptions[i]?.text }</option>
|
||||
<option
|
||||
key={`key-${i}`}
|
||||
value={serviceCodeOptions[i]?.value}
|
||||
>{ serviceCodeOptions[i]?.text }</option>
|
||||
)
|
||||
}
|
||||
return rs;
|
||||
|
||||
@@ -1,28 +1,15 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||
import { overlay } from 'overlay-kit';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { useBillingDetailMutation } from '@/entities/transaction/api/use-billing-detail-mutation';
|
||||
import { AmountInfoWrap } from '@/entities/transaction/ui/info-wrap/amount-info-wrap';
|
||||
import { ImportantInfoWrap } from '@/entities/transaction/ui/info-wrap/important-info-wrap';
|
||||
import { PaymentInfoWrap } from '@/entities/transaction/ui/info-wrap/payment-info-wrap';
|
||||
import { TransactionInfoWrap } from '@/entities/transaction/ui/info-wrap/transaction-info-wrap';
|
||||
import { SettlementInfoWrap } from '@/entities/transaction/ui/info-wrap/settlement-info-wrap';
|
||||
import { PartCancelInfoWrap } from '@/entities/transaction/ui/info-wrap/part-cancel-info-wrap';
|
||||
import { BillingInfoWrap } from '@/entities/transaction/ui/info-wrap/billing-info-wrap';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
TransactionCategory,
|
||||
BillingDetailParams,
|
||||
DetailResponse,
|
||||
AmountInfo,
|
||||
ImportantInfo,
|
||||
PaymentInfo,
|
||||
TransactionInfo,
|
||||
SettlementInfo,
|
||||
PartCancelInfo,
|
||||
InfoWrapKeys
|
||||
BillingDetailResponse,
|
||||
BillingInfo
|
||||
} from '@/entities/transaction/model/types';
|
||||
import {
|
||||
useSetOnBack,
|
||||
@@ -34,19 +21,9 @@ import {
|
||||
export const BillingDetailPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
const [billingInfo, setBillingInfo] = useState<BillingInfo>();
|
||||
|
||||
const [amountInfo, setAmountInfo] = useState<AmountInfo>();
|
||||
const [importantInfo, setImportantInfo] = useState<ImportantInfo>();
|
||||
const [paymentInfo, setPaymentInfo] = useState<PaymentInfo>();
|
||||
const [transactionInfo, setTransactionInfo] = useState<TransactionInfo>();
|
||||
const [settlementInfo, setSettlementInfo] = useState<SettlementInfo>();
|
||||
const [partCancelInfo, setPartCancelInfo] = useState<PartCancelInfo>();
|
||||
const [showAmount, setShowAmount] = useState<boolean>(false);
|
||||
const [showPayment, setShowPayment] = useState<boolean>(false);
|
||||
const [showTransaction, setShowTransaction] = useState<boolean>(false);
|
||||
const [showSettlement, setShowSettlement] = useState<boolean>(false);
|
||||
const [showPartCancel, setShowPartCancel] = useState<boolean>(false);
|
||||
|
||||
useSetHeaderTitle('빌링 상세');
|
||||
useSetHeaderType(HeaderType.RightClose);
|
||||
useSetOnBack(() => {
|
||||
@@ -60,37 +37,14 @@ export const BillingDetailPage = () => {
|
||||
let billingDetailParams: BillingDetailParams = {
|
||||
billKey: location?.state.billKey
|
||||
};
|
||||
billingDetail(billingDetailParams).then((rs: DetailResponse) => {
|
||||
setAmountInfo(rs.amountInfo);
|
||||
setImportantInfo(rs.importantInfo);
|
||||
setPaymentInfo(rs.paymentInfo);
|
||||
setTransactionInfo(rs.transactionInfo);
|
||||
setSettlementInfo(rs.settlementInfo);
|
||||
setPartCancelInfo(rs.partCancelInfo);
|
||||
billingDetail(billingDetailParams).then((rs: BillingDetailResponse) => {
|
||||
setBillingInfo(rs);
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
callDetail();
|
||||
}, []);
|
||||
|
||||
const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => {
|
||||
if(infoWrapKey === InfoWrapKeys.Amount){
|
||||
setShowAmount(!showAmount);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.Payment){
|
||||
setShowPayment(!showPayment);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.Transaction){
|
||||
setShowTransaction(!showTransaction);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.Settlement){
|
||||
setShowSettlement(!showSettlement);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.PartCancel){
|
||||
setShowPartCancel(!showPartCancel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
@@ -98,48 +52,12 @@ export const BillingDetailPage = () => {
|
||||
<div className="tab-pane sub active">
|
||||
<div className="option-list">
|
||||
<div className="txn-detail">
|
||||
<AmountInfoWrap
|
||||
<BillingInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
amountInfo={ amountInfo }
|
||||
show={ showAmount }
|
||||
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
|
||||
></AmountInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<ImportantInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
importantInfo={ importantInfo }
|
||||
></ImportantInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<PaymentInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
paymentInfo={ paymentInfo }
|
||||
show={ showPayment }
|
||||
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
|
||||
></PaymentInfoWrap>
|
||||
<div className="txn-divider"></div>
|
||||
<TransactionInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
transactionInfo={ transactionInfo }
|
||||
show={ showTransaction }
|
||||
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
|
||||
></TransactionInfoWrap>
|
||||
<div className="txn-divider"></div>
|
||||
<SettlementInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
settlementInfo={ settlementInfo }
|
||||
show={ showSettlement }
|
||||
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
|
||||
></SettlementInfoWrap>
|
||||
<div className="txn-divider"></div>
|
||||
<PartCancelInfoWrap
|
||||
transactionCategory={ TransactionCategory.Billing }
|
||||
partCancelInfo={ partCancelInfo }
|
||||
show={ showPartCancel }
|
||||
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
|
||||
></PartCancelInfoWrap>
|
||||
billingInfo={ billingInfo }
|
||||
></BillingInfoWrap>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import moment from 'moment';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { BillingList } from '@/entities/transaction/ui/billing-list';
|
||||
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { BillingListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { useBillingListMutation } from '@/entities/transaction/api/use-billing-list-mutation';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||
@@ -27,6 +28,7 @@ const serviceCodes = [
|
||||
|
||||
export const BillingListPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userInfo = useStore((state) => state.UserStore.UserInfo);
|
||||
|
||||
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
@@ -69,12 +71,11 @@ export const BillingListPage = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const assembleData = (content: Array<ListItem>) => {
|
||||
const assembleData = (content: Array<BillingListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let stateDate = content[i]?.stateDate;
|
||||
let groupDate = stateDate?.substring(0, 8);
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||
import { overlay } from 'overlay-kit';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { useCashReceiptDetailMutation } from '@/entities/transaction/api/use-cash-receipt-detail-mutation';
|
||||
import { IssueInfoWrap } from '@/entities/transaction/ui/info-wrap/issue-info-wrap';
|
||||
@@ -29,7 +27,6 @@ export const CashReceiptDetailPage = () => {
|
||||
|
||||
const [issueInfo, setIssueInfo] = useState<IssueInfo>();
|
||||
const [detailInfo, setDetailInfo] = useState<DetailInfo>();
|
||||
const [showIssueInfo, setShowIssueInfo] = useState<boolean>(false);
|
||||
const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false);
|
||||
|
||||
useSetHeaderTitle('현금영수증 상세');
|
||||
@@ -55,10 +52,7 @@ export const CashReceiptDetailPage = () => {
|
||||
}, []);
|
||||
|
||||
const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => {
|
||||
if(infoWrapKey === InfoWrapKeys.Issue){
|
||||
setShowIssueInfo(!showIssueInfo);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.Detail){
|
||||
if(infoWrapKey === InfoWrapKeys.Detail){
|
||||
setShowDetailInfo(!showDetailInfo);
|
||||
}
|
||||
};
|
||||
@@ -73,8 +67,6 @@ export const CashReceiptDetailPage = () => {
|
||||
<IssueInfoWrap
|
||||
transactionCategory={ TransactionCategory.CashReceipt }
|
||||
issueInfo={ issueInfo }
|
||||
show={ showIssueInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></IssueInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<DetailInfoWrap
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { CashReceiptList } from '@/entities/transaction/ui/cash-receipt-list';
|
||||
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { CashReceiptListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { useCashReceiptListMutation } from '@/entities/transaction/api/use-cash-receipt-list-mutation';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||
@@ -63,17 +63,17 @@ export const CashReceiptListPage = () => {
|
||||
};
|
||||
|
||||
cashReceiptList(listParams).then((rs) => {
|
||||
console.log(rs)
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<ListItem>) => {
|
||||
const assembleData = (content: Array<CashReceiptListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let stateDate = content[i]?.stateDate;
|
||||
let groupDate = stateDate?.substring(0, 8);
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import moment from 'moment';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { EscrowList } from '@/entities/transaction/ui/escrow-list';
|
||||
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { EscrowListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
|
||||
import { useEscrowListMutation } from '@/entities/transaction/api/use-escrow-list-mutation';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||
@@ -26,14 +27,15 @@ const serviceCodes = [
|
||||
|
||||
export const EscrowListPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userInfo = useStore((state) => state.UserStore.UserInfo);
|
||||
|
||||
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYYMMDD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYY-MM-DD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYY-MM-DD'));
|
||||
|
||||
useSetHeaderTitle('에스크로');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
@@ -49,32 +51,33 @@ export const EscrowListPage = () => {
|
||||
sortBy?: string,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
// pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
setPageParam(pageParam);
|
||||
let listParams = {
|
||||
mid: "nictest001m",
|
||||
searchType: "ORDER_NUMBER",
|
||||
searchKeyword: "01384234",
|
||||
mid: 'nictest001m',
|
||||
searchType: 'ORDER_NUMBER',
|
||||
searchKeyword: '',
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
deliveryStatus: "ALL",
|
||||
settlementStatus: "ALL",
|
||||
deliveryStatus: 'ALL',
|
||||
settlementStatus: 'ALL',
|
||||
minAmount: 0,
|
||||
maxAmount: 999999999,
|
||||
pagination: pageParam
|
||||
};
|
||||
|
||||
console.log(listParams)
|
||||
|
||||
escrowList(listParams).then((rs) => {
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<ListItem>) => {
|
||||
const assembleData = (content: Array<EscrowListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let stateDate = content[i]?.stateDate;
|
||||
let groupDate = stateDate?.substring(0, 8);
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
|
||||
@@ -148,15 +148,15 @@ export const API_URL = {
|
||||
/* Escro Management - 에스크로 API */
|
||||
escrowList: () => {
|
||||
// POST: 에스크로 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/list`;
|
||||
return `${API_BASE_URL}/api/v1/escrows/list`;
|
||||
},
|
||||
escrowDetail: () => {
|
||||
// POST: 에스크로 목록 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/detail`;
|
||||
return `${API_BASE_URL}/api/v1/escrows/detail`;
|
||||
},
|
||||
escroMailResend: () => {
|
||||
// POST: 에스크로 메일 재발송
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/mail/resend`;
|
||||
return `${API_BASE_URL}/api/v1/escrows/mail/resend`;
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -18,4 +18,15 @@ main {
|
||||
|
||||
.ic20.rot-180{
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.txn-divider{
|
||||
z-index: 20;
|
||||
}
|
||||
.txn-section{
|
||||
z-index: 20;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.kv-list{
|
||||
padding-bottom: 20px;
|
||||
z-index: 10;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ export const Menu = ({
|
||||
>
|
||||
<div className="full-menu-container">
|
||||
<div className="full-menu-header">
|
||||
<div className="full-menu-title">{ userInfo.usrid } <span>(madzoneviper)</span></div>
|
||||
<div className="full-menu-title">{ 'nictest001m' } <span>(madzoneviper)</span></div>
|
||||
<div className="full-menu-actions">
|
||||
<button
|
||||
className="full-menu-settings"
|
||||
|
||||
Reference in New Issue
Block a user