import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/core"; import type { DB } from "../generated/kysely-tailordb"; export type GetSlackWorkspaceIntegrationInput = Record; export async function run(db: ReadonlyDB, input: GetSlackWorkspaceIntegrationInput) { void input; const row = await db .selectFrom("SlackWorkspaceIntegration") .select([ "id", "teamId", "teamName", "botUserId", "status", "installedAt", "lastValidatedAt", "revokedAt", "createdAt", "updatedAt", ]) .orderBy("createdAt") .limit(1) .executeTakeFirst(); return ok({ slackWorkspaceIntegration: row ?? null }); }