export function pointCoordStringToWKT(coordString) {
  if (!coordString) return null;

  return `SRID=4326;POINT(${coordString})`;
}

export function pointGeographyToCoordinates(columnName) {
  return `ST_X(${columnName}::geometry) || ' ' || ST_Y(${columnName}::geometry) as ${columnName}`;
}

export function lineCoordStringToWKT(coordsString) {
  if (!coordsString) return null;

  return `SRID=4326;LINESTRING(${coordsString})`;
}

export function getTrackingSettings() {
  if (process.env.ENVIRONMENT === 'development') {
    return {
      clickTracking: {
        enable: false,
      },
    };
  }

  return undefined; // null breaks sendgrid code
}

export function pointCoordStringToWKT(coordString) {
  if (!coordString) return null;

  return `SRID=4326;POINT(${coordString})`;
}

export function pointGeographyToCoordinates(columnName) {
  return `ST_X(${columnName}::geometry) || ' ' || ST_Y(${columnName}::geometry) as ${columnName}`;
}

export function lineCoordStringToWKT(coordsString) {
  if (!coordsString) return null;

  return `SRID=4326;LINESTRING(${coordsString})`;
}

export function getTrackingSettings() {
  return {
    clickTracking: {
      enable: false,
    },
  };
}

disable click tracking for all emails in all envs