Files
test-assignment/docs/implementation-checklist.md

15 KiB

Implementation checklist

Implemented

  • Existing pnpm/Turbo, NestJS, React, PostgreSQL and Prisma foundation retained
  • Additive migration for merchant company/contact fields, decimal USD estimates, source, nullable manager, timestamps and versions
  • Typed interactions, immutable audit events, checklist change history, review cycles/snapshots and attributed commercial/compliance tasks
  • Hashed passwords, opaque database-backed sessions, cookie security, eight-hour expiry, rotation and logout
  • Trusted-Origin checks on every mutation and bounded IP/email login throttles with Retry-After
  • Four demo identities: Head, Compliance, Alex and Sam; original user IDs/password hashes preserved
  • Query-level scoping for reads, search, totals, detail children, dashboards and writes
  • Head-only manager lookup and reassignment with open commercial task handoff
  • Adjacent commercial stages, assignment prerequisite, complete KYB submission, immutable review decisions, corrections/resubmission and approval-gated activation
  • Reviewed company/KYB fields locked during and after review; Sales cannot override Compliance
  • Version-checked transactions serialize merchant and child mutations; stale updates return 409
  • Merchant editing, assignment, collection, review, interaction and task UI; server-derived capabilities
  • EN/RU controls and validation, nullable-owner rendering, USD formatting, local date/time input and protected routes
  • Repeatable 45-merchant seed with 90-day histories, five unassigned leads and balanced 20-merchant manager portfolios
  • Recognition-based legacy enrichment; edited/unrecognized legacy fixtures preserved without inferred approvals
  • Documentation updated for endpoints, credentials, security, workflow and migration behavior

Verification · 24 September 2026

Check Actual outcome
Build All workspace packages built; browser bundle excludes database/Prisma dependencies
Lint and typecheck Passed
Unit tests 8 passed: contracts, localization, return paths, scopes and password hashing
Integration tests 18 passed against disposable PostgreSQL on 55441
Authorization coverage Both manager-to-manager attack directions, hidden children, forbidden field injection, personal Compliance tasks, Head-only lookup, anonymous and origin denial
Workflow coverage Corrections/resubmission, approval, rejection, approval-required activation, immutable decisions, concurrent decisions and reassignment races
Seed coverage Fresh 45-record fixtures; edited merchant/task/password preservation; legacy account migration; unchanged original records; no inferred approvals for modified legacy fixtures
Browser tests 8 passed: EN/RU at 390px/1440px, editor sheets, all four accounts, assignment, editing, tasks, corrections, approval, activation and reassignment
Session/browser coverage Logout, expiry, account switching, private-cache clearing, no auth tokens in localStorage, protected routes, loading/error/empty states, keyboard and reduced motion
Format and whitespace Prettier check and git diff check passed
Development database upgrade Applied migration and seed; compared all 18 original merchants, stage events, notes, checklist values, original tasks and password hashes: unchanged; 45 merchants after upgrade

A pre-upgrade development backup was saved locally at /tmp/merchantflow-before-onboarding-yn40uh40.dump. Tests recreate only the disposable db-test service, never the development db service. Integration and browser suites run sequentially. Screenshots/traces are in ignored test-results/ and playwright-report/ directories.

Development smoke checks passed through both localhost:5173 and 127.0.0.1:5173: healthy database, successful login for all four accounts, 45 merchants for Head/Compliance, 20 for each manager, and 401 when reusing every revoked session. The API health check also passed directly on port 3001.

Visual inspection covered the completed approval-to-Live detail screen and the mobile Russian editor. The later daily-sales milestone brings these records together in the Activity tab, with translated system labels and complete history.

Existing dependency warnings are non-fatal: Zod/Rollup annotation placement and the Prisma PostgreSQL adapter's pg concurrent-query deprecation. All checks above passed despite these warnings.

Public landing and lead intake · 24 September 2026

  • Original MerchantFlow consultation page with bold typography, lime accents, three benefits, onboarding steps, inline form and mobile staff login
  • All seven required fields, localized countries, Other industry, shared validation and complete EN/RU feedback
  • Public lead endpoint with trusted-Origin checks, bounded IP/email throttles and Retry-After
  • Atomic unassigned New Lead creation, LANDING_PAGE source, four missing KYB items and system-attributed creation history
  • Database-backed idempotency across concurrent requests and API restarts; changed-payload conflicts
  • Keyboard/accessibility-excluded honeypot with indistinguishable acceptance and no database writes
  • Preserved form values, stable retry keys, pending/success/validation/network/server/rate-limit states and accessible announcements

Verification: build, lint, typecheck and 13 unit tests passed. All 24 integration tests passed, including public creation, permission checks, parallel retries across two API instances, restart replay, honeypot rejection, throttling and injected transaction rollback. The six public API tests were rerun successfully after the final quota-reservation adjustment.

All 14 browser tests passed. Consultation coverage exercises EN/RU at 375px and 1440px, every submission state, keyboard focus, hidden honeypot, locale/value preservation, real persistence and a committed request with a deliberately lost response. Existing CRM journeys continue to pass at 390px and 1440px. Screenshots were visually inspected in both languages and sizes. Test-created leads are cleaned up only in the disposable test database; the reference website received no submissions.

The additive migration was applied to development. Before/after checksums confirmed all 45 existing merchants, 135 activities and 206 stage events remained unchanged. Prisma reports no schema difference, and the running web/API database health check passes. No development reseed or reset was performed.

Boundaries

No staff registration, merchant deletion UI, merchant portal, uploads, payment processing, external KYB service, external reminders or deployment. Login rate-limit buckets are intentionally in-process for this single-process local prototype. Seed dates are anchored once and naturally age; reruns do not refresh deadlines or rewrite existing edits.

Daily sales workspace

  • Staff lead creation with required company/contact/email, Head assignment and server-enforced Manager self-assignment
  • Additive nullable-field migration with safe incomplete-lead rendering
  • Scoped combined directory filters, URL persistence, pagination recovery and responsive contact information
  • Shared workflow policy, Call/Email evidence, qualification completeness and explicit rejection permissions
  • Typed actions/blockers on detail and pipeline; strict general edits and atomic version-checked mutations
  • Unified chronological history with ownership identities, rejection reasons and preserved attribution
  • URL-addressable detail tabs and single-stage mobile pipeline with explicit card actions
  • Retained form values on failure, accessible controls and bilingual feedback

Verification: all 32 integration tests passed against the isolated PostgreSQL service, including role/stage rejection cases, filters, creation, races and injected transaction rollback. All 19 browser tests passed, covering EN/RU at mobile and desktop sizes, real API creation/filtering/history, pipeline progression and rejection, ownership isolation, stale-editor preservation and the existing compliance journeys. Build, lint, typecheck, 17 unit tests, formatting and whitespace checks passed. The additive sales migration was applied to development without a reset or reseed.

Gated onboarding completion

  • Three current KYB collection records: company registration, ownership structure and authorized-representative identification; legacy requirements remain read-only history
  • Sales collection status/notes restricted to Head or assigned Manager in KYB, with received-history submission evidence and pending-review locks
  • Compliance-only approval with risk/rationale, actionable corrections stored separately from collection notes, and rejection with a reason
  • Numbered immutable review snapshots and outcomes; only the latest current-policy approval authorizes activation; open forms remain bound to their original cycle
  • Four persisted demo activation checks with stage-specific editing, approved-cycle attribution and change history; no external payment/processing calls
  • Compliance queue with pending/filtered counts, elapsed waiting time, URL-persisted search/manager/age filters and direct review-cycle links
  • Server-derived next owner, required action and specific blockers; distinct business closure and Compliance decisions; responsive EN/RU UI
  • Additive legacy upgrade and explicit return-to-KYB recovery; existing decisions and collection history remain unchanged
  • Fresh fixture approval/check evidence, preserved existing fixture edits and passwords, and repeatable seed behavior

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

  • Shared creation, editing, completion and reopening from Tasks and merchant details, with a scoped merchant picker and server-derived capabilities
  • Today, Upcoming, Overdue and Completed views, URL filters, UTC persistence, local date/time display and DST-aware day boundaries
  • Private Compliance tasks and task audits; merchant-scoped reads, counts, selectors, writes, reminders and dashboards
  • Atomic open-task reassignment; preserved completed attribution; audited inherited-task reopening under the current owner
  • Database-backed reminder dismissal with revision checks, completed-task suppression, polling, focus/visibility/reconnection refresh and error states
  • Exact reminder timestamps retained on title-only edits; conflicts preserve form inputs and require explicit version refresh
  • Distinct Head, Manager and Compliance dashboards with shared scoped query predicates, all-stage distribution, workload and linked filtered records
  • Activation numerator/denominator and earliest-Live onboarding sample count, honest empty states, decision-history drilldowns and EN/RU explanatory text
  • 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.