sort 관련 정리
This commit is contained in:
@@ -10,22 +10,12 @@ import type { ExtensionSmsDetailResponse } from './sms-payment/types';
|
||||
// 공통 Enums 및 타입들
|
||||
// ========================================
|
||||
|
||||
export enum SortByKeys {
|
||||
New = 'New',
|
||||
Amount = 'Amount',
|
||||
}
|
||||
|
||||
export enum ProcessResult {
|
||||
ALL = 'ALL',
|
||||
SUCCESS = 'SUCCESS',
|
||||
FAIL = 'FAIL'
|
||||
}
|
||||
|
||||
export interface SortOptionsBoxProps {
|
||||
sortBy: SortByKeys;
|
||||
onClickToSort: (sortBy: SortByKeys) => void;
|
||||
}
|
||||
|
||||
// 부가서비스 카테고리 enum
|
||||
export enum AdditionalServiceCategory {
|
||||
KeyInPayment = 'KeyInPayment',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import moment from 'moment';
|
||||
import { SortByKeys } from '@/entities/common/model/types';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { useEffect, useState } from 'react';
|
||||
@@ -12,7 +12,7 @@ import { useExtensionFundAccountResultExcelMutation } from '../../api/fund-accou
|
||||
import { useExtensionFundAccountResultListMutation } from '../../api/fund-account/use-extension-fund-account-result-list-mutation';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { FundAccountStatusBtnGroup } from '../../model/fund-account/constant';
|
||||
import { FundAccountResultFilter } from '../filter/fund-account-result-filter';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
@@ -21,7 +21,7 @@ export const FundAccountResultListWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState<Record<string, Array<FundAccountResultContentItem>>>({});
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
@@ -48,11 +48,11 @@ export const FundAccountResultListWrap = () => {
|
||||
const { mutateAsync: extensionFundAccountResultSummary } = useExtensionFundAccountResultSummaryMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let params: ExtensionFundAccountResultListParams = {
|
||||
@@ -124,10 +124,10 @@ export const FundAccountResultListWrap = () => {
|
||||
setFilterOn(!filterOn);
|
||||
};
|
||||
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortBy: sort
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
const onClickToStatus = (val: FundAccountStatus) => {
|
||||
@@ -268,10 +268,10 @@ export const FundAccountResultListWrap = () => {
|
||||
</section>
|
||||
|
||||
<section className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={ sortBy }
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
></SortOptionsBox>
|
||||
></SortTypeBox>
|
||||
<div className="excrow mr-0">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SortByKeys } from '@/entities/common/model/types';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { useEffect, useState } from 'react';
|
||||
@@ -18,7 +18,7 @@ import moment from 'moment';
|
||||
import { useExtensionFundAccountTransferListMutation } from '../../api/fund-account/use-extension-fund-account-transfer-list-mutation';
|
||||
import { ListDateGroup } from '../list-date-group';
|
||||
import { AdditionalServiceCategory } from '../../model/types';
|
||||
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { useExtensionFundAccountTransferExcelMutation } from '../../api/fund-account/use-extension-fund-account-transfer-excel-mutation';
|
||||
import { FundAccountStatusBtnGroup } from '../../model/fund-account/constant';
|
||||
import { useExtensionFundAccountBalanceMutation } from '../../api/fund-account/use-extension-fund-account-balance-mutation';
|
||||
@@ -31,7 +31,7 @@ export const FundAccountTransferListWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState<Record<string, Array<FundAccountTransferContentItem>>>({});
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
@@ -50,11 +50,11 @@ export const FundAccountTransferListWrap = () => {
|
||||
const { mutateAsync: extensionFundAccountBalance } = useExtensionFundAccountBalanceMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let params: ExtensionFundAccountTransferListParams = {
|
||||
@@ -119,13 +119,15 @@ export const FundAccountTransferListWrap = () => {
|
||||
setFilterOn(!filterOn);
|
||||
};
|
||||
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
callList({sortBy: sort});
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({sortType: sort});
|
||||
};
|
||||
const onClickToStatus = (val: FundAccountStatus) => {
|
||||
setStatus(val);
|
||||
callList({val: val});
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
const getListDateGroup = () => {
|
||||
@@ -208,10 +210,10 @@ export const FundAccountTransferListWrap = () => {
|
||||
</section>
|
||||
|
||||
<section className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={ sortBy }
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
></SortOptionsBox>
|
||||
></SortTypeBox>
|
||||
<div className="excrow mr-0">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
|
||||
@@ -5,8 +5,9 @@ import { LinkPaymentHistoryFilter } from "./filter/link-payment-history-filter";
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PATHS } from "@/shared/constants/paths";
|
||||
import { LinkPaymentHistoryList } from "./link-payment-history-list";
|
||||
import { SortOptionsBox } from "../sort-options-box";
|
||||
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentHistoryListItem, LinkPaymentTransactionStatus, ProcessResult, SortByKeys } from "../../model/types";
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentHistoryListItem, LinkPaymentTransactionStatus, ProcessResult } from "../../model/types";
|
||||
import { LinkPaymentSearchType, } from "../../model/types";
|
||||
import { useExtensionLinkPayHistoryListMutation } from '../../api/link-payment/use-extension-link-pay-history-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
@@ -24,7 +25,7 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
@@ -44,10 +45,10 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
};
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||
pageParam.sortType = (option?.sortType) ? option.sortType : sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let listParams = {
|
||||
@@ -106,9 +107,11 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
setProcessResult(val);
|
||||
}
|
||||
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
callList({ sortBy: sort });
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToOpenFilter = () => {
|
||||
@@ -153,11 +156,11 @@ export const LinkPaymentHistoryWrap = () => {
|
||||
</section>
|
||||
|
||||
<div className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={sortBy}
|
||||
onClickToSort={onClickToSort}
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
>
|
||||
</SortOptionsBox>
|
||||
</SortTypeBox>
|
||||
<div className="excrow">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
|
||||
@@ -5,8 +5,9 @@ import { LinkPaymentWaitSendFilter } from "./filter/link-payment-pending-send-fi
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PATHS } from "@/shared/constants/paths";
|
||||
import { LinkPaymentWaitList } from "./link-payment-wait-list";
|
||||
import { AdditionalServiceCategory, LinkPaymentWaitListItem, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod, SortByKeys } from "../../model/types";
|
||||
import { SortOptionsBox } from '../sort-options-box';
|
||||
import { AdditionalServiceCategory, LinkPaymentWaitListItem, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod } from "../../model/types";
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { useExtensionLinkPayWaitListMutation } from '../../api/link-payment/use-extension-link-pay-wait-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { useExtensionLinkPayWaitDownloadExcelMutation } from '../../api/link-payment/use-extension-link-pay-wait-download-excel-mutation';
|
||||
@@ -22,7 +23,7 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchType, setSearchType] = useState<LinkPaymentSearchType>(LinkPaymentSearchType.ALL)
|
||||
@@ -45,10 +46,10 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
}
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||
pageParam.sortType = (option?.sortType) ? option.sortType : sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let listParams = {
|
||||
@@ -101,8 +102,8 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
};
|
||||
|
||||
const onClickSendingStatus = (val: LinkPaymentSendingStatus) => {
|
||||
@@ -147,10 +148,10 @@ export const LinkPaymentWaitSendWrap = () => {
|
||||
</section>
|
||||
|
||||
<div className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={sortBy}
|
||||
onClickToSort={onClickToSort}
|
||||
></SortOptionsBox>
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
></SortTypeBox>
|
||||
<div className="excrow">
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import {
|
||||
SortByKeys,
|
||||
SortOptionsBoxProps
|
||||
} from '../model/types';
|
||||
export const SortOptionsBox = ({
|
||||
sortBy,
|
||||
onClickToSort
|
||||
}: SortOptionsBoxProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.New)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.New) }
|
||||
>최신순</button>
|
||||
<span className="sort-divider">|</span>
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.Amount)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.Amount) }
|
||||
>고액순</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-consent-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-consent-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmConsentParams,
|
||||
AppAlarmConsentResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmConsent = (params: AppAlarmConsentParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmConsentResponse>(API_URL_ALARM.appAlarmConsent(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmConsentMutation = (options?: UseMutationOptions<AppAlarmConsentResponse, CBDCAxiosError, AppAlarmConsentParams>) => {
|
||||
const mutation = useMutation<AppAlarmConsentResponse, CBDCAxiosError, AppAlarmConsentParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmConsentParams) => appAlarmConsent(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-find-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-find-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmFindParams,
|
||||
AppAlarmFindResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmFind = (params: AppAlarmFindParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmFindResponse>(API_URL_ALARM.appAlarmFind(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmFindMutation = (options?: UseMutationOptions<AppAlarmFindResponse, CBDCAxiosError, AppAlarmFindParams>) => {
|
||||
const mutation = useMutation<AppAlarmFindResponse, CBDCAxiosError, AppAlarmFindParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmFindParams) => appAlarmFind(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-list-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-list-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmListParams,
|
||||
AppAlarmListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmList = (params: AppAlarmListParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmListResponse>(API_URL_ALARM.appAlarmList(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmListMutation = (options?: UseMutationOptions<AppAlarmListResponse, CBDCAxiosError, AppAlarmListParams>) => {
|
||||
const mutation = useMutation<AppAlarmListResponse, CBDCAxiosError, AppAlarmListParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmListParams) => appAlarmList(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/alarm/api/use-app-alarm-mark-mutation.ts
Normal file
29
src/entities/alarm/api/use-app-alarm-mark-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_ALARM } from '@/shared/api/api-url-alarm';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
AppAlarmMarkParams,
|
||||
AppAlarmMarkResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const appAlarmMark = (params: AppAlarmMarkParams) => {
|
||||
return resultify(
|
||||
axios.post<AppAlarmMarkResponse>(API_URL_ALARM.appAlarmMark(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useAppAlarmMarkMutation = (options?: UseMutationOptions<AppAlarmMarkResponse, CBDCAxiosError, AppAlarmMarkParams>) => {
|
||||
const mutation = useMutation<AppAlarmMarkResponse, CBDCAxiosError, AppAlarmMarkParams>({
|
||||
...options,
|
||||
mutationFn: (params: AppAlarmMarkParams) => appAlarmMark(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,61 @@
|
||||
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||
|
||||
export interface AlarmItemProps {
|
||||
title?: string,
|
||||
name?: string,
|
||||
category?: string,
|
||||
date?: string
|
||||
title?: string;
|
||||
name?: string;
|
||||
category?: string;
|
||||
date?: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmMarkParams {
|
||||
appNotificationSequence: number;
|
||||
usrid: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmMarkResponse {
|
||||
|
||||
};
|
||||
export enum MERCHANT_ADMIN_APP {
|
||||
MERCHANT_ADMIN_APP = 'MERCHANT_ADMIN_APP',
|
||||
};
|
||||
export interface AppAlarmListParams {
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
appNotificationCategory: string;
|
||||
page: DefaultRequestPagination;
|
||||
};
|
||||
export interface AppAlarmListResponse extends DefaulResponsePagination {
|
||||
content: Array<AlarmListContent>;
|
||||
};
|
||||
export interface AlarmListContent {
|
||||
appNotificationSequence: number;
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
appNotificationCategory: string;
|
||||
notificationReceivedDate: string;
|
||||
appNotificationTitle: string;
|
||||
appNotificationContent: string;
|
||||
appNotificationLink: string;
|
||||
};
|
||||
|
||||
export interface AppAlarmFindParams {
|
||||
usrid: string;
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
};
|
||||
|
||||
export interface AlarmAgree {
|
||||
appNotificationSubCategory: string;
|
||||
appNotificationAllowed: boolean;
|
||||
};
|
||||
export interface AppAlarmFindResponse {
|
||||
alarmAgree: Array<AlarmAgree>;
|
||||
};
|
||||
export interface AppAlarmConsentParams {
|
||||
appCl: MERCHANT_ADMIN_APP;
|
||||
usrid: string;
|
||||
appNotificationSubCategory: string;
|
||||
appNotificationAllowed: boolean;
|
||||
};
|
||||
export interface AppAlarmConsentResponse {
|
||||
|
||||
};
|
||||
@@ -1,11 +1,10 @@
|
||||
import { PATHS } from "@/shared/constants/paths";
|
||||
import { SortTypeKeys } from "./types";
|
||||
|
||||
export const DEFAULT_PAGE_PARAM = {
|
||||
cursor: 'string',
|
||||
cursor: null,
|
||||
size: 0,
|
||||
sortBy: 'string',
|
||||
sortOrder: 'ASC',
|
||||
orderBy: 'string',
|
||||
sortType: SortTypeKeys.LATEST,
|
||||
limit: 0
|
||||
};
|
||||
|
||||
|
||||
@@ -20,11 +20,9 @@ export enum CalendarType {
|
||||
Single = 'Single'
|
||||
};
|
||||
export interface DefaultRequestPagination {
|
||||
cursor: string;
|
||||
cursor: string | null;
|
||||
size: number;
|
||||
sortBy: string;
|
||||
sortOrder: string;
|
||||
orderBy: string;
|
||||
sortType: SortTypeKeys;
|
||||
limit: number;
|
||||
};
|
||||
export interface DefaulResponsePagination {
|
||||
@@ -84,13 +82,15 @@ export enum FooterItemActiveKey {
|
||||
Settlement = 'Settlement',
|
||||
Account = 'Account',
|
||||
};
|
||||
export enum SortByKeys {
|
||||
New = 'New',
|
||||
Amount = 'Amount',
|
||||
export enum SortTypeKeys {
|
||||
LATEST = 'LATEST',
|
||||
OLDEST = 'OLDEST',
|
||||
HIGH_AMOUNT = 'HIGH_AMOUNT',
|
||||
LOW_AMOUNT = 'LOW_AMOUNT'
|
||||
};
|
||||
export interface SortOptionsBoxProps {
|
||||
sortBy: SortByKeys;
|
||||
onClickToSort: (sortBy: SortByKeys) => void;
|
||||
export interface SortTypeBoxProps {
|
||||
sortType: SortTypeKeys;
|
||||
onClickToSort: (sortType: SortTypeKeys) => void;
|
||||
};
|
||||
|
||||
export interface CodesSelectParams {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { SortByKeys, SortOptionsBoxProps } from '../model/types';
|
||||
export const SortOptionsBox = ({
|
||||
sortBy,
|
||||
onClickToSort
|
||||
}: SortOptionsBoxProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.New)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.New) }
|
||||
>최신순</button>
|
||||
<span className="sort-divider">|</span>
|
||||
<button
|
||||
className={ `sort-btn ${(sortBy === SortByKeys.Amount)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortByKeys.Amount) }
|
||||
>고액순</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
22
src/entities/common/ui/sort-type-box.tsx
Normal file
22
src/entities/common/ui/sort-type-box.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { SortTypeKeys, SortTypeBoxProps } from '../model/types';
|
||||
export const SortTypeBox = ({
|
||||
sortType,
|
||||
onClickToSort
|
||||
}: SortTypeBoxProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
<button
|
||||
className={ `sort-btn ${(sortType === SortTypeKeys.LATEST)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortTypeKeys.LATEST) }
|
||||
>최신순</button>
|
||||
<span className="sort-divider">|</span>
|
||||
<button
|
||||
className={ `sort-btn ${(sortType === SortTypeKeys.HIGH_AMOUNT)? 'active': ''}` }
|
||||
onClick={ () => onClickToSort(SortTypeKeys.HIGH_AMOUNT) }
|
||||
>고액순</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { ListDateGroup } from './list-date-group';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { useSettlementsHistoryMutation } from '../api/use-settlements-history-mutation';
|
||||
import { useSettlementsHistorySummaryMutation } from '../api/use-settlements-history-summary-mutation';
|
||||
import { useSettlementsTransactionSummaryMutation } from '../api/use-settlements-transaction-summary-mutation';
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
ListDateGroupProps,
|
||||
SettlementsTransactionListContent
|
||||
} from '../model/types';
|
||||
import { SortByKeys } from '@/entities/common/model/types';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
|
||||
export interface ListWrapProps {
|
||||
@@ -39,7 +39,7 @@ export const ListWrap = ({
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [settlementDateListItems, setSettlementDateListItems] = useState<Record<string, Array<SettlementsHistoryContent>>>({});
|
||||
const [transactionDatelistItems, setTransactionDateListItems] = useState<Record<string, Array<SettlementsTransactionListContent>>>({});
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
@@ -80,7 +80,7 @@ export const ListWrap = ({
|
||||
};
|
||||
|
||||
const callSettlementList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
let listSummaryParams = {
|
||||
@@ -90,7 +90,7 @@ export const ListWrap = ({
|
||||
endDate: endDate,
|
||||
paymentMethod: paymentMethod,
|
||||
};
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let listParams = {
|
||||
@@ -110,10 +110,10 @@ export const ListWrap = ({
|
||||
});
|
||||
};
|
||||
const callTransactionList = (option?: {
|
||||
sortBy?: string,
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
|
||||
setPageParam(pageParam);
|
||||
let params = {
|
||||
mid: mid,
|
||||
@@ -161,13 +161,17 @@ export const ListWrap = ({
|
||||
}
|
||||
return data;
|
||||
};
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
if(periodType === SettlementPeriodType.SETTLEMENT_DATE){
|
||||
callSettlementList({sortBy: sort});
|
||||
callSettlementList({
|
||||
sortType: sort
|
||||
});
|
||||
}
|
||||
else if(periodType === SettlementPeriodType.TRANSACTION_DATE){
|
||||
callTransactionList({sortBy: sort});
|
||||
callTransactionList({
|
||||
sortType: sort
|
||||
});
|
||||
}
|
||||
};
|
||||
const changePeriodType = (val: SettlementPeriodType) => {
|
||||
@@ -309,10 +313,10 @@ export const ListWrap = ({
|
||||
</div>
|
||||
|
||||
<div className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={ sortBy }
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
></SortOptionsBox>
|
||||
></SortTypeBox>
|
||||
<div>
|
||||
<div className="full-menu-keywords no-padding">
|
||||
<span
|
||||
|
||||
@@ -3,8 +3,8 @@ import moment from 'moment';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { ListFilter } from './filter/list-filter';
|
||||
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
|
||||
import { SortByKeys } from '@/entities/common/model/types';
|
||||
import { SortTypeBox } from '@/entities/common/ui/sort-type-box';
|
||||
import { SortTypeKeys } from '@/entities/common/model/types';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import {
|
||||
VatReturnListContent,
|
||||
@@ -20,7 +20,7 @@ export const ListWrap = () => {
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
|
||||
const [listItems, setListItems] = useState<Record<string, Array<VatReturnListContent>>>({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
@@ -55,8 +55,8 @@ export const ListWrap = () => {
|
||||
const onClickToOpenFIlter = () => {
|
||||
setFilterOn(true);
|
||||
};
|
||||
const onClickToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -124,10 +124,10 @@ export const ListWrap = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="filter-section mt-10">
|
||||
<SortOptionsBox
|
||||
sortBy={ sortBy }
|
||||
<SortTypeBox
|
||||
sortType={ sortType }
|
||||
onClickToSort={ onClickToSort }
|
||||
></SortOptionsBox>
|
||||
></SortTypeBox>
|
||||
</div>
|
||||
<div className="transaction-list">
|
||||
{ getListDateGroup() }
|
||||
|
||||
Reference in New Issue
Block a user