Skip to content

feat: implement churn analytics, SMS 2FA, and multi-location support#1266

Merged
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
coderDom-x:feat/admin-analytics-sms2fa-multilocation
Jun 28, 2026
Merged

feat: implement churn analytics, SMS 2FA, and multi-location support#1266
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
coderDom-x:feat/admin-analytics-sms2fa-multilocation

Conversation

@coderDom-x

Copy link
Copy Markdown
Contributor

Summary

This PR implements four related features across the frontend and backend to improve analytics, authentication, and multi-location workspace support.

Implemented Features

FE-30 — Churn Risk Dashboard

  • Added At-Risk Members section to the Admin Analytics page.
  • Added paginated churn risk table.
  • Added Risk Score progress badges (Green / Amber / Red).
  • Added Send Campaign quick action.
  • Added Mark Inactive quick action.
  • Added useGetChurnRisk React Query hook.

BE-37 — SMS Two-Factor Authentication

  • Added SMS 2FA support using Africa's Talking with Twilio fallback.
  • Added phone number and SMS 2FA fields to the User entity.
  • Implemented enable, verify, disable, send-code, and login verification endpoints.
  • Added OTP hashing, expiration, single-use validation, and rate limiting.
  • Added required SMS provider configuration.

FE-34 — SMS 2FA Frontend

  • Added SMS Two-Factor Authentication settings card.
  • Implemented phone number setup flow.
  • Added OTP verification modal.
  • Added disable flow requiring current password.
  • Added SMS verification option during login.
  • Added React Query hooks for enable, verify, and disable actions.

FE-35 — Multi-location Support

  • Added Location Switcher component.
  • Integrated location selector into the navigation.
  • Persisted selected location in Zustand.
  • Added locationId support for workspace, booking, check-in, and analytics requests.
  • Added All Locations option for administrators.
  • Automatically hides the switcher when only one location exists.

Testing

  • Verified Churn Risk dashboard rendering and pagination.
  • Verified SMS 2FA enable, verification, disable, and login flow.
  • Verified Location Switcher persistence across refresh.
  • Verified API requests include the selected locationId.
  • Verified admin analytics filtering by selected location.

Closes

Closes #1214

Closes #1221

Closes #1222

Closes #1224

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@coderDom-x is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@coderDom-x 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

@yusuftomilola yusuftomilola merged commit aa6a739 into DistinctCodes:main Jun 28, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants