export const RUST_API_URL = import.meta.env.VITE_RUST_API_URL || 'http://localhost:8080';
export const RUST_PHOTOGRAPHERS_URL = import.meta.env.VITE_RUST_PHOTOGRAPHERS_URL || 'http://localhost:8081';
export const RUST_TUTORS_URL = import.meta.env.VITE_RUST_TUTORS_URL || 'http://localhost:8082';
export const RUST_COMPANIES_URL = import.meta.env.VITE_RUST_COMPANIES_URL || 'http://localhost:8083';
export const RUST_JOB_SEEKERS_URL = import.meta.env.VITE_RUST_JOB_SEEKERS_URL || 'http://localhost:8084';
export const RUST_CUSTOMERS_URL = import.meta.env.VITE_RUST_CUSTOMERS_URL || 'http://localhost:8085';
export const RUST_MAKEUP_ARTISTS_URL = import.meta.env.VITE_RUST_MAKEUP_ARTISTS_URL || 'http://localhost:8086';
export const RUST_DEVELOPERS_URL = import.meta.env.VITE_RUST_DEVELOPERS_URL || 'http://localhost:8087';
export const RUST_VIDEO_EDITORS_URL = import.meta.env.VITE_RUST_VIDEO_EDITORS_URL || 'http://localhost:8088';
export const RUST_GRAPHIC_DESIGNERS_URL = import.meta.env.VITE_RUST_GRAPHIC_DESIGNERS_URL || 'http://localhost:8089';
export const RUST_SOCIAL_MEDIA_MANAGERS_URL = import.meta.env.VITE_RUST_SOCIAL_MEDIA_MANAGERS_URL || 'http://localhost:8090';
export const RUST_FITNESS_TRAINERS_URL = import.meta.env.VITE_RUST_FITNESS_TRAINERS_URL || 'http://localhost:8091';
export const RUST_CATERING_SERVICES_URL = import.meta.env.VITE_RUST_CATERING_SERVICES_URL || 'http://localhost:8092';

export function getServiceUrlForRole(roleKey: string | null | undefined): string {
  if (!roleKey) return RUST_API_URL;
  
  const normalized = roleKey.toUpperCase();
  switch (normalized) {
    case 'PHOTOGRAPHER': return RUST_PHOTOGRAPHERS_URL;
    case 'TUTOR': return RUST_TUTORS_URL;
    case 'COMPANY': return RUST_COMPANIES_URL;
    case 'JOB_SEEKER': return RUST_JOB_SEEKERS_URL;
    case 'CUSTOMER': return RUST_CUSTOMERS_URL;
    case 'MAKEUP_ARTIST': return RUST_MAKEUP_ARTISTS_URL;
    case 'DEVELOPER': return RUST_DEVELOPERS_URL;
    case 'VIDEO_EDITOR': return RUST_VIDEO_EDITORS_URL;
    case 'GRAPHIC_DESIGNER': return RUST_GRAPHIC_DESIGNERS_URL;
    case 'SOCIAL_MEDIA_MANAGER': return RUST_SOCIAL_MEDIA_MANAGERS_URL;
    case 'FITNESS_TRAINER': return RUST_FITNESS_TRAINERS_URL;
    case 'CATERING_SERVICES': return RUST_CATERING_SERVICES_URL;
    default: return RUST_API_URL;
  }
}

