import {getSnowflakeConnection} from '../snowflake/snowflake-connector'; import {snowFlakeExecute} from '../snowflake/snowflake-executor'; import { getDataBricksConnection } from '../databricks/databricks-connector'; import { databricksExecute } from '../databricks/databricks-executor'; /** * Get all the clients from the common * @async * @stable */ export const getAllClients = async (): Promise> => { const connection = await getSnowflakeConnection(); const query = `select * from brands.aramus.client_details where id in (select distinct clientdetailsid from brands.aramus.alert_type_alert_name_mapping where alert_name='Sales increase' and ui_display=true) and client not like '%dbs%'`; const result: any = await snowFlakeExecute(connection, query); return result; }; /** * Get all the clients from the common * @async * @stable */ export const getAllClientsFromDatabricks = async (warehouseId: string | null = null): Promise> => { const connection = await getDataBricksConnection(warehouseId); const query = `select * from common_catalog.aramus.client_details where id in (select distinct clientdetailsid from common_catalog.aramus.alert_type_alert_name_mapping where alert_name='Sales increase' and ui_display=true) and client not like '%dbs%'`; const result: any = await databricksExecute(connection, query); return result; }; export interface IEntireClientDetails { ID: number; CLIENT: string; ENV: string; ACCOUNT: string; AVC_ACCOUNT_TYPE: string; AVC_LOCATION: string; AVC_EMAIL_DOMAIN: string; }