feat: enhance employee and symbol management with new features, improved UI components, and backend schema updates

This commit is contained in:
2025-10-26 22:21:53 -03:00
parent 5dd00b63e1
commit 2c2b792b4a
48 changed files with 9513 additions and 672 deletions

View File

@@ -0,0 +1,44 @@
import { v } from "convex/values";
import { query } from "./_generated/server";
/**
* Listar todas as roles
*/
export const listar = query({
args: {},
returns: v.array(
v.object({
_id: v.id("roles"),
nome: v.string(),
descricao: v.string(),
nivel: v.number(),
setor: v.optional(v.string()),
})
),
handler: async (ctx) => {
return await ctx.db.query("roles").collect();
},
});
/**
* Buscar role por ID
*/
export const buscarPorId = query({
args: {
roleId: v.id("roles"),
},
returns: v.union(
v.object({
_id: v.id("roles"),
nome: v.string(),
descricao: v.string(),
nivel: v.number(),
setor: v.optional(v.string()),
}),
v.null()
),
handler: async (ctx, args) => {
return await ctx.db.get(args.roleId);
},
});