백로그
0할 일
0진행 중
0리뷰
0완료 (30일)
3프로필 탭 네비게이션 + 라우트 + i18n
## 목표 프로필 페이지에 탭 네비게이션(내 정보/결제/크레딧)을 구현하고, 라우트와 i18n을 설정합니다. ## 완료 기준 1. `app/views/shared/_profile_tabs.html.erb` 탭 partial 생성 - 3개 탭: 내 정보(profile_path), 결제(payments_path), 크레딧(credits_path) - 현재 페이지 활성 탭 표시 (Tailwind CSS) - 모바일/데스크탑 반응형 2. `app/views/profiles/show.html.erb` 수정 - 기존 프로필 정보 위에 탭 네비게이션 추가 - 기존 UI 유지하면서 탭 통합 3. `config/routes.rb` 수정 - `resources :credits, only: [:index]` 추가 (locale scope 내) 4. i18n 키 추가 (4개 언어: ko, en, zh, vi) - `config/locales/ko.yml`: profile.tabs.info, profile.tabs.payments, profile.tabs.credits - `config/locales/en.yml`, `zh.yml`, `vi.yml` 동일 구조 5. 통합 테스트 작성 ## 담당 파일 (이 파일만 수정) - `app/views/shared/_profile_tabs.html.erb` (신규) - `app/views/profiles/show.html.erb` (수정) - `config/routes.rb` (수정) - `config/locales/ko.yml` (수정) - `config/locales/en.yml` (수정) - `config/locales/zh.yml` (수정) - `config/locales/vi.yml` (수정) - `test/integration/profile_tabs_test.rb` (신규)
개인 크레딧 페이지 생성
## 목표 개인 크레딧 잔액 및 거래 내역을 보여주는 페이지를 생성합니다. ## 완료 기준 1. `app/controllers/credits_controller.rb` 생성 - layout "authenticated" - index 액션: Current.user의 크레딧 잔액 + CreditTransaction 내역 (최신순) - require_authentication 적용 2. `app/views/credits/index.html.erb` 생성 - 상단: `shared/_profile_tabs` partial 렌더 (탭 네비게이션) - 크레딧 잔액 카드 (큰 숫자로 표시) - 거래 내역 테이블: 날짜, 유형(purchase/usage/admin_grant/refund), 설명, 변동량(+/-), 잔액 - 변동량: 양수는 초록, 음수는 빨강 - 빈 상태 처리 (거래 내역 없을 때) - Tailwind CSS, 기존 shared/_card partial 활용 3. 통합 테스트 작성 - 로그인 후 크레딧 페이지 접근 가능 - 크레딧 잔액 표시 확인 - 거래 내역 표시 확인 ## 참고: 기존 모델 - UserCredit: user_id(unique), balance(integer) - CreditTransaction: user_id, amount, balance_after, transaction_type, description, payment_id, diagnosis_session_id - User#credit_balance: credit&.balance || 0 - User#ensure_credit!: credit || create_credit!(balance: 0) ## 담당 파일 (이 파일만 수정/생성) - `app/controllers/credits_controller.rb` (신규) - `app/views/credits/index.html.erb` (신규) - `test/controllers/credits_controller_test.rb` (신규) ## 주의사항 - `shared/_profile_tabs` partial은 agent-nav가 생성합니다. 해당 파일이 아직 없으면, 탭 partial 렌더링 부분을 주석 처리하고 나중에 통합하세요. - routes.rb는 agent-nav가 수정합니다. credits 라우트가 이미 추가되어 있을 것입니다. - i18n 키는 agent-nav가 관리합니다. t() 호출은 사용하되, locales 파일은 직접 수정하지 마세요.
결제 내역 UI 개선 + 취소 정책
## 목표 결제 내역 페이지에 프로필 탭을 적용하고, 영수증 링크를 강화하며, 리포트 결제 취소 불가 정책을 구현합니다. ## 완료 기준 ### 1. 결제 내역 UI 개선 - `app/views/payments/index.html.erb` 수정 - 상단에 `shared/_profile_tabs` partial 렌더 (탭 네비게이션) - 각 결제 항목에 영수증 링크 표시 (receipt_url이 있으면) - 취소 불가 상품은 "취소불가" 배지 표시 - `app/views/payments/show.html.erb` 수정 - 상단에 `shared/_profile_tabs` partial 렌더 - 리포트 결제일 경우 취소 버튼 대신 "리포트 결제는 취소할 수 없습니다" 안내 ### 2. 리포트 결제 취소 불가 정책 - `app/models/payment.rb` 수정 - `refundable?` 메서드에 `payment_type != "REPORT"` 조건 추가 - 즉: completed && not canceled && 7일 이내 && payment_type != "REPORT" - `app/services/payments/cancellation_service.rb` 수정 (필요시) - 리포트 결제 취소 요청 시 명확한 에러 메시지 ### 3. 테스트 - Payment#refundable? 테스트: 리포트 결제는 false 반환 - CancellationService 테스트: 리포트 결제 취소 거부 - 통합 테스트: 결제 내역 페이지 탭 표시, 리포트 결제 취소 버튼 미표시 ## 참고: 기존 코드 - Payment.payment_type: REPORT, CAREER_UP, PREMIUM, ANALYSIS_CREDIT, PACKAGE, WORKSHOP, STRENGTH_DIARY, CUSTOM - Payment#refundable?: completed? && canceled_at.nil? && approved_at > 7.days.ago - receipt_url 컬럼이 이미 존재 ## 담당 파일 (이 파일만 수정) - `app/views/payments/index.html.erb` (수정) - `app/views/payments/show.html.erb` (수정) - `app/models/payment.rb` (수정) - `app/services/payments/cancellation_service.rb` (수정, 필요시) - `test/models/payment_test.rb` (수정/생성) - `test/services/payments/cancellation_service_test.rb` (수정/생성) - `test/integration/payments_profile_tab_test.rb` (신규) ## 주의사항 - `shared/_profile_tabs` partial은 agent-nav가 생성합니다. 아직 없으면 주석 처리 후 나중에 통합. - i18n 키는 agent-nav가 관리합니다. t() 호출은 사용하되, locales 파일은 직접 수정하지 마세요. - routes.rb는 수정하지 마세요 (agent-nav 담당)