알림 수정
This commit is contained in:
@@ -5,6 +5,7 @@ import moment from 'moment';
|
|||||||
import { useAppAlarmMarkMutation } from '../api/use-app-alarm-mark-mutation';
|
import { useAppAlarmMarkMutation } from '../api/use-app-alarm-mark-mutation';
|
||||||
import { AppAlarmMarkParams, AppAlarmMarkResponse } from '../model/types';
|
import { AppAlarmMarkParams, AppAlarmMarkResponse } from '../model/types';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
export interface AlarmItemProps {
|
export interface AlarmItemProps {
|
||||||
appNotificationSequence?: number;
|
appNotificationSequence?: number;
|
||||||
@@ -13,6 +14,7 @@ export interface AlarmItemProps {
|
|||||||
appNotificationTitle?: string;
|
appNotificationTitle?: string;
|
||||||
appNotificationContent?: string;
|
appNotificationContent?: string;
|
||||||
appNotificationLink?: string;
|
appNotificationLink?: string;
|
||||||
|
appNotificationCategories: Array<any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AlarmItem = ({
|
export const AlarmItem = ({
|
||||||
@@ -21,13 +23,22 @@ export const AlarmItem = ({
|
|||||||
notificationReceivedDate,
|
notificationReceivedDate,
|
||||||
appNotificationTitle,
|
appNotificationTitle,
|
||||||
appNotificationContent,
|
appNotificationContent,
|
||||||
appNotificationLink
|
appNotificationLink,
|
||||||
|
appNotificationCategories
|
||||||
}: AlarmItemProps) => {
|
}: AlarmItemProps) => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
let userInfo = useStore.getState().UserStore.userInfo;
|
let userInfo = useStore.getState().UserStore.userInfo;
|
||||||
const {mutateAsync: appAlarmMark} = useAppAlarmMarkMutation();
|
const {mutateAsync: appAlarmMark} = useAppAlarmMarkMutation();
|
||||||
|
|
||||||
|
const [appNotificationCategoryName, setAppNotificationCategoryName] = useState<string>('');
|
||||||
|
|
||||||
|
const getCategoryName = () => {
|
||||||
|
let myCategory = appNotificationCategories.filter((value, index) => {
|
||||||
|
return value.code1 === appNotificationCategory;
|
||||||
|
});
|
||||||
|
return myCategory[0].desc1;
|
||||||
|
};
|
||||||
const onClickToNavigate = () => {
|
const onClickToNavigate = () => {
|
||||||
let path = PATHS.support.notice.detail + appNotificationSequence;
|
let path = PATHS.support.notice.detail + appNotificationSequence;
|
||||||
let pathState = {};
|
let pathState = {};
|
||||||
@@ -39,21 +50,27 @@ export const AlarmItem = ({
|
|||||||
console.log('appNotificationContent : [' + appNotificationContent + ']');
|
console.log('appNotificationContent : [' + appNotificationContent + ']');
|
||||||
console.log('appNotificationLink : [' + appNotificationLink + ']');
|
console.log('appNotificationLink : [' + appNotificationLink + ']');
|
||||||
|
|
||||||
if(appNotificationCategory === '10'){
|
if(appNotificationLink){
|
||||||
|
path = appNotificationLink;
|
||||||
|
/*
|
||||||
|
if(appNotificationCategory === '10'){
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(appNotificationCategory === '20'){
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(appNotificationCategory === '20'){
|
else if(appNotificationCategory === '30'){
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(appNotificationCategory === '30'){
|
else if(appNotificationCategory === '40'){
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(appNotificationCategory === '60'){
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else if(appNotificationCategory === '40'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(appNotificationCategory === '60'){
|
|
||||||
|
|
||||||
}
|
|
||||||
navigate(path, {
|
navigate(path, {
|
||||||
state: pathState
|
state: pathState
|
||||||
});
|
});
|
||||||
@@ -73,22 +90,26 @@ export const AlarmItem = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setAppNotificationCategoryName(getCategoryName());
|
||||||
|
}, [appNotificationCategory]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="notice-item">
|
<div
|
||||||
|
className="notice-item"
|
||||||
|
onClick={ () => callAppAlarmMark() }
|
||||||
|
>
|
||||||
<div className="notice-content">
|
<div className="notice-content">
|
||||||
<div className="notice-title">{ appNotificationTitle }</div>
|
<div className="notice-title">{ appNotificationTitle }</div>
|
||||||
<div className="notice-meta">
|
<div className="notice-meta">
|
||||||
<strong>{ appNotificationCategory }</strong>
|
<strong>{ appNotificationCategoryName }</strong>
|
||||||
<span>{ moment(notificationReceivedDate).format('YYYY.MM.DD HH:mm:ss') }</span>
|
<span>{ moment(notificationReceivedDate).format('YYYY.MM.DD HH:mm:ss') }</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className="notice-arrow">
|
||||||
className="notice-arrow"
|
|
||||||
onClick={ () => callAppAlarmMark() }
|
|
||||||
>
|
|
||||||
<img
|
<img
|
||||||
src={ IMAGE_ROOT + '/Forward.svg' }
|
src={ IMAGE_ROOT + '/Forward.svg' }
|
||||||
alt={ appNotificationCategory + ' 바로가기' }
|
alt={ appNotificationCategoryName + ' 바로가기' }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ import { DefaultRequestPagination } from '@/entities/common/model/types';
|
|||||||
|
|
||||||
export interface AlarmListProps {
|
export interface AlarmListProps {
|
||||||
appNotificationCategory: string;
|
appNotificationCategory: string;
|
||||||
|
appNotificationCategories: Array<any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AlarmList = ({
|
export const AlarmList = ({
|
||||||
appNotificationCategory
|
appNotificationCategory,
|
||||||
|
appNotificationCategories
|
||||||
}: AlarmListProps) => {
|
}: AlarmListProps) => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -108,6 +110,7 @@ export const AlarmList = ({
|
|||||||
appNotificationTitle={ resultList[i]?.appNotificationTitle }
|
appNotificationTitle={ resultList[i]?.appNotificationTitle }
|
||||||
appNotificationContent={ resultList[i]?.appNotificationContent }
|
appNotificationContent={ resultList[i]?.appNotificationContent }
|
||||||
appNotificationLink={ resultList[i]?.appNotificationLink }
|
appNotificationLink={ resultList[i]?.appNotificationLink }
|
||||||
|
appNotificationCategories={ appNotificationCategories }
|
||||||
></AlarmItem>
|
></AlarmItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ export interface BillingInfo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export interface MerchantInfo {
|
export interface MerchantInfo {
|
||||||
shopName?: string;
|
companyName?: string;
|
||||||
gid?: string;
|
gid?: string;
|
||||||
aid?: string;
|
aid?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ export const ListItem = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="transaction-amount">
|
<div className="transaction-amount">
|
||||||
<NumericFormat
|
<NumericFormat
|
||||||
value={ goodsAmount || amount }
|
value={ goodsAmount || amount || transactionAmount }
|
||||||
thousandSeparator
|
thousandSeparator
|
||||||
displayType="text"
|
displayType="text"
|
||||||
suffix={ '원' }
|
suffix={ '원' }
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const MerchantInfoSection = ({
|
|||||||
<ul className="kv-list">
|
<ul className="kv-list">
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">· 상호</span>
|
<span className="k">· 상호</span>
|
||||||
<span className="v">{ merchantInfo?.shopName }</span>
|
<span className="v">{ merchantInfo?.companyName }</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">· GID</span>
|
<span className="k">· GID</span>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { API_URL_VAT_RETURN } from '@/shared/api/api-url-vat-return';
|
||||||
|
import { resultify } from '@/shared/lib/resultify';
|
||||||
|
import { NiceAxiosError } from '@/shared/@types/error';
|
||||||
|
import {
|
||||||
|
VatReturnBreakdownResponse,
|
||||||
|
VatReturnBreakdownParams,
|
||||||
|
} from '../model/types';
|
||||||
|
import {
|
||||||
|
useMutation,
|
||||||
|
UseMutationOptions
|
||||||
|
} from '@tanstack/react-query';
|
||||||
|
|
||||||
|
export const vatReturnBreakdown = (params: VatReturnBreakdownParams) => {
|
||||||
|
return resultify(
|
||||||
|
axios.post<VatReturnBreakdownResponse>(API_URL_VAT_RETURN.vatReturnBreakdown(), params),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useVatReturnBreakdownMutation = (options?: UseMutationOptions<VatReturnBreakdownResponse, NiceAxiosError, VatReturnBreakdownParams>) => {
|
||||||
|
const mutation = useMutation<VatReturnBreakdownResponse, NiceAxiosError, VatReturnBreakdownParams>({
|
||||||
|
...options,
|
||||||
|
mutationFn: (params: VatReturnBreakdownParams) => vatReturnBreakdown(params),
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...mutation,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -32,7 +32,19 @@ export interface VatReturnListParams {
|
|||||||
targetType?: VatReturnTargetType;
|
targetType?: VatReturnTargetType;
|
||||||
page?: DefaultRequestPagination;
|
page?: DefaultRequestPagination;
|
||||||
};
|
};
|
||||||
|
export interface VatReturnBreakdownParams {
|
||||||
|
taxInvoiceNumber: string;
|
||||||
|
};
|
||||||
|
export interface VatReturnBreakdownResponse {
|
||||||
|
breakdown: Array<Breakdown>;
|
||||||
|
};
|
||||||
|
export interface Breakdown {
|
||||||
|
transactionDate: string;
|
||||||
|
totalAmount: number;
|
||||||
|
supplyAmount: number;
|
||||||
|
vatAmount: number;
|
||||||
|
transactionCount: number;
|
||||||
|
};
|
||||||
|
|
||||||
export interface VatReturnListResponse extends DefaulResponsePagination {
|
export interface VatReturnListResponse extends DefaulResponsePagination {
|
||||||
content: Array<VatReturnListContent>;
|
content: Array<VatReturnListContent>;
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import { IMAGE_ROOT } from "@/shared/constants/common";
|
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||||
|
import { Breakdown } from "../model/types";
|
||||||
|
|
||||||
export interface VatReturnListDetailBottomSheetProps {
|
export interface VatReturnListDetailBottomSheetProps {
|
||||||
bottomSheetOn: boolean;
|
bottomSheetOn: boolean;
|
||||||
setBottomSheetOn: (bottomSheetOn: boolean) => void;
|
setBottomSheetOn: (bottomSheetOn: boolean) => void;
|
||||||
|
breakdown: Array<Breakdown>
|
||||||
};
|
};
|
||||||
|
|
||||||
export const VatReturnListDetailBottomSheet = ({
|
export const VatReturnListDetailBottomSheet = ({
|
||||||
bottomSheetOn,
|
bottomSheetOn,
|
||||||
setBottomSheetOn
|
setBottomSheetOn,
|
||||||
|
breakdown
|
||||||
}: VatReturnListDetailBottomSheetProps) => {
|
}: VatReturnListDetailBottomSheetProps) => {
|
||||||
|
|
||||||
const onClickToClose = () => {
|
const onClickToClose = () => {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export const ListPage = () => {
|
|||||||
let newAppNotificationCategories = appNotificationCategories.filter((value, index) => {
|
let newAppNotificationCategories = appNotificationCategories.filter((value, index) => {
|
||||||
return value.code1 !== '****' && value.code2 === '*';
|
return value.code1 !== '****' && value.code2 === '*';
|
||||||
});
|
});
|
||||||
|
console.log(newAppNotificationCategories)
|
||||||
setAppNotificationCategories(newAppNotificationCategories);
|
setAppNotificationCategories(newAppNotificationCategories);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -51,6 +52,7 @@ export const ListPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
<AlarmList
|
<AlarmList
|
||||||
appNotificationCategory={ appNotificationCategory }
|
appNotificationCategory={ appNotificationCategory }
|
||||||
|
appNotificationCategories={ appNotificationCategories }
|
||||||
></AlarmList>
|
></AlarmList>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|||||||
import { useVatReturnDetailMutation } from '@/entities/vat-return/api/use-vat-return-detail-mutation';
|
import { useVatReturnDetailMutation } from '@/entities/vat-return/api/use-vat-return-detail-mutation';
|
||||||
import { HeaderType } from '@/entities/common/model/types';
|
import { HeaderType } from '@/entities/common/model/types';
|
||||||
import {
|
import {
|
||||||
|
Breakdown,
|
||||||
|
VatReturnBreakdownParams,
|
||||||
|
VatReturnBreakdownResponse,
|
||||||
VatReturnDetailParams,
|
VatReturnDetailParams,
|
||||||
VatReturnDetailResponse,
|
VatReturnDetailResponse,
|
||||||
VatReturnTaxInvoiceParams,
|
VatReturnTaxInvoiceParams,
|
||||||
@@ -22,6 +25,7 @@ import { IssueSection } from '@/entities/vat-return/ui/section/issue-section';
|
|||||||
import { AmountSection } from '@/entities/vat-return/ui/section/amount-section';
|
import { AmountSection } from '@/entities/vat-return/ui/section/amount-section';
|
||||||
import { useVatReturnTaxInvoiceMutation } from '@/entities/vat-return/api/use-vat-return-tax-invoice-mutation';
|
import { useVatReturnTaxInvoiceMutation } from '@/entities/vat-return/api/use-vat-return-tax-invoice-mutation';
|
||||||
import { VatReturnListDetailBottomSheet } from '@/entities/vat-return/ui/list-detail-bottom-sheet';
|
import { VatReturnListDetailBottomSheet } from '@/entities/vat-return/ui/list-detail-bottom-sheet';
|
||||||
|
import { useVatReturnBreakdownMutation } from '@/entities/vat-return/api/use-vat-return-breakdown-mutation';
|
||||||
|
|
||||||
export const DetailPage = () => {
|
export const DetailPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
@@ -33,6 +37,7 @@ export const DetailPage = () => {
|
|||||||
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
||||||
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
||||||
const [detail, setDetail] = useState<VatReturnTaxInvoiceResponse>({});
|
const [detail, setDetail] = useState<VatReturnTaxInvoiceResponse>({});
|
||||||
|
const [breakdown, setBreakdown] = useState<Array<Breakdown>>([]);
|
||||||
|
|
||||||
useSetHeaderTitle('세금계산서 상세');
|
useSetHeaderTitle('세금계산서 상세');
|
||||||
useSetHeaderType(HeaderType.RightClose);
|
useSetHeaderType(HeaderType.RightClose);
|
||||||
@@ -43,6 +48,7 @@ export const DetailPage = () => {
|
|||||||
|
|
||||||
const { mutateAsync: vatReturnTaxInvoice } = useVatReturnTaxInvoiceMutation();
|
const { mutateAsync: vatReturnTaxInvoice } = useVatReturnTaxInvoiceMutation();
|
||||||
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
||||||
|
const { mutateAsync: vatReturnBreakdown } = useVatReturnBreakdownMutation();
|
||||||
|
|
||||||
const callTaxInvoice = () => {
|
const callTaxInvoice = () => {
|
||||||
let params: VatReturnDetailParams = {
|
let params: VatReturnDetailParams = {
|
||||||
@@ -52,6 +58,14 @@ export const DetailPage = () => {
|
|||||||
setDetail(rs);
|
setDetail(rs);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const callVatReturnBreakdown = () => {
|
||||||
|
let params: VatReturnBreakdownParams = {
|
||||||
|
taxInvoiceNumber: taxInvoiceNumber,
|
||||||
|
};
|
||||||
|
vatReturnBreakdown(params).then((rs: VatReturnBreakdownResponse) => {
|
||||||
|
setBreakdown(rs.breakdown);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const onClickToOpenBottomSheet = () => {
|
const onClickToOpenBottomSheet = () => {
|
||||||
setBottomSheetOn(true);
|
setBottomSheetOn(true);
|
||||||
@@ -59,6 +73,7 @@ export const DetailPage = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callTaxInvoice();
|
callTaxInvoice();
|
||||||
|
// callVatReturnBreakdown();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -98,6 +113,7 @@ export const DetailPage = () => {
|
|||||||
<VatReturnListDetailBottomSheet
|
<VatReturnListDetailBottomSheet
|
||||||
bottomSheetOn={ bottomSheetOn }
|
bottomSheetOn={ bottomSheetOn }
|
||||||
setBottomSheetOn={ setBottomSheetOn }
|
setBottomSheetOn={ setBottomSheetOn }
|
||||||
|
breakdown={ breakdown }
|
||||||
></VatReturnListDetailBottomSheet>
|
></VatReturnListDetailBottomSheet>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -20,4 +20,8 @@ export const API_URL_VAT_RETURN = {
|
|||||||
// POST: 세금계산서 상세 조회
|
// POST: 세금계산서 상세 조회
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/vat-return/detail`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/vat-return/detail`;
|
||||||
},
|
},
|
||||||
|
vatReturnBreakdown: () => {
|
||||||
|
// POST: 세금계산서 세부내역 조회
|
||||||
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/vat-return/breakdown`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user