/**
 * ParkSmarter backend environments.
 *
 * Recovered from the official app (com.ipsgroupinc.parksmarter 4.4.0).
 * Each environment pairs a base URL with an application token that the server
 * requires on every request via the `Application_Token` header.
 *
 * `prodv2` is the environment the shipping app defaults to.
 */
export type EnvironmentName =
  | 'dev'
  | 'stage'
  | 'test'
  | 'prodv1'
  | 'prodv2'
  | 'prodv3';

export interface Environment {
  name: EnvironmentName;
  baseUrl: string;
  appToken: string;
}

export const ENVIRONMENTS: Record<EnvironmentName, Environment> = {
  dev: {
    name: 'dev',
    baseUrl: 'https://dev-parksmarter-api.ipsmeters.com',
    appToken: 'ED09B2F6-BE30-4C92-9204-7D02026CAAE7',
  },
  stage: {
    name: 'stage',
    baseUrl: 'https://staging-parksmarter-api.ipsmeters.com',
    appToken: 'AC657B81-121E-42E8-B6BF-5C2C668B4E00',
  },
  test: {
    name: 'test',
    baseUrl: 'https://testing-parksmarter-api.ipsmeters.com',
    appToken: 'AC657B81-121E-42E8-B6BF-5C2C668B4E00',
  },
  prodv1: {
    name: 'prodv1',
    baseUrl: 'https://api.parksmarter.com',
    appToken: '98774898-E21E-4548-B513-FA7211ABA442',
  },
  prodv2: {
    name: 'prodv2',
    baseUrl: 'https://apiv2.parksmarter.com',
    appToken: 'B66EEDDA-B618-4926-B8A0-F5B58397EEBA',
  },
  prodv3: {
    name: 'prodv3',
    baseUrl: 'https://apiv3.parksmarter.com',
    appToken: '98774898-E21E-4548-B513-FA7211ABA442',
  },
};

/** The environment the official app ships pointed at. */
export const DEFAULT_ENVIRONMENT: EnvironmentName = 'prodv2';
