Files
meezi/mobile/meezi_waiter/lib/features/notifications/waiter_notification.dart
T
soroush.asadi a85890f30a chore: Flutter mobile app, CI, and dev tooling
- mobile/: Flutter/Dart merchant mobile app skeleton
- .github/: GitHub Actions CI workflows
- .dockerignore: exclude host node_modules from build context
- .cursorrules: Cursor IDE project rules
- .claude/: Claude Code project settings and launch config

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:35:27 +03:30

52 lines
1.4 KiB
Dart

import '../../core/hub/hub_client.dart';
class WaiterNotification {
WaiterNotification({
required this.id,
required this.type,
required this.title,
this.body,
this.tableNumber,
this.referenceId,
required this.createdAt,
this.isRead = false,
});
final String id;
final String type;
final String title;
final String? body;
final String? tableNumber;
final String? referenceId;
final DateTime createdAt;
bool isRead;
factory WaiterNotification.fromHub(HubNotification n) => WaiterNotification(
id: n.id,
type: n.type,
title: n.title,
body: n.body,
tableNumber: n.tableNumber,
referenceId: n.referenceId,
createdAt: n.createdAt,
);
factory WaiterNotification.fromJson(Map<String, dynamic> json) =>
WaiterNotification(
id: json['id'] as String,
type: json['type'] as String,
title: json['title'] as String,
body: json['body'] as String?,
tableNumber: json['tableNumber'] as String?,
referenceId: json['referenceId'] as String?,
createdAt:
DateTime.tryParse(json['createdAt'] as String? ?? '') ??
DateTime.now(),
isRead: json['isRead'] as bool? ?? false,
);
bool get isCallWaiter => type == 'table_call_waiter';
bool get isNewOrder => type == 'guest_order_new';
bool get isOrderReady => type == 'guest_order_ready';
}