Skip to content

Persist EasyRoutes CSV uploads into Postgres#24

Merged
OziinG merged 1 commit intomainfrom
fix/issue-23-persist-csv-uploads
Apr 30, 2026
Merged

Persist EasyRoutes CSV uploads into Postgres#24
OziinG merged 1 commit intomainfrom
fix/issue-23-persist-csv-uploads

Conversation

@OziinG
Copy link
Copy Markdown
Contributor

@OziinG OziinG commented Apr 30, 2026

CLEVER PR review completion

  • target repo: EVNSolution/tomotono-route-console
  • target service: tomotono-route-console
  • target branch: main
  • source branch: fix/issue-23-persist-csv-uploads
  • project-start issue: pending
  • change-control issue: pending
  • target repo issue: Closes Persist EasyRoutes CSV uploads into Postgres #23

변경 내용

  • CSV import state를 process-memory store에서 Prisma/PostgreSQL 영속 저장으로 변경했습니다.
  • DeliveryImport, DeliveryDay, Driver, Order, Route, RouteStop, DeliveryTip, RouteReviewLog 조회/수정 경로를 DB-backed로 연결했습니다.
  • Next.js 페이지/API가 현재 DB 상태를 읽도록 async store와 dynamic rendering을 적용했습니다.
  • EasyRoutes CSV 변형 2종을 지원하도록 parser header mapping을 확장했습니다.
  • 날짜 컬럼 없는 EasyRoutes export는 America/Toronto 기준 fallback service date로 import되게 했습니다.
  • Prisma 7 PostgreSQL adapter를 추가하고 Docker build 중 prisma generate가 실행되게 했습니다.

PR Scope Grouping Gate

  • grouping decision: single-pr
  • same document/operating-rule cleanup: no
  • same validation command: yes, same app import/persistence validation set
  • different app/service/contract surface: no, one CSV import persistence bugfix across app/API/store/parser
  • merge order dependency: none
  • rollback unit: one deployable app rollback

검증

  • npm test: pass
  • npm run lint: pass
  • npx prisma validate: pass
  • npm run build: pass
  • git diff --check: pass
  • docker build --target runner -t tomotono-route-console:local-test .: pass
  • Local Docker Compose upload verification: dated EasyRoutes CSV imported 83 rows / 5 routes and API route totals showed 83 stops.
  • Local Docker Compose upload verification: date-less EasyRoutes CSV imported 82 rows / 1 route and DB counts showed 1 import / 1 route / 82 stops.

Concurrent Work Gate

  • parallel work decision: done
  • target repo issue: Persist EasyRoutes CSV uploads into Postgres #23
  • clever-change-control issue: pending
  • open PR checked: none open before PR creation
  • conflict candidates: none found
  • user-forced-proceed reason: n/a

PR 검토 에이전트 종료 조건

  • 검토 에이전트 작업은 wiki/service context 업데이트로 마친다.
  • PR 정보를 wiki에 올리지 않는다.
  • wiki에는 필요한 서비스 책임, public contract, deploy/runtime 기준, 운영 caveat, 빠른 탐색 요약만 반영한다.

Context/wiki completion

  • context docs checked:
    • clever-context-monorepo/docs/services/index.md
    • clever-context-monorepo/docs/wiki/index.md
  • wiki/service context update result: not-needed
  • service doc update: not-needed
  • wiki update: not-needed
  • clever-context-monorepo update: not-needed
  • not-needed reason: clever-context-monorepo services directory is a pointer and does not own runtime slice details; target repo docs/project-brief.md already declares Prisma/PostgreSQL persistence and CSV import scope. This PR implements that existing scoped contract without changing public external API shape.

Linked issue close evidence

  • linked issue close evidence: local validation completed; EC2 deployment and live CSV upload evidence will be added to Persist EasyRoutes CSV uploads into Postgres #23 after merge/deploy.
  • 이슈 종료는 PR 검토 완료 결과를 근거로 처리한다.
  • 이슈 종료 코멘트에는 wiki/service context 반영 결과 또는 불필요 사유를 이 PR에서 복사해 남긴다.

PR 기준

  • dev/main PR review criteria completed for this deploy merge unit.

Route console uploads were returning parsed data without making Postgres the source of truth. This keeps the existing replace-import MVP behavior while moving imported delivery days, routes, stops, orders, drivers, tips, and review state through Prisma, and covers both received EasyRoutes CSV header variants without committing raw files.

Constraint: Next.js 16 standalone Docker build must succeed without a live database during image build.
Constraint: Prisma 7 requires a PostgreSQL driver adapter at client construction.
Rejected: Store uploaded CSV state in process memory | process restarts and EC2 redeploys lose imported routes.
Rejected: Commit raw EasyRoutes CSV fixtures | files contain customer and operations data.
Confidence: high
Scope-risk: moderate
Directive: Keep raw customer CSV files out of the repo; use anonymized parser fixtures only.
Tested: npm test; npm run lint; npx prisma validate; npm run build; git diff --check; docker build --target runner -t tomotono-route-console:local-test .; local Docker Compose upload verification for both provided CSV files.
Not-tested: Google Maps paid API rendering because no production Maps key is present locally.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@OziinG OziinG force-pushed the fix/issue-23-persist-csv-uploads branch from c5b3ccb to 5fea13e Compare April 30, 2026 08:02
@OziinG OziinG merged commit 21206b8 into main Apr 30, 2026
2 checks passed
@OziinG OziinG deleted the fix/issue-23-persist-csv-uploads branch April 30, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist EasyRoutes CSV uploads into Postgres

1 participant