import { getAllRows, getRowById, getRowsWhereIn, insertRow, updateRow, deleteRowById } from '../crud' import type { Group, Consultant } from '../../../src/db/types' export const listGroups = (): Group[] => getAllRows('groups') export const addGroup = (group: Omit): number => insertRow('groups', group) export const listConsultants = (): Consultant[] => getAllRows('consultants') export const getConsultant = (id: number): Consultant | undefined => getRowById('consultants', id) export const getConsultantsByIds = (ids: number[]): Consultant[] => getRowsWhereIn('consultants', 'id', ids) export const addConsultant = (consultant: Omit): number => insertRow('consultants', consultant) export const updateConsultant = (id: number, patch: Partial): number => updateRow('consultants', id, patch) export const deleteConsultant = (id: number): void => deleteRowById('consultants', id)