import 'package:equatable/equatable.dart';

/// Represents a polymorphic membership to an organization unit.
///
/// Allows a [User] to be a member of either a [Business] or a [Hub].
class Membership extends Equatable {

  const Membership({
    required this.id,
    required this.userId,
    required this.memberableId,
    required this.memberableType,
    required this.role,
  });
  /// Unique identifier for the membership record.
  final String id;

  /// The [User] holding this membership.
  final String userId;

  /// The ID of the organization unit (Business or Hub).
  final String memberableId;

  /// The type of the organization unit ('business' or 'hub').
  final String memberableType;

  /// The role within that organization (e.g., 'manager', 'viewer').
  final String role;

  @override
  List<Object?> get props => <Object?>[id, userId, memberableId, memberableType, role];
}