class WaiterSession {
  const WaiterSession({
    required this.accessToken,
    required this.cafeId,
    required this.userId,
    required this.role,
    this.branchId,
    this.actor,
  });

  final String accessToken;
  final String cafeId;
  final String userId;
  final String role;
  final String? branchId;
  final String? actor;

  factory WaiterSession.fromJson(Map<String, dynamic> json) => WaiterSession(
        accessToken: json['accessToken'] as String,
        cafeId: json['cafeId'] as String,
        userId: json['userId'] as String,
        role: json['role'] as String,
        branchId: json['branchId'] as String?,
        actor: json['actor'] as String?,
      );

  String get displayName => actor ?? userId;
}
