Skip to content

feat: 사업자 인증 대표자명 필드 추가, 예외 처리 보완#103

Merged
dew102938 merged 5 commits into
developfrom
feat/businessAuth
Feb 19, 2026
Merged

feat: 사업자 인증 대표자명 필드 추가, 예외 처리 보완#103
dew102938 merged 5 commits into
developfrom
feat/businessAuth

Conversation

@dew102938

@dew102938 dew102938 commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

💡 개요

사업자 인증 대표자명 필드 추가, 예외 처리 보완

🔢 관련 이슈 링크

💻 작업내용

  • 사업자 인증 대표자명 필드 추가
  • 이미 인증받은 회원이 인증 시도할 경우 confirm 모달을 띄워 현재 입력한 정보가 정확한지 사용자가 재확인하도록 수정

📌 변경사항PR

  • FEAT: 새로운 기능 추가
  • FIX: 버그/오류 수정
  • CHORE: 코드/내부 파일/설정 수정
  • DOCS: 문서 수정(README 등)
  • REFACTOR: 코드 리팩토링 (기능 변경 없음)
  • TEST: 테스트 코드 추가/수정
  • STYLE: 스타일 변경(포맷, 세미콜론 등)

🤔 추가 논의하고 싶은 내용

  • N/A

✅ 체크리스트

  • 브랜치는 잘 맞게 올렸는지
  • 관련 이슈를 맞게 연결했는지
  • 로컬에서 정상 동작을 확있했는지
  • 충돌이 없다(또는 브랜치에서 충돌 해결 후 PR 업데이트 완료)

Summary by CodeRabbit

  • 새로운 기능

    • 사업자 인증 단계에 대표자명 입력 필드 추가(2자 이상, 20자 이하).
  • 개선 사항

    • 중복 소유자(409) 발생 시 알림을 확인 대화상자로 대체 — 사용자가 확인하면 절차가 이어지고 입력한 대표자명이 반영됩니다.
    • 등록 요청 흐름에 대표자명 포함으로 전송 정보 확장.
    • 확인 대화상자에 제목·설명·버튼 레이블 및 스타일 옵션 추가로 표시 유연성 강화.

@dew102938 dew102938 self-assigned this Feb 19, 2026
@vercel

vercel Bot commented Feb 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eatsfine Ready Ready Preview, Comment Feb 19, 2026 7:34am

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

사업자 인증 흐름에 대표자명(name) 필드를 추가하고, 폼·스키마·타입·변환 로직을 전반적으로 업데이트했으며, OWNER409(이미 인증된 사용자) 처리 시 alert 대신 ConfirmModal을 도입해 예외 흐름을 보완했습니다.

Changes

Cohort / File(s) Summary
스키마 및 타입 정의
src/components/store-registration/BusinessAuth.schema.ts, src/types/store.ts
BusinessAuth 스키마에 name: string 추가(검증: 최소 1/2, 최대 20자). BusinessNumberDto 타입에 name: string 추가.
폼 컴포넌트 통합
src/components/store-registration/StepBusinessAuth.tsx
폼에 name 입력 추가, useForm defaultValues/watchname 포함. OWNER409 처리 흐름을 alertConfirmModal로 변경, pendingData/isVerified 상태 도입, onComplete 페이로드에 name 포함.
데이터 변환 및 페이지 상태
src/components/store-registration/StoreTransform.utils.ts, src/pages/myPage/StoreRegistrationPage.tsx
transformToRegister와 페이지의 step1Data 타입에 name 추가. 변환 결과(RequestStoreCreateDto).businessNumberDtoname 할당.
공용 컴포넌트 (모달)
src/components/store-registration/ConfirmModal.tsx
ConfirmModaltitle, description, confirmLabel, cancelLabel, variant props 추가 및 기본값/버튼 스타일링 분기 도입. ReactNode 타입 import 추가.

Sequence Diagram(s)

sequenceDiagram
    participant User as 사용자
    participant Form as StepBusinessAuth
    participant HookForm as ReactHookForm
    participant API as 사업자 인증 API
    participant Modal as ConfirmModal
    participant Page as StoreRegistrationPage
    participant Transform as StoreTransform

    User->>Form: 대표자명 + 사업자번호/시작일 입력 및 제출
    Form->>HookForm: validate via BusinessAuthSchema (watch("name"))
    HookForm-->>Form: 유효성 결과
    Form->>API: 인증 요청 (businessNumber, startDate)
    alt API returns OWNER409
        API-->>Form: 409 (이미 인증)
        Form->>Modal: pendingData 저장 후 모달 표시
        User->>Modal: 확인 / 취소 선택
        alt 확인
            Modal-->>Form: confirm
            Form->>Form: isVerified = true, onComplete({name, businessNumber, startDate})
        else 취소
            Modal-->>Form: cancel
            Form->>Form: isVerified = false, pendingData 유지 또는 클리어
        end
    else 인증 성공
        API-->>Form: 성공
        Form->>Form: isVerified = true, onComplete({name, businessNumber, startDate})
    end
    Form->>Page: step1Data 업데이트
    Page->>Transform: transformToRegister(step1Data, step2Data)
    Transform-->>Page: RequestStoreCreateDto (businessNumberDto.name 포함)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • feat: 새 가게 등록 API 연동 #59: 동일한 store-registration 영역(BusinessAuth.schema, StepBusinessAuth, StoreTransform.utils, types/store, StoreRegistrationPage) 변경과 밀접 관련 — 대표자명 필드 추가 및 OWNER409 흐름 확장 관점에서 직접 연관.

Suggested labels

API

Suggested Reviewers

  • jjjsun
  • yooseolhee

Poem

🏪 이름을 적고 버튼을 눌러
검증과 확인을 지나며
모달이 묻네, “정말 이대로?”
예를 누르면 등록 길이 열리고
작은 가게의 새 시작을 응원해 ✨


검토 시 주의할 점 (권장 확인 항목, 근거+대안 포함)

  • OWNER409 흐름의 상태 일관성

    • 근거: pendingData/isVerified를 도입해 복수 경로에서 상태를 변경함.
    • 확인: 모달에서 확인→onComplete 호출 시 pendingData가 정확히 클리어되는지, 취소 시 pendingData가 의도대로 보존되는지 검증하세요.
    • 대안/예시: 모달 확인 시 중앙 처리 함수로 위임해 pendingData를 명시적으로 초기화하세요.
      • 예: const handleConfirm409 = () => { setIsVerified(true); onComplete(pendingData!); setPendingData(null); }
  • name 변경 시 검증/인증 해제 로직

    • 근거: name이 수정되면 isVerified를 초기화하는 분기가 있음.
    • 확인: name 변경 → isVerified=false가 모든 경로에서 일관되게 적용되는지, UI와 onComplete 호출 시 최신 name이 포함되는지 확인하세요.
    • 대안/예시: watch("name") 변경 리스너에서 debounce 후 setIsVerified(false) 처리하고, 변경 시 사용자에게 재인증 필요 안내를 띄우는 것이 명확합니다.
      • 간단 예시:
        • useEffect(() => {
        • const t = setTimeout(() => setIsVerified(false), 300);
        • return () => clearTimeout(t);
        • }, [watchedName])
  • 국제화/문자열 검증(한글 조합/공백/특수문자)

    • 근거: 길이 검증만 추가되어 있어 자모 분리/공백만 입력 등 엣지케이스가 있을 수 있음.
    • 확인: 실제 입력(한글 완성/비완성, 공백만 입력, 특수문자 포함)에 대한 UX와 서버측 검증을 검토하세요.
    • 대안: trim() 후 빈값 검사, 필요하면 정규식으로 허용 문자 범위를 제한하거나 서버-클라이언트 검증 규격을 문서화하세요.
      • 예: z.string().transform(s => s.trim()).min(1, "대표자명을 입력해주세요.").regex(/^[가-힣a-zA-Z\s]+$/, "특수문자는 허용되지 않습니다.")
  • 타입/변환 일관성 검토

    • 근거: types/store.tstransformToRegistername 추가로 API 페이로드가 변경됨.
    • 확인: 백엔드 API 스펙(RequestStoreCreateDto.businessNumberDto.name)이 허용되는지 확인하고, API 계약(문서 또는 OpenAPI)에 맞춰 필드명과 필수성 일치 여부를 점검하세요.
    • 대안: 백엔드가 아직 name을 받지 않으면 변환 함수에서 name을 optional로 처리하거나 feature flag로 분기하세요.
      • 예: businessNumberDto: { businessNumber, startDate, ...(step1Data.name ? { name: step1Data.name } : {}) }
  • 접근성(모달 포커스, 라벨)

    • 근거: ConfirmModal이 새로 도입되어 접근성 영향 가능.
    • 확인: 모달 열기 시 포커스 트랩, 스크린리더용 title/description 제공, 버튼 라벨이 명확한지 검토하세요.
    • 대안: DialogTitle/Description에 aria-labelledby/aria-describedby 설정을 명시적으로 추가하고, 확인/취소 버튼에 aria-label을 달아 테스트하세요.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확하게 요약합니다. 대표자명 필드 추가와 예외 처리 보완이라는 두 가지 주요 변경을 간결하게 표현합니다.
Description check ✅ Passed PR 설명에서 개요, 관련 이슈, 작업내용, 변경사항, 체크리스트가 모두 포함되어 있습니다. 템플릿의 주요 섹션을 충분히 작성했습니다.
Linked Issues check ✅ Passed 코드 변경이 이슈 #102의 요구사항을 충족합니다. 대표자명 필드 추가(스키마, 폼, 타입 정의), 409 에러 시 confirm 모달 처리, 필요한 모든 파일 수정이 포함되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #102의 범위 내에 있습니다. ConfirmModal 컴포넌트 확장은 409 처리 모달 기능을 위한 필수 변경이므로 범위 내입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/businessAuth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/types/store.ts (1)

72-72: 콜론 뒤 공백 누락 (스타일 일관성)

같은 파일 내 다른 프로퍼티들(businessNumber: string, startDate: string)과 달리 콜론 뒤 공백이 없어요.

✏️ 제안 수정
-  name:string;
+  name: string;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/types/store.ts` at line 72, Fix the missing space after the colon for the
name property in the Store type/interface: change the declaration of the
property symbol "name" from using "name:string" to match the file's style (e.g.,
"name: string") so it is consistent with other properties like "businessNumber:
string" and "startDate: string".
src/components/store-registration/BusinessAuth.schema.ts (1)

4-8: Zod v4에서 문자열 메시지 단축 형식이 deprecated됐어요 (선택적 개선)

Zod v4에서 기존 message 파라미터는 아직 동작하지만 deprecated 처리됐습니다. .min(5, "Too short!") 같은 문자열 단축 형식은 동작하지만, Zod v4의 권장 방식은 { error: "..." } 객체 형태입니다.

기존 businessNumber, startDate 필드도 같은 패턴을 쓰고 있어서 한꺼번에 마이그레이션하면 좋을 것 같아요.

♻️ Zod v4 권장 방식으로 변경
  name: z
    .string()
-   .min(1, "대표자명을 입력해주세요.")
-   .min(2, "2자 이상이어야 합니다.")
-   .max(20, "20자 이하이어야 합니다."),
+   .min(1, { error: "대표자명을 입력해주세요." })
+   .min(2, { error: "2자 이상이어야 합니다." })
+   .max(20, { error: "20자 이하이어야 합니다." }),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/BusinessAuth.schema.ts` around lines 4 - 8,
Update the Zod validation calls in BusinessAuth.schema.ts to use the Zod v4
object-style error argument instead of the deprecated string shorthand: replace
usages like name.string().min(1, "대표자명을 입력해주세요.").min(2, "2자 이상이어야
합니다.").max(20, "20자 이하이어야 합니다.") with the object form for each constraint (e.g.,
.min(1, { error: "..." }), .min(2, { error: "..." }), .max(20, { error: "..."
})), and apply the same change to the other fields using the shorthand such as
businessNumber and startDate so all .min/.max/.etc calls use the { error: "..."
} payload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 78-93: The code currently uses the native confirm() inside
StepBusinessAuth (the block that calls confirm and then
setIsVerified/onComplete), which blocks the main thread and breaks
accessibility/UX; replace this with your ConfirmModal component by adding local
state (e.g., showConfirmModal) in StepBusinessAuth, open it instead of calling
confirm(), and move the confirm/cancel logic into the modal’s onConfirm and
onCancel handlers to call setIsVerified(true)/onComplete({...}) or
setIsVerified(false) respectively; ensure you remove the synchronous confirm()
call from any onError or async handlers so the flow is fully asynchronous and
consistent with StoreRegistrationPage’s modal usage.

---

Nitpick comments:
In `@src/components/store-registration/BusinessAuth.schema.ts`:
- Around line 4-8: Update the Zod validation calls in BusinessAuth.schema.ts to
use the Zod v4 object-style error argument instead of the deprecated string
shorthand: replace usages like name.string().min(1, "대표자명을 입력해주세요.").min(2, "2자
이상이어야 합니다.").max(20, "20자 이하이어야 합니다.") with the object form for each constraint
(e.g., .min(1, { error: "..." }), .min(2, { error: "..." }), .max(20, { error:
"..." })), and apply the same change to the other fields using the shorthand
such as businessNumber and startDate so all .min/.max/.etc calls use the {
error: "..." } payload.

In `@src/types/store.ts`:
- Line 72: Fix the missing space after the colon for the name property in the
Store type/interface: change the declaration of the property symbol "name" from
using "name:string" to match the file's style (e.g., "name: string") so it is
consistent with other properties like "businessNumber: string" and "startDate:
string".

Comment thread src/components/store-registration/StepBusinessAuth.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
src/components/store-registration/StepBusinessAuth.tsx (3)

123-125: className에 불필요한 공백이 있어요 (사소한 닛픽)

"text-black font-bold" 에 스페이스가 두 개 들어가 있어요. 기능에는 영향이 없지만 깔끔하게 정리해두는 게 좋아요.

-            <span className="text-black  font-bold">
+            <span className="text-black font-bold">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 123 -
125, In StepBusinessAuth locate the span element that currently has
className="text-black  font-bold" and remove the extra space so the className
reads "text-black font-bold"; this is the span inside the StepBusinessAuth
component that renders the warning text and adjusting the className string will
clean up the unnecessary double space.

149-224: 반복되는 onChange 패턴 — 헬퍼로 추출하면 깔끔해져요 (선택 사항)

name, businessNumber, startDate 세 필드 모두 isVerified 상태에서 setIsVerified(false) + onComplete(...) 를 호출하는 거의 동일한 패턴이에요. 인증 해제 로직이 변경될 때 세 군데를 수정해야 하는 부담이 있어요.

♻️ 헬퍼 함수로 리팩토링하는 방법
+ const handleVerifiedFieldChange = (
+   fieldValues: Partial<BusinessAuthFormValues>,
+ ) => {
+   if (!isVerified) return;
+   setIsVerified(false);
+   onComplete({
+     name: fieldValues.name ?? name,
+     businessNumber: fieldValues.businessNumber ?? businessNumber,
+     startDate: fieldValues.startDate ?? startDate,
+     isVerified: false,
+   });
+ };

  // name 필드
  {...register("name", {
-   onChange: (e) => {
-     if (isVerified) {
-       setIsVerified(false);
-       onComplete({ name: e.target.value, businessNumber, startDate, isVerified: false });
-     }
-   },
+   onChange: (e) => handleVerifiedFieldChange({ name: e.target.value }),
  })}

  // businessNumber 필드
  {...register("businessNumber", {
-   onChange: (e) => {
-     if (isVerified) {
-       setIsVerified(false);
-       onComplete({ name, businessNumber: e.target.value, startDate, isVerified: false });
-     }
-   },
+   onChange: (e) => handleVerifiedFieldChange({ businessNumber: e.target.value }),
  })}

  // startDate 필드
  {...register("startDate", {
-   onChange: (e) => {
-     if (isVerified) {
-       setIsVerified(false);
-       onComplete({ name, businessNumber, startDate: e.target.value, isVerified: false });
-     }
-   },
+   onChange: (e) => handleVerifiedFieldChange({ startDate: e.target.value }),
  })}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 149 -
224, Extract the repeated onChange logic into a helper (e.g., a local function
like handleFieldChange) and use it for register callbacks for name,
businessNumber, and startDate: implement a function that accepts the field key
and returns an onChange handler which checks isVerified, calls
setIsVerified(false) and calls onComplete with the updated field value and
current other fields; then replace the inline onChange objects in
{...register("name", {...})}, {...register("businessNumber", {...})}, and
{...register("startDate", {...})} to use this helper so the shared logic
(isVerified, setIsVerified, onComplete) is centralized.

87-87: alert()도 추후 커스텀 토스트/모달로 교체 고려해보세요

409 처리가 ConfirmModal로 잘 교체됐는데, 다른 에러 케이스(Line 87)에 여전히 네이티브 alert()가 남아 있어요. 이 PR 범위를 넘어서는 내용이지만, 추후 프로젝트의 토스트 또는 알림 컴포넌트로 통일하면 UX·접근성 측면에서 일관성이 생겨요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` at line 87, The
native alert(getErrorMessage(error)) call in StepBusinessAuth should be replaced
with the project's unified notification component (e.g., use the existing
ConfirmModal or the app toast utility) so error handling is consistent; locate
the alert call in StepBusinessAuth and swap it to invoke the modal/toast API
with the same getErrorMessage(error) text and appropriate severity/OK action
(mirror how 409 uses ConfirmModal) to ensure UX/accessibility consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/store-registration/ConfirmModal.tsx`:
- Around line 47-62: The confirm and cancel <button> elements in
ConfirmModal.tsx currently rely on default button behavior (which is "submit")
and can inadvertently submit enclosing forms; update the two buttons that call
onConfirm and onClose (the elements rendering confirmLabel and cancelLabel) to
explicitly include type="button" to prevent accidental form submissions when
this component is used inside a form.

In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 147-235: The three inputs (id="name", id="businessNumber",
id="startDate" registered via register(...)) lack ARIA linkage to their error
<p> elements; update each input to include aria-describedby that points to a
unique error id (e.g. "name-error", "businessNumber-error", "startDate-error")
when an error exists, and add role="alert" to the corresponding error <p>
elements (errors.name && touchedFields.name -> <p id="name-error" role="alert">,
etc.) so screen readers announce validation messages; ensure the
aria-describedby is only present when the error is rendered to avoid referencing
non-existent IDs.

---

Nitpick comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 123-125: In StepBusinessAuth locate the span element that
currently has className="text-black  font-bold" and remove the extra space so
the className reads "text-black font-bold"; this is the span inside the
StepBusinessAuth component that renders the warning text and adjusting the
className string will clean up the unnecessary double space.
- Around line 149-224: Extract the repeated onChange logic into a helper (e.g.,
a local function like handleFieldChange) and use it for register callbacks for
name, businessNumber, and startDate: implement a function that accepts the field
key and returns an onChange handler which checks isVerified, calls
setIsVerified(false) and calls onComplete with the updated field value and
current other fields; then replace the inline onChange objects in
{...register("name", {...})}, {...register("businessNumber", {...})}, and
{...register("startDate", {...})} to use this helper so the shared logic
(isVerified, setIsVerified, onComplete) is centralized.
- Line 87: The native alert(getErrorMessage(error)) call in StepBusinessAuth
should be replaced with the project's unified notification component (e.g., use
the existing ConfirmModal or the app toast utility) so error handling is
consistent; locate the alert call in StepBusinessAuth and swap it to invoke the
modal/toast API with the same getErrorMessage(error) text and appropriate
severity/OK action (mirror how 409 uses ConfirmModal) to ensure UX/accessibility
consistency.

Comment thread src/components/store-registration/ConfirmModal.tsx
Comment thread src/components/store-registration/StepBusinessAuth.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/store-registration/StepBusinessAuth.tsx (1)

2-2: ⚠️ Potential issue | 🟡 Minor

프로젝트의 Label 컴포넌트를 사용해서 스타일 일관성을 유지해주세요

src/components/ui/label.tsx는 Radix Label을 래핑해서 프로젝트의 디자인 시스템 스타일(텍스트 크기, 갭, 폰트 굵기, 비활성 상태 처리 등)을 적용하고 있어요. 지금은 원본 Radix를 직접 사용하고 있어서 이 스타일들이 빠지고 있습니다.

-import { Label } from "@radix-ui/react-label";
+import { Label } from "@/components/ui/label";

2번 라인의 import와 143~146번 라인의 사용처를 함께 수정하면 돼요. 팀의 UI 기준을 맞추는 작은 정리이니까 함께 처리해주세요 😊

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` at line 2, Replace
the Radix Label import and usages with the project's wrapped Label component to
restore design-system styles: change the import in StepBusinessAuth from
"@radix-ui/react-label" to the project's Label component and update the JSX
where Label is used (the Label element in StepBusinessAuth) to use the wrapped
Label, preserving props like htmlFor and className so existing
behavior/associations remain the same.
🧹 Nitpick comments (2)
src/components/store-registration/StepBusinessAuth.tsx (2)

123-123: className에 공백이 두 개 들어가 있어요 (minor nitpick)

-              <span className="text-black  font-bold">
+              <span className="text-black font-bold">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` at line 123, In
StepBusinessAuth.tsx fix the minor formatting typo in the span's className
attribute: replace the double space in the class string "text-black  font-bold"
with a single space so it becomes "text-black font-bold" (locate the span
element where className is set and update the string accordingly).

79-88: OWNER409 이외의 에러는 여전히 alert()을 쓰고 있어서 UX 불일치가 생겨요

이번 PR에서 OWNER409 케이스는 ConfirmModal로 개선됐는데, 나머지 에러는 alert()으로 처리되고 있어요. 같은 onError 블록 안에서 두 가지 다른 UX 패턴이 공존하게 됩니다. 추후 리팩토링 시 에러 알림도 토스트(toast)나 모달 등 프로젝트 디자인 시스템에 맞는 컴포넌트로 통일하는 것을 권장해요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 79 - 88,
In the onError handler for StepBusinessAuth replace the plain
alert(getErrorMessage(error)) so non-OWNER409 errors use the same project UX as
OWNER409 (modal/toast) — e.g., invoke the shared error notification flow (toast
or an error modal) instead of alert; keep the existing OWNER409 branch that
calls setPendingData(data) and only change the fallback branch where
setIsVerified(false) currently precedes alert, calling the centralized
notification API/component used elsewhere in the app (match the
ConfirmModal/toast pattern) and pass getErrorMessage(error) as the message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Line 2: Replace the Radix Label import and usages with the project's wrapped
Label component to restore design-system styles: change the import in
StepBusinessAuth from "@radix-ui/react-label" to the project's Label component
and update the JSX where Label is used (the Label element in StepBusinessAuth)
to use the wrapped Label, preserving props like htmlFor and className so
existing behavior/associations remain the same.

---

Duplicate comments:
In `@src/components/store-registration/ConfirmModal.tsx`:
- Around line 47-64: Buttons in ConfirmModal now correctly include type="button"
on both action elements; no change needed — keep the two button elements with
handlers onConfirm and onClose, labels confirmLabel and cancelLabel, and the
variant-based class on the confirm button as-is to preserve the fixed behavior
and prevent accidental form submissions.

In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 37-39: The change replacing window.confirm with the ConfirmModal
and the pendingData-based async flow is good; apply the same fix to the other
duplicate block (the second occurrence in StepBusinessAuth.tsx around the
pendingData/state and modal handling between lines ~92-131): ensure the
duplicate pendingData state and its usage mirror the first one
(useState<BusinessAuthFormValues | null>(null)), update the corresponding
handler (handleConfirm409) to setIsVerified → onComplete → setPendingData(null)
in that duplicate, and make onClose also reset isVerified, so both places use
the ConfirmModal and identical state/flow semantics.
- Around line 147-270: The review contains a duplicate reviewer tag—keep the
approval ([approve_code_changes]) and remove the duplicate marker
([duplicate_comment]); no code changes are required for the input fields (ids:
"name", "businessNumber", "startDate") or their ARIA attributes, just update the
PR review body to delete the redundant "[duplicate_comment]" entry so only the
single approval remains.

---

Nitpick comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Line 123: In StepBusinessAuth.tsx fix the minor formatting typo in the span's
className attribute: replace the double space in the class string "text-black 
font-bold" with a single space so it becomes "text-black font-bold" (locate the
span element where className is set and update the string accordingly).
- Around line 79-88: In the onError handler for StepBusinessAuth replace the
plain alert(getErrorMessage(error)) so non-OWNER409 errors use the same project
UX as OWNER409 (modal/toast) — e.g., invoke the shared error notification flow
(toast or an error modal) instead of alert; keep the existing OWNER409 branch
that calls setPendingData(data) and only change the fallback branch where
setIsVerified(false) currently precedes alert, calling the centralized
notification API/component used elsewhere in the app (match the
ConfirmModal/toast pattern) and pass getErrorMessage(error) as the message.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/store-registration/StepBusinessAuth.tsx (1)

79-88: ⚠️ Potential issue | 🟠 Major

alert() 여전히 사용 중 — confirm()과 동일한 접근성 문제예요

OWNER409 경로는 ConfirmModal로 잘 교체됐는데, line 87의 일반 오류 처리에는 네이티브 alert()이 그대로 남아 있어요. 이 역시:

  • 스크린 리더와 ARIA 연동이 없고,
  • 메인 스레드를 블로킹하며,
  • 일부 모바일/PWA 환경에서 억제될 수 있습니다.

인라인 에러 메시지 상태나 토스트 알림으로 교체하는 걸 권장해요.

🛡️ 인라인 에러 상태로 교체하는 예시
+  const [errorMessage, setErrorMessage] = useState<string | null>(null);

   const onSubmit = async (data: BusinessAuthFormValues) => {
     verifyOwner(data, {
       onError: (error) => {
         const err = error as any;
         const serverCode = err.response?.data?.code || err.code;
         if (serverCode === "OWNER409") {
           setPendingData(data);
           return;
         }
         setIsVerified(false);
-        alert(getErrorMessage(error));
+        setErrorMessage(getErrorMessage(error));
       },
     });
   };

그리고 폼 상단 또는 버튼 위에 에러 메시지를 렌더링:

+  {errorMessage && (
+    <p role="alert" aria-live="assertive" className="text-red-500 text-sm text-center">
+      {errorMessage}
+    </p>
+  )}
   <button type="submit" ...>

As per coding guidelines, src/components/**에 적용되는 "접근성(aria) 체크" 규칙에 따라 네이티브 블로킹 다이얼로그 대신 ARIA 지원이 있는 대안을 사용해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 79 - 88,
The onError handler currently calls the native alert(getErrorMessage(error))
which is inaccessible and blocks the main thread; replace this with an
ARIA-friendly inline error UI or a toast call instead: add or reuse a state
(e.g., errorMessage / setErrorMessage) in StepBusinessAuth and set it inside
onError (after setIsVerified(false)) or invoke the app's toast helper (e.g.,
showToast or notify) with getErrorMessage(error); ensure OWNER409 branch remains
using setPendingData(data) and that the error UI is rendered in the component
(near the form or button) with proper role="alert" so screen readers announce
it.
🧹 Nitpick comments (1)
src/components/store-registration/StepBusinessAuth.tsx (1)

123-125: className에 공백 하나 남아 있어요 (닛픽)

"text-black font-bold"에 스페이스가 두 개 들어가 있어요. 기능상 문제는 없지만 Prettier 등으로 정리하면 깔끔해집니다.

✨ 수정 예시
-              <span className="text-black  font-bold">
+              <span className="text-black font-bold">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 123 -
125, In StepBusinessAuth.tsx update the span's className value to remove the
duplicate space so it reads "text-black font-bold" (locate the span inside the
component StepBusinessAuth and the JSX snippet currently using
className="text-black  font-bold"); just normalize the whitespace in that
className string (or run Prettier/formatter) so there is a single space between
class names.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 274-281: The success banner rendered in StepBusinessAuth.tsx when
!isPending && isVerified lacks an aria-live attribute so screen readers won't
announce the dynamic message; update the outer success div (the one with
className "bg-green-50 border border-green-200 rounded-lg p-4") to include an
appropriate live region like aria-live="polite" (and consider aria-atomic="true"
or role="status") so the message is announced when isVerified becomes true,
keeping the attribute only on the rendered banner for that condition.

---

Outside diff comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 79-88: The onError handler currently calls the native
alert(getErrorMessage(error)) which is inaccessible and blocks the main thread;
replace this with an ARIA-friendly inline error UI or a toast call instead: add
or reuse a state (e.g., errorMessage / setErrorMessage) in StepBusinessAuth and
set it inside onError (after setIsVerified(false)) or invoke the app's toast
helper (e.g., showToast or notify) with getErrorMessage(error); ensure OWNER409
branch remains using setPendingData(data) and that the error UI is rendered in
the component (near the form or button) with proper role="alert" so screen
readers announce it.

---

Nitpick comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 123-125: In StepBusinessAuth.tsx update the span's className value
to remove the duplicate space so it reads "text-black font-bold" (locate the
span inside the component StepBusinessAuth and the JSX snippet currently using
className="text-black  font-bold"); just normalize the whitespace in that
className string (or run Prettier/formatter) so there is a single space between
class names.

Comment thread src/components/store-registration/StepBusinessAuth.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/components/store-registration/StepBusinessAuth.tsx (2)

83-87: alert() 도 ConfirmModal/토스트 알림으로 교체하면 더 일관성 있어요 🎨

OWNER409 케이스는 ConfirmModal로 잘 교체됐는데, 그 외 에러 케이스(L87)에는 여전히 네이티브 alert()를 쓰고 있어서 UX와 접근성이 일치하지 않아요. 스크린 리더 통합, 모바일 브라우저 동작, UI 일관성 측면에서 동일한 문제가 남아 있어요.

프로젝트에 토스트 라이브러리가 있다면 그쪽으로, 아니면 에러 전용 모달/인라인 메시지로 교체하는 걸 추천해요.

♻️ 예시: 에러 상태를 컴포넌트 내에서 처리하는 방식
+  const [errorMessage, setErrorMessage] = useState<string | null>(null);

   ...

   onError: (error) => {
     const err = error as any;
     const serverCode = err.response?.data?.code || err.code;
     if (serverCode === "OWNER409") {
       setPendingData(data);
       return;
     }
     setIsVerified(false);
-    alert(getErrorMessage(error));
+    setErrorMessage(getErrorMessage(error));
   },

그리고 JSX 에서:

+{errorMessage && (
+  <p role="alert" aria-live="assertive" className="text-red-500 text-sm">
+    {errorMessage}
+  </p>
+)}

As per coding guidelines, src/components/**에 적용되는 "접근성(aria) 체크" 규칙에 따라 네이티브 alert() 대신 접근성 친화적인 방식을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 83 - 87,
The code in StepBusinessAuth currently calls the native
alert(getErrorMessage(error)) after setIsVerified(false); replace this alert
with the app's accessible UI error pattern: either call the project's
toast/error API (e.g., toast.error(getErrorMessage(error))) or set a component
error state (e.g., setErrorMessage/getErrorMessage + setShowErrorModal) and
render an accessible ConfirmModal/ErrorModal instead; update the handler where
setIsVerified(false) is used to invoke that toast or set the modal state so
OWNER409 already-handled flow stays consistent with other error paths and
aria/accessibility rules for src/components/**.

92-131: OWNER409 ConfirmModal 통합 잘 됐어요! 이전 리뷰 피드백 완벽하게 반영됐네요 ✅

pendingData → 모달 → handleConfirm409 흐름이 깔끔하고, 취소 시 setIsVerified(false) 처리도 올바르게 됐어요.

한 가지 아주 작은 거: L123에 text-black font-bold 사이에 공백이 두 개 있어요.

-              <span className="text-black  font-bold">
+              <span className="text-black font-bold">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/store-registration/StepBusinessAuth.tsx` around lines 92 -
131, Minor CSS class typo: remove the duplicate space in the className string
used in the ConfirmModal description. Edit the JSX in StepBusinessAuth where
ConfirmModal's description contains <span className="text-black  font-bold"> and
change the className to "text-black font-bold" (refer to the ConfirmModal usage
and the span inside the description, and you may verify behavior via
pendingData, handleConfirm409 and setIsVerified flows).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/store-registration/StepBusinessAuth.tsx`:
- Around line 83-87: The code in StepBusinessAuth currently calls the native
alert(getErrorMessage(error)) after setIsVerified(false); replace this alert
with the app's accessible UI error pattern: either call the project's
toast/error API (e.g., toast.error(getErrorMessage(error))) or set a component
error state (e.g., setErrorMessage/getErrorMessage + setShowErrorModal) and
render an accessible ConfirmModal/ErrorModal instead; update the handler where
setIsVerified(false) is used to invoke that toast or set the modal state so
OWNER409 already-handled flow stays consistent with other error paths and
aria/accessibility rules for src/components/**.
- Around line 92-131: Minor CSS class typo: remove the duplicate space in the
className string used in the ConfirmModal description. Edit the JSX in
StepBusinessAuth where ConfirmModal's description contains <span
className="text-black  font-bold"> and change the className to "text-black
font-bold" (refer to the ConfirmModal usage and the span inside the description,
and you may verify behavior via pendingData, handleConfirm409 and setIsVerified
flows).

@jjjsun jjjsun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 확인했습니다! 고생하셨어요!!

@dew102938 dew102938 merged commit f005f72 into develop Feb 19, 2026
3 checks passed
@jjjsun jjjsun deleted the feat/businessAuth branch February 19, 2026 18:01
@jjjsun jjjsun added 🔨 Refactor 코드 리팩토링 ✨ Feature 새로운 기능 추가 labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 추가 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 사업자 인증 대표자명 필드 추가

2 participants