- 링크결제_분리승인 상세 추가
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { resultify } from "@/shared/lib/resultify";
|
||||
import { ExtensionLInkPaySeparateActionParams, ExtensionLinkPaySeparateActionResponse } from "../../model/link-pay/types";
|
||||
import axios from "axios";
|
||||
import { API_URL_ADDITIONAL_SERVICE } from "@/shared/api/api-url-additional-service";
|
||||
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
||||
import { CBDCAxiosError } from "@/shared/@types/error";
|
||||
|
||||
export const extensionLinkPaySeparateAction = (params: ExtensionLInkPaySeparateActionParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionLinkPaySeparateActionResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentSeparateAction(), params)
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionLinkPaySeparateAction = (options?: UseMutationOptions<ExtensionLinkPaySeparateActionResponse, CBDCAxiosError, ExtensionLInkPaySeparateActionParams>) => {
|
||||
const mutation = useMutation<ExtensionLinkPaySeparateActionResponse, CBDCAxiosError, ExtensionLInkPaySeparateActionParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionLInkPaySeparateActionParams) => extensionLinkPaySeparateAction(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
import { resultify } from "@/shared/lib/resultify";
|
||||
import { ExtensionLinkPaySeparateDetailParams, ExtensionLinkPaySeparateDetailResponse } from "../../model/link-pay/types";
|
||||
import axios from "axios";
|
||||
import { API_URL_ADDITIONAL_SERVICE } from "@/shared/api/api-url-additional-service";
|
||||
import { useMutation, UseMutationOptions } from "@tanstack/react-query";
|
||||
import { CBDCAxiosError } from "@/shared/@types/error";
|
||||
|
||||
export const extensionLinkPaySeparateDetail = (params: ExtensionLinkPaySeparateDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionLinkPaySeparateDetailResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentSeparateDetail(), params)
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionLinkPaySeparateDetail = (options?: UseMutationOptions<ExtensionLinkPaySeparateDetailResponse,CBDCAxiosError, ExtensionLinkPaySeparateDetailParams>) => {
|
||||
const mutation = useMutation<ExtensionLinkPaySeparateDetailResponse, CBDCAxiosError, ExtensionLinkPaySeparateDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionLinkPaySeparateDetailParams) => extensionLinkPaySeparateDetail(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -64,6 +64,16 @@ export enum LinkContentType {
|
||||
ADDITIONAL = "ADDITIONAL"
|
||||
}
|
||||
|
||||
export enum LinkPaymentSeparateType {
|
||||
MAIN = "MAIN",
|
||||
SUB = "SUB"
|
||||
}
|
||||
|
||||
export enum LinkPaymentSeparateAction {
|
||||
EXTEND = "EXTEND",
|
||||
DEACTIVATE = "DEACTIVATE"
|
||||
}
|
||||
|
||||
export interface LinkPaymentHistoryListItem {
|
||||
requestId?: string;
|
||||
cursorId?: string;
|
||||
@@ -300,4 +310,44 @@ export interface ExtensionLinkPayWaitDeleteParams extends ExtensionRequestParams
|
||||
|
||||
export interface ExtensionLinkPayWaitDeleteRespone {
|
||||
status: boolean
|
||||
}
|
||||
|
||||
// 분리승인 상세 조회 Request
|
||||
export interface ExtensionLinkPaySeparateDetailParams {
|
||||
reqId: string;
|
||||
}
|
||||
|
||||
// 분리승인 상세 조회 Response Item
|
||||
export interface ExtensionLinkPaySeparateDetailItem {
|
||||
type: string;
|
||||
moid: string;
|
||||
amount: number;
|
||||
paymentStatus: string;
|
||||
paymentStatusName: string;
|
||||
paymentLimitDate: string;
|
||||
paymentLimitCount: number;
|
||||
requestId: string;
|
||||
subRequestId: string;
|
||||
}
|
||||
|
||||
// 분리승인 상세 조회 Response
|
||||
export interface ExtensionLinkPaySeparateDetailResponse {
|
||||
details: Array<ExtensionLinkPaySeparateDetailItem>;
|
||||
}
|
||||
|
||||
export interface ExtensionLInkPaySeparateActionParams extends ExtensionRequestParams {
|
||||
action: string;
|
||||
reqId: string;
|
||||
selectedItems: Array<{
|
||||
type: string;
|
||||
subRequestId: string;
|
||||
}>;
|
||||
extendDate?: string;
|
||||
}
|
||||
|
||||
export interface ExtensionLinkPaySeparateActionResponse {
|
||||
success : boolean;
|
||||
totalCount: number;
|
||||
successCount: number;
|
||||
failCount: number;
|
||||
}
|
||||
@@ -117,6 +117,7 @@ export interface DetailResponse {
|
||||
titleInfo?: TitleInfo //최상단 섹션
|
||||
detailInfo?: DetailInfo // '상세 정보' 섹션
|
||||
paymentInfo?: PaymentInfo // '결제 정보' 섹션
|
||||
detailExposure?: boolean // 분리승인 상세 노출 여부
|
||||
}
|
||||
|
||||
export interface DetailInfoSectionProps extends DetailResponse {
|
||||
|
||||
@@ -14,7 +14,8 @@ export const LinkPaymentHistoryList = ({
|
||||
let date = '';
|
||||
let list: LinkPaymentHistoryListItem[] = [];
|
||||
for (let i = 0; i < listItems.length; i++) {
|
||||
// paymentDate format: "20211018140420" (YYYYMMDDHHmmss)
|
||||
|
||||
// sendDate(발송일자) 기준
|
||||
let sendDate = listItems[i]?.sendDate || '';
|
||||
let itemDate = sendDate.substring(0, 8);
|
||||
if (i === 0) {
|
||||
|
||||
@@ -395,7 +395,7 @@ export const ListItem = ({
|
||||
);
|
||||
}
|
||||
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentHistory) {
|
||||
if (paymentStatus === "3" || paymentStatus === "4") {
|
||||
if (paymentStatus === "0" || paymentStatus === "3" || paymentStatus === "4") {
|
||||
rs.push(
|
||||
<div key="link-payment-history" className="transaction-details">
|
||||
<span>{getPaymentStatusText(paymentStatus)}</span>
|
||||
|
||||
Reference in New Issue
Block a user