feat: add dependents management to employee registration
- Introduced functionality to manage dependents during employee registration, allowing users to add details such as relationship, name, CPF, and birth date. - Updated the backend schema and mutation to support optional dependents, enhancing the employee data model. - Enhanced the frontend form to include fields for dependents, improving the user experience in the employee registration process.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -174,6 +174,23 @@ export const create = mutation({
|
||||
declaracaoIdoneidade: v.optional(v.id("_storage")),
|
||||
termoNepotismo: v.optional(v.id("_storage")),
|
||||
termoOpcaoRemuneracao: v.optional(v.id("_storage")),
|
||||
// Dependentes (opcional)
|
||||
dependentes: v.optional(
|
||||
v.array(
|
||||
v.object({
|
||||
parentesco: v.union(
|
||||
v.literal("filho"),
|
||||
v.literal("filha"),
|
||||
v.literal("conjuge"),
|
||||
v.literal("outro")
|
||||
),
|
||||
nome: v.string(),
|
||||
cpf: v.string(),
|
||||
nascimento: v.string(),
|
||||
documentoId: v.optional(v.id("_storage")),
|
||||
})
|
||||
)
|
||||
),
|
||||
},
|
||||
returns: v.id("funcionarios"),
|
||||
handler: async (ctx, args) => {
|
||||
@@ -303,6 +320,23 @@ export const update = mutation({
|
||||
declaracaoIdoneidade: v.optional(v.id("_storage")),
|
||||
termoNepotismo: v.optional(v.id("_storage")),
|
||||
termoOpcaoRemuneracao: v.optional(v.id("_storage")),
|
||||
// Dependentes (opcional)
|
||||
dependentes: v.optional(
|
||||
v.array(
|
||||
v.object({
|
||||
parentesco: v.union(
|
||||
v.literal("filho"),
|
||||
v.literal("filha"),
|
||||
v.literal("conjuge"),
|
||||
v.literal("outro")
|
||||
),
|
||||
nome: v.string(),
|
||||
cpf: v.string(),
|
||||
nascimento: v.string(),
|
||||
documentoId: v.optional(v.id("_storage")),
|
||||
})
|
||||
)
|
||||
),
|
||||
},
|
||||
returns: v.null(),
|
||||
handler: async (ctx, args) => {
|
||||
|
||||
@@ -134,6 +134,24 @@ export default defineSchema({
|
||||
comprovanteResidencia: v.optional(v.id("_storage")),
|
||||
comprovanteContaBradesco: v.optional(v.id("_storage")),
|
||||
|
||||
// Dependentes do funcionário (uploads opcionais)
|
||||
dependentes: v.optional(
|
||||
v.array(
|
||||
v.object({
|
||||
parentesco: v.union(
|
||||
v.literal("filho"),
|
||||
v.literal("filha"),
|
||||
v.literal("conjuge"),
|
||||
v.literal("outro")
|
||||
),
|
||||
nome: v.string(),
|
||||
cpf: v.string(),
|
||||
nascimento: v.string(),
|
||||
documentoId: v.optional(v.id("_storage")),
|
||||
})
|
||||
)
|
||||
),
|
||||
|
||||
// Declarações (Storage IDs)
|
||||
declaracaoAcumulacaoCargo: v.optional(v.id("_storage")),
|
||||
declaracaoDependentesIR: v.optional(v.id("_storage")),
|
||||
|
||||
Reference in New Issue
Block a user