refactor base auth
This commit is contained in:
@@ -381,6 +381,7 @@ export default defineSchema({
|
||||
|
||||
// Sistema de Autenticação e Controle de Acesso
|
||||
usuarios: defineTable({
|
||||
authId: v.optional(v.string()),
|
||||
senhaHash: v.string(), // Senha criptografada com bcrypt
|
||||
nome: v.string(),
|
||||
email: v.string(),
|
||||
@@ -422,7 +423,8 @@ export default defineSchema({
|
||||
.index("by_ativo", ["ativo"])
|
||||
.index("by_status_presenca", ["statusPresenca"])
|
||||
.index("by_bloqueado", ["bloqueado"])
|
||||
.index("by_funcionarioId", ["funcionarioId"]),
|
||||
.index("by_funcionarioId", ["funcionarioId"])
|
||||
.index("authId", ["authId"]),
|
||||
|
||||
roles: defineTable({
|
||||
nome: v.string(), // "admin", "ti_master", "ti_usuario", "usuario_avancado", "usuario"
|
||||
@@ -619,7 +621,11 @@ export default defineSchema({
|
||||
|
||||
// Sistema de Chat
|
||||
conversas: defineTable({
|
||||
tipo: v.union(v.literal("individual"), v.literal("grupo"), v.literal("sala_reuniao")),
|
||||
tipo: v.union(
|
||||
v.literal("individual"),
|
||||
v.literal("grupo"),
|
||||
v.literal("sala_reuniao")
|
||||
),
|
||||
nome: v.optional(v.string()), // nome do grupo/sala
|
||||
avatar: v.optional(v.string()), // avatar do grupo/sala
|
||||
participantes: v.array(v.id("usuarios")), // IDs dos participantes
|
||||
|
||||
Reference in New Issue
Block a user