ux improved

This commit is contained in:
Lucas Tettamanti
2026-01-17 04:13:35 -03:00
parent 98e3d78e3d
commit 63b9ecef61
35 changed files with 4266 additions and 75 deletions

View File

@@ -0,0 +1,47 @@
import {
listRecommendations,
getRecommendationById,
insertRecommendation,
updateRecommendation,
deleteRecommendation,
} from "../db/repo.js";
export async function handleListRecommendations({ tenantId, q = "", limit = 200 }) {
const items = await listRecommendations({ tenantId, q, limit });
return { items };
}
export async function handleGetRecommendation({ tenantId, id }) {
return getRecommendationById({ tenantId, id });
}
export async function handleCreateRecommendation({
tenantId,
rule_key,
trigger = {},
queries = [],
boosts = {},
ask_slots = [],
active = true,
priority = 100,
}) {
return insertRecommendation({ tenantId, rule_key, trigger, queries, boosts, ask_slots, active, priority });
}
export async function handleUpdateRecommendation({
tenantId,
id,
trigger,
queries,
boosts,
ask_slots,
active,
priority,
}) {
return updateRecommendation({ tenantId, id, trigger, queries, boosts, ask_slots, active, priority });
}
export async function handleDeleteRecommendation({ tenantId, id }) {
const deleted = await deleteRecommendation({ tenantId, id });
return { deleted };
}