feat(inventory): 재고 현황 요약/상세 플로우를 릴리스
- lib/features/inventory/summary 계층과 warehouse select 위젯을 추가해 목록/상세, 자동 새로고침, 필터, 상세 시트를 구현 - PermissionBootstrapper, scope 파서, 라우트 가드로 inventory.view 기반 권한 부여와 메뉴 노출을 통합(lib/core, lib/main.dart 등) - Inventory Summary API/QA/Audit 문서와 PR 템플릿, CHANGELOG를 신규 스펙과 검증 커맨드로 업데이트 - DTO 직렬화 의존성을 추가하고 Golden·Widget·단위 테스트를 작성했으며 flutter analyze / flutter test --coverage를 통과
This commit is contained in:
45
doc/qa/inventory_data_replay.md
Normal file
45
doc/qa/inventory_data_replay.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# 재고 요약 데이터 재현 가이드 (프런트 참조)
|
||||
|
||||
> 백엔드 원본: `../superport_api_v2/doc/qa/inventory_data_replay.md` – QA/프런트 협업용 요약.
|
||||
|
||||
## 목적
|
||||
- 스테이징/로컬에서 `/api/v1/inventory/summary` 계약을 검증할 때 동일한 데이터 세트를 확보한다.
|
||||
|
||||
## 순서 요약
|
||||
1. **마이그레이션 실행**
|
||||
```bash
|
||||
for file in migration/0*_*.sql migration/1*_*.sql; do
|
||||
psql "$DATABASE_URL" --set ON_ERROR_STOP=1 -f "$file"
|
||||
done
|
||||
```
|
||||
2. **QA 시드 재적재**
|
||||
```bash
|
||||
psql "$DATABASE_URL" --set ON_ERROR_STOP=1 -f migration/120_seed_inventory_summary.sql
|
||||
```
|
||||
3. **마테뷰 리프레시**
|
||||
```bash
|
||||
../superport_api_v2/script/refresh_inventory_mv.sh --database-url "$DATABASE_URL"
|
||||
```
|
||||
4. **정합성 SQL**
|
||||
```sql
|
||||
SELECT product_id, total_quantity,
|
||||
SUM((wb->>'quantity')::numeric) AS warehouse_sum
|
||||
FROM inventory_balance_snapshots
|
||||
CROSS JOIN LATERAL jsonb_array_elements(warehouse_balances) AS wb
|
||||
GROUP BY product_id, total_quantity
|
||||
HAVING SUM((wb->>'quantity')::numeric) <> total_quantity;
|
||||
```
|
||||
5. **API 스팟 체크**
|
||||
```bash
|
||||
curl -H "Authorization: Bearer <token>" \
|
||||
"$API_BASE/api/v1/inventory/summary?page=1&page_size=50"
|
||||
```
|
||||
|
||||
## 롤백
|
||||
1. `DROP MATERIALIZED VIEW IF EXISTS inventory_balance_snapshots;`
|
||||
2. `DROP MATERIALIZED VIEW IF EXISTS inventory_balance_events_view;`
|
||||
3. 110/115 마이그레이션 재실행 → 리프레시 → 120 시드 재적재.
|
||||
|
||||
## 프런트 활용 팁
|
||||
- QA가 위 절차로 데이터를 복원했다는 확인을 받은 뒤 UI/Golden 테스트를 실행한다.
|
||||
- `last_refreshed_at` 값(응답 필드)을 QA 케이스에 기록해 자동 새로고침 UX 기준으로 활용한다.
|
||||
Reference in New Issue
Block a user