feat(tradein): /scrapers/avito — 6-я секция Расписание (in-app scheduler UI) #483
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#483
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-frontend-scheduler"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
UI для in-app scheduler (parallel PR
feat/tradein-scheduler-backend). Шестая секция на/trade-in/scrapers/avitoс status preview, формой настройки окна, и UTC↔МСК конвертацией для удобного ввода.LOC: 2 files (page.tsx modify + CSS append).
Changes
app/scrapers/avito/page.tsxuseSchedules(GET с polling 30s) +useUpdateSchedule(PUT mutation с query invalidate)ScheduleConfig,ScheduleConfigUpdate/admin/scrape/schedules/avito_city_sweeputcToMsk,mskToUtc,formatMskRange— UI всегда показывает МСК, backend хранит UTCCSS
.scraper-section--schedule— зелёный success border (отличается от city sweep синего).schedule-status— preview block с label/value grid.run-mutedreused from city sweep sectionVerify
tsc --noEmitcleannext buildpass —/scrapers/avito5.96 kB, all 9 routesTest plan
/scrapers/avito→ scroll до секции 6 → verify status показывает defaultsBehavior
UTC↔МСК
mskHour = (utcHour + 3) % 24,utcHour = (mskHour - 3 + 24) % 24Refs
feat/tradein-scheduler-backend(migration 052 + 2 endpoints + scheduler service)UI для backend scheduler (parallel PR feat/tradein-scheduler-backend) — заменяет manual SSH crontab setup на UI-managed config в БД. - 2 hooks: useSchedules (poll 30s) + useUpdateSchedule (PUT с invalidate) - Local TS interfaces: ScheduleConfig, ScheduleConfigUpdate - 6-я секция 'Расписание автозапуска (in-app scheduler)': * Status preview: enabled badge, window (МСК + UTC), next_run_at, last_run_at + run_id * Edit form: enabled checkbox, window start/end (вход в МСК!), pages/anchor, detail top-N, delay, radius, enrich_houses checkbox * Submit → PUT /admin/scrape/schedules/avito_city_sweep - UTC ↔ МСК конвертация: utcToMsk / mskToUtc / formatMskRange helpers - CSS: .scraper-section--schedule (зелёный success border), .schedule-status grid Backend хранит часы UTC, UI ввод/отображение — МСК (UTC+3). Default из migration 052: 02:00-05:00 UTC = 05:00-08:00 МСК.Merged via deep-code-reviewer — verdict APPROVE (MINOR follow-ups noted).
UTC↔MSK math verified across edge cases (cross-midnight, MSK 00:00→UTC 21:00, MSK 02:00→UTC 23:00, round-trip stable). Backend contract on main since #482 merged seconds earlier — no 404 risk.
MINOR follow-ups (not blocking, OK to address in separate PR):
useEffect([schedulesQ.data])overwrites user input every 30s when poll refetches. Recommend gating withuseRef"form is dirty" flag or pausingrefetchIntervalwhile form has unsaved changes.parseInt(e.target.value, 10)returns NaN when user clears the input → controlledvalue={NaN}triggers React warning. Guard withNumber.isNaN(v) ? 0 : vor fallback to previous state.Status preview, badge colour mapping, CSS tokens (
--success,--success-soft,run-badge--cancelled) all reuse existing design system — no new tokens introduced.