/**
 * User Filter Type Detection Utilities
 * 
 * Determines which filter component to use based on user role/job title.
 * This allows for plug-and-play filter components per user type.
 */

export type UserFilterType = 'DEALER' | 'STANDARD';

/**
 * Check if user is a dealer based on job title
 */
export function isDealerUser(user: any): boolean {
  if (!user) return false;
  
  // Check job title
  if (user.jobTitle === 'Dealer' || user.jobTitle === 'DEALER') {
    return true;
  }
  
  return false;
}

/**
 * Get the filter type for a user
 * Returns the appropriate UserFilterType based on user properties
 */
export function getUserFilterType(user: any): UserFilterType {
  if (isDealerUser(user)) {
    return 'DEALER';
  }
  return 'STANDARD';
}

