백로그

0
티켓 없음

할 일

0
티켓 없음

진행 중

0
티켓 없음

리뷰

0
티켓 없음

완료 (전체)

3
높음 b4837b64
서브 티켓 상품 관리

Admin Products 라우트 + 컨트롤러 구현

Admin::ProductsController CRUD 구현 ## 수정 파일 - config/routes.rb: admin 네임스페이스에 resources :products 추가 (toggle_active member 라우트 포함) - app/controllers/admin/products_controller.rb: 새 파일 생성 ## 컨트롤러 요구사항 - Admin::BaseController 상속 (require_admin 자동 적용) - 액션: index, show, new, create, edit, update, toggle_active - index: 검색(q param, name ILIKE), 필터(product_type, active), 정렬(sort/direction), 페이지네이션(PER_PAGE=30) - show: @product with product_prices eager load - create/update: strong params (name, slug, description, price, currency, product_type, active, product_prices_attributes[id, currency, amount, _destroy]) - toggle_active: active 토글 후 redirect - accepts_nested_attributes_for :product_prices (모델에 추가 필요) - flash 메시지: notice/alert, i18n 키 사용 - 기존 Admin::WorkspacesController 패턴 참고 ## 완료 기준 - rails routes | grep admin/products 로 라우트 확인 - 컨트롤러 파일이 기존 패턴과 일관성 있음

B
backend-dev
11 days
높음 f716e9dd
서브 티켓 상품 관리

Admin Products 뷰 + 사이드바 + i18n 구현

Admin Products 뷰 파일, 사이드바 메뉴, i18n 번역 구현 ## 생성할 파일 - app/views/admin/products/index.html.erb - app/views/admin/products/show.html.erb - app/views/admin/products/new.html.erb - app/views/admin/products/edit.html.erb - app/views/admin/products/_form.html.erb ## 수정할 파일 - app/views/admin/shared/_sidebar.html.erb: products 메뉴 추가 (diagnosis_sessions와 workspaces 사이) - app/views/admin/shared/_nav_item.html.erb: products 아이콘 SVG 추가 (쇼핑백/상자 아이콘) - config/locales/ko.yml: admin.nav.products, admin.products.* 번역 키 추가 - config/locales/en.yml: 영문 번역 추가 ## 뷰 요구사항 ### index.html.erb - 기존 admin/workspaces/index.html.erb 패턴 참고 - 검색바 (name 검색) - 필터: product_type (report, credit_pack), active (true/false/all) - 테이블: slug, name, product_type, price, currency, active 상태 배지, 등록일 - 각 행에 show/edit 링크 - 페이지네이션 (shared/_pagination 파티션 사용) - 새 상품 등록 버튼 ### show.html.erb - 상품 기본 정보 카드 (name, slug, description, product_type, price, currency, active, metadata) - 다통화 가격 목록 (ProductPrice 테이블) - 편집/목록 버튼 ### _form.html.erb (new/edit 공유) - 필드: name, slug, description, price, currency (select), product_type (select), active (checkbox) - ProductPrice nested form: currency + amount 행 추가/삭제 가능 (Stimulus 없이 순수 HTML로) - 기존 shared 파티션(shared/_input, shared/_button, shared/_card) 활용 ### 사이드바 - icon key: "products" - i18n key: admin.nav.products - path: admin_products_path - active: controller_name == "products" ### i18n 키 (ko.yml) - admin.nav.products: "상품" - admin.products.title: "상품 관리" - admin.products.new_product: "새 상품 등록" - admin.products.edit_product: "상품 수정" - admin.products.form.*: 폼 라벨들 - admin.products.show.*: 상세 화면 라벨들 ## Tailwind CSS - 기존 admin 뷰와 동일한 디자인 시스템 사용 - 반응형 테이블, 상태 배지, 카드 레이아웃 ## 완료 기준 - 사이드바에 상품 메뉴가 표시됨 - 모든 뷰 파일이 기존 admin 패턴과 일관됨 - i18n 키가 누락 없이 등록됨

F
frontend-dev
11 days
높음 64f974e2
서브 티켓 상품 관리

Admin Products 통합 테스트 구현

Admin Products 통합 테스트 작성 ## 생성/수정할 파일 - test/integration/admin/products_test.rb: 새 파일 생성 - test/fixtures/products.yml: 기존 fixtures 확인 및 보완 - test/fixtures/product_prices.yml: 기존 fixtures 확인 및 보완 ## 테스트 요구사항 (Minitest) ### 인증/권한 테스트 - 비로그인 사용자 접근 시 로그인 페이지로 리다이렉트 - 일반 사용자 접근 시 접근 거부 - admin 사용자만 접근 가능 ### index 테스트 - 상품 목록 표시 - name 검색 (q 파라미터) - product_type 필터 - active 필터 - 정렬 (sort/direction 파라미터) ### CRUD 테스트 - new: 새 상품 폼 렌더링 - create: 유효한 파라미터로 상품 생성 - create: 무효한 파라미터(slug 중복 등)로 실패 - show: 상품 상세 + product_prices 표시 - edit: 편집 폼 렌더링 - update: 상품 정보 수정 - update: product_prices 추가/수정/삭제 ### toggle_active 테스트 - 활성 → 비활성 토글 - 비활성 → 활성 토글 ## 테스트 패턴 - 기존 test/integration/admin/workspaces_test.rb 패턴 참고 - sign_in_as(users(:admin_user)) 사용 - assert_response, assert_redirected_to, assert_difference 활용 - fixtures 기반 테스트 데이터 ## 완료 기준 - bin/rails test test/integration/admin/products_test.rb 통과 - 모든 CRUD + 필터 + 권한 테스트 커버

T
tester
11 days