import '@/shared/config/load-env';

interface ConnectionConfig {
  username?: string;
  password?: string;
  database?: string;
  host?: string;
  port?: string;
}

/**
 * Database connection parameters per environment. Defaults for development are
 * applied by the Sequelize bootstrap in `db/models/index.ts`.
 */
const dbConfig: Record<
  'production' | 'development' | 'dev_stage',
  ConnectionConfig
> = {
  production: {
    username: process.env.DB_USER,
    password: process.env.DB_PASS,
    database: process.env.DB_NAME,
    host: process.env.DB_HOST,
    port: process.env.DB_PORT,
  },
  development: {
    username: process.env.DB_USER,
    password: process.env.DB_PASS,
    database: process.env.DB_NAME,
    host: process.env.DB_HOST,
    port: process.env.DB_PORT,
  },
  dev_stage: {
    username: process.env.DB_USER,
    password: process.env.DB_PASS,
    database: process.env.DB_NAME,
    host: process.env.DB_HOST,
    port: process.env.DB_PORT,
  },
};

export default dbConfig;
