flit-models 3.3.43 → 3.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/models/contas/usuario/index.d.ts +3 -0
- package/lib/models/contas/usuario/usuario-elastic-convert.js +76 -63
- package/lib/models/contas/usuario/usuario-fire-convert.d.ts +9 -9
- package/lib/models/contas/usuario/usuario-fire-convert.js +46 -38
- package/lib/models/contas/usuario/usuario-json-convert.d.ts +11 -11
- package/lib/models/contas/usuario/usuario-json-convert.js +97 -87
- package/lib/models/utils/date-helper.d.ts +2 -0
- package/lib/models/utils/date-helper.js +16 -0
- package/package.json +1 -1
|
@@ -118,6 +118,9 @@ export interface IUsuarioStatusProgramado {
|
|
|
118
118
|
}
|
|
119
119
|
export declare class Integracao {
|
|
120
120
|
id: string;
|
|
121
|
+
id_externo: string;
|
|
122
|
+
lancamento_data_base: any;
|
|
123
|
+
lancamentos_refs: any[];
|
|
121
124
|
tipo: EnumTipoIntegracao;
|
|
122
125
|
constructor({ id, tipo }: {
|
|
123
126
|
id: string;
|
|
@@ -11,7 +11,7 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
11
11
|
function UsuarioElasticConvert() {
|
|
12
12
|
}
|
|
13
13
|
UsuarioElasticConvert.fromElastic = function (doc) {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25;
|
|
15
15
|
var docData = doc;
|
|
16
16
|
return new _1.Usuario({
|
|
17
17
|
_id: (_a = doc === null || doc === void 0 ? void 0 : doc.i_id) !== null && _a !== void 0 ? _a : null,
|
|
@@ -19,9 +19,9 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
19
19
|
admissao: date_helper_1.DateHelper.fromString(docData.admissao, null),
|
|
20
20
|
ativo: boolean_helper_1.BooleanHelper.check(docData.ativo, true),
|
|
21
21
|
avatar_atualizacao: date_helper_1.DateHelper.fromString(docData.avatar_atualizacao, null),
|
|
22
|
-
avatar_thumbnail_path: string_helper_1.StringHelper.trim(docData.avatar_thumbnail_path, null),
|
|
23
|
-
avatar_thumbnail_url: string_helper_1.StringHelper.trim(docData.avatar_thumbnail_url, null),
|
|
24
|
-
avatarUrl: string_helper_1.StringHelper.trim(docData.avatarUrl, null),
|
|
22
|
+
avatar_thumbnail_path: string_helper_1.StringHelper.trim(docData.avatar_thumbnail_path, null) || null,
|
|
23
|
+
avatar_thumbnail_url: string_helper_1.StringHelper.trim(docData.avatar_thumbnail_url, null) || null,
|
|
24
|
+
avatarUrl: string_helper_1.StringHelper.trim(docData.avatarUrl, null) || null,
|
|
25
25
|
beneficios: docData.beneficios
|
|
26
26
|
? {
|
|
27
27
|
vale_alimentacao: (_c = docData.beneficios.vale_alimentacao) !== null && _c !== void 0 ? _c : false,
|
|
@@ -30,107 +30,120 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
30
30
|
}
|
|
31
31
|
: null,
|
|
32
32
|
cargo_ref: (_g = (_f = docData.cargo_ref) === null || _f === void 0 ? void 0 : _f.i_path) !== null && _g !== void 0 ? _g : null,
|
|
33
|
-
celular: string_helper_1.StringHelper.trim(docData.celular, null),
|
|
33
|
+
celular: string_helper_1.StringHelper.trim(docData.celular, null) || null,
|
|
34
34
|
conta_ref: (_j = (_h = docData.conta_ref) === null || _h === void 0 ? void 0 : _h.i_path) !== null && _j !== void 0 ? _j : null,
|
|
35
|
-
cpf: string_helper_1.StringHelper.trim(docData.cpf, null),
|
|
35
|
+
cpf: string_helper_1.StringHelper.trim(docData.cpf, null) || null,
|
|
36
36
|
data_atualizacao_doc: date_helper_1.DateHelper.fromString(docData.data_atualizacao_doc, new Date()),
|
|
37
37
|
data_criacao_doc: date_helper_1.DateHelper.fromString(docData.data_atualizacao_doc, new Date()),
|
|
38
38
|
departamento_ref: (_l = (_k = docData.departamento_ref) === null || _k === void 0 ? void 0 : _k.i_path) !== null && _l !== void 0 ? _l : null,
|
|
39
39
|
desligamento: date_helper_1.DateHelper.fromString(docData.desligamento, null),
|
|
40
|
-
email: string_helper_1.StringHelper.trim(docData.email, null),
|
|
40
|
+
email: string_helper_1.StringHelper.trim(docData.email, null) || null,
|
|
41
41
|
empresa_ref: (_o = (_m = docData.empresa_ref) === null || _m === void 0 ? void 0 : _m.i_path) !== null && _o !== void 0 ? _o : null,
|
|
42
42
|
endereco: docData.endereco
|
|
43
43
|
? {
|
|
44
|
-
bairro: string_helper_1.StringHelper.trim(docData.endereco.bairro, null),
|
|
45
|
-
cep: string_helper_1.StringHelper.trim(docData.endereco.cep, null),
|
|
46
|
-
cidade: string_helper_1.StringHelper.trim(docData.endereco.cidade, null),
|
|
47
|
-
complemento: string_helper_1.StringHelper.trim(docData.endereco.complemento, null),
|
|
48
|
-
logradouro: string_helper_1.StringHelper.trim(docData.endereco.logradouro, null),
|
|
49
|
-
numero: string_helper_1.StringHelper.trim(docData.endereco.numero, null),
|
|
50
|
-
uf: string_helper_1.StringHelper.trim(docData.endereco.uf, null),
|
|
44
|
+
bairro: string_helper_1.StringHelper.trim(docData.endereco.bairro, null) || null,
|
|
45
|
+
cep: string_helper_1.StringHelper.trim(docData.endereco.cep, null) || null,
|
|
46
|
+
cidade: string_helper_1.StringHelper.trim(docData.endereco.cidade, null) || null,
|
|
47
|
+
complemento: string_helper_1.StringHelper.trim(docData.endereco.complemento, null) || null,
|
|
48
|
+
logradouro: string_helper_1.StringHelper.trim(docData.endereco.logradouro, null) || null,
|
|
49
|
+
numero: string_helper_1.StringHelper.trim(docData.endereco.numero, null) || null,
|
|
50
|
+
uf: string_helper_1.StringHelper.trim(docData.endereco.uf, null) || null,
|
|
51
51
|
}
|
|
52
52
|
: null,
|
|
53
53
|
endereco_prestacao_diferente_empresa: boolean_helper_1.BooleanHelper.check(docData.endereco_prestacao_diferente_empresa, false),
|
|
54
54
|
endereco_prestacao: docData.endereco_prestacao
|
|
55
55
|
? {
|
|
56
|
-
bairro: string_helper_1.StringHelper.trim(docData.endereco_prestacao.bairro, null)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
bairro: string_helper_1.StringHelper.trim(docData.endereco_prestacao.bairro, null) ||
|
|
57
|
+
null,
|
|
58
|
+
cep: string_helper_1.StringHelper.trim(docData.endereco_prestacao.cep, null) || null,
|
|
59
|
+
cidade: string_helper_1.StringHelper.trim(docData.endereco_prestacao.cidade, null) ||
|
|
60
|
+
null,
|
|
61
|
+
complemento: string_helper_1.StringHelper.trim(docData.endereco_prestacao.complemento, null) ||
|
|
62
|
+
null,
|
|
63
|
+
logradouro: string_helper_1.StringHelper.trim(docData.endereco_prestacao.logradouro, null) ||
|
|
64
|
+
null,
|
|
65
|
+
numero: string_helper_1.StringHelper.trim(docData.endereco_prestacao.numero, null) ||
|
|
66
|
+
null,
|
|
67
|
+
uf: string_helper_1.StringHelper.trim(docData.endereco_prestacao.uf, null) || null,
|
|
63
68
|
}
|
|
64
69
|
: null,
|
|
65
70
|
escala_ref: (_q = (_p = docData.escala_ref) === null || _p === void 0 ? void 0 : _p.i_path) !== null && _q !== void 0 ? _q : null,
|
|
66
71
|
esocial_categoria_de_trabalhador_ref: (_s = (_r = docData.esocial_categoria_de_trabalhador_ref) === null || _r === void 0 ? void 0 : _r.i_path) !== null && _s !== void 0 ? _s : null,
|
|
67
72
|
excluido: boolean_helper_1.BooleanHelper.check(docData.excluido, false),
|
|
68
|
-
id_externo: string_helper_1.StringHelper.trim(docData.id_externo, null),
|
|
73
|
+
id_externo: string_helper_1.StringHelper.trim(docData.id_externo, null) || null,
|
|
69
74
|
integracao: docData.integracao
|
|
70
75
|
? {
|
|
71
|
-
id: string_helper_1.StringHelper.trim((_t = docData.integracao) === null || _t === void 0 ? void 0 : _t.id, null),
|
|
72
|
-
|
|
76
|
+
id: string_helper_1.StringHelper.trim((_t = docData.integracao) === null || _t === void 0 ? void 0 : _t.id, null) || null,
|
|
77
|
+
id_externo: string_helper_1.StringHelper.trim((_u = docData.integracao) === null || _u === void 0 ? void 0 : _u.id_externo, null) || null,
|
|
78
|
+
lancamento_data_base: date_helper_1.DateHelper.fromString((_v = docData.integracao) === null || _v === void 0 ? void 0 : _v.lancamento_data_base, null),
|
|
79
|
+
lancamentos_refs: ((_w = docData.integracao) === null || _w === void 0 ? void 0 : _w.lancamentos_refs) &&
|
|
80
|
+
((_x = docData.integracao) === null || _x === void 0 ? void 0 : _x.lancamentos_refs.length)
|
|
81
|
+
? (_y = docData.integracao) === null || _y === void 0 ? void 0 : _y.lancamentos_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.i_path; })
|
|
82
|
+
: [],
|
|
83
|
+
tipo: string_helper_1.StringHelper.trim((_z = docData.integracao) === null || _z === void 0 ? void 0 : _z.tipo, null) || null,
|
|
73
84
|
}
|
|
74
85
|
: null,
|
|
75
86
|
interno: boolean_helper_1.BooleanHelper.check(docData.interno, false),
|
|
76
87
|
nascimento: date_helper_1.DateHelper.fromString(docData.nascimento, null),
|
|
77
|
-
nome: string_helper_1.StringHelper.trim(docData.nome, null),
|
|
78
|
-
nomeCompleto: string_helper_1.StringHelper.trim(docData.nomeCompleto, null),
|
|
79
|
-
observacoes: string_helper_1.StringHelper.trim(docData.observacoes, null),
|
|
88
|
+
nome: string_helper_1.StringHelper.trim(docData.nome, null) || null,
|
|
89
|
+
nomeCompleto: string_helper_1.StringHelper.trim(docData.nomeCompleto, null) || null,
|
|
90
|
+
observacoes: string_helper_1.StringHelper.trim(docData.observacoes, null) || null,
|
|
80
91
|
parametros: docData.parametros
|
|
81
92
|
? {
|
|
82
|
-
acessar_manager: boolean_helper_1.BooleanHelper.check(docData.parametros.acessar_manager,
|
|
83
|
-
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_foto_marcacao_externa,
|
|
84
|
-
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_localizacao_marcacao_externa,
|
|
85
|
-
cargo_confianca: boolean_helper_1.BooleanHelper.check(docData.parametros.cargo_confianca,
|
|
86
|
-
codigo_externo: string_helper_1.StringHelper.
|
|
87
|
-
|
|
93
|
+
acessar_manager: boolean_helper_1.BooleanHelper.check(docData.parametros.acessar_manager, false),
|
|
94
|
+
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_foto_marcacao_externa, false),
|
|
95
|
+
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_localizacao_marcacao_externa, false),
|
|
96
|
+
cargo_confianca: boolean_helper_1.BooleanHelper.check(docData.parametros.cargo_confianca, false),
|
|
97
|
+
codigo_externo: string_helper_1.StringHelper.trim(docData.parametros.codigo_externo, null) ||
|
|
98
|
+
null,
|
|
99
|
+
horario_noturno: ((_0 = docData.parametros) === null || _0 === void 0 ? void 0 : _0.horario_noturno)
|
|
88
100
|
? {
|
|
89
|
-
tipo: string_helper_1.StringHelper.
|
|
90
|
-
inicio: string_helper_1.StringHelper.
|
|
91
|
-
fim: string_helper_1.StringHelper.
|
|
92
|
-
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((
|
|
101
|
+
tipo: string_helper_1.StringHelper.trim((_2 = docData.parametros.horario_noturno) === null || _2 === void 0 ? void 0 : _2.tipo, null) || null,
|
|
102
|
+
inicio: string_helper_1.StringHelper.trim((_3 = docData.parametros.horario_noturno) === null || _3 === void 0 ? void 0 : _3.inicio, null) || null,
|
|
103
|
+
fim: string_helper_1.StringHelper.trim((_4 = docData.parametros.horario_noturno) === null || _4 === void 0 ? void 0 : _4.fim, null) || null,
|
|
104
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_5 = docData.parametros.horario_noturno) === null || _5 === void 0 ? void 0 : _5.hora_reduzida_segundos),
|
|
93
105
|
}
|
|
94
106
|
: null,
|
|
95
|
-
horista: boolean_helper_1.BooleanHelper.check(docData.parametros.horista,
|
|
96
|
-
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(docData.parametros.marcacao_whatsapp,
|
|
97
|
-
marca_ponto_web: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_web,
|
|
98
|
-
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_multi_empresa,
|
|
99
|
-
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_flit,
|
|
100
|
-
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial,
|
|
101
|
-
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial_obrigatorio,
|
|
102
|
-
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_apenas_online,
|
|
103
|
-
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.
|
|
104
|
-
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((
|
|
105
|
-
regime_compensacao: string_helper_1.StringHelper.
|
|
107
|
+
horista: boolean_helper_1.BooleanHelper.check(docData.parametros.horista, false),
|
|
108
|
+
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(docData.parametros.marcacao_whatsapp, false),
|
|
109
|
+
marca_ponto_web: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_web, false),
|
|
110
|
+
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_multi_empresa, false),
|
|
111
|
+
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_flit, false),
|
|
112
|
+
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial, false),
|
|
113
|
+
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial_obrigatorio, false),
|
|
114
|
+
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_apenas_online, false),
|
|
115
|
+
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.trim(docData.parametros.configuracao_tipo_falta_jornada, null),
|
|
116
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_6 = docData.parametros) === null || _6 === void 0 ? void 0 : _6.limite_minutos_interjornada) || null,
|
|
117
|
+
regime_compensacao: string_helper_1.StringHelper.trim(docData.parametros.regime_compensacao, null) ||
|
|
118
|
+
null,
|
|
106
119
|
}
|
|
107
120
|
: null,
|
|
108
|
-
perfil_ref: (
|
|
109
|
-
perimetros_refs: docData.perimetros_refs
|
|
110
|
-
? docData.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.i_path; })
|
|
111
|
-
:
|
|
121
|
+
perfil_ref: (_8 = (_7 = docData.perfil_ref) === null || _7 === void 0 ? void 0 : _7.i_path) !== null && _8 !== void 0 ? _8 : null,
|
|
122
|
+
perimetros_refs: ((_10 = (_9 = docData.perimetros_refs) === null || _9 === void 0 ? void 0 : _9.length) !== null && _10 !== void 0 ? _10 : 0) > 0
|
|
123
|
+
? docData.perimetros_refs.map(function (ref) { var _a; return (_a = ref === null || ref === void 0 ? void 0 : ref.i_path) !== null && _a !== void 0 ? _a : null; })
|
|
124
|
+
: null,
|
|
112
125
|
pin: number_helper_1.NumberHelper.convertToNumber(docData === null || docData === void 0 ? void 0 : docData.pin),
|
|
113
|
-
pis: string_helper_1.StringHelper.trim(docData.pis, null),
|
|
126
|
+
pis: string_helper_1.StringHelper.trim(docData.pis, null) || null,
|
|
114
127
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(docData.sem_autenticacao, false),
|
|
115
|
-
status: string_helper_1.StringHelper.
|
|
128
|
+
status: string_helper_1.StringHelper.trim(docData.status, _1.StatusUsuario.Ativo) || null,
|
|
116
129
|
status_data_ini: date_helper_1.DateHelper.fromString(docData.status_data_ini, null),
|
|
117
130
|
status_data_fim: date_helper_1.DateHelper.fromString(docData.status_data_fim, null),
|
|
118
131
|
status_programado: docData.status_programado
|
|
119
132
|
? {
|
|
120
133
|
data_prevista: date_helper_1.DateHelper.fromString(docData.status_programado.data_prevista, null),
|
|
121
|
-
executado: boolean_helper_1.BooleanHelper.check(docData.status_programado.executado,
|
|
122
|
-
tipo: string_helper_1.StringHelper.
|
|
134
|
+
executado: boolean_helper_1.BooleanHelper.check(docData.status_programado.executado, false),
|
|
135
|
+
tipo: string_helper_1.StringHelper.trim((_11 = docData.status_programado) === null || _11 === void 0 ? void 0 : _11.tipo, null) || null,
|
|
123
136
|
}
|
|
124
137
|
: null,
|
|
125
|
-
telefone: string_helper_1.StringHelper.trim(docData.telefone, null),
|
|
138
|
+
telefone: string_helper_1.StringHelper.trim(docData.telefone, null) || null,
|
|
126
139
|
modificador: docData.modificador
|
|
127
140
|
? (0, lodash_1.omitBy)({
|
|
128
|
-
id: (
|
|
129
|
-
ref: (
|
|
130
|
-
tipo: (
|
|
131
|
-
nome:
|
|
132
|
-
documento:
|
|
133
|
-
email:
|
|
141
|
+
id: (_14 = (_13 = (_12 = docData.modificador) === null || _12 === void 0 ? void 0 : _12.ref) === null || _13 === void 0 ? void 0 : _13.id) !== null && _14 !== void 0 ? _14 : null,
|
|
142
|
+
ref: (_17 = (_16 = (_15 = docData.modificador) === null || _15 === void 0 ? void 0 : _15.ref) === null || _16 === void 0 ? void 0 : _16.path) !== null && _17 !== void 0 ? _17 : null,
|
|
143
|
+
tipo: (_19 = (_18 = docData.modificador) === null || _18 === void 0 ? void 0 : _18.tipo) !== null && _19 !== void 0 ? _19 : null,
|
|
144
|
+
nome: (_21 = (_20 = docData.modificador) === null || _20 === void 0 ? void 0 : _20.nome) !== null && _21 !== void 0 ? _21 : null,
|
|
145
|
+
documento: (_23 = (_22 = docData.modificador) === null || _22 === void 0 ? void 0 : _22.documento) !== null && _23 !== void 0 ? _23 : null,
|
|
146
|
+
email: (_25 = (_24 = docData.modificador) === null || _24 === void 0 ? void 0 : _24.email) !== null && _25 !== void 0 ? _25 : null,
|
|
134
147
|
}, lodash_1.isUndefined)
|
|
135
148
|
: undefined,
|
|
136
149
|
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { BeneficiosUsuario, Integracao, ParametrosUsuario, StatusUsuario, Usuario, UsuarioBase, UsuarioStatusProgramado } from '.';
|
|
2
|
-
import { FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
2
|
+
import { FirebaseDocumentReferenceGeneric, FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
3
|
import { AuditoriaModificadorFirestoreData } from '../auditoria/modificador';
|
|
4
4
|
import { Endereco } from '../shared';
|
|
5
5
|
export declare class UsuarioFirestoreData implements Omit<UsuarioBase, 'modificador'> {
|
|
6
|
+
conta_ref?: FirebaseDocumentReferenceGeneric;
|
|
7
|
+
empresa_ref?: FirebaseDocumentReferenceGeneric;
|
|
8
|
+
departamento_ref?: FirebaseDocumentReferenceGeneric;
|
|
9
|
+
cargo_ref?: FirebaseDocumentReferenceGeneric;
|
|
10
|
+
escala_ref?: FirebaseDocumentReferenceGeneric;
|
|
11
|
+
esocial_categoria_de_trabalhador_ref?: FirebaseDocumentReferenceGeneric;
|
|
12
|
+
perfil_ref?: FirebaseDocumentReferenceGeneric;
|
|
13
|
+
perimetros_refs?: FirebaseDocumentReferenceGeneric[];
|
|
6
14
|
admissao?: FirebaseTimestampGeneric;
|
|
7
15
|
ativo?: boolean;
|
|
8
16
|
avatar_atualizacao?: FirebaseTimestampGeneric;
|
|
@@ -10,21 +18,15 @@ export declare class UsuarioFirestoreData implements Omit<UsuarioBase, 'modifica
|
|
|
10
18
|
avatar_thumbnail_url?: string;
|
|
11
19
|
avatarUrl?: string;
|
|
12
20
|
beneficios?: BeneficiosUsuario;
|
|
13
|
-
cargo_ref?: any;
|
|
14
21
|
celular?: string;
|
|
15
|
-
conta_ref?: any;
|
|
16
22
|
cpf?: string;
|
|
17
23
|
data_atualizacao_doc?: FirebaseTimestampGeneric;
|
|
18
24
|
data_criacao_doc?: FirebaseTimestampGeneric;
|
|
19
|
-
departamento_ref?: any;
|
|
20
25
|
desligamento?: FirebaseTimestampGeneric;
|
|
21
26
|
email?: string;
|
|
22
|
-
empresa_ref?: any;
|
|
23
27
|
endereco?: Endereco;
|
|
24
28
|
endereco_prestacao_diferente_empresa?: boolean;
|
|
25
29
|
endereco_prestacao?: Endereco;
|
|
26
|
-
escala_ref?: any;
|
|
27
|
-
esocial_categoria_de_trabalhador_ref?: any;
|
|
28
30
|
excluido?: boolean;
|
|
29
31
|
id_externo?: string;
|
|
30
32
|
integracao?: Integracao;
|
|
@@ -34,8 +36,6 @@ export declare class UsuarioFirestoreData implements Omit<UsuarioBase, 'modifica
|
|
|
34
36
|
nomeCompleto?: string;
|
|
35
37
|
observacoes?: string;
|
|
36
38
|
parametros?: ParametrosUsuario;
|
|
37
|
-
perfil_ref?: any;
|
|
38
|
-
perimetros_refs?: any[];
|
|
39
39
|
pin?: number;
|
|
40
40
|
pis?: string;
|
|
41
41
|
sem_autenticacao?: boolean;
|
|
@@ -16,7 +16,7 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
16
16
|
function UsuarioFireConvert() {
|
|
17
17
|
}
|
|
18
18
|
UsuarioFireConvert.fromFirestore = function (doc) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39;
|
|
20
20
|
var d = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
|
|
21
21
|
return new _1.Usuario({
|
|
22
22
|
_id: (_b = doc === null || doc === void 0 ? void 0 : doc.id) !== null && _b !== void 0 ? _b : null,
|
|
@@ -76,66 +76,74 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
76
76
|
integracao: d.integracao
|
|
77
77
|
? {
|
|
78
78
|
id: string_helper_1.StringHelper.trim((_x = d.integracao) === null || _x === void 0 ? void 0 : _x.id, null),
|
|
79
|
-
|
|
79
|
+
id_externo: string_helper_1.StringHelper.trim((_y = d.integracao) === null || _y === void 0 ? void 0 : _y.id_externo, null),
|
|
80
|
+
lancamento_data_base: (_2 = (_0 = (_z = d.integracao) === null || _z === void 0 ? void 0 : _z.lancamento_data_base) === null || _0 === void 0 ? void 0 : _0.toDate()) !== null && _2 !== void 0 ? _2 : null,
|
|
81
|
+
lancamentos_refs: ((_3 = d.integracao) === null || _3 === void 0 ? void 0 : _3.lancamentos_refs) &&
|
|
82
|
+
((_4 = d.integracao) === null || _4 === void 0 ? void 0 : _4.lancamentos_refs.length)
|
|
83
|
+
? (_5 = d.integracao) === null || _5 === void 0 ? void 0 : _5.lancamentos_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.i_path; })
|
|
84
|
+
: [],
|
|
85
|
+
tipo: string_helper_1.StringHelper.trim((_6 = d.integracao) === null || _6 === void 0 ? void 0 : _6.tipo, null),
|
|
80
86
|
}
|
|
81
87
|
: null,
|
|
82
88
|
interno: boolean_helper_1.BooleanHelper.check(d.interno, false),
|
|
83
|
-
nascimento: (
|
|
89
|
+
nascimento: (_8 = (_7 = d.nascimento) === null || _7 === void 0 ? void 0 : _7.toDate()) !== null && _8 !== void 0 ? _8 : null,
|
|
84
90
|
nome: string_helper_1.StringHelper.trim(d.nome, null),
|
|
85
91
|
nomeCompleto: string_helper_1.StringHelper.trim(d.nomeCompleto, null),
|
|
86
92
|
observacoes: string_helper_1.StringHelper.trim(d.observacoes, null),
|
|
87
93
|
parametros: d.parametros
|
|
88
94
|
? {
|
|
89
|
-
acessar_manager: boolean_helper_1.BooleanHelper.check(d.parametros.acessar_manager,
|
|
90
|
-
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_foto_marcacao_externa,
|
|
91
|
-
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_localizacao_marcacao_externa,
|
|
92
|
-
cargo_confianca: boolean_helper_1.BooleanHelper.check(d.parametros.cargo_confianca,
|
|
93
|
-
codigo_externo: string_helper_1.StringHelper.
|
|
94
|
-
horario_noturno: ((
|
|
95
|
+
acessar_manager: boolean_helper_1.BooleanHelper.check(d.parametros.acessar_manager, false),
|
|
96
|
+
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_foto_marcacao_externa, false),
|
|
97
|
+
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_localizacao_marcacao_externa, false),
|
|
98
|
+
cargo_confianca: boolean_helper_1.BooleanHelper.check(d.parametros.cargo_confianca, false),
|
|
99
|
+
codigo_externo: string_helper_1.StringHelper.trim(d.parametros.codigo_externo, null),
|
|
100
|
+
horario_noturno: ((_9 = d.parametros) === null || _9 === void 0 ? void 0 : _9.horario_noturno)
|
|
95
101
|
? {
|
|
96
|
-
tipo: string_helper_1.StringHelper.
|
|
97
|
-
inicio: string_helper_1.StringHelper.
|
|
98
|
-
fim: string_helper_1.StringHelper.
|
|
99
|
-
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((
|
|
102
|
+
tipo: string_helper_1.StringHelper.trim((_10 = d.parametros.horario_noturno) === null || _10 === void 0 ? void 0 : _10.tipo, null),
|
|
103
|
+
inicio: string_helper_1.StringHelper.trim((_11 = d.parametros.horario_noturno) === null || _11 === void 0 ? void 0 : _11.inicio, null),
|
|
104
|
+
fim: string_helper_1.StringHelper.trim((_12 = d.parametros.horario_noturno) === null || _12 === void 0 ? void 0 : _12.fim, null),
|
|
105
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_13 = d.parametros.horario_noturno) === null || _13 === void 0 ? void 0 : _13.hora_reduzida_segundos),
|
|
100
106
|
}
|
|
101
107
|
: null,
|
|
102
|
-
horista: boolean_helper_1.BooleanHelper.check(d.parametros.horista,
|
|
103
|
-
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(d.parametros.marcacao_whatsapp,
|
|
104
|
-
marca_ponto_web: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_web,
|
|
105
|
-
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_multi_empresa,
|
|
106
|
-
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_flit,
|
|
107
|
-
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial,
|
|
108
|
-
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial_obrigatorio,
|
|
109
|
-
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_apenas_online,
|
|
110
|
-
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.
|
|
111
|
-
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((
|
|
112
|
-
regime_compensacao: string_helper_1.StringHelper.
|
|
108
|
+
horista: boolean_helper_1.BooleanHelper.check(d.parametros.horista, false),
|
|
109
|
+
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(d.parametros.marcacao_whatsapp, false),
|
|
110
|
+
marca_ponto_web: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_web, false),
|
|
111
|
+
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_multi_empresa, false),
|
|
112
|
+
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_flit, false),
|
|
113
|
+
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial, false),
|
|
114
|
+
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial_obrigatorio, false),
|
|
115
|
+
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_apenas_online, false),
|
|
116
|
+
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.trim(d.parametros.configuracao_tipo_falta_jornada, null),
|
|
117
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_14 = d.parametros) === null || _14 === void 0 ? void 0 : _14.limite_minutos_interjornada) || null,
|
|
118
|
+
regime_compensacao: string_helper_1.StringHelper.trim(d.parametros.regime_compensacao, null),
|
|
113
119
|
}
|
|
114
120
|
: null,
|
|
115
|
-
perfil_ref: d.perfil_ref ? (
|
|
116
|
-
perimetros_refs: (
|
|
121
|
+
perfil_ref: d.perfil_ref ? (_15 = d.perfil_ref) === null || _15 === void 0 ? void 0 : _15.path : null,
|
|
122
|
+
perimetros_refs: ((_17 = (_16 = d.perimetros_refs) === null || _16 === void 0 ? void 0 : _16.length) !== null && _17 !== void 0 ? _17 : 0) > 0
|
|
123
|
+
? d.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
|
|
124
|
+
: null,
|
|
117
125
|
pin: number_helper_1.NumberHelper.convertToNumber(d === null || d === void 0 ? void 0 : d.pin),
|
|
118
126
|
pis: string_helper_1.StringHelper.trim(d.pis, null),
|
|
119
127
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(d.sem_autenticacao, false),
|
|
120
|
-
status: string_helper_1.StringHelper.
|
|
121
|
-
status_data_ini: (
|
|
122
|
-
status_data_fim: (
|
|
128
|
+
status: string_helper_1.StringHelper.trim(d.status, _1.StatusUsuario.Ativo),
|
|
129
|
+
status_data_ini: (_19 = (_18 = d.status_data_ini) === null || _18 === void 0 ? void 0 : _18.toDate()) !== null && _19 !== void 0 ? _19 : null,
|
|
130
|
+
status_data_fim: (_21 = (_20 = d.status_data_fim) === null || _20 === void 0 ? void 0 : _20.toDate()) !== null && _21 !== void 0 ? _21 : null,
|
|
123
131
|
status_programado: d.status_programado
|
|
124
132
|
? {
|
|
125
|
-
data_prevista: (
|
|
126
|
-
executado: boolean_helper_1.BooleanHelper.check((
|
|
127
|
-
tipo: string_helper_1.StringHelper.
|
|
133
|
+
data_prevista: (_23 = (_22 = d.status_programado.data_prevista) === null || _22 === void 0 ? void 0 : _22.toDate()) !== null && _23 !== void 0 ? _23 : null,
|
|
134
|
+
executado: boolean_helper_1.BooleanHelper.check((_24 = d.status_programado) === null || _24 === void 0 ? void 0 : _24.executado, false),
|
|
135
|
+
tipo: string_helper_1.StringHelper.trim((_25 = d.status_programado) === null || _25 === void 0 ? void 0 : _25.tipo, null),
|
|
128
136
|
}
|
|
129
137
|
: null,
|
|
130
138
|
telefone: string_helper_1.StringHelper.trim(d.telefone, null),
|
|
131
139
|
modificador: d.modificador
|
|
132
140
|
? (0, lodash_1.omitBy)({
|
|
133
|
-
id: (
|
|
134
|
-
ref: (
|
|
135
|
-
tipo: (
|
|
136
|
-
nome:
|
|
137
|
-
documento:
|
|
138
|
-
email:
|
|
141
|
+
id: (_28 = (_27 = (_26 = d.modificador) === null || _26 === void 0 ? void 0 : _26.ref) === null || _27 === void 0 ? void 0 : _27.id) !== null && _28 !== void 0 ? _28 : null,
|
|
142
|
+
ref: (_31 = (_30 = (_29 = d.modificador) === null || _29 === void 0 ? void 0 : _29.ref) === null || _30 === void 0 ? void 0 : _30.path) !== null && _31 !== void 0 ? _31 : null,
|
|
143
|
+
tipo: (_33 = (_32 = d.modificador) === null || _32 === void 0 ? void 0 : _32.tipo) !== null && _33 !== void 0 ? _33 : null,
|
|
144
|
+
nome: (_35 = (_34 = d.modificador) === null || _34 === void 0 ? void 0 : _34.nome) !== null && _35 !== void 0 ? _35 : null,
|
|
145
|
+
documento: (_37 = (_36 = d.modificador) === null || _36 === void 0 ? void 0 : _36.documento) !== null && _37 !== void 0 ? _37 : null,
|
|
146
|
+
email: (_39 = (_38 = d.modificador) === null || _38 === void 0 ? void 0 : _38.email) !== null && _39 !== void 0 ? _39 : null,
|
|
139
147
|
}, lodash_1.isUndefined)
|
|
140
148
|
: undefined,
|
|
141
149
|
});
|
|
@@ -4,28 +4,30 @@ import { Endereco } from '../shared';
|
|
|
4
4
|
export declare class UsuarioJsonData implements UsuarioBase {
|
|
5
5
|
_id: string;
|
|
6
6
|
_path: string;
|
|
7
|
+
conta_ref?: string;
|
|
8
|
+
empresa_ref?: string;
|
|
9
|
+
departamento_ref?: string;
|
|
10
|
+
cargo_ref?: string;
|
|
11
|
+
escala_ref?: string;
|
|
12
|
+
esocial_categoria_de_trabalhador_ref?: string;
|
|
13
|
+
perfil_ref?: string;
|
|
14
|
+
perimetros_refs?: string[];
|
|
7
15
|
admissao?: number;
|
|
8
16
|
ativo?: boolean;
|
|
9
|
-
avatar_atualizacao?:
|
|
17
|
+
avatar_atualizacao?: number;
|
|
10
18
|
avatar_thumbnail_path?: string;
|
|
11
19
|
avatar_thumbnail_url?: string;
|
|
12
20
|
avatarUrl?: string;
|
|
13
21
|
beneficios?: BeneficiosUsuario;
|
|
14
|
-
cargo_ref?: any;
|
|
15
22
|
celular?: string;
|
|
16
|
-
conta_ref?: any;
|
|
17
23
|
cpf?: string;
|
|
18
|
-
data_atualizacao_doc?:
|
|
19
|
-
data_criacao_doc?:
|
|
20
|
-
departamento_ref?: any;
|
|
24
|
+
data_atualizacao_doc?: number;
|
|
25
|
+
data_criacao_doc?: number;
|
|
21
26
|
desligamento?: number;
|
|
22
27
|
email?: string;
|
|
23
|
-
empresa_ref?: any;
|
|
24
28
|
endereco?: Endereco;
|
|
25
29
|
endereco_prestacao_diferente_empresa?: boolean;
|
|
26
30
|
endereco_prestacao?: Endereco;
|
|
27
|
-
escala_ref?: any;
|
|
28
|
-
esocial_categoria_de_trabalhador_ref?: any;
|
|
29
31
|
excluido?: boolean;
|
|
30
32
|
id_externo?: string;
|
|
31
33
|
integracao?: Integracao;
|
|
@@ -35,8 +37,6 @@ export declare class UsuarioJsonData implements UsuarioBase {
|
|
|
35
37
|
nomeCompleto?: string;
|
|
36
38
|
observacoes?: string;
|
|
37
39
|
parametros?: ParametrosUsuario;
|
|
38
|
-
perfil_ref?: any;
|
|
39
|
-
perimetros_refs?: any[];
|
|
40
40
|
pin?: number;
|
|
41
41
|
pis?: string;
|
|
42
42
|
sem_autenticacao?: boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UsuarioJsonConvert = exports.UsuarioJsonData = void 0;
|
|
4
4
|
var lodash_1 = require("lodash");
|
|
5
|
+
var _1 = require(".");
|
|
5
6
|
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
6
7
|
var date_helper_1 = require("../../utils/date-helper");
|
|
7
8
|
var number_helper_1 = require("../../utils/number-helper");
|
|
@@ -19,129 +20,138 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
19
20
|
// public static fromJson(obj: UsuarioJsonData): Usuario {
|
|
20
21
|
// }
|
|
21
22
|
UsuarioJsonConvert.toJson = function (usuario) {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0,
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45;
|
|
23
24
|
var usuarioJson = {
|
|
24
25
|
_id: (_a = usuario === null || usuario === void 0 ? void 0 : usuario._id) !== null && _a !== void 0 ? _a : null,
|
|
25
26
|
_path: (_b = usuario === null || usuario === void 0 ? void 0 : usuario._path) !== null && _b !== void 0 ? _b : null,
|
|
26
|
-
admissao: (_c = date_helper_1.DateHelper.
|
|
27
|
-
ativo: boolean_helper_1.BooleanHelper.check(usuario.ativo,
|
|
28
|
-
avatar_atualizacao: usuario.avatar_atualizacao
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
avatar_thumbnail_url: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_url, null),
|
|
33
|
-
avatarUrl: string_helper_1.StringHelper.check(usuario.avatarUrl, null),
|
|
27
|
+
admissao: (_d = (_c = date_helper_1.DateHelper.tratarData(usuario.admissao, null)) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : null,
|
|
28
|
+
ativo: boolean_helper_1.BooleanHelper.check(usuario.ativo, true),
|
|
29
|
+
avatar_atualizacao: (_f = (_e = date_helper_1.DateHelper.tratarData(usuario.avatar_atualizacao, null)) === null || _e === void 0 ? void 0 : _e.getTime()) !== null && _f !== void 0 ? _f : null,
|
|
30
|
+
avatar_thumbnail_path: string_helper_1.StringHelper.trim(usuario.avatar_thumbnail_path, null) || null,
|
|
31
|
+
avatar_thumbnail_url: string_helper_1.StringHelper.trim(usuario.avatar_thumbnail_url, null) || null,
|
|
32
|
+
avatarUrl: string_helper_1.StringHelper.trim(usuario.avatarUrl, null) || null,
|
|
34
33
|
beneficios: usuario.beneficios
|
|
35
34
|
? {
|
|
36
|
-
vale_alimentacao: (
|
|
37
|
-
vale_refeicao: (
|
|
38
|
-
vale_transporte: (
|
|
35
|
+
vale_alimentacao: (_g = usuario.beneficios.vale_alimentacao) !== null && _g !== void 0 ? _g : false,
|
|
36
|
+
vale_refeicao: (_h = usuario.beneficios.vale_refeicao) !== null && _h !== void 0 ? _h : false,
|
|
37
|
+
vale_transporte: (_j = usuario.beneficios.vale_transporte) !== null && _j !== void 0 ? _j : false,
|
|
39
38
|
}
|
|
40
39
|
: null,
|
|
41
|
-
cargo_ref: (
|
|
42
|
-
celular: string_helper_1.StringHelper.trim(usuario.celular, null),
|
|
43
|
-
conta_ref: (
|
|
44
|
-
cpf: string_helper_1.StringHelper.trim(usuario.cpf, null),
|
|
45
|
-
data_atualizacao_doc: usuario.data_atualizacao_doc
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
departamento_ref: (_j = usuario.departamento_ref) !== null && _j !== void 0 ? _j : null,
|
|
52
|
-
desligamento: (_k = date_helper_1.DateHelper.fromString(usuario.desligamento, null)) === null || _k === void 0 ? void 0 : _k.getTime(),
|
|
53
|
-
email: string_helper_1.StringHelper.trim(usuario.email, null),
|
|
54
|
-
empresa_ref: (_l = usuario.empresa_ref) !== null && _l !== void 0 ? _l : null,
|
|
40
|
+
cargo_ref: (_l = (_k = usuario.cargo_ref) === null || _k === void 0 ? void 0 : _k.path) !== null && _l !== void 0 ? _l : null,
|
|
41
|
+
celular: string_helper_1.StringHelper.trim(usuario.celular, null) || null,
|
|
42
|
+
conta_ref: (_o = (_m = usuario.conta_ref) === null || _m === void 0 ? void 0 : _m.path) !== null && _o !== void 0 ? _o : null,
|
|
43
|
+
cpf: string_helper_1.StringHelper.trim(usuario.cpf, null) || null,
|
|
44
|
+
data_atualizacao_doc: (_q = (_p = date_helper_1.DateHelper.tratarData(usuario.data_atualizacao_doc, null)) === null || _p === void 0 ? void 0 : _p.getTime()) !== null && _q !== void 0 ? _q : null,
|
|
45
|
+
data_criacao_doc: (_s = (_r = date_helper_1.DateHelper.tratarData(usuario.data_criacao_doc, null)) === null || _r === void 0 ? void 0 : _r.getTime()) !== null && _s !== void 0 ? _s : null,
|
|
46
|
+
departamento_ref: (_u = (_t = usuario.departamento_ref) === null || _t === void 0 ? void 0 : _t.path) !== null && _u !== void 0 ? _u : null,
|
|
47
|
+
desligamento: (_w = (_v = date_helper_1.DateHelper.tratarData(usuario.desligamento, null)) === null || _v === void 0 ? void 0 : _v.getTime()) !== null && _w !== void 0 ? _w : null,
|
|
48
|
+
email: string_helper_1.StringHelper.trim(usuario.email, null) || null,
|
|
49
|
+
empresa_ref: (_y = (_x = usuario.empresa_ref) === null || _x === void 0 ? void 0 : _x.path) !== null && _y !== void 0 ? _y : null,
|
|
55
50
|
endereco: usuario.endereco
|
|
56
51
|
? {
|
|
57
|
-
bairro: string_helper_1.StringHelper.trim(usuario.endereco.bairro, null),
|
|
58
|
-
cep: string_helper_1.StringHelper.trim(usuario.endereco.cep, null),
|
|
59
|
-
cidade: string_helper_1.StringHelper.trim(usuario.endereco.cidade, null),
|
|
60
|
-
complemento: string_helper_1.StringHelper.trim(usuario.endereco.complemento, null),
|
|
61
|
-
logradouro: string_helper_1.StringHelper.trim(usuario.endereco.logradouro, null),
|
|
62
|
-
numero: string_helper_1.StringHelper.trim(usuario.endereco.numero, null),
|
|
63
|
-
uf: string_helper_1.StringHelper.trim(usuario.endereco.uf, null),
|
|
52
|
+
bairro: string_helper_1.StringHelper.trim(usuario.endereco.bairro, null) || null,
|
|
53
|
+
cep: string_helper_1.StringHelper.trim(usuario.endereco.cep, null) || null,
|
|
54
|
+
cidade: string_helper_1.StringHelper.trim(usuario.endereco.cidade, null) || null,
|
|
55
|
+
complemento: string_helper_1.StringHelper.trim(usuario.endereco.complemento, null) || null,
|
|
56
|
+
logradouro: string_helper_1.StringHelper.trim(usuario.endereco.logradouro, null) || null,
|
|
57
|
+
numero: string_helper_1.StringHelper.trim(usuario.endereco.numero, null) || null,
|
|
58
|
+
uf: string_helper_1.StringHelper.trim(usuario.endereco.uf, null) || null,
|
|
64
59
|
}
|
|
65
60
|
: null,
|
|
66
61
|
endereco_prestacao_diferente_empresa: boolean_helper_1.BooleanHelper.check(usuario.endereco_prestacao_diferente_empresa, false),
|
|
67
62
|
endereco_prestacao: usuario.endereco_prestacao
|
|
68
63
|
? {
|
|
69
|
-
bairro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.bairro, null)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
bairro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.bairro, null) ||
|
|
65
|
+
null,
|
|
66
|
+
cep: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cep, null) || null,
|
|
67
|
+
cidade: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cidade, null) ||
|
|
68
|
+
null,
|
|
69
|
+
complemento: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.complemento, null) ||
|
|
70
|
+
null,
|
|
71
|
+
logradouro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.logradouro, null) ||
|
|
72
|
+
null,
|
|
73
|
+
numero: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.numero, null) ||
|
|
74
|
+
null,
|
|
75
|
+
uf: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.uf, null) || null,
|
|
76
76
|
}
|
|
77
77
|
: null,
|
|
78
|
-
escala_ref: (
|
|
79
|
-
esocial_categoria_de_trabalhador_ref: (
|
|
78
|
+
escala_ref: (_0 = (_z = usuario.escala_ref) === null || _z === void 0 ? void 0 : _z.path) !== null && _0 !== void 0 ? _0 : null,
|
|
79
|
+
esocial_categoria_de_trabalhador_ref: (_3 = (_2 = usuario.esocial_categoria_de_trabalhador_ref) === null || _2 === void 0 ? void 0 : _2.path) !== null && _3 !== void 0 ? _3 : null,
|
|
80
80
|
excluido: boolean_helper_1.BooleanHelper.check(usuario.excluido, false),
|
|
81
|
-
id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null),
|
|
81
|
+
id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null) || null,
|
|
82
82
|
integracao: usuario.integracao
|
|
83
83
|
? {
|
|
84
|
-
id: string_helper_1.StringHelper.trim((
|
|
85
|
-
|
|
84
|
+
id: string_helper_1.StringHelper.trim((_4 = usuario.integracao) === null || _4 === void 0 ? void 0 : _4.id, null) || null,
|
|
85
|
+
id_externo: string_helper_1.StringHelper.trim((_5 = usuario.integracao) === null || _5 === void 0 ? void 0 : _5.id_externo, null) || null,
|
|
86
|
+
lancamento_data_base: (_8 = (_7 = date_helper_1.DateHelper.tratarData((_6 = usuario.integracao) === null || _6 === void 0 ? void 0 : _6.lancamento_data_base, null)) === null || _7 === void 0 ? void 0 : _7.getTime()) !== null && _8 !== void 0 ? _8 : null,
|
|
87
|
+
lancamentos_refs: ((_9 = usuario.integracao) === null || _9 === void 0 ? void 0 : _9.lancamentos_refs) &&
|
|
88
|
+
((_10 = usuario.integracao) === null || _10 === void 0 ? void 0 : _10.lancamentos_refs.length)
|
|
89
|
+
? (_11 = usuario.integracao) === null || _11 === void 0 ? void 0 : _11.lancamentos_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.i_path; })
|
|
90
|
+
: [],
|
|
91
|
+
tipo: string_helper_1.StringHelper.trim((_12 = usuario.integracao) === null || _12 === void 0 ? void 0 : _12.tipo, null) || null,
|
|
86
92
|
}
|
|
87
93
|
: null,
|
|
88
94
|
interno: boolean_helper_1.BooleanHelper.check(usuario.interno, false),
|
|
89
|
-
nascimento: (
|
|
90
|
-
nome: string_helper_1.StringHelper.trim(usuario.nome, null),
|
|
91
|
-
nomeCompleto: string_helper_1.StringHelper.trim(usuario.nomeCompleto, null),
|
|
92
|
-
observacoes: string_helper_1.StringHelper.trim(usuario.observacoes, null),
|
|
95
|
+
nascimento: (_14 = (_13 = date_helper_1.DateHelper.tratarData(usuario.nascimento, null)) === null || _13 === void 0 ? void 0 : _13.getTime()) !== null && _14 !== void 0 ? _14 : null,
|
|
96
|
+
nome: string_helper_1.StringHelper.trim(usuario.nome, null) || null,
|
|
97
|
+
nomeCompleto: string_helper_1.StringHelper.trim(usuario.nomeCompleto, null) || null,
|
|
98
|
+
observacoes: string_helper_1.StringHelper.trim(usuario.observacoes, null) || null,
|
|
93
99
|
parametros: usuario.parametros
|
|
94
100
|
? {
|
|
95
|
-
acessar_manager: boolean_helper_1.BooleanHelper.check(usuario.parametros.acessar_manager,
|
|
96
|
-
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_foto_marcacao_externa,
|
|
97
|
-
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_localizacao_marcacao_externa,
|
|
98
|
-
cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca,
|
|
99
|
-
codigo_externo: string_helper_1.StringHelper.
|
|
100
|
-
|
|
101
|
+
acessar_manager: boolean_helper_1.BooleanHelper.check(usuario.parametros.acessar_manager, false),
|
|
102
|
+
capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_foto_marcacao_externa, false),
|
|
103
|
+
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_localizacao_marcacao_externa, false),
|
|
104
|
+
cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca, false),
|
|
105
|
+
codigo_externo: string_helper_1.StringHelper.trim(usuario.parametros.codigo_externo, null) ||
|
|
106
|
+
null,
|
|
107
|
+
horario_noturno: ((_15 = usuario.parametros) === null || _15 === void 0 ? void 0 : _15.horario_noturno)
|
|
101
108
|
? {
|
|
102
|
-
tipo: string_helper_1.StringHelper.
|
|
103
|
-
inicio: string_helper_1.StringHelper.
|
|
104
|
-
fim: string_helper_1.StringHelper.
|
|
105
|
-
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((
|
|
109
|
+
tipo: string_helper_1.StringHelper.trim((_16 = usuario.parametros.horario_noturno) === null || _16 === void 0 ? void 0 : _16.tipo, null) || null,
|
|
110
|
+
inicio: string_helper_1.StringHelper.trim((_17 = usuario.parametros.horario_noturno) === null || _17 === void 0 ? void 0 : _17.inicio, null) || null,
|
|
111
|
+
fim: string_helper_1.StringHelper.trim((_18 = usuario.parametros.horario_noturno) === null || _18 === void 0 ? void 0 : _18.fim, null) || null,
|
|
112
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_19 = usuario.parametros.horario_noturno) === null || _19 === void 0 ? void 0 : _19.hora_reduzida_segundos),
|
|
106
113
|
}
|
|
107
114
|
: null,
|
|
108
|
-
horista: boolean_helper_1.BooleanHelper.check(usuario.parametros.horista,
|
|
109
|
-
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(usuario.parametros.marcacao_whatsapp,
|
|
110
|
-
marca_ponto_web: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_web,
|
|
111
|
-
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_multi_empresa,
|
|
112
|
-
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_flit,
|
|
113
|
-
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial,
|
|
114
|
-
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio,
|
|
115
|
-
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online,
|
|
116
|
-
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.
|
|
117
|
-
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((
|
|
118
|
-
regime_compensacao: string_helper_1.StringHelper.
|
|
115
|
+
horista: boolean_helper_1.BooleanHelper.check(usuario.parametros.horista, false),
|
|
116
|
+
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(usuario.parametros.marcacao_whatsapp, false),
|
|
117
|
+
marca_ponto_web: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_web, false),
|
|
118
|
+
marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_multi_empresa, false),
|
|
119
|
+
marca_ponto_flit: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_flit, false),
|
|
120
|
+
reconhecimento_facial: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial, false),
|
|
121
|
+
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio, false),
|
|
122
|
+
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online, false),
|
|
123
|
+
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.trim(usuario.parametros.configuracao_tipo_falta_jornada, null) || null,
|
|
124
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_20 = usuario.parametros) === null || _20 === void 0 ? void 0 : _20.limite_minutos_interjornada) || null,
|
|
125
|
+
regime_compensacao: string_helper_1.StringHelper.trim(usuario.parametros.regime_compensacao, null) ||
|
|
126
|
+
null,
|
|
119
127
|
}
|
|
120
128
|
: null,
|
|
121
|
-
perfil_ref: (
|
|
122
|
-
perimetros_refs: (
|
|
129
|
+
perfil_ref: (_22 = (_21 = usuario.perfil_ref) === null || _21 === void 0 ? void 0 : _21.path) !== null && _22 !== void 0 ? _22 : null,
|
|
130
|
+
perimetros_refs: ((_24 = (_23 = usuario.perimetros_refs) === null || _23 === void 0 ? void 0 : _23.length) !== null && _24 !== void 0 ? _24 : 0) > 0
|
|
131
|
+
? usuario.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
|
|
132
|
+
: null,
|
|
123
133
|
pin: number_helper_1.NumberHelper.convertToNumber(usuario === null || usuario === void 0 ? void 0 : usuario.pin),
|
|
124
|
-
pis: string_helper_1.StringHelper.trim(usuario.pis, null),
|
|
125
|
-
sem_autenticacao: boolean_helper_1.BooleanHelper.check(usuario.sem_autenticacao,
|
|
126
|
-
status: string_helper_1.StringHelper.
|
|
127
|
-
status_data_ini: (
|
|
128
|
-
status_data_fim: (
|
|
134
|
+
pis: string_helper_1.StringHelper.trim(usuario.pis, null) || null,
|
|
135
|
+
sem_autenticacao: boolean_helper_1.BooleanHelper.check(usuario.sem_autenticacao, false),
|
|
136
|
+
status: string_helper_1.StringHelper.trim(usuario.status, _1.StatusUsuario.Ativo) || null,
|
|
137
|
+
status_data_ini: (_26 = (_25 = date_helper_1.DateHelper.tratarData(usuario.status_data_ini, null)) === null || _25 === void 0 ? void 0 : _25.getTime()) !== null && _26 !== void 0 ? _26 : null,
|
|
138
|
+
status_data_fim: (_28 = (_27 = date_helper_1.DateHelper.tratarData(usuario.status_data_fim, null)) === null || _27 === void 0 ? void 0 : _27.getTime()) !== null && _28 !== void 0 ? _28 : null,
|
|
129
139
|
status_programado: usuario.status_programado
|
|
130
140
|
? {
|
|
131
|
-
data_prevista: (
|
|
132
|
-
executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado,
|
|
133
|
-
tipo: string_helper_1.StringHelper.
|
|
141
|
+
data_prevista: (_30 = (_29 = date_helper_1.DateHelper.tratarData(usuario.status_programado.data_prevista, null)) === null || _29 === void 0 ? void 0 : _29.getTime()) !== null && _30 !== void 0 ? _30 : null,
|
|
142
|
+
executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado, false),
|
|
143
|
+
tipo: string_helper_1.StringHelper.trim((_31 = usuario.status_programado) === null || _31 === void 0 ? void 0 : _31.tipo, null) || null,
|
|
134
144
|
}
|
|
135
145
|
: null,
|
|
136
|
-
telefone: string_helper_1.StringHelper.trim(usuario.telefone, null),
|
|
146
|
+
telefone: string_helper_1.StringHelper.trim(usuario.telefone, null) || null,
|
|
137
147
|
modificador: usuario.modificador
|
|
138
148
|
? (0, lodash_1.omitBy)({
|
|
139
|
-
id: (
|
|
140
|
-
ref: (
|
|
141
|
-
tipo: (
|
|
142
|
-
nome:
|
|
143
|
-
documento:
|
|
144
|
-
email:
|
|
149
|
+
id: (_34 = (_33 = (_32 = usuario.modificador) === null || _32 === void 0 ? void 0 : _32.ref) === null || _33 === void 0 ? void 0 : _33.id) !== null && _34 !== void 0 ? _34 : null,
|
|
150
|
+
ref: (_37 = (_36 = (_35 = usuario.modificador) === null || _35 === void 0 ? void 0 : _35.ref) === null || _36 === void 0 ? void 0 : _36.path) !== null && _37 !== void 0 ? _37 : null,
|
|
151
|
+
tipo: (_39 = (_38 = usuario.modificador) === null || _38 === void 0 ? void 0 : _38.tipo) !== null && _39 !== void 0 ? _39 : null,
|
|
152
|
+
nome: (_41 = (_40 = usuario.modificador) === null || _40 === void 0 ? void 0 : _40.nome) !== null && _41 !== void 0 ? _41 : null,
|
|
153
|
+
documento: (_43 = (_42 = usuario.modificador) === null || _42 === void 0 ? void 0 : _42.documento) !== null && _43 !== void 0 ? _43 : null,
|
|
154
|
+
email: (_45 = (_44 = usuario.modificador) === null || _44 === void 0 ? void 0 : _44.email) !== null && _45 !== void 0 ? _45 : null,
|
|
145
155
|
}, lodash_1.isUndefined)
|
|
146
156
|
: undefined,
|
|
147
157
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
1
2
|
export declare abstract class DateHelper {
|
|
2
3
|
static isValidDate(d: any): boolean;
|
|
3
4
|
static fromString(str: string, def: Date | null): Date;
|
|
5
|
+
static tratarData(data: Date | Timestamp | string, def: Date | null): Date;
|
|
4
6
|
}
|
|
@@ -16,6 +16,22 @@ var DateHelper = /** @class */ (function () {
|
|
|
16
16
|
return def;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
+
DateHelper.tratarData = function (data, def) {
|
|
20
|
+
// Inválido
|
|
21
|
+
if (!data)
|
|
22
|
+
return def;
|
|
23
|
+
// Date
|
|
24
|
+
if (data instanceof Date && !isNaN(data.getTime()))
|
|
25
|
+
return data;
|
|
26
|
+
// String
|
|
27
|
+
if (typeof data === 'string')
|
|
28
|
+
return new Date(data);
|
|
29
|
+
// Timestamp
|
|
30
|
+
if (typeof data === 'object' && 'seconds' in data && 'nanoseconds' in data)
|
|
31
|
+
return new Date(data.seconds * 1000 + Math.floor(data.nanoseconds / 1000000));
|
|
32
|
+
// Default
|
|
33
|
+
return def;
|
|
34
|
+
};
|
|
19
35
|
return DateHelper;
|
|
20
36
|
}());
|
|
21
37
|
exports.DateHelper = DateHelper;
|