ef15fd6247
Full backend implementation: - Multi-tenant cafe/restaurant management (menus, orders, tables, staff) - POS order flow with ZarinPal and Snappfood payment integration - OTP authentication via Kavenegar SMS - QR digital menu with public discover/finder endpoints - Customer loyalty, coupons, CRM - PostgreSQL via EF Core, Redis for caching/sessions - Background jobs, webhook handlers - Full migration history Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
using Microsoft.AspNetCore.SignalR;
|
|
using Meezi.API.Hubs;
|
|
using Meezi.API.Models.Orders;
|
|
using Meezi.Core.Enums;
|
|
|
|
namespace Meezi.API.Services;
|
|
|
|
public class KdsNotifier : IKdsNotifier
|
|
{
|
|
private readonly IHubContext<KdsHub> _hubContext;
|
|
|
|
public KdsNotifier(IHubContext<KdsHub> hubContext)
|
|
{
|
|
_hubContext = hubContext;
|
|
}
|
|
|
|
public Task NotifyOrderCreatedAsync(string cafeId, LiveOrderDto order, CancellationToken cancellationToken = default) =>
|
|
_hubContext.Clients.Group(KdsHub.GroupName(cafeId)).SendAsync("OrderCreated", order, cancellationToken);
|
|
|
|
public Task NotifyOrderStatusChangedAsync(string cafeId, string orderId, OrderStatus status, CancellationToken cancellationToken = default) =>
|
|
_hubContext.Clients.Group(KdsHub.GroupName(cafeId)).SendAsync("OrderStatusChanged", new { orderId, status }, cancellationToken);
|
|
|
|
public Task NotifyTableStatusChangedAsync(string cafeId, CancellationToken cancellationToken = default) =>
|
|
_hubContext.Clients.Group(KdsHub.GroupName(cafeId)).SendAsync("TableStatusChanged", null, cancellationToken);
|
|
}
|