refactor: enhance employee management with regime de trabalho integration
- Added regime de trabalho selection to employee forms for better categorization. - Updated backend validation to include regime de trabalho options for employees. - Enhanced employee data handling by integrating regime de trabalho into various components. - Removed the print modal for financial data to streamline the employee profile interface. - Improved overall code clarity and maintainability across multiple files.
This commit is contained in:
@@ -36,6 +36,15 @@ const aposentadoValidator = v.optional(
|
||||
v.union(v.literal("nao"), v.literal("funape_ipsep"), v.literal("inss"))
|
||||
);
|
||||
|
||||
const regimeTrabalhoValidator = v.optional(
|
||||
v.union(
|
||||
v.literal("clt"),
|
||||
v.literal("estatutario_pe"),
|
||||
v.literal("estatutario_federal"),
|
||||
v.literal("estatutario_municipal")
|
||||
)
|
||||
);
|
||||
|
||||
export const getAll = query({
|
||||
args: {},
|
||||
handler: async (ctx) => {
|
||||
@@ -282,6 +291,7 @@ export const update = mutation({
|
||||
nomeacaoPortaria: v.optional(v.string()),
|
||||
nomeacaoData: v.optional(v.string()),
|
||||
nomeacaoDOE: v.optional(v.string()),
|
||||
regimeTrabalho: regimeTrabalhoValidator,
|
||||
pertenceOrgaoPublico: v.optional(v.boolean()),
|
||||
orgaoOrigem: v.optional(v.string()),
|
||||
aposentado: aposentadoValidator,
|
||||
|
||||
@@ -31,6 +31,11 @@ import type { QueryCtx } from "./_generated/server";
|
||||
* - Servidor com mais de 10 anos: pode acumular até 2 períodos
|
||||
* - Preferência: férias no período de 20/12 a 10/01 para docentes
|
||||
* - Gestante: pode antecipar ou prorrogar férias
|
||||
*
|
||||
* ============================================
|
||||
* REGRAS SERVIDOR PÚBLICO MUNICIPAL
|
||||
* ============================================
|
||||
* - Seguem as mesmas diretrizes do regime estadual acima
|
||||
*/
|
||||
|
||||
type RegimeTrabalho = "clt" | "estatutario_pe" | "estatutario_federal" | "estatutario_municipal";
|
||||
@@ -63,7 +68,7 @@ const REGIMES_CONFIG = {
|
||||
},
|
||||
estatutario_municipal: {
|
||||
nome: "Servidor Público Municipal",
|
||||
maxPeriodos: 3,
|
||||
maxPeriodos: 2,
|
||||
minDiasPeriodo: 10,
|
||||
minDiasPeriodoPrincipal: null,
|
||||
abonoPermitido: false,
|
||||
@@ -364,7 +369,7 @@ export const validarSolicitacao = query({
|
||||
}
|
||||
|
||||
// Validação 7: Servidor PE - aviso sobre período preferencial para docentes
|
||||
if (regime === "estatutario_pe") {
|
||||
if (regime === "estatutario_pe" || regime === "estatutario_municipal") {
|
||||
for (const periodo of args.periodos) {
|
||||
const mes = new Date(periodo.dataInicio).getMonth() + 1;
|
||||
if (mes === 12 || mes === 1) {
|
||||
|
||||
Reference in New Issue
Block a user