import { Environment } from "./service-factory";

interface ApiEndpoints {
  authentication: string;
  projects: string;
  teams: string;
  users: string;
}

const STAGING_ENDPOINTS: ApiEndpoints = {
  authentication:
    "https://staging.dev-portal.spartify.io/api-keys/authentication",
  projects: "https://staging.dev-portal.spartify.io/projects",
  teams: "https://staging.dev-portal.spartify.io/teams",
  users: "https://staging.dev-portal.spartify.io/users",
};

const PRODUCTION_ENDPOINTS: ApiEndpoints = {
  authentication: "https://dev-portal.spartify.io/api-keys/authentication",
  projects: "https://dev-portal.spartify.io/projects",
  teams: "https://dev-portal.spartify.io/teams",
  users: "https://dev-portal.spartify.io/users",
};

export const getApiEndpoints = (environment: Environment): ApiEndpoints => {
  switch (environment) {
    case "staging":
      return STAGING_ENDPOINTS;
    case "production":
      return PRODUCTION_ENDPOINTS;
    default:
      return PRODUCTION_ENDPOINTS;
  }
};
