chore: reorganize project structure and ensure default queues
This commit is contained in:
parent
854887f499
commit
1cccb852a5
201 changed files with 417 additions and 838 deletions
|
|
@ -1,46 +0,0 @@
|
|||
import { ConvexHttpClient } from "convex/browser";
|
||||
|
||||
const url = process.env.NEXT_PUBLIC_CONVEX_URL;
|
||||
|
||||
if (!url) {
|
||||
console.error("Missing NEXT_PUBLIC_CONVEX_URL");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const client = new ConvexHttpClient(url);
|
||||
|
||||
const tenantId = process.argv[2] ?? "tenant-atlas";
|
||||
|
||||
const ensureAdmin = await client.mutation("users:ensureUser", {
|
||||
tenantId,
|
||||
email: "admin@sistema.dev",
|
||||
name: "Administrador",
|
||||
role: "ADMIN",
|
||||
});
|
||||
|
||||
console.log("Ensured admin user:", ensureAdmin);
|
||||
|
||||
const agents = await client.query("users:listAgents", { tenantId });
|
||||
console.log("Agents:", agents);
|
||||
|
||||
const viewerId = ensureAdmin?._id ?? agents[0]?._id;
|
||||
|
||||
if (!viewerId) {
|
||||
console.error("Unable to determine viewer id");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const tickets = await client.query("tickets:list", {
|
||||
tenantId,
|
||||
viewerId,
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
console.log("Tickets:", tickets);
|
||||
|
||||
const dashboard = await client.query("reports:dashboardOverview", {
|
||||
tenantId,
|
||||
viewerId,
|
||||
});
|
||||
|
||||
console.log("Dashboard:", dashboard);
|
||||
Loading…
Add table
Add a link
Reference in a new issue