Added tasks, reminders, and role-specific dashboards

This commit is contained in:
Oleksandr Prokhorenko
2026-09-24 22:18:41 +03:00
parent 1f8721e742
commit 9ccbac4aca
33 changed files with 2583 additions and 511 deletions
+16
View File
@@ -91,3 +91,19 @@ Verification: all 32 integration tests passed against the isolated PostgreSQL se
Verification: 41 integration tests passed, including a populated legacy-schema migration, correction/resubmission, stale decisions, older approval/check evidence, concurrent writes, authorization bypasses, queue filters and transaction rollback. All 20 unit/contract/localization tests, build, lint, typecheck, formatting and whitespace checks passed. All 24 browser tests passed. Browser verification covers the complete successful journey through Live, rejection, conflict preservation, direct review links, queue filtering, EN/RU and mobile/desktop layouts. Screenshots were visually inspected.
Applied migrations `202609240005_gated_onboarding` and `202609240006_kyb_upgrade` to development without a reset or reseed. Before/after checksums confirmed original company data, review decisions/snapshots, collection notes/history, activities, stage events, tasks and password hashes were unchanged for all 45 merchants. Only new missing representative records and unfinished merchant concurrency versions were added. Local health, authentication, detail capabilities and queue authorization passed for all four demo accounts; smoke-test sessions were signed out afterward.
## Actionable tasks, reminders, and scoped dashboards
- [x] Shared creation, editing, completion and reopening from Tasks and merchant details, with a scoped merchant picker and server-derived capabilities
- [x] Today, Upcoming, Overdue and Completed views, URL filters, UTC persistence, local date/time display and DST-aware day boundaries
- [x] Private Compliance tasks and task audits; merchant-scoped reads, counts, selectors, writes, reminders and dashboards
- [x] Atomic open-task reassignment; preserved completed attribution; audited inherited-task reopening under the current owner
- [x] Database-backed reminder dismissal with revision checks, completed-task suppression, polling, focus/visibility/reconnection refresh and error states
- [x] Exact reminder timestamps retained on title-only edits; conflicts preserve form inputs and require explicit version refresh
- [x] Distinct Head, Manager and Compliance dashboards with shared scoped query predicates, all-stage distribution, workload and linked filtered records
- [x] Activation numerator/denominator and earliest-Live onboarding sample count, honest empty states, decision-history drilldowns and EN/RU explanatory text
- [x] Updated product brief, API documentation and additive upgrade instructions
Verification: **46 integration tests, 34 browser tests, and 21 unit/contract/localization tests passed**. Build, lint, typecheck, formatting and whitespace checks passed. Integration assertions independently calculate seed metrics and cover empty portfolios, first-Live deduplication, date boundaries, both manager isolation directions, private tasks/audits, reminder timing/dismissal/reopening/rescheduling, API restart persistence, assignment races and completed attribution. Browser coverage includes both task entry points, every primary view, polling and focus refresh, reminder errors, exact timestamp preservation, stale form conflicts, EN/RU at 390px/1440px, local New York time, filtered dashboard links, account switching, keyboard focus and reduced motion. Dashboard, task editor and inbox screenshots were visually inspected. The new browser journeys use real database-backed test sessions so repeated setup does not exhaust the unchanged production login limits.
Applied `202609240007_tasks_dashboards` to development without resetting or reseeding. Before/after checksums confirmed all original rows across 13 business tables were unchanged, preserving **45 merchants and 114 tasks**, histories, reviews and passwords. Health/login/dashboard/tasks/reminders smoke checks passed for all four development accounts; smoke-test sessions were signed out. Development's preserved history correctly yields 5/45 activation and 56 days average onboarding; fresh fixtures independently yield 5/45 and 78.6 days. No historical data was rewritten to force either result.
+7 -1
View File
@@ -18,7 +18,7 @@ Reviewed company identity, website, country, industry and KYB items remain locke
## Journeys and records
Landing → email/password login → role-scoped dashboard → merchant search/filter → detail, editing, assignment, checklist, reviews, interactions, history and tasks. The directory searches company, contact, email and website and combines stage, country, industry and authorized owner filters with eight-record pagination. Search/filter/page state is stored in the URL. Head and Compliance may filter by manager or Unassigned; Managers remain scoped to their own merchants. Desktop uses tables and pipeline columns; mobile uses directory cards and exactly one selected pipeline stage. Detail has URL-addressable Overview, Activity, Onboarding and Tasks tabs; Activity merges notes, interactions, ownership, stage events and compliance outcomes into one newest-first history. Explicit stage controls display server-derived blocking reasons. Pipeline, Tasks and Compliance Review Queue provide dedicated views. The Compliance-only queue shows total pending and filtered counts, elapsed waiting time, manager/search/24-hour/72-hour filters stored in the URL, and links to individual review cycles. Merchant detail shows the next owner, required action and server-derived blockers; commercial closure remains visibly distinct from Compliance rejection. Tasks can be created, edited and completed from merchant details; reminders stay in the app.
Landing → email/password login → role-scoped dashboard → merchant search/filter → detail, editing, assignment, checklist, reviews, interactions, history and tasks. The directory searches company, contact, email and website and combines stage, country, industry and authorized owner filters with eight-record pagination. Search/filter/page state is stored in the URL. Head and Compliance may filter by manager or Unassigned; Managers remain scoped to their own merchants. Desktop uses tables and pipeline columns; mobile uses directory cards and exactly one selected pipeline stage. Detail has URL-addressable Overview, Activity, Onboarding and Tasks tabs; Activity merges notes, interactions, ownership, stage events and compliance outcomes into one newest-first history. Explicit stage controls display server-derived blocking reasons. Pipeline, Tasks and Compliance Review Queue provide dedicated views. The Compliance-only queue shows total pending and filtered counts, elapsed waiting time, manager/search/24-hour/72-hour filters stored in the URL, and links to individual review cycles. Merchant detail shows the next owner, required action and server-derived blockers; commercial closure remains visibly distinct from Compliance rejection. Tasks can be created, edited, completed and reopened from Tasks and merchant details. Sales tasks follow the merchant manager (or the Head for unassigned leads); personal Compliance tasks are private. Reopening an inherited completed sales task assigns it to the current manager and retains the prior completion in audit history. Today uses the viewer’s local calendar day and includes overdue tasks due today; Upcoming begins tomorrow; Overdue means an open task whose due time has passed. Reminder dismissal is database-backed and survives reloads. Completed tasks suppress reminders; reopening preserves dismissal unless the reminder time or assignee changes. The in-app inbox refreshes while visible and on focus/reconnection.
Staff creation requires company name, primary-contact name and email; website, country, industry and volume may be completed later. Merchants include company and primary-contact details, website, country, industry, decimal USD volume estimates, source, nullable manager, stage, timestamps and a concurrency version. Related models retain activities, stage events, checklist changes, review snapshots and task attribution. Mutations and audit history commit atomically and reject stale versions.
@@ -49,3 +49,9 @@ No merchant deletion UI, staff registration, merchant self-service, real payment
Review policy version 2 uses the three current KYB requirements. Legacy beneficial-owner ID and business-activity checklist records and every historical review snapshot/decision remain readable and unchanged. Additive migrations mark old cycles as version 1, leave their risk unset, and add a missing authorized-representative item to unfinished merchants. No previous identification is reinterpreted and no approval or demo result is invented.
Legacy pending cycles may receive corrections or rejection but cannot be approved under obsolete requirements. Head or the assigned Manager can explicitly return legacy Integration/Testing merchants to KYB for collection and a fresh review. This audited exception preserves prior approvals. Current-policy approvals lock reviewed fields; Live and Rejected remain terminal.
## Operational dashboards and metric definitions
Head sees total merchants, newly created leads in the last 30 days regardless of current stage, active onboarding, Live merchants, every pipeline stage including Rejected, manager workload, overdue commercial tasks and unassigned New Leads. Active onboarding consists of KYB, Compliance Review, Integration and Testing. Manager dashboards use the same merchant scope as their directory, emphasize next actions and overdue follow-ups, and contain only their own workload. Compliance sees pending cycles, the oldest waiting cycles, decisions in the last 30 days (including corrections), and personal review tasks.
Activation rate is currently Live merchants divided by all visible merchants, including Rejected. Average onboarding duration is creation to the first recorded Live transition per visible merchant that reached Live. Display the activation numerator/denominator and duration sample count; no merchants or no recorded Live transitions produces an explanatory empty state. Do not infer missing transitions. Dashboard totals, chart counts and filtered record links use shared database predicates and one consistent database snapshot. Any displayed volume is an estimated processing volume, never revenue.