import 'package:equatable/equatable.dart'; /// User entity representing a user in the system class User extends Equatable { final String id; final String name; final String email; final List roles; final bool isActive; final DateTime createdAt; final DateTime updatedAt; const User({ required this.id, required this.name, required this.email, required this.roles, required this.isActive, required this.createdAt, required this.updatedAt, }); @override List get props => [ id, name, email, roles, isActive, createdAt, updatedAt, ]; /// Check if user has a specific role bool hasRole(String role) => roles.contains(role); /// Check if user is admin bool get isAdmin => hasRole('admin'); /// Check if user is manager bool get isManager => hasRole('manager'); /// Check if user is cashier bool get isCashier => hasRole('cashier'); }