Skip to content

Add micro-deposit verification, role-based onboarding checklist, API usage daily view, and backup integrity verification - #664

Open
david87131 wants to merge 1 commit into
Smartdevs17:mainfrom
david87131:feat/issues-633-632-631-630
Open

Add micro-deposit verification, role-based onboarding checklist, API usage daily view, and backup integrity verification#664
david87131 wants to merge 1 commit into
Smartdevs17:mainfrom
david87131:feat/issues-633-632-631-630

Conversation

@david87131

Copy link
Copy Markdown
Contributor

This PR implements a small, real, working slice of each of four epic issues. Each is a large epic in the issue description; only the scoped slice below is implemented here, with the rest explicitly deferred as noted.

  • Build payment method verification with micro-deposits #633 — Payment method micro-deposit verification. Added PaymentMethod Prisma model (pending/verified/failed/locked status, two pending deposit amounts, attempt counter, attempt limit). Added MicroDepositVerificationService with issueMicroDeposits() (generates two random 1-99 cent amounts) and verifyMicroDeposits() (order-independent match, increments attempts on mismatch, locks out after the configured limit). Wired to POST /api/v1/payment-methods, POST /api/v1/payment-methods/:id/micro-deposits, POST /api/v1/payment-methods/:id/verify. Deferred: verification notifications, verification analytics/reporting.
  • Implement automated onboarding with role-based workflows #632 — Role-based onboarding checklist. Added OnboardingChecklist Prisma model reusing the existing WorkspaceRole enum (owner/admin/member/viewer). Added OnboardingChecklistService with a small hardcoded per-role task template, getOrCreateChecklist(), completeTask(), and completion-percentage computation. Wired to GET /api/v1/onboarding-checklist/checklist?role=... and POST /api/v1/onboarding-checklist/checklist/tasks/:taskId/complete (kept separate from the existing merchant-KYC onboarding.ts router, which is a different feature). Deferred: automated cross-team task assignment, onboarding analytics, notifications, completion incentives.
  • Build API usage analytics with developer insights #631 — API usage tracking. This repo already has an ApiKey/ApiKeyUsage/ApiKeyQuota model set, an apiUsageTracker middleware wired into /api/v1/developers/api-keys, and a usage-summary endpoint (from a prior issue). Added the specific piece this issue calls for that was missing: a per-day usage breakdown — getDailyUsage(keyId, days) in quota-manager.ts and GET /api/v1/developers/api-keys/:keyId/usage/daily?days=N. Deferred: dashboard UI, forecasting/trending, threshold alerts, cross-key comparison tools.
  • Implement automated backup verification with integrity checks #630 — Backup integrity verification. scripts/backup.sh already computed and stored a .sha256 checksum at backup time, but verify_backup_integrity() / do_verify_all only ran gunzip -t and never compared it. Fixed verify_backup_integrity() to recompute the sha256 of the backup file and compare it against the stored .sha256 file, failing verification if the checksum file is missing or the digest doesn't match (in addition to the existing gzip check). Also added a standalone backend/src/utils/backup-integrity.ts with computeChecksum(), verifyChecksum(), parseChecksumFile(), and verifyBackupFile() plus unit tests, since programmatic backup handling may live in the app later. Deferred: scheduling, S3 restore-time verification, alerting.

Test plan

  • npx vitest run on the three new test files — 23/23 passing (micro-deposit verification, onboarding checklist, backup integrity utils)
  • bash -n scripts/backup.sh — syntax valid
  • npx tsc --noEmit scoped to changed/new files — no new errors introduced (two pre-existing req.params typing errors remain untouched in api-keys.ts; the full-repo tsc run has ~1000 pre-existing errors from prisma generate currently failing on an unrelated duplicate SubscriptionStatus enum definition already on main — confirmed by stashing this branch's changes and reproducing the same failure — and from missing socket.io types, both out of scope for this PR)
  • Not run: full app boot / integration test against a live Postgres instance (no local DB available in this environment)

Fixes #633
Fixes #632
Fixes #631
Fixes #630

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@david87131 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@david87131 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant