Built No-show flag and block: Two new numbers under Booking Rules (blank means off). A symbol appears on the clients list, client page, calendar entries and appointment pages. Online booking is refused at the block number, and customers are told at the details step. Staff can still book a blocked customer in, and an owner can reset someone with a two-tap button. The count resets when they attend, and matches the same email or phone, so a guest can’t dodge it with a new profile. Email rules: staff and owners get email only for customer cancellations, schedule changes and invitations. Routine events (new booking, reschedule) are push-only. Nobody is told about their own action. A barber reassignment sends one customer email instead of two. Reward expiry sends one warning. Email redesign: your brand colour, a details card, Add to calendar and View on map links, a preferences link, hidden preview text, and dark mode. Replies now go to the business’s own email. WhatsApp “due now” queue: a list in time order with a highlighted next one, an owner setting for how many hours ahead (12–72), and a once-a-day push telling each barber how many reminders are waiting. Monitoring: /api/health now reports whether notifications are actually going out. The worker resets stuck deliveries and alerts the owner on the first setup failure (such as a bad SMTP login). The app emails your operator address about server errors, and the manager pushes that address to each business. Google scope: now only calendar.app.created. Events go to a calendar the app creates in the staff member’s Google account, called “<Business> bookings”.
This commit is contained in:
116 files changed
+3089
-766
No files matched your search
@@ -12,6 +12,8 @@ import { getUnreadNotificationCount } from "@/services/notifications/notificatio
|
||||
import { clientDirectoryWhere } from "@/services/customer/client-directory";
|
||||
import { matchesCustomerSearch } from "@/services/customer/customer.service";
|
||||
import { getLoyaltySummariesForCustomers } from "@/services/loyalty/loyalty.service";
|
||||
import { NoShowBadge } from "@/features/staff/components/no-show-badge";
|
||||
import { countNoShows, evaluateStanding, getNoShowThresholds } from "@/services/customer/no-show.service";
|
||||
import { InlineNotificationBell } from "@/features/notifications/components/notification-bell";
|
||||
import { cn } from "@/lib/utils/cn";
|
||||
|
||||
@@ -49,6 +51,7 @@ export default async function StaffClientsPage({
|
||||
lastName: true,
|
||||
email: true,
|
||||
phone: true,
|
||||
noShowResetAt: true,
|
||||
appointments: {
|
||||
where: { businessId: context.businessId },
|
||||
orderBy: { startAt: "desc" },
|
||||
@@ -57,6 +60,8 @@ export default async function StaffClientsPage({
|
||||
},
|
||||
});
|
||||
|
||||
const noShowThresholds = await getNoShowThresholds(prisma, context.businessId);
|
||||
|
||||
const loyaltySummaries = await getLoyaltySummariesForCustomers(prisma, {
|
||||
businessId: context.businessId,
|
||||
customerIds: customers.map((c) => c.id),
|
||||
@@ -166,6 +171,10 @@ export default async function StaffClientsPage({
|
||||
(a) => UPCOMING_STATUSES.includes(a.status) && a.startAt > now,
|
||||
);
|
||||
const loyalty = loyaltySummaries.get(customer.id);
|
||||
const noShow = evaluateStanding(
|
||||
countNoShows(customer.appointments, customer.noShowResetAt),
|
||||
noShowThresholds,
|
||||
);
|
||||
|
||||
return (
|
||||
<Link
|
||||
@@ -178,8 +187,11 @@ export default async function StaffClientsPage({
|
||||
{customer.lastName.charAt(0)}
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-bold">
|
||||
{customer.firstName} {customer.lastName}
|
||||
<p className="flex items-center gap-2 text-sm font-bold">
|
||||
<span className="truncate">
|
||||
{customer.firstName} {customer.lastName}
|
||||
</span>
|
||||
<NoShowBadge count={noShow.count} flagged={noShow.flagged} blocked={noShow.blocked} />
|
||||
</p>
|
||||
<p className="text-muted truncate text-xs">
|
||||
{customer.phone ?? customer.email}
|
||||
|
||||
Reference in new issue
Block a user