import * as repo from './notification.repo'

export const listCompany      = (companyId: string, unread?: string) => repo.findCompany(companyId, unread)
export const listCompanyHistory = (companyId: string, opts?: { channel?: string; status?: string; limit?: number }) => repo.findCompanyHistory(companyId, opts)
export const countUnread      = (companyId: string) => repo.countUnread(companyId)
export const markRead         = (id: string, companyId: string) => repo.markRead(id, companyId)
export const markAllRead      = (companyId: string) => repo.markAllRead(companyId)
export const getPreferences   = (employeeId: string) => repo.findEmployeePreferences(employeeId)
export const setPreferences   = (employeeId: string, prefs: any[]) => repo.upsertEmployeePreferences(employeeId, prefs)

export const listRenter           = (renterId: string) => repo.findRenter(renterId)
export const markRenterRead       = (id: string, renterId: string) => repo.markRenterRead(id, renterId)
export const markAllRenterRead    = (renterId: string) => repo.markAllRenterRead(renterId)
export const getRenterPreferences = (renterId: string) => repo.findRenterPreferences(renterId)
export const setRenterPreferences = (renterId: string, prefs: any[]) => repo.upsertRenterPreferences(renterId, prefs)
