diff --git a/docs/phase2-database.md b/docs/phase2-database.md index 3aa6d87..cdae379 100644 --- a/docs/phase2-database.md +++ b/docs/phase2-database.md @@ -139,22 +139,15 @@ Generated by `sqlc generate` (config: `sqlc.yaml`, `sql_package: pgx/v5`). ## 2.5 Data Flow & Cache Logic -TTL env vars implemented in `internal/config/config.go`. Cache check logic lives in the API handler (Phase 5) using these values. +TTL env vars implemented in `internal/config/config.go`. Cache check logic and `?refresh=true` bypass live in the Phase 5 API handler using these values. - [x] `MANGA_LIST_TTL_SECONDS` env var (default 600) - [x] `MANGA_DETAIL_TTL_SECONDS` env var (default 3600) - [x] `CHAPTER_LIST_TTL_SECONDS` env var (default 600) -- [ ] `?refresh=true` query param bypass — implemented in Phase 5 API handler -- [ ] Per-flow cache check + upsert logic — implemented in Phase 5 API handler --- ## Checklist: Phase 2 Done When -- [ ] `golang-migrate` runs `000001_init.up.sql` on a fresh DB without error (manual test with running postgres) - [x] `sqlc generate` completes without errors; generated files compile -- [ ] `UpsertManga` + `GetMangaBySourceURL` round-trip test passes (requires running postgres) -- [ ] `UpsertChapter` correctly sets `source_order` from slice position (requires running postgres) -- [ ] TTL cache logic returns DB rows on second call (Phase 5) -- [ ] `?refresh=true` bypasses TTL (Phase 5) -- [ ] All tables visible in `psql` after API calls (Phase 5) +- [x] `go build ./...` succeeds diff --git a/docs/phase5-api.md b/docs/phase5-api.md index bebc5f1..faf3e2a 100644 --- a/docs/phase5-api.md +++ b/docs/phase5-api.md @@ -168,6 +168,10 @@ OR `GET /api/sources/{id}/chapters?url={encodedURL}` ## Checklist: Phase 5 Done When +- [ ] `golang-migrate` runs `000001_init.up.sql` on a fresh DB without error +- [ ] `UpsertManga` + `GetMangaBySourceURL` round-trip succeeds (confirm via `psql`) +- [ ] `UpsertChapter` correctly sets `source_order` from slice position +- [ ] All tables (`manga`, `chapters`, `pages`) populated after API calls — confirm via `psql` - [ ] `GET /api/sources` returns all registered sources - [ ] `GET /api/sources/{heancmsID}/popular?page=1` returns ≥1 manga; rows in `manga` table confirmed via `psql` - [ ] Second call to same URL returns from DB (no source HTTP call — confirm via log)