import { GetWorkPageSubAccountArgs,DeleteWorkPageArgs } from "../../utils/types" import { Knex } from "knex"; import { WORKPAGE, RUNTIME, ID, TENANT_ID, INSTANCE_ID } from "../../utils/globals"; import getDatabaseClient from "../../database/knexClient" import {OrderBy} from "../../utils/enum" // const sharedLib = require('portal-cf-shared-lib'); // const cfLogger:any = sharedLib.cfLogger; // const logger = cfLogger.initLogger('portal-cf-shared-database-client/dao/runtime/workPageVersion.ts'); class WorkPageSubaccountDAO{ async getWorkPage({trx, params = ['*'], zoneId, id, instanceId, orderById = OrderBy.Ascending }:GetWorkPageSubAccountArgs) { try{ const results = await trx .select(params) .from(WORKPAGE) .where(ID, id) .where(INSTANCE_ID, instanceId) .where(TENANT_ID, zoneId) .orderBy(ID , orderById); return results[0]; } catch (error) { // logger.logRequestMessage('error', "Get workPage DB call failed:\n " + error); throw error; } } } export default new WorkPageSubaccountDAO()