fix(dashboard): 결품 집계에서 판정 제외(EXCLUDED) 품목 분리 — 128,250 중 63,930이 허수 - #69
Merged
Conversation
ai#38 로 inventory.status 에 EXCLUDED 가 생겼으나, 대시보드 stockoutItems 는 status 가 아니라 on_hand=0 만 보고 세고 있어 미운영·데이터누락 품목이 그대로 결품으로 잡혔다. 실측상 128,250 중 63,930(약 절반)이 허수였다. - stockoutItems: on_hand=0 AND status<>'EXCLUDED' → 실제 결품 64,320 - notOperatedItems 신설: on_hand=0 AND status='EXCLUDED' → 63,930 - REST(/dashboard)·GraphQL(CentralSummary) 양쪽에 노출 - schema.sql 의 status 주석에 EXCLUDED 를 추가하고, on_hand 기준 집계는 별도로 걸러야 한다는 점을 명시 검증: 운영 DB 로 수정 쿼리 실행해 위 수치 확인. py_compile 통과. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Open
4 tasks
choigod1023
marked this pull request as ready for review
August 7, 2026 02:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ai#38반영 후 대시보드 결품 집계가 절반이 허수인 상태여서 고쳤습니다.Related DGU-TeamLex/ai#38
inventory.status에EXCLUDED(판정 제외)가 생겼지만,stockoutItems는 status 가 아니라on_hand = 0만 보고 세고 있었습니다. 그래서 해당 기관이 취급하지도 않는 품목이 그대로 결품으로 잡혔습니다.stockoutItems(실제 결품)notOperatedItems(신설)belowRopItems수정 전 128,250 중 63,930(약 절반)이 미운영·데이터누락 품목이었습니다.
변경
stockoutItems=on_hand = 0 AND status <> 'EXCLUDED'notOperatedItems신설 =on_hand = 0 AND status = 'EXCLUDED'— 결품과 구분해 화면에 표기할 수 있게 별도 노출/dashboard)·GraphQL(CentralSummary) 양쪽에 반영schema.sql의status주석에EXCLUDED추가. 기존 주석이 "집계·정렬·프론트 라벨이 4값을 전제"라고 경고하고 있었는데, 그 경고가 가리키던 지점이 바로 이 집계였습니다. on_hand 기준 집계는 status 화이트리스트가 안 먹으니 별도로 걸러야 한다는 점을 명시했습니다.Type
Screenshots
To Reviewer
운영 DB 로 수정 쿼리를 실행해 위 수치를 확인했고
py_compile도 통과했습니다. 서버를 띄운 통합 테스트는 하지 않았습니다.알림 계열 쿼리(
/alerts/derived등)는status화이트리스트(CRITICAL/BELOW_ROP)를 쓰고 있어 이미 자동으로 걸러지므로 손대지 않았습니다. 이번에 문제가 된 건 status 를 안 보고on_hand만 보던 집계 한 곳입니다.frontend 에서
notOperatedItems를 어떻게 보여줄지는 별도 판단이 필요합니다 — 결품 카드 옆에 부가 표기하거나, 툴팁으로 "미운영·데이터누락 63,930건 제외됨"을 붙이는 방식을 제안합니다.PR Checklist