flit-models 3.3.47 → 3.3.49
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/index.d.ts +1 -1
- package/lib/index.js +44 -28
- package/lib/models/contas/dispositivo/dispositivo-elastic-convert.js +1 -1
- package/lib/models/contas/dispositivo/dispositivo-fire-convert.js +2 -2
- package/lib/models/contas/dispositivo/index.js +1 -1
- package/lib/models/contas/empresa/empresa-elastic-convert.js +1 -1
- package/lib/models/contas/empresa/empresa-fire-convert.js +1 -1
- package/lib/models/contas/escala/escala-fire-convert.d.ts +2 -1
- package/lib/models/contas/escala/escala-fire-convert.js +28 -26
- package/lib/models/contas/escala/index.d.ts +6 -0
- package/lib/models/contas/escala/index.js +8 -2
- package/lib/models/contas/lancamento/lancamento-elastic-convert.js +1 -1
- package/lib/models/contas/lancamento/lancamento-fire-convert.js +2 -2
- package/lib/models/contas/lancamento/lancamento-json-convert.js +2 -2
- package/lib/models/contas/shared/index.d.ts +8 -17
- package/lib/models/contas/usuario/index.d.ts +93 -110
- package/lib/models/contas/usuario/index.js +90 -102
- package/lib/models/contas/usuario/usuario-elastic-convert.d.ts +72 -47
- package/lib/models/contas/usuario/usuario-elastic-convert.js +11 -5
- package/lib/models/contas/usuario/usuario-fire-convert.d.ts +54 -44
- package/lib/models/contas/usuario/usuario-fire-convert.js +5 -5
- package/lib/models/contas/usuario/usuario-json-convert.d.ts +53 -43
- package/lib/models/contas/usuario/usuario-json-convert.js +39 -42
- package/lib/models/utils/number-helper.d.ts +1 -0
- package/lib/models/utils/number-helper.js +8 -2
- package/package.json +1 -1
|
@@ -1,58 +1,83 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UsuarioBeneficios, UsuarioTipoIntegracao, UsuarioParametros, UsuarioStatus, Usuario, UsuarioBase } from '.';
|
|
2
2
|
import { AuditoriaModificadorFirestoreData } from '../auditoria/modificador';
|
|
3
3
|
import { Endereco } from '../shared';
|
|
4
|
-
export
|
|
4
|
+
export declare class UsuarioElasticSource implements UsuarioBase {
|
|
5
5
|
i_created?: string;
|
|
6
6
|
i_id?: string;
|
|
7
7
|
i_parent_id?: string;
|
|
8
8
|
i_path?: string;
|
|
9
9
|
i_type_sync?: string;
|
|
10
10
|
i_updated?: string;
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
11
|
+
esocial_categoria_de_trabalhador_ref: {
|
|
12
|
+
i_path: string;
|
|
13
|
+
};
|
|
14
|
+
conta_ref: {
|
|
15
|
+
i_path: string;
|
|
16
|
+
};
|
|
17
|
+
perimetros_refs: {
|
|
18
|
+
i_path: string;
|
|
19
|
+
}[];
|
|
20
|
+
cargo_ref: {
|
|
21
|
+
i_path: string;
|
|
22
|
+
};
|
|
23
|
+
departamento_ref: {
|
|
24
|
+
i_path: string;
|
|
25
|
+
};
|
|
26
|
+
empresa_ref: {
|
|
27
|
+
i_path: string;
|
|
28
|
+
};
|
|
29
|
+
escala_ref: {
|
|
30
|
+
i_path: string;
|
|
31
|
+
};
|
|
32
|
+
perfil_ref: {
|
|
33
|
+
i_path: string;
|
|
34
|
+
};
|
|
35
|
+
admissao: string;
|
|
36
|
+
ativo: boolean;
|
|
37
|
+
avatar_atualizacao: string;
|
|
38
|
+
avatar_thumbnail_path: string;
|
|
39
|
+
avatar_thumbnail_url: string;
|
|
40
|
+
avatarUrl: string;
|
|
41
|
+
beneficios: UsuarioBeneficios;
|
|
42
|
+
celular: string;
|
|
43
|
+
cpf: string;
|
|
44
|
+
data_atualizacao_doc: string;
|
|
45
|
+
data_criacao_doc: string;
|
|
46
|
+
desligamento: string;
|
|
47
|
+
email: string;
|
|
48
|
+
endereco: Endereco;
|
|
49
|
+
endereco_prestacao_diferente_empresa: boolean;
|
|
50
|
+
endereco_prestacao: Endereco;
|
|
51
|
+
excluido: boolean;
|
|
52
|
+
id_externo: string;
|
|
53
|
+
integracao: {
|
|
54
|
+
id: string;
|
|
55
|
+
id_externo: string;
|
|
56
|
+
lancamento_data_base: string;
|
|
57
|
+
lancamentos_refs: {
|
|
58
|
+
i_path: string;
|
|
59
|
+
}[];
|
|
60
|
+
tipo: UsuarioTipoIntegracao;
|
|
61
|
+
};
|
|
62
|
+
interno: boolean;
|
|
63
|
+
nascimento: string;
|
|
64
|
+
nome: string;
|
|
65
|
+
nomeCompleto: string;
|
|
66
|
+
observacoes: string;
|
|
67
|
+
parametros: UsuarioParametros;
|
|
68
|
+
pin: number;
|
|
69
|
+
pis: string;
|
|
70
|
+
sem_autenticacao: boolean;
|
|
71
|
+
status: UsuarioStatus;
|
|
72
|
+
status_data_ini: string;
|
|
73
|
+
status_data_fim: string;
|
|
74
|
+
status_programado: {
|
|
75
|
+
data_prevista: string;
|
|
76
|
+
executado: boolean;
|
|
77
|
+
tipo: 'Ativo' | 'Demitido';
|
|
78
|
+
};
|
|
79
|
+
telefone: string;
|
|
80
|
+
modificador: Partial<AuditoriaModificadorFirestoreData>;
|
|
56
81
|
}
|
|
57
82
|
export declare abstract class UsuarioElasticConvert {
|
|
58
83
|
static fromElastic(doc: UsuarioElasticSource): Usuario;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UsuarioElasticConvert = void 0;
|
|
3
|
+
exports.UsuarioElasticConvert = exports.UsuarioElasticSource = void 0;
|
|
4
4
|
var lodash_1 = require("lodash");
|
|
5
5
|
var _1 = require(".");
|
|
6
6
|
var boolean_helper_1 = require("../../utils/boolean-helper");
|
|
7
7
|
var date_helper_1 = require("../../utils/date-helper");
|
|
8
8
|
var number_helper_1 = require("../../utils/number-helper");
|
|
9
9
|
var string_helper_1 = require("../../utils/string-helper");
|
|
10
|
+
var UsuarioElasticSource = /** @class */ (function () {
|
|
11
|
+
function UsuarioElasticSource() {
|
|
12
|
+
}
|
|
13
|
+
return UsuarioElasticSource;
|
|
14
|
+
}());
|
|
15
|
+
exports.UsuarioElasticSource = UsuarioElasticSource;
|
|
10
16
|
var UsuarioElasticConvert = /** @class */ (function () {
|
|
11
17
|
function UsuarioElasticConvert() {
|
|
12
18
|
}
|
|
@@ -101,7 +107,7 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
101
107
|
tipo: string_helper_1.StringHelper.trim((_2 = docData.parametros.horario_noturno) === null || _2 === void 0 ? void 0 : _2.tipo, null) || null,
|
|
102
108
|
inicio: string_helper_1.StringHelper.trim((_3 = docData.parametros.horario_noturno) === null || _3 === void 0 ? void 0 : _3.inicio, null) || null,
|
|
103
109
|
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.
|
|
110
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToInt((_5 = docData.parametros.horario_noturno) === null || _5 === void 0 ? void 0 : _5.hora_reduzida_segundos),
|
|
105
111
|
}
|
|
106
112
|
: null,
|
|
107
113
|
horista: boolean_helper_1.BooleanHelper.check(docData.parametros.horista, false),
|
|
@@ -113,7 +119,7 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
113
119
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial_obrigatorio, false),
|
|
114
120
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_apenas_online, false),
|
|
115
121
|
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.trim(docData.parametros.configuracao_tipo_falta_jornada, null),
|
|
116
|
-
limite_minutos_interjornada: number_helper_1.NumberHelper.
|
|
122
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToInt((_6 = docData.parametros) === null || _6 === void 0 ? void 0 : _6.limite_minutos_interjornada) || null,
|
|
117
123
|
regime_compensacao: string_helper_1.StringHelper.trim(docData.parametros.regime_compensacao, null) ||
|
|
118
124
|
null,
|
|
119
125
|
}
|
|
@@ -122,10 +128,10 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
122
128
|
perimetros_refs: ((_10 = (_9 = docData.perimetros_refs) === null || _9 === void 0 ? void 0 : _9.length) !== null && _10 !== void 0 ? _10 : 0) > 0
|
|
123
129
|
? 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
130
|
: null,
|
|
125
|
-
pin: number_helper_1.NumberHelper.
|
|
131
|
+
pin: number_helper_1.NumberHelper.convertToInt(docData === null || docData === void 0 ? void 0 : docData.pin),
|
|
126
132
|
pis: string_helper_1.StringHelper.trim(docData.pis, null) || null,
|
|
127
133
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(docData.sem_autenticacao, false),
|
|
128
|
-
status: string_helper_1.StringHelper.trim(docData.status, _1.
|
|
134
|
+
status: string_helper_1.StringHelper.trim(docData.status, _1.UsuarioStatus.Ativo) || null,
|
|
129
135
|
status_data_ini: date_helper_1.DateHelper.fromString(docData.status_data_ini, null),
|
|
130
136
|
status_data_fim: date_helper_1.DateHelper.fromString(docData.status_data_fim, null),
|
|
131
137
|
status_programado: docData.status_programado
|
|
@@ -1,50 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UsuarioBeneficios, UsuarioTipoIntegracao, UsuarioParametros, UsuarioStatus, Usuario, UsuarioBase } from '.';
|
|
2
2
|
import { FirebaseDocumentReferenceGeneric, FirebaseDocumentSnapshotGeneric, FirebaseQueryDocumentSnapshotGeneric, FirebaseTimestampGeneric } from '../../../shared/flitModelsDependencyInjection';
|
|
3
3
|
import { AuditoriaModificadorFirestoreData } from '../auditoria/modificador';
|
|
4
4
|
import { Endereco } from '../shared';
|
|
5
|
-
export declare class UsuarioFirestoreData implements
|
|
6
|
-
conta_ref
|
|
7
|
-
empresa_ref
|
|
8
|
-
departamento_ref
|
|
9
|
-
cargo_ref
|
|
10
|
-
escala_ref
|
|
11
|
-
esocial_categoria_de_trabalhador_ref
|
|
12
|
-
perfil_ref
|
|
13
|
-
perimetros_refs
|
|
14
|
-
admissao
|
|
15
|
-
ativo
|
|
16
|
-
avatar_atualizacao
|
|
17
|
-
avatar_thumbnail_path
|
|
18
|
-
avatar_thumbnail_url
|
|
19
|
-
avatarUrl
|
|
20
|
-
beneficios
|
|
21
|
-
celular
|
|
22
|
-
cpf
|
|
23
|
-
data_atualizacao_doc
|
|
24
|
-
data_criacao_doc
|
|
25
|
-
desligamento
|
|
26
|
-
email
|
|
27
|
-
endereco
|
|
28
|
-
endereco_prestacao_diferente_empresa
|
|
29
|
-
endereco_prestacao
|
|
30
|
-
excluido
|
|
31
|
-
id_externo
|
|
32
|
-
integracao
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
5
|
+
export declare class UsuarioFirestoreData implements UsuarioBase {
|
|
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[];
|
|
14
|
+
admissao: FirebaseTimestampGeneric;
|
|
15
|
+
ativo: boolean;
|
|
16
|
+
avatar_atualizacao: FirebaseTimestampGeneric;
|
|
17
|
+
avatar_thumbnail_path: string;
|
|
18
|
+
avatar_thumbnail_url: string;
|
|
19
|
+
avatarUrl: string;
|
|
20
|
+
beneficios: UsuarioBeneficios;
|
|
21
|
+
celular: string;
|
|
22
|
+
cpf: string;
|
|
23
|
+
data_atualizacao_doc: FirebaseTimestampGeneric;
|
|
24
|
+
data_criacao_doc: FirebaseTimestampGeneric;
|
|
25
|
+
desligamento: FirebaseTimestampGeneric;
|
|
26
|
+
email: string;
|
|
27
|
+
endereco: Endereco;
|
|
28
|
+
endereco_prestacao_diferente_empresa: boolean;
|
|
29
|
+
endereco_prestacao: Endereco;
|
|
30
|
+
excluido: boolean;
|
|
31
|
+
id_externo: string;
|
|
32
|
+
integracao: {
|
|
33
|
+
id: string;
|
|
34
|
+
id_externo: string;
|
|
35
|
+
lancamento_data_base: FirebaseTimestampGeneric;
|
|
36
|
+
lancamentos_refs: FirebaseDocumentReferenceGeneric[];
|
|
37
|
+
tipo: UsuarioTipoIntegracao;
|
|
38
|
+
};
|
|
39
|
+
interno: boolean;
|
|
40
|
+
nascimento: FirebaseTimestampGeneric;
|
|
41
|
+
nome: string;
|
|
42
|
+
nomeCompleto: string;
|
|
43
|
+
observacoes: string;
|
|
44
|
+
parametros: UsuarioParametros;
|
|
45
|
+
pin: number;
|
|
46
|
+
pis: string;
|
|
47
|
+
sem_autenticacao: boolean;
|
|
48
|
+
status: UsuarioStatus;
|
|
49
|
+
status_data_ini: FirebaseTimestampGeneric;
|
|
50
|
+
status_data_fim: FirebaseTimestampGeneric;
|
|
51
|
+
status_programado: {
|
|
52
|
+
data_prevista: FirebaseTimestampGeneric;
|
|
53
|
+
executado: boolean;
|
|
54
|
+
tipo: 'Ativo' | 'Demitido';
|
|
55
|
+
};
|
|
56
|
+
telefone: string;
|
|
57
|
+
modificador: AuditoriaModificadorFirestoreData;
|
|
48
58
|
}
|
|
49
59
|
export declare abstract class UsuarioFireConvert {
|
|
50
60
|
static fromFirestore(doc: FirebaseDocumentSnapshotGeneric | FirebaseQueryDocumentSnapshotGeneric): Usuario;
|
|
@@ -80,7 +80,7 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
80
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
81
|
lancamentos_refs: ((_3 = d.integracao) === null || _3 === void 0 ? void 0 : _3.lancamentos_refs) &&
|
|
82
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.
|
|
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.path; })
|
|
84
84
|
: [],
|
|
85
85
|
tipo: string_helper_1.StringHelper.trim((_6 = d.integracao) === null || _6 === void 0 ? void 0 : _6.tipo, null),
|
|
86
86
|
}
|
|
@@ -102,7 +102,7 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
102
102
|
tipo: string_helper_1.StringHelper.trim((_10 = d.parametros.horario_noturno) === null || _10 === void 0 ? void 0 : _10.tipo, null),
|
|
103
103
|
inicio: string_helper_1.StringHelper.trim((_11 = d.parametros.horario_noturno) === null || _11 === void 0 ? void 0 : _11.inicio, null),
|
|
104
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.
|
|
105
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToInt((_13 = d.parametros.horario_noturno) === null || _13 === void 0 ? void 0 : _13.hora_reduzida_segundos),
|
|
106
106
|
}
|
|
107
107
|
: null,
|
|
108
108
|
horista: boolean_helper_1.BooleanHelper.check(d.parametros.horista, false),
|
|
@@ -114,7 +114,7 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
114
114
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial_obrigatorio, false),
|
|
115
115
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_apenas_online, false),
|
|
116
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.
|
|
117
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToInt((_14 = d.parametros) === null || _14 === void 0 ? void 0 : _14.limite_minutos_interjornada) || null,
|
|
118
118
|
regime_compensacao: string_helper_1.StringHelper.trim(d.parametros.regime_compensacao, null),
|
|
119
119
|
}
|
|
120
120
|
: null,
|
|
@@ -122,10 +122,10 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
122
122
|
perimetros_refs: ((_17 = (_16 = d.perimetros_refs) === null || _16 === void 0 ? void 0 : _16.length) !== null && _17 !== void 0 ? _17 : 0) > 0
|
|
123
123
|
? d.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
|
|
124
124
|
: null,
|
|
125
|
-
pin: number_helper_1.NumberHelper.
|
|
125
|
+
pin: number_helper_1.NumberHelper.convertToInt(d === null || d === void 0 ? void 0 : d.pin),
|
|
126
126
|
pis: string_helper_1.StringHelper.trim(d.pis, null),
|
|
127
127
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(d.sem_autenticacao, false),
|
|
128
|
-
status: string_helper_1.StringHelper.trim(d.status, _1.
|
|
128
|
+
status: string_helper_1.StringHelper.trim(d.status, _1.UsuarioStatus.Ativo),
|
|
129
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
130
|
status_data_fim: (_21 = (_20 = d.status_data_fim) === null || _20 === void 0 ? void 0 : _20.toDate()) !== null && _21 !== void 0 ? _21 : null,
|
|
131
131
|
status_programado: d.status_programado
|
|
@@ -1,51 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UsuarioBeneficios, UsuarioTipoIntegracao, UsuarioParametros, UsuarioStatus, Usuario, UsuarioBase } from '.';
|
|
2
2
|
import { AuditoriaModificadorFirestoreData } from '../auditoria/modificador';
|
|
3
3
|
import { Endereco } from '../shared';
|
|
4
4
|
export declare class UsuarioJsonData implements UsuarioBase {
|
|
5
5
|
_id: string;
|
|
6
6
|
_path: string;
|
|
7
|
-
conta_ref
|
|
8
|
-
empresa_ref
|
|
9
|
-
departamento_ref
|
|
10
|
-
cargo_ref
|
|
11
|
-
escala_ref
|
|
12
|
-
esocial_categoria_de_trabalhador_ref
|
|
13
|
-
perfil_ref
|
|
14
|
-
perimetros_refs
|
|
15
|
-
admissao
|
|
16
|
-
ativo
|
|
17
|
-
avatar_atualizacao
|
|
18
|
-
avatar_thumbnail_path
|
|
19
|
-
avatar_thumbnail_url
|
|
20
|
-
avatarUrl
|
|
21
|
-
beneficios
|
|
22
|
-
celular
|
|
23
|
-
cpf
|
|
24
|
-
data_atualizacao_doc
|
|
25
|
-
data_criacao_doc
|
|
26
|
-
desligamento
|
|
27
|
-
email
|
|
28
|
-
endereco
|
|
29
|
-
endereco_prestacao_diferente_empresa
|
|
30
|
-
endereco_prestacao
|
|
31
|
-
excluido
|
|
32
|
-
id_externo
|
|
33
|
-
integracao
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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[];
|
|
15
|
+
admissao: number;
|
|
16
|
+
ativo: boolean;
|
|
17
|
+
avatar_atualizacao: number;
|
|
18
|
+
avatar_thumbnail_path: string;
|
|
19
|
+
avatar_thumbnail_url: string;
|
|
20
|
+
avatarUrl: string;
|
|
21
|
+
beneficios: UsuarioBeneficios;
|
|
22
|
+
celular: string;
|
|
23
|
+
cpf: string;
|
|
24
|
+
data_atualizacao_doc: number;
|
|
25
|
+
data_criacao_doc: number;
|
|
26
|
+
desligamento: number;
|
|
27
|
+
email: string;
|
|
28
|
+
endereco: Endereco;
|
|
29
|
+
endereco_prestacao_diferente_empresa: boolean;
|
|
30
|
+
endereco_prestacao: Endereco;
|
|
31
|
+
excluido: boolean;
|
|
32
|
+
id_externo: string;
|
|
33
|
+
integracao: {
|
|
34
|
+
id: string;
|
|
35
|
+
id_externo: string;
|
|
36
|
+
lancamento_data_base: number;
|
|
37
|
+
lancamentos_refs: string[];
|
|
38
|
+
tipo: UsuarioTipoIntegracao;
|
|
39
|
+
};
|
|
40
|
+
interno: boolean;
|
|
41
|
+
nascimento: number;
|
|
42
|
+
nome: string;
|
|
43
|
+
nomeCompleto: string;
|
|
44
|
+
observacoes: string;
|
|
45
|
+
parametros: UsuarioParametros;
|
|
46
|
+
pin: number;
|
|
47
|
+
pis: string;
|
|
48
|
+
sem_autenticacao: boolean;
|
|
49
|
+
status: UsuarioStatus;
|
|
50
|
+
status_data_ini: number;
|
|
51
|
+
status_data_fim: number;
|
|
52
|
+
status_programado: {
|
|
53
|
+
data_prevista: number;
|
|
54
|
+
executado: boolean;
|
|
55
|
+
tipo: 'Ativo' | 'Demitido';
|
|
56
|
+
};
|
|
57
|
+
telefone: string;
|
|
58
|
+
modificador: AuditoriaModificadorFirestoreData;
|
|
49
59
|
}
|
|
50
60
|
export declare abstract class UsuarioJsonConvert {
|
|
51
61
|
static toJson(usuario: Usuario): Partial<UsuarioJsonData>;
|
|
@@ -16,11 +16,8 @@ exports.UsuarioJsonData = UsuarioJsonData;
|
|
|
16
16
|
var UsuarioJsonConvert = /** @class */ (function () {
|
|
17
17
|
function UsuarioJsonConvert() {
|
|
18
18
|
}
|
|
19
|
-
// Não foi implementado no momento pois não foi utilizado no front
|
|
20
|
-
// public static fromJson(obj: UsuarioJsonData): Usuario {
|
|
21
|
-
// }
|
|
22
19
|
UsuarioJsonConvert.toJson = function (usuario) {
|
|
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
|
|
20
|
+
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;
|
|
24
21
|
var usuarioJson = {
|
|
25
22
|
_id: (_a = usuario === null || usuario === void 0 ? void 0 : usuario._id) !== null && _a !== void 0 ? _a : null,
|
|
26
23
|
_path: (_b = usuario === null || usuario === void 0 ? void 0 : usuario._path) !== null && _b !== void 0 ? _b : null,
|
|
@@ -37,16 +34,16 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
37
34
|
vale_transporte: (_j = usuario.beneficios.vale_transporte) !== null && _j !== void 0 ? _j : false,
|
|
38
35
|
}
|
|
39
36
|
: null,
|
|
40
|
-
cargo_ref: (
|
|
37
|
+
cargo_ref: (_k = usuario.cargo_ref) !== null && _k !== void 0 ? _k : null,
|
|
41
38
|
celular: string_helper_1.StringHelper.trim(usuario.celular, null) || null,
|
|
42
|
-
conta_ref: (
|
|
39
|
+
conta_ref: (_l = usuario.conta_ref) !== null && _l !== void 0 ? _l : null,
|
|
43
40
|
cpf: string_helper_1.StringHelper.trim(usuario.cpf, null) || null,
|
|
44
|
-
data_atualizacao_doc: (
|
|
45
|
-
data_criacao_doc: (
|
|
46
|
-
departamento_ref: (
|
|
47
|
-
desligamento: (
|
|
41
|
+
data_atualizacao_doc: (_o = (_m = date_helper_1.DateHelper.tratarData(usuario.data_atualizacao_doc, null)) === null || _m === void 0 ? void 0 : _m.getTime()) !== null && _o !== void 0 ? _o : null,
|
|
42
|
+
data_criacao_doc: (_q = (_p = date_helper_1.DateHelper.tratarData(usuario.data_criacao_doc, null)) === null || _p === void 0 ? void 0 : _p.getTime()) !== null && _q !== void 0 ? _q : null,
|
|
43
|
+
departamento_ref: (_r = usuario.departamento_ref) !== null && _r !== void 0 ? _r : null,
|
|
44
|
+
desligamento: (_t = (_s = date_helper_1.DateHelper.tratarData(usuario.desligamento, null)) === null || _s === void 0 ? void 0 : _s.getTime()) !== null && _t !== void 0 ? _t : null,
|
|
48
45
|
email: string_helper_1.StringHelper.trim(usuario.email, null) || null,
|
|
49
|
-
empresa_ref: (
|
|
46
|
+
empresa_ref: (_u = usuario.empresa_ref) !== null && _u !== void 0 ? _u : null,
|
|
50
47
|
endereco: usuario.endereco
|
|
51
48
|
? {
|
|
52
49
|
bairro: string_helper_1.StringHelper.trim(usuario.endereco.bairro, null) || null,
|
|
@@ -75,24 +72,24 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
75
72
|
uf: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.uf, null) || null,
|
|
76
73
|
}
|
|
77
74
|
: null,
|
|
78
|
-
escala_ref: (
|
|
79
|
-
esocial_categoria_de_trabalhador_ref: (
|
|
75
|
+
escala_ref: (_v = usuario.escala_ref) !== null && _v !== void 0 ? _v : null,
|
|
76
|
+
esocial_categoria_de_trabalhador_ref: (_w = usuario.esocial_categoria_de_trabalhador_ref) !== null && _w !== void 0 ? _w : null,
|
|
80
77
|
excluido: boolean_helper_1.BooleanHelper.check(usuario.excluido, false),
|
|
81
78
|
id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null) || null,
|
|
82
79
|
integracao: usuario.integracao
|
|
83
80
|
? {
|
|
84
|
-
id: string_helper_1.StringHelper.trim((
|
|
85
|
-
id_externo: string_helper_1.StringHelper.trim((
|
|
86
|
-
lancamento_data_base: (
|
|
87
|
-
lancamentos_refs: ((
|
|
88
|
-
((
|
|
89
|
-
? (
|
|
81
|
+
id: string_helper_1.StringHelper.trim((_x = usuario.integracao) === null || _x === void 0 ? void 0 : _x.id, null) || null,
|
|
82
|
+
id_externo: string_helper_1.StringHelper.trim((_y = usuario.integracao) === null || _y === void 0 ? void 0 : _y.id_externo, null) || null,
|
|
83
|
+
lancamento_data_base: (_2 = (_0 = date_helper_1.DateHelper.tratarData((_z = usuario.integracao) === null || _z === void 0 ? void 0 : _z.lancamento_data_base, null)) === null || _0 === void 0 ? void 0 : _0.getTime()) !== null && _2 !== void 0 ? _2 : null,
|
|
84
|
+
lancamentos_refs: ((_3 = usuario.integracao) === null || _3 === void 0 ? void 0 : _3.lancamentos_refs) &&
|
|
85
|
+
((_4 = usuario.integracao) === null || _4 === void 0 ? void 0 : _4.lancamentos_refs.length)
|
|
86
|
+
? (_5 = usuario.integracao) === null || _5 === void 0 ? void 0 : _5.lancamentos_refs.map(function (ref) { return ref; })
|
|
90
87
|
: [],
|
|
91
|
-
tipo: string_helper_1.StringHelper.trim((
|
|
88
|
+
tipo: string_helper_1.StringHelper.trim((_6 = usuario.integracao) === null || _6 === void 0 ? void 0 : _6.tipo, null) || null,
|
|
92
89
|
}
|
|
93
90
|
: null,
|
|
94
91
|
interno: boolean_helper_1.BooleanHelper.check(usuario.interno, false),
|
|
95
|
-
nascimento: (
|
|
92
|
+
nascimento: (_8 = (_7 = date_helper_1.DateHelper.tratarData(usuario.nascimento, null)) === null || _7 === void 0 ? void 0 : _7.getTime()) !== null && _8 !== void 0 ? _8 : null,
|
|
96
93
|
nome: string_helper_1.StringHelper.trim(usuario.nome, null) || null,
|
|
97
94
|
nomeCompleto: string_helper_1.StringHelper.trim(usuario.nomeCompleto, null) || null,
|
|
98
95
|
observacoes: string_helper_1.StringHelper.trim(usuario.observacoes, null) || null,
|
|
@@ -104,12 +101,12 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
104
101
|
cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca, false),
|
|
105
102
|
codigo_externo: string_helper_1.StringHelper.trim(usuario.parametros.codigo_externo, null) ||
|
|
106
103
|
null,
|
|
107
|
-
horario_noturno: ((
|
|
104
|
+
horario_noturno: ((_9 = usuario.parametros) === null || _9 === void 0 ? void 0 : _9.horario_noturno)
|
|
108
105
|
? {
|
|
109
|
-
tipo: string_helper_1.StringHelper.trim((
|
|
110
|
-
inicio: string_helper_1.StringHelper.trim((
|
|
111
|
-
fim: string_helper_1.StringHelper.trim((
|
|
112
|
-
hora_reduzida_segundos: number_helper_1.NumberHelper.
|
|
106
|
+
tipo: string_helper_1.StringHelper.trim((_10 = usuario.parametros.horario_noturno) === null || _10 === void 0 ? void 0 : _10.tipo, null) || null,
|
|
107
|
+
inicio: string_helper_1.StringHelper.trim((_11 = usuario.parametros.horario_noturno) === null || _11 === void 0 ? void 0 : _11.inicio, null) || null,
|
|
108
|
+
fim: string_helper_1.StringHelper.trim((_12 = usuario.parametros.horario_noturno) === null || _12 === void 0 ? void 0 : _12.fim, null) || null,
|
|
109
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToInt((_13 = usuario.parametros.horario_noturno) === null || _13 === void 0 ? void 0 : _13.hora_reduzida_segundos),
|
|
113
110
|
}
|
|
114
111
|
: null,
|
|
115
112
|
horista: boolean_helper_1.BooleanHelper.check(usuario.parametros.horista, false),
|
|
@@ -121,37 +118,37 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
121
118
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio, false),
|
|
122
119
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online, false),
|
|
123
120
|
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.
|
|
121
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToInt((_14 = usuario.parametros) === null || _14 === void 0 ? void 0 : _14.limite_minutos_interjornada) || null,
|
|
125
122
|
regime_compensacao: string_helper_1.StringHelper.trim(usuario.parametros.regime_compensacao, null) ||
|
|
126
123
|
null,
|
|
127
124
|
}
|
|
128
125
|
: null,
|
|
129
|
-
perfil_ref: (
|
|
130
|
-
perimetros_refs: ((
|
|
131
|
-
? usuario.perimetros_refs.map(function (ref) { return ref
|
|
126
|
+
perfil_ref: (_15 = usuario.perfil_ref) !== null && _15 !== void 0 ? _15 : null,
|
|
127
|
+
perimetros_refs: ((_17 = (_16 = usuario.perimetros_refs) === null || _16 === void 0 ? void 0 : _16.length) !== null && _17 !== void 0 ? _17 : 0) > 0
|
|
128
|
+
? usuario.perimetros_refs.map(function (ref) { return ref; })
|
|
132
129
|
: null,
|
|
133
|
-
pin: number_helper_1.NumberHelper.
|
|
130
|
+
pin: number_helper_1.NumberHelper.convertToInt(usuario === null || usuario === void 0 ? void 0 : usuario.pin),
|
|
134
131
|
pis: string_helper_1.StringHelper.trim(usuario.pis, null) || null,
|
|
135
132
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(usuario.sem_autenticacao, false),
|
|
136
|
-
status: string_helper_1.StringHelper.trim(usuario.status, _1.
|
|
137
|
-
status_data_ini: (
|
|
138
|
-
status_data_fim: (
|
|
133
|
+
status: string_helper_1.StringHelper.trim(usuario.status, _1.UsuarioStatus.Ativo) || null,
|
|
134
|
+
status_data_ini: (_19 = (_18 = date_helper_1.DateHelper.tratarData(usuario.status_data_ini, null)) === null || _18 === void 0 ? void 0 : _18.getTime()) !== null && _19 !== void 0 ? _19 : null,
|
|
135
|
+
status_data_fim: (_21 = (_20 = date_helper_1.DateHelper.tratarData(usuario.status_data_fim, null)) === null || _20 === void 0 ? void 0 : _20.getTime()) !== null && _21 !== void 0 ? _21 : null,
|
|
139
136
|
status_programado: usuario.status_programado
|
|
140
137
|
? {
|
|
141
|
-
data_prevista: (
|
|
138
|
+
data_prevista: (_23 = (_22 = date_helper_1.DateHelper.tratarData(usuario.status_programado.data_prevista, null)) === null || _22 === void 0 ? void 0 : _22.getTime()) !== null && _23 !== void 0 ? _23 : null,
|
|
142
139
|
executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado, false),
|
|
143
|
-
tipo: string_helper_1.StringHelper.trim((
|
|
140
|
+
tipo: string_helper_1.StringHelper.trim((_24 = usuario.status_programado) === null || _24 === void 0 ? void 0 : _24.tipo, null) || null,
|
|
144
141
|
}
|
|
145
142
|
: null,
|
|
146
143
|
telefone: string_helper_1.StringHelper.trim(usuario.telefone, null) || null,
|
|
147
144
|
modificador: usuario.modificador
|
|
148
145
|
? (0, lodash_1.omitBy)({
|
|
149
|
-
id: (
|
|
150
|
-
ref: (
|
|
151
|
-
tipo: (
|
|
152
|
-
nome: (
|
|
153
|
-
documento: (
|
|
154
|
-
email: (
|
|
146
|
+
id: (_27 = (_26 = (_25 = usuario.modificador) === null || _25 === void 0 ? void 0 : _25.ref) === null || _26 === void 0 ? void 0 : _26.id) !== null && _27 !== void 0 ? _27 : null,
|
|
147
|
+
ref: (_30 = (_29 = (_28 = usuario.modificador) === null || _28 === void 0 ? void 0 : _28.ref) === null || _29 === void 0 ? void 0 : _29.path) !== null && _30 !== void 0 ? _30 : null,
|
|
148
|
+
tipo: (_32 = (_31 = usuario.modificador) === null || _31 === void 0 ? void 0 : _31.tipo) !== null && _32 !== void 0 ? _32 : null,
|
|
149
|
+
nome: (_34 = (_33 = usuario.modificador) === null || _33 === void 0 ? void 0 : _33.nome) !== null && _34 !== void 0 ? _34 : null,
|
|
150
|
+
documento: (_36 = (_35 = usuario.modificador) === null || _35 === void 0 ? void 0 : _35.documento) !== null && _36 !== void 0 ? _36 : null,
|
|
151
|
+
email: (_38 = (_37 = usuario.modificador) === null || _37 === void 0 ? void 0 : _37.email) !== null && _38 !== void 0 ? _38 : null,
|
|
155
152
|
}, lodash_1.isUndefined)
|
|
156
153
|
: undefined,
|
|
157
154
|
};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NumberHelper = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
4
5
|
var NumberHelper = /** @class */ (function () {
|
|
5
6
|
function NumberHelper() {
|
|
6
7
|
}
|
|
8
|
+
NumberHelper.convertToInt = function (value) {
|
|
9
|
+
var _a;
|
|
10
|
+
var number = (_a = (0, lodash_1.parseInt)(value, 10)) !== null && _a !== void 0 ? _a : null;
|
|
11
|
+
return (0, lodash_1.isNaN)(number) ? null : number;
|
|
12
|
+
};
|
|
7
13
|
NumberHelper.convertToNumber = function (value) {
|
|
8
14
|
var _a;
|
|
9
|
-
var number = (_a =
|
|
10
|
-
return isNaN(number) ? null : number;
|
|
15
|
+
var number = (_a = Number(value)) !== null && _a !== void 0 ? _a : null;
|
|
16
|
+
return (0, lodash_1.isNaN)(number) ? null : number;
|
|
11
17
|
};
|
|
12
18
|
return NumberHelper;
|
|
13
19
|
}());
|