Files
quyun-v2/docs/seed_verification.md

2.5 KiB

Seed Verification Guide (Staging)

Service Startup (Local)

  • Backend: go run ./backend/main.go serve (default http://localhost:8080).
  • Portal frontend: npm -C frontend/portal install then npm -C frontend/portal run dev (default http://localhost:5174).
  • Superadmin frontend: npm -C frontend/superadmin install then npm -C frontend/superadmin run dev (default http://localhost:5173).
  • Portal dev server proxies /v1 to http://localhost:8080 (frontend/portal/vite.config.js).
  • Superadmin dev server proxies /super/v1 and /v1 to http://localhost:8080 (frontend/superadmin/vite.config.mjs).

Run Seed

  • Execute go run ./backend/main.go seed.
  • Ensure no panics; capture console output for troubleshooting.

Data Validation (DB/Logs)

  • Users: verify creator, test, superadmin, negative exist in users.username.
  • Tenant: read tenants.code to obtain tenantCode (DB query or admin UI).
  • Memberships: tenant_users includes creator as tenant_admin, test as member.
  • Orders: orders has content_purchase + withdrawal, plus flagged/reconciled records.
  • Ledger: tenant_ledgers has at least one row.
  • Templates: notification_templates contains order/audit/interaction types.

Portal Smoke (Use tenantCode)

  • Tenant code: query DB, then open http://localhost:5174/t/:tenantCode.
  • Login: OTP is fixed to 1234 (see backend/app/services/user.go).
  • Home: /t/:tenantCode lists content.
  • Detail: open any content detail; cover and main asset render.
  • Login: sign in as test (phone 13800138000, OTP 1234) and open /t/:tenantCode/me.
  • Orders & Library: /t/:tenantCode/me/orders and /t/:tenantCode/me/library show data.
  • Likes/Favorites: content detail shows prefilled like/favorite; toggle to confirm.
  • Notifications: /t/:tenantCode/me/notifications shows unread items.

Superadmin Smoke

  • Open http://localhost:5173/super/auth/login.
  • Login: superadmin / superadmin123.
  • Users: list includes negative; balance anomaly list returns result.
  • Orders: list includes flagged/reconciled and refund orders.
  • Withdrawals: list contains created/paid/failed statuses.
  • Finance: ledger list has data; order anomaly list returns missing paid/refund items.
  • Content/Reports: content list is populated; report list has pending item.
  • Templates: order/audit/interaction templates present.
  • System Configs: site_name and support_email present.

Manual-Only Coverage

  • Upload flow (init/part/complete) requires real storage integration; seed only preloads assets.