diff --git a/src/entities/business-member/api/use-business-member-info-mutation.tsx b/src/entities/business-member/api/use-business-member-info-mutation.tsx deleted file mode 100644 index f5a4aa0..0000000 --- a/src/entities/business-member/api/use-business-member-info-mutation.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import axios from 'axios'; -import { API_URL } from '@/shared/api/urls'; -import { resultify } from '@/shared/lib/resultify'; -import { CBDCAxiosError } from '@/shared/@types/error'; -import { - BusinessMemberInfoParams, - BusinessMemberInfoResponse -} from '../model/types'; -import { - useMutation, - UseMutationOptions -} from '@tanstack/react-query'; - -export const businessMemberInfo = (params: BusinessMemberInfoParams) => { - return resultify( - axios.post(API_URL.businessMemberInfo(), params), - ); -}; - -export const useBusinessMemberInfoMutation = (options?: UseMutationOptions) => { - const mutation = useMutation({ - ...options, - mutationFn: (params: BusinessMemberInfoParams) => businessMemberInfo(params), - }); - - return { - ...mutation, - }; -}; diff --git a/src/entities/business-member/model/types.ts b/src/entities/business-member/model/types.ts deleted file mode 100644 index 6421bb0..0000000 --- a/src/entities/business-member/model/types.ts +++ /dev/null @@ -1,56 +0,0 @@ -export enum BusinessMemberTabKeys { - Info = 'Info', - RegistrationStatus = 'RegistrationStatus', -}; -export enum BusinessMemberInfoKeys { - InfoContractManager = 'InfoContractManager', - InfoTechnicalManager = 'InfoTechnicalManager', - InfoSettlementManager = 'InfoSettlementManager', - InfoSettlementAccount = 'InfoSettlementAccount' -}; -export interface BusinessMemberTabProps { - activeTab: BusinessMemberTabKeys; -}; -export interface InfoArrowProps { - show?: boolean; -}; -export interface BusinessMemberRequestParams { - tid?: string; -}; -export interface InfoBasicInfoProps { - -}; -export interface InfoOwnerInfoProps { - -}; -export interface InfoCompanyInfoProps { - -}; -export interface InfoContractManagerProps { - -}; -export interface InfoTechnicalManagerProps { - -}; -export interface InfoSettlementManagerProps { - -}; -export interface InfoSettlementAccountProps { - -}; -export interface BusinessMemberInfoResponse { - InfoBasicInfo?: InfoBasicInfoProps; - InfoOwnerInfo?: InfoOwnerInfoProps; - InfoCompanyInfo?: InfoCompanyInfoProps; - infoContractManager?: InfoContractManagerProps; - infoTechnicalManager?: InfoTechnicalManagerProps; - infoSettlementManager?: InfoSettlementManagerProps; - infoSettlementAccount?: InfoSettlementAccountProps; -}; -export interface InfoProps extends BusinessMemberInfoResponse{ - show?: boolean; - onClickToShowInfo?: (info: BusinessMemberInfoKeys) => void; -}; -export interface BusinessMemberInfoParams extends BusinessMemberRequestParams { - svcCd: string; -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/business-member-tab.tsx b/src/entities/business-member/ui/business-member-tab.tsx deleted file mode 100644 index 4aae849..0000000 --- a/src/entities/business-member/ui/business-member-tab.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { PATHS } from '@/shared/constants/paths'; -import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { - BusinessMemberTabKeys, - BusinessMemberTabProps -} from '../model/types'; - -export const BusinessMemberTab = ({ - activeTab -}: BusinessMemberTabProps) => { - const { navigate } = useNavigate(); - - const onClickToNavigation = (tab: BusinessMemberTabKeys) => { - if(activeTab !== tab){ - if(tab === BusinessMemberTabKeys.Info){ - navigate(PATHS.businessMember.info); - } - else if(tab === BusinessMemberTabKeys.RegistrationStatus){ - navigate(PATHS.businessMember.registrationStatus); - } - } - }; - return( - <> -
- - -
- - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-arrow.tsx b/src/entities/business-member/ui/info-arrow.tsx deleted file mode 100644 index a586e8d..0000000 --- a/src/entities/business-member/ui/info-arrow.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { useEffect, useState } from 'react'; -import { IMAGE_ROOT } from '@/shared/constants/common'; -import { InfoArrowProps } from '../model/types'; - -export const InfoArrow = ({ show }: InfoArrowProps) => { - const [altMsg, setAltMsg] = useState<'접기' | '펼치기'>('접기'); - const [className, setClassName] = useState('ic20 rot-180'); - - useEffect(() => { - setAltMsg((show)? '접기': '펼치기'); - setClassName(`ic20 ${(show)? 'rot-180': ''}`); - }, [show]); - - return ( - <> - { - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-basic-info.tsx b/src/entities/business-member/ui/info-basic-info.tsx deleted file mode 100644 index 7f950be..0000000 --- a/src/entities/business-member/ui/info-basic-info.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { InfoProps } from '../model/types'; - -export const InfoBasicInfo = ({ - InfoBasicInfo -}: InfoProps) => { - - return ( - <> -
-
기본정보
-
    -
  • - 상호 - 나이스테스트 -
  • -
  • - 사업자번호 - 123-45-16798 -
  • -
  • - 사업자속성 - 일반 -
  • -
  • - 업종 - 식품 -
  • -
  • - 업태 - 식품 -
  • -
-
- - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-company-info.tsx b/src/entities/business-member/ui/info-company-info.tsx deleted file mode 100644 index 3897acc..0000000 --- a/src/entities/business-member/ui/info-company-info.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { InfoProps } from '../model/types'; - -export const InfoCompanyInfo = ({ - InfoCompanyInfo -}: InfoProps) => { - - return ( - <> -
-
    -
  • - 사업장주소 - 서울특별시 마포구 마포대로 217(아현동) -
  • -
  • - 홈페이지 주소 - https://adm.dev-nicepay.co.kr:8011 -
  • -
-
- - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-contract-manager.tsx b/src/entities/business-member/ui/info-contract-manager.tsx deleted file mode 100644 index 82337d8..0000000 --- a/src/entities/business-member/ui/info-contract-manager.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { motion } from 'framer-motion'; -import { BusinessMemberInfoKeys, InfoProps } from '../model/types'; -import { InfoArrow } from './info-arrow'; - -export const InfoContractManager = ({ - infoContractManager, - show, - onClickToShowInfo -}: InfoProps) => { - - const variants = { - hidden: { height: 0, padding: 0, display: 'none' }, - visible: { height: 'auto', paddingTop: '12px', display: 'block' }, - }; - - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(BusinessMemberInfoKeys.InfoContractManager); - } - }; - - return ( - <> -
-
onClickToSetShowInfo() } - > - 계약 담당자 -
- -
  • - 김테스트 - -
  • -
  • - 010-1234-**** - -
  • -
  • - testkim@nicepay.co.kr - -
  • -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-owner-info.tsx b/src/entities/business-member/ui/info-owner-info.tsx deleted file mode 100644 index a521a98..0000000 --- a/src/entities/business-member/ui/info-owner-info.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { InfoProps } from '../model/types'; - -export const InfoOwnerInfo = ({ - InfoOwnerInfo -}: InfoProps) => { - - return ( - <> -
    -
      -
    • - 대표자명 - 김테스트 -
    • -
    • - 대표 연락처 - 010-1234-1234 -
    • -
    • - 대표 이메일 - testkim@nicepay.co.kr -
    • -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-settlement-account.tsx b/src/entities/business-member/ui/info-settlement-account.tsx deleted file mode 100644 index 88060c8..0000000 --- a/src/entities/business-member/ui/info-settlement-account.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { motion } from 'framer-motion'; -import { BusinessMemberInfoKeys, InfoProps } from '../model/types'; -import { InfoArrow } from './info-arrow'; - -export const InfoSettlementAccount = ({ - infoSettlementAccount, - show, - onClickToShowInfo -}: InfoProps) => { - - const variants = { - hidden: { height: 0, padding: 0, display: 'none' }, - visible: { height: 'auto', paddingTop: '12px', display: 'block' }, - }; - - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(BusinessMemberInfoKeys.InfoSettlementAccount); - } - }; - - return ( - <> -
    -
    onClickToSetShowInfo() } - > - 정산계좌 -
    - -
  • - 은행 - 신한은행 -
  • -
  • - 계좌번호 - 123-45-16798 -
  • -
  • - 예금주 - 김테스트 -
  • -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-settlement-manager.tsx b/src/entities/business-member/ui/info-settlement-manager.tsx deleted file mode 100644 index 3c20b3e..0000000 --- a/src/entities/business-member/ui/info-settlement-manager.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { motion } from 'framer-motion'; -import { BusinessMemberInfoKeys, InfoProps } from '../model/types'; -import { InfoArrow } from './info-arrow'; - -export const InfoSettlementManager = ({ - infoSettlementManager, - show, - onClickToShowInfo -}: InfoProps) => { - - const variants = { - hidden: { height: 0, padding: 0, display: 'none' }, - visible: { height: 'auto', paddingTop: '12px', display: 'block' }, - }; - - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(BusinessMemberInfoKeys.InfoSettlementManager); - } - }; - - return ( - <> -
    -
    onClickToSetShowInfo() } - > - 정산 담당자 -
    - -
  • - 김테스트 - -
  • -
  • - 010-1234-**** - -
  • -
  • - testkim@nicepay.co.kr - -
  • -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-technical-manager.tsx b/src/entities/business-member/ui/info-technical-manager.tsx deleted file mode 100644 index 377bdbc..0000000 --- a/src/entities/business-member/ui/info-technical-manager.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { motion } from 'framer-motion'; -import { BusinessMemberInfoKeys, InfoProps } from '../model/types'; -import { InfoArrow } from './info-arrow'; - -export const InfoTechnicalManager = ({ - infoTechnicalManager, - show, - onClickToShowInfo -}: InfoProps) => { - - const variants = { - hidden: { height: 0, padding: 0, display: 'none' }, - visible: { height: 'auto', paddingTop: '12px', display: 'block' }, - }; - - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(BusinessMemberInfoKeys.InfoTechnicalManager); - } - }; - - return ( - <> -
    -
    onClickToSetShowInfo() } - > - 기술 담당자 -
    - -
  • - 김테스트 - -
  • -
  • - 010-1234-**** - -
  • -
  • - testkim@nicepay.co.kr - -
  • -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/business-member/ui/info-wrap.tsx b/src/entities/business-member/ui/info-wrap.tsx deleted file mode 100644 index 6942a8f..0000000 --- a/src/entities/business-member/ui/info-wrap.tsx +++ /dev/null @@ -1,121 +0,0 @@ -import { useEffect, useState } from 'react'; -import { useBusinessMemberInfoMutation } from '../api/use-business-member-info-mutation'; -import { InfoBasicInfo } from './info-basic-info'; -import { InfoOwnerInfo } from './info-owner-info'; -import { InfoCompanyInfo } from './info-company-info'; -import { InfoContractManager } from './info-contract-manager'; -import { InfoTechnicalManager } from './info-technical-manager'; -import { InfoSettlementManager } from './info-settlement-manager'; -import { InfoSettlementAccount } from './info-settlement-account'; -import { - BusinessMemberInfoParams, - BusinessMemberInfoResponse, - InfoContractManagerProps, - InfoTechnicalManagerProps, - InfoSettlementManagerProps, - InfoSettlementAccountProps, - BusinessMemberInfoKeys -} from '../model/types'; - -export const InfoWrap = () => { - const [infoContractManager, setInfoContractManager] = useState(); - const [infoTechnicalManager, setInfoTechnicalManager] = useState(); - const [infoSettlementManager, setInfoSettlementManager] = useState(); - const [infoSettlementAccount, setInfoSettlementAccount] = useState(); - const [showInfoContractManager, setShowInfoContractManager] = useState(false); - const [showInfoTechnicalManager, setShowInfoTechnicalManager] = useState(false); - const [showInfoSettlementManager, setShowInfoSettlementManager] = useState(false); - const [showInfoSettlementAccount, setShowInfoSettlemenAccount] = useState(false); - - const { mutateAsync: businessMemberInfo } = useBusinessMemberInfoMutation(); - - const callInfo = () => { - let businessMemberInfoParams: BusinessMemberInfoParams = { - svcCd: 'st', - }; - businessMemberInfo(businessMemberInfoParams).then((rs: BusinessMemberInfoResponse) => { - setInfoContractManager(rs.infoContractManager); - setInfoTechnicalManager(rs.infoTechnicalManager); - setInfoSettlementManager(rs.infoSettlementManager); - setInfoSettlementAccount(rs.infoSettlementAccount); - }); - }; - - const onClickToShowInfo = (info: BusinessMemberInfoKeys) => { - if(info === BusinessMemberInfoKeys.InfoContractManager){ - setShowInfoContractManager(!showInfoContractManager); - } - else if(info === BusinessMemberInfoKeys.InfoTechnicalManager){ - setShowInfoTechnicalManager(!showInfoTechnicalManager); - } - else if(info === BusinessMemberInfoKeys.InfoSettlementManager){ - setShowInfoSettlementManager(!showInfoSettlementManager); - } - else if(info === BusinessMemberInfoKeys.InfoSettlementAccount){ - setShowInfoSettlemenAccount(!showInfoSettlementAccount); - } - }; - - useEffect(() => { - callInfo(); - }, []); - - return ( - <> -
    - -
    - -
    - -
    - - - -
    - - - -
    - - onClickToShowInfo(info) } - > - -
    - - onClickToShowInfo(info) } - > - -
    - - onClickToShowInfo(info) } - > - -
    - - onClickToShowInfo(info) } - > - -
    -

    ※ 가맹점 정보는 앱에서 수정할 수 없습니다.
    PC 가맹점 관리자에서 설정해 주세요.

    -
    -
    - - ); -}; \ No newline at end of file diff --git a/src/entities/common/model/types.ts b/src/entities/common/model/types.ts index ae38c95..9212d85 100644 --- a/src/entities/common/model/types.ts +++ b/src/entities/common/model/types.ts @@ -178,6 +178,6 @@ export interface EmptyTokenAddSendCodeResponse { authCode: string; }; -export interface DetailArrowProps { - show?: boolean; +export interface SectionArrowProps { + isOpen?: boolean; }; \ No newline at end of file diff --git a/src/entities/transaction/ui/detail-arrow.tsx b/src/entities/common/ui/section-title-arrow.tsx similarity index 64% rename from src/entities/transaction/ui/detail-arrow.tsx rename to src/entities/common/ui/section-title-arrow.tsx index a86146d..6a213d2 100644 --- a/src/entities/transaction/ui/detail-arrow.tsx +++ b/src/entities/common/ui/section-title-arrow.tsx @@ -2,17 +2,17 @@ import { useEffect, useState } from 'react'; import { IMAGE_ROOT } from '@/shared/constants/common'; import { AltMsgKeys, - DetailArrowProps -} from '@/entities/common/model/types'; + SectionArrowProps +} from '../model/types'; -export const DetailArrow = ({ show }: DetailArrowProps) => { +export const SectionTitleArrow = ({ isOpen }: SectionArrowProps) => { const [altMsg, setAltMsg] = useState(AltMsgKeys.Fold); const [className, setClassName] = useState('ic20 rot-180'); useEffect(() => { - setAltMsg((show)? AltMsgKeys.Fold: AltMsgKeys.UnFold); - setClassName(`ic20 ${(show)? 'rot-180': ''}`); - }, [show]); + setAltMsg((isOpen)? AltMsgKeys.Fold: AltMsgKeys.UnFold); + setClassName(`ic20 ${(isOpen)? 'rot-180': ''}`); + }, [isOpen]); return ( <> diff --git a/src/entities/merchant/api/use-merchant-mid-mutation.tsx b/src/entities/merchant/api/use-merchant-mid-mutation.tsx new file mode 100644 index 0000000..92746c8 --- /dev/null +++ b/src/entities/merchant/api/use-merchant-mid-mutation.tsx @@ -0,0 +1,29 @@ +import axios from 'axios'; +import { API_URL_MERCHANT } from '@/shared/api/api-url-merchant'; +import { resultify } from '@/shared/lib/resultify'; +import { CBDCAxiosError } from '@/shared/@types/error'; +import { + MerchantMidParams, + MerchantMidResponse +} from '../model/types'; +import { + useMutation, + UseMutationOptions +} from '@tanstack/react-query'; + +export const merchantMid = (params: MerchantMidParams) => { + return resultify( + axios.post(API_URL_MERCHANT.merchantMid(params.mid), params), + ); +}; + +export const useMerchantMidMutation = (options?: UseMutationOptions) => { + const mutation = useMutation({ + ...options, + mutationFn: (params: MerchantMidParams) => merchantMid(params), + }); + + return { + ...mutation, + }; +}; diff --git a/src/entities/merchant/api/use-merchant-mid-status-mutation.tsx b/src/entities/merchant/api/use-merchant-mid-status-mutation.tsx new file mode 100644 index 0000000..12d240e --- /dev/null +++ b/src/entities/merchant/api/use-merchant-mid-status-mutation.tsx @@ -0,0 +1,29 @@ +import axios from 'axios'; +import { API_URL_MERCHANT } from '@/shared/api/api-url-merchant'; +import { resultify } from '@/shared/lib/resultify'; +import { CBDCAxiosError } from '@/shared/@types/error'; +import { + MerchantMidStatusParams, + MerchantMidStatusResponse +} from '../model/types'; +import { + useMutation, + UseMutationOptions +} from '@tanstack/react-query'; + +export const merchantMidStatus = (params: MerchantMidStatusParams) => { + return resultify( + axios.post(API_URL_MERCHANT.merchantMidStatus(params.mid), params), + ); +}; + +export const useMerchantMidStatusMutation = (options?: UseMutationOptions) => { + const mutation = useMutation({ + ...options, + mutationFn: (params: MerchantMidStatusParams) => merchantMidStatus(params), + }); + + return { + ...mutation, + }; +}; diff --git a/src/entities/merchant/model/types.ts b/src/entities/merchant/model/types.ts new file mode 100644 index 0000000..f512cdd --- /dev/null +++ b/src/entities/merchant/model/types.ts @@ -0,0 +1,119 @@ +export enum MerchantTabKeys { + Info = 'Info', + RegistrationStatus = 'RegistrationStatus', +}; +export interface MerchantTabProps { + activeTab: MerchantTabKeys; +}; +export enum ContractStatus { + RECEPTION_COMPLETED = 'RECEPTION_COMPLETED', + RECEPTION_INCOMPLETE = 'RECEPTION_INCOMPLETE', +}; +export enum CardAuditStatus { + REQUEST_COMPLETED = 'REQUEST_COMPLETED', + SUPPLEMENT_REQUIRED = 'SUPPLEMENT_REQUIRED' +}; +export enum UsageStatus { + AVAILABLE = 'AVAILABLE', + SUSPENDED = 'SUSPENDED' +}; +export enum InitialRegistrationFeeStatus { + EXEMPT = 'EXEMPT', + NOT_REGISTERED = 'NOT_REGISTERED', + UNPAID = 'UNPAID', + PAID = 'PAID', +}; +export enum GuaranteeInsuranceFeeStatus { + EXEMPT = 'EXEMPT', + NOT_REGISTERED = 'NOT_REGISTERED', + UNPAID = 'UNPAID', + PAID = 'PAID', +}; +export enum CardCompanyName { + BC = 'BC', + KOOKMIN = 'KOOKMIN', + HANA = 'HANA', + SAMSUNG = 'SAMSUNG', + SHINHAN = 'SHINHAN', + HYUNDAI = 'HYUNDAI', + LOTTE = 'LOTTE', + NH = 'NH', + WOORI = 'WOORI' +}; +export enum EscrowStatus { + ACTIVE = 'ACTIVE', + INACTIVE = 'INACTIVE' +}; +export enum InfoWrapKeys { + Merchant = 'Merchant', + Technical = 'Technical', + Settlement = 'Settlement', +}; +export interface MerchantMidParams { + mid: string; +}; +export interface MerchantMidResponse { + memberCompanyId?: string; + businessCompanyName?: string; + businessRegistrationNumber?: string; + businessScaleTypeName?: string; + businessType?: string; + businessCategory?: string; + representativeName?: string; + telephoneNumber?: string; + email?: string; + businessAddress?: string; + url?: string; + merchantManager?: string; + merchantManagerTelephone?: string; + merchantManagerEmail?: string; + technicalManager?: string; + technicalManagerTelephone?: string; + technicalManagerEmail?: string; + settlementManager?: string; + settlementManagerTelephone?: string; + settlementManagerEmail?: string; + bankName?: string; + accountNumber?: string; + accountHolderName?: string; +}; +export interface MerchantMidStatusParams { + mid: string; +}; +export interface MerchantMidStatusResponse { + onlineInfomation: OnlineInfomation; + offlineInfomation: OfflineInfomation; + cardApplications: Array; + escrow: Escrow; +}; +export interface OnlineInfomation { + registrationDate: string; + businessRegistrationNumber: string; + companyName: string; + contractStatus: ContractStatus; + cardAuditStatus: CardAuditStatus; + insuranceAmount: string; + insuranceExpiryDate: string; + usageStatus: UsageStatus; +}; +export interface OfflineInfomation { + registrationDate: string; + contractDocumentCount: number; + initialRegistrationFeeStatus: InitialRegistrationFeeStatus; + initialRegistrationFeeAmount: string; + guaranteeInsuranceFeeStatus: GuaranteeInsuranceFeeStatus; + guaranteeInsuranceFeeAmount: string; +}; +export interface CardApplications { + cardCompanyName: CardCompanyName; + partnerServiceName: string; + statusName: string; +}; +export interface Escrow { + companyName: string; + businessRegistrationNumber: string; + escrowStatus: EscrowStatus, + address: string; + merchantUrl: string; + serviceRegistrationNumber: string; +}; \ No newline at end of file diff --git a/src/entities/merchant/ui/info-wrap.tsx b/src/entities/merchant/ui/info-wrap.tsx new file mode 100644 index 0000000..d1b2b3c --- /dev/null +++ b/src/entities/merchant/ui/info-wrap.tsx @@ -0,0 +1,85 @@ +import { useEffect, useState } from 'react'; +import { useMerchantMidMutation } from '../api/use-merchant-mid-mutation'; +import { BusinessInfoWrap } from './info-wrap/business-info-wrap'; +import { ManagerInfoWrap } from './info-wrap/manager-info-wrap'; + +import { + InfoWrapKeys, + MerchantMidParams, + MerchantMidResponse +} from '../model/types'; + +export const InfoWrap = () => { + + const [mid, setMid] = useState('nictest001m'); + const [data, setData] = useState(); + + const [openChild, setOpenChild] = useState(null); + const { mutateAsync: merchantMid } = useMerchantMidMutation(); + + const callInfo = () => { + let params: MerchantMidParams = { + mid: mid, + }; + merchantMid(params).then((rs: MerchantMidResponse) => { + setData(rs); + }); + }; + + useEffect(() => { + callInfo(); + }, []); + + return ( + <> +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    +

    ※ 가맹점 정보는 앱에서 수정할 수 없습니다.
    PC 가맹점 관리자에서 설정해 주세요.

    +
    +
    + + ); +}; \ No newline at end of file diff --git a/src/entities/merchant/ui/info-wrap/business-info-wrap.tsx b/src/entities/merchant/ui/info-wrap/business-info-wrap.tsx new file mode 100644 index 0000000..ae4cbbd --- /dev/null +++ b/src/entities/merchant/ui/info-wrap/business-info-wrap.tsx @@ -0,0 +1,70 @@ +import { MerchantMidResponse } from '../../model/types'; + +export interface BusinessInfoWrapProps { + data?: MerchantMidResponse +}; + +export const BusinessInfoWrap = ({ + data +}: BusinessInfoWrapProps) => { + + return ( + <> +
    +
    기본정보
    +
      +
    • + 상호 + { data?.businessCompanyName } +
    • +
    • + 사업자번호 + { data?.businessRegistrationNumber } +
    • +
    • + 사업자속성 + { data?.businessScaleTypeName } +
    • +
    • + 업종 + { data?.businessType } +
    • +
    • + 업태 + { data?.businessCategory } +
    • +
    +
    +
    +
    +
      +
    • + 대표자명 + { data?.representativeName } +
    • +
    • + 대표 연락처 + { data?.telephoneNumber } +
    • +
    • + 대표 이메일 + { data?.email } +
    • +
    +
    +
    +
    +
      +
    • + 사업장주소 + { data?.businessAddress } +
    • +
    • + 홈페이지 주소 + { data?.url } +
    • +
    +
    + + ); +}; \ No newline at end of file diff --git a/src/entities/merchant/ui/info-wrap/manager-info-wrap.tsx b/src/entities/merchant/ui/info-wrap/manager-info-wrap.tsx new file mode 100644 index 0000000..bd1b7f8 --- /dev/null +++ b/src/entities/merchant/ui/info-wrap/manager-info-wrap.tsx @@ -0,0 +1,75 @@ +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; +import { InfoWrapKeys, MerchantMidResponse } from '../../model/types'; +import SlideDown from 'react-slidedown'; +import 'react-slidedown/lib/slidedown.css'; +import { useEffect, useState } from 'react'; + +export interface ManagerInfoWrapProps { + type: InfoWrapKeys; + title?: string; + manager?: string; + managerTelephone?: string; + managetEmail?: string; + openChild: InfoWrapKeys | null; + setOpenChild: (openChild: InfoWrapKeys | null) => void; +}; + +export const ManagerInfoWrap = ({ + type, + title, + manager, + managerTelephone, + managetEmail, + openChild, + setOpenChild +}: ManagerInfoWrapProps) => { + + const [isOpen, setIsOpen] = useState(false); + + const opeSection = () => { + const staus = !isOpen; + setIsOpen(staus); + if(!!staus){ + setOpenChild(type); + } + else { + setOpenChild(null) + } + }; + + useEffect(() => { + if(!!openChild && openChild !== type){ + setIsOpen(false); + } + }, [openChild]); + + return ( + <> +
    +
    opeSection() } + > + { title } +
    + + { isOpen && +
      +
    • + { manager } + +
    • +
    • + { managerTelephone } + +
    • +
    • + { managetEmail } + +
    • +
    + } +
    +
    + + ); +}; \ No newline at end of file diff --git a/src/entities/merchant/ui/merchant-tab.tsx b/src/entities/merchant/ui/merchant-tab.tsx new file mode 100644 index 0000000..b7bd1be --- /dev/null +++ b/src/entities/merchant/ui/merchant-tab.tsx @@ -0,0 +1,37 @@ +import { PATHS } from '@/shared/constants/paths'; +import { useNavigate } from '@/shared/lib/hooks/use-navigate'; +import { + MerchantTabKeys, + MerchantTabProps +} from '../model/types'; + +export const MerchantTab = ({ + activeTab +}: MerchantTabProps) => { + const { navigate } = useNavigate(); + + const onClickToNavigation = (tab: MerchantTabKeys) => { + if(activeTab !== tab){ + if(tab === MerchantTabKeys.Info){ + navigate(PATHS.merchant.info); + } + else if(tab === MerchantTabKeys.RegistrationStatus){ + navigate(PATHS.merchant.registrationStatus); + } + } + }; + return( + <> +
    + + +
    + + ); +}; \ No newline at end of file diff --git a/src/entities/business-member/ui/registration-status-wrap.tsx b/src/entities/merchant/ui/registration-status-wrap.tsx similarity index 100% rename from src/entities/business-member/ui/registration-status-wrap.tsx rename to src/entities/merchant/ui/registration-status-wrap.tsx diff --git a/src/entities/payment/ui/data-notification-notify-content.tsx b/src/entities/payment/ui/data-notification-notify-content.tsx index 3f7d4b0..6dd5ced 100644 --- a/src/entities/payment/ui/data-notification-notify-content.tsx +++ b/src/entities/payment/ui/data-notification-notify-content.tsx @@ -48,7 +48,7 @@ export const DataNotificationNotifyContent = ({ if(!!openChild && openChild !== type){ setIsOpen(false); } - }, [openChild]) + }, [openChild]); return ( <> diff --git a/src/entities/settlement/model/types.ts b/src/entities/settlement/model/types.ts index 103cd8c..c31fa8a 100644 --- a/src/entities/settlement/model/types.ts +++ b/src/entities/settlement/model/types.ts @@ -189,11 +189,11 @@ export interface AmountInfoWrapProps { }; export interface SettlementInfoWrapProps { settlementInfo?: SettlementInfo; - show: boolean; + isOpen: boolean; onClickToShowInfo: (infoWrapKey: InfoWrapKeys) => void; }; export interface TransactionInfoWrapProps { transactionInfo?: TransactionInfo; - show: boolean; + isOpen: boolean; onClickToShowInfo: (infoWrapKey: InfoWrapKeys) => void; }; \ No newline at end of file diff --git a/src/entities/settlement/ui/detail-arrow.tsx b/src/entities/settlement/ui/detail-arrow.tsx deleted file mode 100644 index a86146d..0000000 --- a/src/entities/settlement/ui/detail-arrow.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { useEffect, useState } from 'react'; -import { IMAGE_ROOT } from '@/shared/constants/common'; -import { - AltMsgKeys, - DetailArrowProps -} from '@/entities/common/model/types'; - -export const DetailArrow = ({ show }: DetailArrowProps) => { - const [altMsg, setAltMsg] = useState(AltMsgKeys.Fold); - const [className, setClassName] = useState('ic20 rot-180'); - - useEffect(() => { - setAltMsg((show)? AltMsgKeys.Fold: AltMsgKeys.UnFold); - setClassName(`ic20 ${(show)? 'rot-180': ''}`); - }, [show]); - - return ( - <> - { - - ); -}; \ No newline at end of file diff --git a/src/entities/settlement/ui/info-wrap/amount-info-wrap.tsx b/src/entities/settlement/ui/info-wrap/amount-info-wrap.tsx index 1aed8fa..699ec43 100644 --- a/src/entities/settlement/ui/info-wrap/amount-info-wrap.tsx +++ b/src/entities/settlement/ui/info-wrap/amount-info-wrap.tsx @@ -70,6 +70,12 @@ export const AmountInfoWrap = ({ } + { (periodType === SettlementPeriodType.TRANSACTION_DATE) && +
      + + +
    + } ); diff --git a/src/entities/settlement/ui/info-wrap/settlement-info-wrap.tsx b/src/entities/settlement/ui/info-wrap/settlement-info-wrap.tsx index a321341..1039f63 100644 --- a/src/entities/settlement/ui/info-wrap/settlement-info-wrap.tsx +++ b/src/entities/settlement/ui/info-wrap/settlement-info-wrap.tsx @@ -1,17 +1,17 @@ import moment from 'moment'; import { NumericFormat } from 'react-number-format'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import SlideDown from 'react-slidedown'; import 'react-slidedown/lib/slidedown.css'; import { InfoWrapKeys, SettlementInfoWrapProps, SettlementPeriodType -} from '@/entities/settlement/model/types'; +} from '../../model/types'; export const SettlementInfoWrap = ({ settlementInfo, - show, + isOpen, onClickToShowInfo }: SettlementInfoWrapProps) => { @@ -28,10 +28,10 @@ export const SettlementInfoWrap = ({ className="section-title" onClick={ () => onClickToSetShowInfo() } > - 정산 정보 + 정산 정보 - { show && + { isOpen &&
    • MID diff --git a/src/entities/settlement/ui/info-wrap/transaction-info-wrap.tsx b/src/entities/settlement/ui/info-wrap/transaction-info-wrap.tsx index 4a628fe..092e616 100644 --- a/src/entities/settlement/ui/info-wrap/transaction-info-wrap.tsx +++ b/src/entities/settlement/ui/info-wrap/transaction-info-wrap.tsx @@ -1,5 +1,5 @@ import moment from 'moment'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import SlideDown from 'react-slidedown'; import 'react-slidedown/lib/slidedown.css'; import { @@ -9,7 +9,7 @@ import { export const TransactionInfoWrap = ({ transactionInfo, - show, + isOpen, onClickToShowInfo }: TransactionInfoWrapProps) => { @@ -26,10 +26,10 @@ export const TransactionInfoWrap = ({ className="section-title" onClick={ () => onClickToSetShowInfo() } > - 거래 상세 정보 + 거래 상세 정보 - { show && + { isOpen &&
      • 주문번호 diff --git a/src/entities/transaction/model/types.ts b/src/entities/transaction/model/types.ts index 5896ad6..3f7df5e 100644 --- a/src/entities/transaction/model/types.ts +++ b/src/entities/transaction/model/types.ts @@ -461,11 +461,11 @@ export interface BillingDetailResponse extends BillingInfo { export interface DetailInfoProps extends DetailResponse { transactionCategory?: TransactionCategory; - show?: boolean; + isOpen?: boolean; tid?: string; serviceCode?: string; purposeType?: CashReceiptPurposeType; - onClickToShowInfo?: (info: InfoWrapKeys) => void; + onClickToOpenInfo?: (info: InfoWrapKeys) => void; } export interface DownloadConfirmationParams { diff --git a/src/entities/transaction/ui/info-wrap/amount-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/amount-info-wrap.tsx index 6b3f558..64b4f9a 100644 --- a/src/entities/transaction/ui/info-wrap/amount-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/amount-info-wrap.tsx @@ -1,6 +1,6 @@ import moment from 'moment'; import { NumericFormat } from 'react-number-format'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { useDownloadConfirmationMutation } from '../../api/use-download-confirmation-mutation'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { SlideDown } from 'react-slidedown'; @@ -9,10 +9,10 @@ import 'react-slidedown/lib/slidedown.css'; export const AmountInfoWrap = ({ transactionCategory, amountInfo, - show, + isOpen, tid, serviceCode, - onClickToShowInfo + onClickToOpenInfo }: DetailInfoProps) => { const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation(); @@ -34,7 +34,7 @@ export const AmountInfoWrap = ({ }; const showTop = ['01', '02', '03', '26']; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['mid', 'cardAmount', 'pointAmount', 'couponAmount', 'escrowFee', 'kakaoMoney', @@ -65,9 +65,9 @@ export const AmountInfoWrap = ({ let newAmountInfo: Record | undefined = amountInfo; const subLi = () => { let rs = []; - if(!!newAmountInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Amount); + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Amount); } }; @@ -131,12 +131,12 @@ export const AmountInfoWrap = ({ type="button" onClick={ () => onClickToSetShowInfo() } > - 금액상세 + 금액상세 - { !!show && + { !!isOpen &&
          { subLi() } diff --git a/src/entities/transaction/ui/info-wrap/detail-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/detail-info-wrap.tsx index ffbcfe3..06e8f4f 100644 --- a/src/entities/transaction/ui/info-wrap/detail-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/detail-info-wrap.tsx @@ -1,5 +1,5 @@ import moment from 'moment'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { SlideDown } from 'react-slidedown'; import 'react-slidedown/lib/slidedown.css'; @@ -7,13 +7,13 @@ import 'react-slidedown/lib/slidedown.css'; export const DetailInfoWrap = ({ transactionCategory, detailInfo, - show, - onClickToShowInfo + isOpen, + onClickToOpenInfo }: DetailInfoProps) => { - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Issue); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Issue); } }; @@ -22,12 +22,12 @@ export const DetailInfoWrap = ({
          onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 상세 정보 + 상세 정보
          - { !!show && + { !!isOpen &&
          • 취소일자 diff --git a/src/entities/transaction/ui/info-wrap/escrow-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/escrow-info-wrap.tsx index 0c7972d..7c19791 100644 --- a/src/entities/transaction/ui/info-wrap/escrow-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/escrow-info-wrap.tsx @@ -1,5 +1,5 @@ import moment from 'moment'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { SlideDown } from 'react-slidedown'; import 'react-slidedown/lib/slidedown.css'; @@ -7,13 +7,13 @@ import 'react-slidedown/lib/slidedown.css'; export const EscrowInfoWrap = ({ transactionCategory, escrowInfo, - show, - onClickToShowInfo + isOpen, + onClickToOpenInfo }: DetailInfoProps) => { - const onClickToSetShowInfo = () => { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Escrow); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Escrow); } }; @@ -22,12 +22,12 @@ export const EscrowInfoWrap = ({
            onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 정산 정보 + 정산 정보
            - { !!show && + { !!isOpen &&
            • 배송상태 diff --git a/src/entities/transaction/ui/info-wrap/important-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/important-info-wrap.tsx index bb5bd55..9213575 100644 --- a/src/entities/transaction/ui/info-wrap/important-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/important-info-wrap.tsx @@ -20,7 +20,7 @@ export const ImportantInfoWrap = ({ productName: {name: '상품명', type: 'string'} }; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod', 'approvalDate', 'cancelDate', 'productName'], @@ -57,9 +57,9 @@ export const ImportantInfoWrap = ({ const subLi = () => { let rs = []; - if(!!newImportantInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { const subItems: Record> = { @@ -21,7 +21,7 @@ export const PartCancelInfoWrap = ({ remainingAmount: {name: (serviceCode === '05')? '재승인 금액': '부분취소 후 잔액', type: 'number'}, }; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['originalTid', 'originalAmount', 'partCancelTid', 'partCancelAmount', 'remainingAmount'], @@ -58,9 +58,9 @@ export const PartCancelInfoWrap = ({ const subLi = () => { let rs = []; - if(!!newPartCancelInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.PartCancel); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.PartCancel); } }; @@ -103,12 +103,12 @@ export const PartCancelInfoWrap = ({
              onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 부분취소 정보 + 부분취소 정보
              - { !!show && + { !!isOpen &&
                { subLi() }
              diff --git a/src/entities/transaction/ui/info-wrap/payment-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/payment-info-wrap.tsx index 8771bf9..ebbec46 100644 --- a/src/entities/transaction/ui/info-wrap/payment-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/payment-info-wrap.tsx @@ -1,6 +1,5 @@ import moment from 'moment'; -import { motion } from 'framer-motion'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types'; import { NumericFormat } from 'react-number-format'; import { SlideDown } from 'react-slidedown'; @@ -10,8 +9,8 @@ export const PaymentInfoWrap = ({ transactionCategory, paymentInfo, serviceCode, - show, - onClickToShowInfo + isOpen, + onClickToOpenInfo }: DetailInfoProps) => { const subItems: Record> = { @@ -49,7 +48,7 @@ export const PaymentInfoWrap = ({ culturelandId: {name: '컬처랜드ID', type: 'string'}, }; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['approvalAcquire', 'approvalReturn', 'approvalReAcquire', 'approvalVAN', 'cancelAcquire', 'cancelReturn', 'cancelReAcquire', @@ -82,9 +81,9 @@ export const PaymentInfoWrap = ({ const subLi = () => { let rs = []; - if(!!newPaymentInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Payment); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Payment); } }; @@ -127,12 +126,12 @@ export const PaymentInfoWrap = ({
              onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 결제 정보 + 결제 정보
              - { !!show && + { !!isOpen &&
                { (transactionCategory === TransactionCategory.AllTransaction) && subLi() diff --git a/src/entities/transaction/ui/info-wrap/settlement-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/settlement-info-wrap.tsx index 9e87306..eddb7b3 100644 --- a/src/entities/transaction/ui/info-wrap/settlement-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/settlement-info-wrap.tsx @@ -1,6 +1,6 @@ import moment from 'moment'; import { NumericFormat } from 'react-number-format'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { SlideDown } from 'react-slidedown'; import 'react-slidedown/lib/slidedown.css'; @@ -9,8 +9,8 @@ export const SettlementInfoWrap = ({ transactionCategory, settlementInfo, serviceCode, - show, - onClickToShowInfo + isOpen, + onClickToOpenInfo }: DetailInfoProps) => { const subItems: Record> = { @@ -20,7 +20,7 @@ export const SettlementInfoWrap = ({ cancelSettleAmount: {name: '취소정산금액', type: 'number'}, }; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['approvalSettleDate', 'approvalSettleAmount', 'cancelSettleDate', 'cancelSettleAmount'], @@ -57,9 +57,9 @@ export const SettlementInfoWrap = ({ const subLi = () => { let rs = []; - if(!!newSettlementInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Settlement); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Settlement); } }; @@ -102,12 +102,12 @@ export const SettlementInfoWrap = ({
                onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 정산 정보 + 정산 정보
                - { !!show && + { !!isOpen &&
                  { subLi() }
                diff --git a/src/entities/transaction/ui/info-wrap/transaction-info-wrap.tsx b/src/entities/transaction/ui/info-wrap/transaction-info-wrap.tsx index 073cd21..d5eb1d9 100644 --- a/src/entities/transaction/ui/info-wrap/transaction-info-wrap.tsx +++ b/src/entities/transaction/ui/info-wrap/transaction-info-wrap.tsx @@ -1,5 +1,5 @@ import moment from 'moment'; -import { DetailArrow } from '../detail-arrow'; +import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow'; import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types'; import { NumericFormat } from 'react-number-format'; import { SlideDown } from 'react-slidedown'; @@ -9,8 +9,8 @@ export const TransactionInfoWrap = ({ transactionCategory, transactionInfo, serviceCode, - show, - onClickToShowInfo + isOpen, + onClickToOpenInfo }: DetailInfoProps) => { const subItems: Record> = { @@ -23,7 +23,7 @@ export const TransactionInfoWrap = ({ cashReceiptIssue: {name: '현금영수증발행', type: 'string'}, }; - const showSubItems: Record> = { + const openSubItems: Record> = { // 신용카드 '01': ['buyerName', 'email', 'phoneNumber', 'cancelReason', 'cancelRequestor', 'partialCancel'], @@ -60,9 +60,9 @@ export const TransactionInfoWrap = ({ const subLi = () => { let rs = []; - if(!!newTransactionInfo && !!serviceCode && !!showSubItems[serviceCode]){ - for(let i=0;i { - if(!!onClickToShowInfo){ - onClickToShowInfo(InfoWrapKeys.Transaction); + const onClickToSetOpenInfo = () => { + if(!!onClickToOpenInfo){ + onClickToOpenInfo(InfoWrapKeys.Transaction); } }; return ( <> -
                onClickToSetShowInfo() }> +
                onClickToSetShowInfo() } + onClick={ () => onClickToSetOpenInfo() } > - 거래 정보 + 거래 정보
                - { !!show && + { !!isOpen &&
                  { (transactionCategory === TransactionCategory.AllTransaction) && subLi() diff --git a/src/pages/business-member/info/info-page.tsx b/src/pages/merchant/info/info-page.tsx similarity index 65% rename from src/pages/business-member/info/info-page.tsx rename to src/pages/merchant/info/info-page.tsx index dc02ec9..81b431b 100644 --- a/src/pages/business-member/info/info-page.tsx +++ b/src/pages/merchant/info/info-page.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import { PATHS } from '@/shared/constants/paths'; import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { BusinessMemberTab } from '@/entities/business-member/ui/business-member-tab'; -import { InfoWrap } from '@/entities/business-member/ui/info-wrap'; -import { BusinessMemberTabKeys } from '@/entities/business-member/model/types'; +import { MerchantTab } from '@/entities/merchant/ui/merchant-tab'; +import { InfoWrap } from '@/entities/merchant/ui/info-wrap'; +import { MerchantTabKeys } from '@/entities/merchant/model/types'; import { HeaderType } from '@/entities/common/model/types'; import { useSetHeaderTitle, @@ -15,7 +15,7 @@ import { export const InfoPage = () => { const { navigate } = useNavigate(); - const [activeTab, setActiveTab] = useState(BusinessMemberTabKeys.Info); + const [activeTab, setActiveTab] = useState(MerchantTabKeys.Info); useSetHeaderTitle('가맹점 관리'); useSetHeaderType(HeaderType.LeftArrow); @@ -29,7 +29,7 @@ export const InfoPage = () => {
                  - +
                  diff --git a/src/pages/business-member/business-member-pages.tsx b/src/pages/merchant/merchant-pages.tsx similarity index 61% rename from src/pages/business-member/business-member-pages.tsx rename to src/pages/merchant/merchant-pages.tsx index 364aac7..71f22bb 100644 --- a/src/pages/business-member/business-member-pages.tsx +++ b/src/pages/merchant/merchant-pages.tsx @@ -4,12 +4,12 @@ import { ROUTE_NAMES } from '@/shared/constants/route-names'; import { InfoPage } from './info/info-page'; import { RegistrationStatusPage } from './registration-status/registration-status-page'; -export const BusinessMemberPages = () => { +export const MerchantPages = () => { return ( <> - } /> - } /> + } /> + } /> ); diff --git a/src/pages/business-member/registration-status/registration-status-page.tsx b/src/pages/merchant/registration-status/registration-status-page.tsx similarity index 64% rename from src/pages/business-member/registration-status/registration-status-page.tsx rename to src/pages/merchant/registration-status/registration-status-page.tsx index 383c1bc..e948dfa 100644 --- a/src/pages/business-member/registration-status/registration-status-page.tsx +++ b/src/pages/merchant/registration-status/registration-status-page.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import { PATHS } from '@/shared/constants/paths'; import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { BusinessMemberTab } from '@/entities/business-member/ui/business-member-tab'; -import { RegistrationStatusWrap } from '@/entities/business-member/ui/registration-status-wrap'; -import { BusinessMemberTabKeys } from '@/entities/business-member/model/types'; +import { MerchantTab } from '@/entities/merchant/ui/merchant-tab'; +import { RegistrationStatusWrap } from '@/entities/merchant/ui/registration-status-wrap'; +import { MerchantTabKeys } from '@/entities/merchant/model/types'; import { HeaderType } from '@/entities/common/model/types'; import { useSetHeaderTitle, @@ -15,7 +15,7 @@ import { export const RegistrationStatusPage = () => { const { navigate } = useNavigate(); - const [activeTab, setActiveTab] = useState(BusinessMemberTabKeys.RegistrationStatus); + const [activeTab, setActiveTab] = useState(MerchantTabKeys.RegistrationStatus); useSetHeaderTitle('가맹점 관리'); useSetHeaderType(HeaderType.LeftArrow); @@ -29,7 +29,7 @@ export const RegistrationStatusPage = () => {
                  - +
                  diff --git a/src/pages/settlement/list/detail-page.tsx b/src/pages/settlement/list/detail-page.tsx index aaa87e0..aef0010 100644 --- a/src/pages/settlement/list/detail-page.tsx +++ b/src/pages/settlement/list/detail-page.tsx @@ -146,14 +146,14 @@ export const DetailPage = () => { { (periodType === SettlementPeriodType.SETTLEMENT_DATE) && onClickToShowInfo(infoWrapKey) } > } { (periodType === SettlementPeriodType.TRANSACTION_DATE) && onClickToShowInfo(infoWrapKey) } > } diff --git a/src/pages/transaction/all-transaction/detail-page.tsx b/src/pages/transaction/all-transaction/detail-page.tsx index 625ad2f..c60fe8d 100644 --- a/src/pages/transaction/all-transaction/detail-page.tsx +++ b/src/pages/transaction/all-transaction/detail-page.tsx @@ -108,7 +108,7 @@ export const AllTransactionDetailPage = () => { }); }; - const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => { + const onClickToOpenInfo = (infoWrapKey: InfoWrapKeys) => { if(infoWrapKey === InfoWrapKeys.Amount){ setShowAmountInfo(!showAmountInfo); } @@ -136,10 +136,10 @@ export const AllTransactionDetailPage = () => { onClickToShowInfo(infoWrapKey) } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
                  { transactionCategory={ TransactionCategory.AllTransaction } paymentInfo={ paymentInfo } serviceCode={ serviceCode } - show={ showPaymentInfo } - onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } + isOpen={ showPaymentInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
                  onClickToShowInfo(infoWrapKey) } + isOpen={ showTransactionInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
                  onClickToShowInfo(infoWrapKey) } + isOpen={ showSettlementInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
                  onClickToShowInfo(infoWrapKey) } + isOpen={ showPartCancelInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
                diff --git a/src/pages/transaction/cash-receipt/detail-page.tsx b/src/pages/transaction/cash-receipt/detail-page.tsx index ee125a4..d08ca50 100644 --- a/src/pages/transaction/cash-receipt/detail-page.tsx +++ b/src/pages/transaction/cash-receipt/detail-page.tsx @@ -76,7 +76,7 @@ export const CashReceiptDetailPage = () => { callDetail(); }, []); - const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => { + const onClickToOpenInfo = (infoWrapKey: InfoWrapKeys) => { if(infoWrapKey === InfoWrapKeys.Detail){ setShowDetailInfo(!showDetailInfo); } @@ -102,8 +102,8 @@ export const CashReceiptDetailPage = () => { onClickToShowInfo(infoWrapKey) } + isOpen={ showDetailInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
              diff --git a/src/pages/transaction/escrow/detail-page.tsx b/src/pages/transaction/escrow/detail-page.tsx index ed72bf5..7940b78 100644 --- a/src/pages/transaction/escrow/detail-page.tsx +++ b/src/pages/transaction/escrow/detail-page.tsx @@ -93,7 +93,7 @@ export const EscrowDetailPage = () => { }); }; - const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => { + const onClickToOpenInfo = (infoWrapKey: InfoWrapKeys) => { if(infoWrapKey === InfoWrapKeys.Amount){ setShowAmountInfo(!showAmountInfo); } @@ -130,29 +130,29 @@ export const EscrowDetailPage = () => { onClickToShowInfo(infoWrapKey) } + isOpen={ showEscroInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
              onClickToShowInfo(infoWrapKey) } + isOpen={ showPaymentInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
              onClickToShowInfo(infoWrapKey) } + isOpen={ showTransactionInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
              onClickToShowInfo(infoWrapKey) } + isOpen={ showSettlementInfo } + onClickToOpenInfo={ (infoWrapKey) => onClickToOpenInfo(infoWrapKey) } >
              diff --git a/src/shared/api/api-url-merchant.ts b/src/shared/api/api-url-merchant.ts new file mode 100644 index 0000000..879e303 --- /dev/null +++ b/src/shared/api/api-url-merchant.ts @@ -0,0 +1,16 @@ +import { + API_BASE_URL, + API_URL_KEY, +} from './../constants/url'; + +/* nmsa-merchant-controller */ +export const API_URL_MERCHANT = { + merchantMid: (mid: string) => { + // POST: 가맹점 정보 조회 API + return `${API_BASE_URL}/api/v1/${API_URL_KEY}/app/merchant/${mid}`; + }, + merchantMidStatus: (mid: string) => { + // POST: 가맹점 등록 현황 조회 API + return `${API_BASE_URL}/api/v1/${API_URL_KEY}/app/merchant/${mid}/status`; + } +}; \ No newline at end of file diff --git a/src/shared/configs/sentry/index.tsx b/src/shared/configs/sentry/index.tsx index 2016c37..894ce22 100644 --- a/src/shared/configs/sentry/index.tsx +++ b/src/shared/configs/sentry/index.tsx @@ -76,7 +76,7 @@ const lazyLoad = (path: string) => { const HomePage = lazyLoad('/src/pages/home/home-page'); const TransactionPages = lazyLoad('/src/pages/transaction/transaction-pages'); const SettlementPages = lazyLoad('/src/pages/settlement/settlement-pages'); -const BusinessMemberPages = lazyLoad('/src/pages/business-member/business-member-pages'); +const MerchantPages = lazyLoad('/src/pages/merchant/merchant-pages'); const PaymentPages = lazyLoad('/src/pages/payment/payment-pages'); const AccountPages = lazyLoad('/src/pages/account/account-pages'); const TaxPages = lazyLoad('/src/pages/tax/tax-pages'); @@ -122,7 +122,7 @@ const Pages = () => { } /> } /> } /> - } /> + } /> } /> } /> } /> diff --git a/src/shared/constants/paths.ts b/src/shared/constants/paths.ts index e23fb28..b5c106d 100644 --- a/src/shared/constants/paths.ts +++ b/src/shared/constants/paths.ts @@ -77,10 +77,10 @@ export const PATHS: RouteNamesType = { list: generatePath(ROUTE_NAMES.settlement.base, ROUTE_NAMES.settlement.list), detail: generatePath(ROUTE_NAMES.settlement.base, ROUTE_NAMES.settlement.detail), }, - businessMember: { - base: generatePath(ROUTE_NAMES.businessMember.base), - info: generatePath(ROUTE_NAMES.businessMember.base, ROUTE_NAMES.businessMember.info), - registrationStatus: generatePath(ROUTE_NAMES.businessMember.base, ROUTE_NAMES.businessMember.registrationStatus), + merchant: { + base: generatePath(ROUTE_NAMES.merchant.base), + info: generatePath(ROUTE_NAMES.merchant.base, ROUTE_NAMES.merchant.info), + registrationStatus: generatePath(ROUTE_NAMES.merchant.base, ROUTE_NAMES.merchant.registrationStatus), }, payment: { base: generatePath(ROUTE_NAMES.payment.base), diff --git a/src/shared/constants/route-names.ts b/src/shared/constants/route-names.ts index b841af4..9e43ab4 100644 --- a/src/shared/constants/route-names.ts +++ b/src/shared/constants/route-names.ts @@ -32,8 +32,8 @@ export const ROUTE_NAMES = { list: 'list', detail: 'detail/:detailId', }, - businessMember: { - base: '/business-member/*', + merchant: { + base: '/merchant/*', info: 'info', registrationStatus: 'registration-status' }, diff --git a/src/shared/ui/menu/index.tsx b/src/shared/ui/menu/index.tsx index 05fb3c3..08befeb 100644 --- a/src/shared/ui/menu/index.tsx +++ b/src/shared/ui/menu/index.tsx @@ -49,8 +49,8 @@ export const Menu = ({ category: '가맹점 관리', categoryIcon: 'merchant-icon', items: [ - {title: '가맹점 정보', path: PATHS.businessMember.info}, - {title: '등록 현황', path: PATHS.businessMember.registrationStatus}, + {title: '가맹점 정보', path: PATHS.merchant.info}, + {title: '등록 현황', path: PATHS.merchant.registrationStatus}, ] }, payment: {