flit-models 3.3.42 → 3.3.44
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 +13 -13
- package/lib/models/contas/usuario/index.js +56 -40
- package/lib/models/contas/usuario/usuario-elastic-convert.d.ts +14 -14
- package/lib/models/contas/usuario/usuario-elastic-convert.js +31 -35
- package/lib/models/contas/usuario/usuario-fire-convert.d.ts +9 -9
- package/lib/models/contas/usuario/usuario-fire-convert.js +46 -48
- package/lib/models/contas/usuario/usuario-json-convert.d.ts +16 -16
- package/lib/models/contas/usuario/usuario-json-convert.js +47 -61
- package/package.json +1 -1
|
@@ -34,14 +34,14 @@ export interface UsuarioStatusProgramado {
|
|
|
34
34
|
}
|
|
35
35
|
export type UsuarioBase = Omit<Partial<Usuario>, '_joins' | '_avatarBlob' | '_avatarBlobThumbnail' | '_jornadaAtual'>;
|
|
36
36
|
export declare class Usuario {
|
|
37
|
-
_id
|
|
38
|
-
_path
|
|
37
|
+
_id?: string;
|
|
38
|
+
_path?: string;
|
|
39
39
|
_avatarBlob?: Blob;
|
|
40
40
|
_avatarBlobThumbnail?: Blob;
|
|
41
41
|
_jornadaAtual?: any;
|
|
42
|
-
_joins
|
|
43
|
-
cargo
|
|
44
|
-
esocial_categoria_de_trabalhador
|
|
42
|
+
_joins?: {
|
|
43
|
+
cargo?: Cargo;
|
|
44
|
+
esocial_categoria_de_trabalhador?: EsocialCategoriaDeTrabalhador;
|
|
45
45
|
conta?: any;
|
|
46
46
|
departamento?: Departamento;
|
|
47
47
|
empresa?: Empresa;
|
|
@@ -50,14 +50,14 @@ export declare class Usuario {
|
|
|
50
50
|
perfil?: Perfil;
|
|
51
51
|
multiplosPerimetros?: any[];
|
|
52
52
|
};
|
|
53
|
-
cargo_ref?:
|
|
54
|
-
esocial_categoria_de_trabalhador_ref?:
|
|
55
|
-
conta_ref?:
|
|
56
|
-
departamento_ref?:
|
|
57
|
-
empresa_ref?:
|
|
58
|
-
escala_ref?:
|
|
59
|
-
perimetros_refs?:
|
|
60
|
-
perfil_ref?:
|
|
53
|
+
cargo_ref?: any;
|
|
54
|
+
esocial_categoria_de_trabalhador_ref?: any;
|
|
55
|
+
conta_ref?: any;
|
|
56
|
+
departamento_ref?: any;
|
|
57
|
+
empresa_ref?: any;
|
|
58
|
+
escala_ref?: any;
|
|
59
|
+
perimetros_refs?: any[];
|
|
60
|
+
perfil_ref?: any;
|
|
61
61
|
admissao?: any;
|
|
62
62
|
ativo?: boolean;
|
|
63
63
|
avatar_atualizacao?: any;
|
|
@@ -50,53 +50,69 @@ exports.StatusUsuarioArray = [
|
|
|
50
50
|
];
|
|
51
51
|
var Usuario = /** @class */ (function () {
|
|
52
52
|
function Usuario(usuarioPayload) {
|
|
53
|
-
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, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
53
|
+
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, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
|
|
54
54
|
this._id = (_a = usuarioPayload._id) !== null && _a !== void 0 ? _a : undefined;
|
|
55
55
|
this._path = (_b = usuarioPayload._path) !== null && _b !== void 0 ? _b : undefined;
|
|
56
|
-
|
|
57
|
-
this.
|
|
56
|
+
// Inicializa internos
|
|
57
|
+
this._joins = (_c = usuarioPayload._joins) !== null && _c !== void 0 ? _c : {
|
|
58
|
+
cargo: null,
|
|
59
|
+
conta: null,
|
|
60
|
+
departamento: null,
|
|
61
|
+
empresa: null,
|
|
62
|
+
escala: null,
|
|
63
|
+
esocial_categoria_de_trabalhador: null,
|
|
64
|
+
multiplosPerimetros: null,
|
|
65
|
+
perfil: null,
|
|
66
|
+
perimetros: null,
|
|
67
|
+
};
|
|
68
|
+
this._avatarBlob = (_d = usuarioPayload._avatarBlob) !== null && _d !== void 0 ? _d : null;
|
|
69
|
+
this._avatarBlobThumbnail = (_e = usuarioPayload._avatarBlobThumbnail) !== null && _e !== void 0 ? _e : null;
|
|
70
|
+
this._jornadaAtual = (_f = usuarioPayload._jornadaAtual) !== null && _f !== void 0 ? _f : null;
|
|
71
|
+
this.admissao = (_g = usuarioPayload.admissao) !== null && _g !== void 0 ? _g : undefined;
|
|
72
|
+
this.ativo = (_h = usuarioPayload.ativo) !== null && _h !== void 0 ? _h : undefined;
|
|
58
73
|
this.avatar_thumbnail_path =
|
|
59
|
-
(
|
|
74
|
+
(_j = usuarioPayload.avatar_thumbnail_path) !== null && _j !== void 0 ? _j : undefined;
|
|
60
75
|
this.avatar_thumbnail_url =
|
|
61
|
-
(
|
|
62
|
-
this.avatarUrl = (
|
|
63
|
-
this.cargo_ref = (
|
|
64
|
-
this.beneficios = (
|
|
65
|
-
this.celular = (
|
|
66
|
-
this.conta_ref = (
|
|
67
|
-
this.cpf = (
|
|
76
|
+
(_k = usuarioPayload.avatar_thumbnail_url) !== null && _k !== void 0 ? _k : undefined;
|
|
77
|
+
this.avatarUrl = (_l = usuarioPayload.avatarUrl) !== null && _l !== void 0 ? _l : undefined;
|
|
78
|
+
this.cargo_ref = (_m = usuarioPayload.cargo_ref) !== null && _m !== void 0 ? _m : undefined;
|
|
79
|
+
this.beneficios = (_o = usuarioPayload.beneficios) !== null && _o !== void 0 ? _o : undefined;
|
|
80
|
+
this.celular = (_p = usuarioPayload.celular) !== null && _p !== void 0 ? _p : undefined;
|
|
81
|
+
this.conta_ref = (_q = usuarioPayload.conta_ref) !== null && _q !== void 0 ? _q : undefined;
|
|
82
|
+
this.cpf = (_r = usuarioPayload.cpf) !== null && _r !== void 0 ? _r : undefined;
|
|
68
83
|
this.data_atualizacao_doc =
|
|
69
|
-
(
|
|
70
|
-
this.data_criacao_doc = (
|
|
71
|
-
this.departamento_ref = (
|
|
72
|
-
this.desligamento = (
|
|
73
|
-
this.email = (
|
|
74
|
-
this.empresa_ref = (
|
|
75
|
-
this.endereco = (
|
|
84
|
+
(_s = usuarioPayload.data_atualizacao_doc) !== null && _s !== void 0 ? _s : undefined;
|
|
85
|
+
this.data_criacao_doc = (_t = usuarioPayload.data_criacao_doc) !== null && _t !== void 0 ? _t : undefined;
|
|
86
|
+
this.departamento_ref = (_u = usuarioPayload.departamento_ref) !== null && _u !== void 0 ? _u : undefined;
|
|
87
|
+
this.desligamento = (_v = usuarioPayload.desligamento) !== null && _v !== void 0 ? _v : undefined;
|
|
88
|
+
this.email = (_w = usuarioPayload.email) !== null && _w !== void 0 ? _w : undefined;
|
|
89
|
+
this.empresa_ref = (_x = usuarioPayload.empresa_ref) !== null && _x !== void 0 ? _x : undefined;
|
|
90
|
+
this.endereco = (_y = usuarioPayload.endereco) !== null && _y !== void 0 ? _y : undefined;
|
|
76
91
|
this.endereco_prestacao_diferente_empresa =
|
|
77
|
-
(
|
|
78
|
-
this.endereco_prestacao = (
|
|
79
|
-
this.escala_ref = (
|
|
92
|
+
(_z = usuarioPayload.endereco_prestacao_diferente_empresa) !== null && _z !== void 0 ? _z : false;
|
|
93
|
+
this.endereco_prestacao = (_0 = usuarioPayload.endereco_prestacao) !== null && _0 !== void 0 ? _0 : undefined;
|
|
94
|
+
this.escala_ref = (_1 = usuarioPayload.escala_ref) !== null && _1 !== void 0 ? _1 : undefined;
|
|
80
95
|
this.esocial_categoria_de_trabalhador_ref =
|
|
81
|
-
(
|
|
82
|
-
this.excluido = (
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
96
|
+
(_2 = usuarioPayload.esocial_categoria_de_trabalhador_ref) !== null && _2 !== void 0 ? _2 : undefined;
|
|
97
|
+
this.excluido = (_3 = usuarioPayload.excluido) !== null && _3 !== void 0 ? _3 : undefined;
|
|
98
|
+
this.integracao = (_4 = usuarioPayload.integracao) !== null && _4 !== void 0 ? _4 : undefined;
|
|
99
|
+
this.interno = (_5 = usuarioPayload.interno) !== null && _5 !== void 0 ? _5 : undefined;
|
|
100
|
+
this.modificador = (_6 = usuarioPayload.modificador) !== null && _6 !== void 0 ? _6 : undefined;
|
|
101
|
+
this.nascimento = (_7 = usuarioPayload.nascimento) !== null && _7 !== void 0 ? _7 : undefined;
|
|
102
|
+
this.nome = (_8 = usuarioPayload.nome) !== null && _8 !== void 0 ? _8 : undefined;
|
|
103
|
+
this.nomeCompleto = (_9 = usuarioPayload.nomeCompleto) !== null && _9 !== void 0 ? _9 : undefined;
|
|
104
|
+
this.observacoes = (_10 = usuarioPayload.observacoes) !== null && _10 !== void 0 ? _10 : undefined;
|
|
105
|
+
this.parametros = (_11 = usuarioPayload.parametros) !== null && _11 !== void 0 ? _11 : undefined;
|
|
106
|
+
this.perfil_ref = (_12 = usuarioPayload.perfil_ref) !== null && _12 !== void 0 ? _12 : undefined;
|
|
107
|
+
this.perimetros_refs = (_13 = usuarioPayload.perimetros_refs) !== null && _13 !== void 0 ? _13 : undefined;
|
|
108
|
+
this.pin = (_14 = usuarioPayload.pin) !== null && _14 !== void 0 ? _14 : undefined;
|
|
109
|
+
this.pis = (_15 = usuarioPayload.pis) !== null && _15 !== void 0 ? _15 : undefined;
|
|
110
|
+
this.sem_autenticacao = (_16 = usuarioPayload.sem_autenticacao) !== null && _16 !== void 0 ? _16 : undefined;
|
|
111
|
+
this.status = (_17 = usuarioPayload.status) !== null && _17 !== void 0 ? _17 : undefined;
|
|
112
|
+
this.status_data_fim = (_18 = usuarioPayload.status_data_fim) !== null && _18 !== void 0 ? _18 : undefined;
|
|
113
|
+
this.status_data_ini = (_19 = usuarioPayload.status_data_ini) !== null && _19 !== void 0 ? _19 : undefined;
|
|
114
|
+
this.status_programado = (_20 = usuarioPayload.status_programado) !== null && _20 !== void 0 ? _20 : undefined;
|
|
115
|
+
this.telefone = (_21 = usuarioPayload.telefone) !== null && _21 !== void 0 ? _21 : undefined;
|
|
100
116
|
}
|
|
101
117
|
return Usuario;
|
|
102
118
|
}());
|
|
@@ -2,23 +2,23 @@ import { BeneficiosUsuario, Integracao, IUsuarioStatusProgramado, ParametrosUsua
|
|
|
2
2
|
import { AuditoriaModificadorFirestoreData } from '../auditoria/modificador';
|
|
3
3
|
import { Endereco } from '../shared';
|
|
4
4
|
export interface UsuarioElasticSource {
|
|
5
|
-
i_created
|
|
6
|
-
i_id
|
|
7
|
-
i_parent_id
|
|
8
|
-
i_path
|
|
9
|
-
i_type_sync
|
|
10
|
-
i_updated
|
|
5
|
+
i_created?: string;
|
|
6
|
+
i_id?: string;
|
|
7
|
+
i_parent_id?: string;
|
|
8
|
+
i_path?: string;
|
|
9
|
+
i_type_sync?: string;
|
|
10
|
+
i_updated?: string;
|
|
11
|
+
_avatarBlob?: Blob;
|
|
12
|
+
_avatarBlobThumbnail?: Blob;
|
|
13
|
+
_jornadaAtual?: any;
|
|
11
14
|
esocial_categoria_de_trabalhador_ref?: any;
|
|
12
15
|
conta_ref?: any;
|
|
13
16
|
perimetros_refs?: any;
|
|
14
|
-
cargo_ref
|
|
15
|
-
departamento_ref
|
|
16
|
-
empresa_ref
|
|
17
|
-
escala_ref
|
|
18
|
-
perfil_ref
|
|
19
|
-
avatarBlob?: Blob;
|
|
20
|
-
avatarBlobThumbnail?: Blob;
|
|
21
|
-
jornadaAtual?: any;
|
|
17
|
+
cargo_ref?: any;
|
|
18
|
+
departamento_ref?: any;
|
|
19
|
+
empresa_ref?: any;
|
|
20
|
+
escala_ref?: any;
|
|
21
|
+
perfil_ref?: any;
|
|
22
22
|
admissao?: string;
|
|
23
23
|
ativo?: boolean;
|
|
24
24
|
avatar_atualizacao?: string;
|
|
@@ -11,11 +11,11 @@ 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;
|
|
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;
|
|
15
15
|
var docData = doc;
|
|
16
16
|
return new _1.Usuario({
|
|
17
|
-
_id: (_a = doc.i_id) !== null && _a !== void 0 ? _a : null,
|
|
18
|
-
_path: (_b = doc.i_path) !== null && _b !== void 0 ? _b : null,
|
|
17
|
+
_id: (_a = doc === null || doc === void 0 ? void 0 : doc.i_id) !== null && _a !== void 0 ? _a : null,
|
|
18
|
+
_path: (_b = doc === null || doc === void 0 ? void 0 : doc.i_path) !== null && _b !== void 0 ? _b : null,
|
|
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),
|
|
@@ -29,16 +29,16 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
29
29
|
vale_transporte: (_e = docData.beneficios.vale_transporte) !== null && _e !== void 0 ? _e : false,
|
|
30
30
|
}
|
|
31
31
|
: null,
|
|
32
|
-
cargo_ref: (_f = docData.cargo_ref.i_path) !== null &&
|
|
32
|
+
cargo_ref: (_g = (_f = docData.cargo_ref) === null || _f === void 0 ? void 0 : _f.i_path) !== null && _g !== void 0 ? _g : null,
|
|
33
33
|
celular: string_helper_1.StringHelper.trim(docData.celular, null),
|
|
34
|
-
conta_ref: (
|
|
34
|
+
conta_ref: (_j = (_h = docData.conta_ref) === null || _h === void 0 ? void 0 : _h.i_path) !== null && _j !== void 0 ? _j : null,
|
|
35
35
|
cpf: string_helper_1.StringHelper.trim(docData.cpf, 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
|
-
departamento_ref: (
|
|
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
40
|
email: string_helper_1.StringHelper.trim(docData.email, null),
|
|
41
|
-
empresa_ref: (
|
|
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
44
|
bairro: string_helper_1.StringHelper.trim(docData.endereco.bairro, null),
|
|
@@ -62,14 +62,14 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
62
62
|
uf: string_helper_1.StringHelper.trim(docData.endereco_prestacao.uf, null),
|
|
63
63
|
}
|
|
64
64
|
: null,
|
|
65
|
-
escala_ref: (
|
|
66
|
-
esocial_categoria_de_trabalhador_ref: (
|
|
65
|
+
escala_ref: (_q = (_p = docData.escala_ref) === null || _p === void 0 ? void 0 : _p.i_path) !== null && _q !== void 0 ? _q : null,
|
|
66
|
+
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
67
|
excluido: boolean_helper_1.BooleanHelper.check(docData.excluido, false),
|
|
68
68
|
id_externo: string_helper_1.StringHelper.trim(docData.id_externo, null),
|
|
69
69
|
integracao: docData.integracao
|
|
70
70
|
? {
|
|
71
|
-
id: string_helper_1.StringHelper.trim(docData.integracao.id, null),
|
|
72
|
-
tipo: string_helper_1.StringHelper.trim(docData.integracao.tipo, null),
|
|
71
|
+
id: string_helper_1.StringHelper.trim((_t = docData.integracao) === null || _t === void 0 ? void 0 : _t.id, null),
|
|
72
|
+
tipo: string_helper_1.StringHelper.trim((_u = docData.integracao) === null || _u === void 0 ? void 0 : _u.tipo, null),
|
|
73
73
|
}
|
|
74
74
|
: null,
|
|
75
75
|
interno: boolean_helper_1.BooleanHelper.check(docData.interno, false),
|
|
@@ -84,15 +84,14 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
84
84
|
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_localizacao_marcacao_externa, null),
|
|
85
85
|
cargo_confianca: boolean_helper_1.BooleanHelper.check(docData.parametros.cargo_confianca, null),
|
|
86
86
|
codigo_externo: string_helper_1.StringHelper.check(docData.parametros.codigo_externo, null),
|
|
87
|
-
horario_noturno:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.hora_reduzida_segundos
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
87
|
+
horario_noturno: ((_v = docData.parametros) === null || _v === void 0 ? void 0 : _v.horario_noturno)
|
|
88
|
+
? {
|
|
89
|
+
tipo: string_helper_1.StringHelper.check((_w = docData.parametros.horario_noturno) === null || _w === void 0 ? void 0 : _w.tipo, null),
|
|
90
|
+
inicio: string_helper_1.StringHelper.check((_x = docData.parametros.horario_noturno) === null || _x === void 0 ? void 0 : _x.inicio, null),
|
|
91
|
+
fim: string_helper_1.StringHelper.check((_y = docData.parametros.horario_noturno) === null || _y === void 0 ? void 0 : _y.fim, null),
|
|
92
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_z = docData.parametros.horario_noturno) === null || _z === void 0 ? void 0 : _z.hora_reduzida_segundos),
|
|
93
|
+
}
|
|
94
|
+
: null,
|
|
96
95
|
horista: boolean_helper_1.BooleanHelper.check(docData.parametros.horista, null),
|
|
97
96
|
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(docData.parametros.marcacao_whatsapp, null),
|
|
98
97
|
marca_ponto_web: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_web, null),
|
|
@@ -102,39 +101,36 @@ var UsuarioElasticConvert = /** @class */ (function () {
|
|
|
102
101
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial_obrigatorio, null),
|
|
103
102
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_apenas_online, null),
|
|
104
103
|
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(docData.parametros.configuracao_tipo_falta_jornada, null),
|
|
105
|
-
limite_minutos_interjornada: docData.parametros
|
|
106
|
-
.limite_minutos_interjornada
|
|
107
|
-
? number_helper_1.NumberHelper.convertToNumber(docData.parametros.limite_minutos_interjornada)
|
|
108
|
-
: null,
|
|
104
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_0 = docData.parametros) === null || _0 === void 0 ? void 0 : _0.limite_minutos_interjornada),
|
|
109
105
|
regime_compensacao: string_helper_1.StringHelper.check(docData.parametros.regime_compensacao, null),
|
|
110
106
|
}
|
|
111
107
|
: null,
|
|
112
|
-
perfil_ref: (
|
|
108
|
+
perfil_ref: (_3 = (_2 = docData.perfil_ref) === null || _2 === void 0 ? void 0 : _2.i_path) !== null && _3 !== void 0 ? _3 : null,
|
|
113
109
|
perimetros_refs: docData.perimetros_refs && docData.perimetros_refs.length
|
|
114
|
-
? docData.perimetros_refs.map(function (ref) { return ref.i_path; })
|
|
110
|
+
? docData.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.i_path; })
|
|
115
111
|
: [],
|
|
116
|
-
pin:
|
|
112
|
+
pin: number_helper_1.NumberHelper.convertToNumber(docData === null || docData === void 0 ? void 0 : docData.pin),
|
|
117
113
|
pis: string_helper_1.StringHelper.trim(docData.pis, null),
|
|
118
114
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(docData.sem_autenticacao, false),
|
|
119
|
-
status: string_helper_1.StringHelper.check(docData.status,
|
|
115
|
+
status: string_helper_1.StringHelper.check(docData.status, _1.StatusUsuario.Ativo),
|
|
120
116
|
status_data_ini: date_helper_1.DateHelper.fromString(docData.status_data_ini, null),
|
|
121
117
|
status_data_fim: date_helper_1.DateHelper.fromString(docData.status_data_fim, null),
|
|
122
118
|
status_programado: docData.status_programado
|
|
123
119
|
? {
|
|
124
120
|
data_prevista: date_helper_1.DateHelper.fromString(docData.status_programado.data_prevista, null),
|
|
125
121
|
executado: boolean_helper_1.BooleanHelper.check(docData.status_programado.executado, null),
|
|
126
|
-
tipo: string_helper_1.StringHelper.check(docData.status_programado.tipo, null),
|
|
122
|
+
tipo: string_helper_1.StringHelper.check((_4 = docData.status_programado) === null || _4 === void 0 ? void 0 : _4.tipo, null),
|
|
127
123
|
}
|
|
128
124
|
: null,
|
|
129
125
|
telefone: string_helper_1.StringHelper.trim(docData.telefone, null),
|
|
130
126
|
modificador: docData.modificador
|
|
131
127
|
? (0, lodash_1.omitBy)({
|
|
132
|
-
id: (
|
|
133
|
-
ref: (
|
|
134
|
-
tipo: (
|
|
135
|
-
nome: string_helper_1.StringHelper.trim((
|
|
136
|
-
documento: string_helper_1.StringHelper.trim((
|
|
137
|
-
email: string_helper_1.StringHelper.trim((
|
|
128
|
+
id: (_7 = (_6 = (_5 = docData.modificador) === null || _5 === void 0 ? void 0 : _5.ref) === null || _6 === void 0 ? void 0 : _6.id) !== null && _7 !== void 0 ? _7 : null,
|
|
129
|
+
ref: (_10 = (_9 = (_8 = docData.modificador) === null || _8 === void 0 ? void 0 : _8.ref) === null || _9 === void 0 ? void 0 : _9.path) !== null && _10 !== void 0 ? _10 : null,
|
|
130
|
+
tipo: (_12 = (_11 = docData.modificador) === null || _11 === void 0 ? void 0 : _11.tipo) !== null && _12 !== void 0 ? _12 : null,
|
|
131
|
+
nome: string_helper_1.StringHelper.trim((_13 = docData.modificador) === null || _13 === void 0 ? void 0 : _13.nome, null),
|
|
132
|
+
documento: string_helper_1.StringHelper.trim((_14 = docData.modificador) === null || _14 === void 0 ? void 0 : _14.documento, null),
|
|
133
|
+
email: string_helper_1.StringHelper.trim((_15 = docData.modificador) === null || _15 === void 0 ? void 0 : _15.email, null),
|
|
138
134
|
}, lodash_1.isUndefined)
|
|
139
135
|
: undefined,
|
|
140
136
|
});
|
|
@@ -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,34 +16,34 @@ 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;
|
|
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;
|
|
20
20
|
var d = ((_a = doc.data()) !== null && _a !== void 0 ? _a : {});
|
|
21
21
|
return new _1.Usuario({
|
|
22
|
-
_id: (_b = doc.id) !== null && _b !== void 0 ? _b : null,
|
|
23
|
-
_path: (_c = doc.ref.path) !== null &&
|
|
24
|
-
admissao: (
|
|
22
|
+
_id: (_b = doc === null || doc === void 0 ? void 0 : doc.id) !== null && _b !== void 0 ? _b : null,
|
|
23
|
+
_path: (_d = (_c = doc.ref) === null || _c === void 0 ? void 0 : _c.path) !== null && _d !== void 0 ? _d : null,
|
|
24
|
+
admissao: (_f = (_e = d.admissao) === null || _e === void 0 ? void 0 : _e.toDate()) !== null && _f !== void 0 ? _f : null,
|
|
25
25
|
ativo: boolean_helper_1.BooleanHelper.check(d.ativo, true),
|
|
26
|
-
avatar_atualizacao: (
|
|
26
|
+
avatar_atualizacao: (_h = (_g = d.avatar_atualizacao) === null || _g === void 0 ? void 0 : _g.toDate()) !== null && _h !== void 0 ? _h : null,
|
|
27
27
|
avatar_thumbnail_path: string_helper_1.StringHelper.trim(d.avatar_thumbnail_path, null),
|
|
28
28
|
avatar_thumbnail_url: string_helper_1.StringHelper.trim(d.avatar_thumbnail_url, null),
|
|
29
29
|
avatarUrl: string_helper_1.StringHelper.trim(d.avatarUrl, null),
|
|
30
30
|
beneficios: d.beneficios
|
|
31
31
|
? {
|
|
32
|
-
vale_alimentacao: (
|
|
33
|
-
vale_refeicao: (
|
|
34
|
-
vale_transporte: (
|
|
32
|
+
vale_alimentacao: (_j = d.beneficios.vale_alimentacao) !== null && _j !== void 0 ? _j : false,
|
|
33
|
+
vale_refeicao: (_k = d.beneficios.vale_refeicao) !== null && _k !== void 0 ? _k : false,
|
|
34
|
+
vale_transporte: (_l = d.beneficios.vale_transporte) !== null && _l !== void 0 ? _l : false,
|
|
35
35
|
}
|
|
36
36
|
: null,
|
|
37
|
-
cargo_ref: d.cargo_ref ? d.cargo_ref.path : null,
|
|
37
|
+
cargo_ref: d.cargo_ref ? (_m = d.cargo_ref) === null || _m === void 0 ? void 0 : _m.path : null,
|
|
38
38
|
celular: string_helper_1.StringHelper.trim(d.celular, null),
|
|
39
|
-
conta_ref: d.conta_ref ? d.conta_ref.path : null,
|
|
39
|
+
conta_ref: d.conta_ref ? (_o = d.conta_ref) === null || _o === void 0 ? void 0 : _o.path : null,
|
|
40
40
|
cpf: string_helper_1.StringHelper.trim(d.cpf, null),
|
|
41
|
-
data_atualizacao_doc: ((
|
|
42
|
-
data_criacao_doc: ((
|
|
43
|
-
departamento_ref: d.departamento_ref ? d.departamento_ref.path : null,
|
|
44
|
-
desligamento: (
|
|
41
|
+
data_atualizacao_doc: ((_p = d.data_atualizacao_doc) === null || _p === void 0 ? void 0 : _p.toDate()) || new Date(),
|
|
42
|
+
data_criacao_doc: ((_q = d.data_criacao_doc) === null || _q === void 0 ? void 0 : _q.toDate()) || new Date(),
|
|
43
|
+
departamento_ref: d.departamento_ref ? (_r = d.departamento_ref) === null || _r === void 0 ? void 0 : _r.path : null,
|
|
44
|
+
desligamento: (_t = (_s = d.desligamento) === null || _s === void 0 ? void 0 : _s.toDate()) !== null && _t !== void 0 ? _t : null,
|
|
45
45
|
email: string_helper_1.StringHelper.trim(d.email, null),
|
|
46
|
-
empresa_ref: d.empresa_ref ? d.empresa_ref.path : null,
|
|
46
|
+
empresa_ref: d.empresa_ref ? (_u = d.empresa_ref) === null || _u === void 0 ? void 0 : _u.path : null,
|
|
47
47
|
endereco: d.endereco
|
|
48
48
|
? {
|
|
49
49
|
bairro: string_helper_1.StringHelper.trim(d.endereco.bairro, null),
|
|
@@ -67,20 +67,20 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
67
67
|
uf: string_helper_1.StringHelper.trim(d.endereco_prestacao.uf, null),
|
|
68
68
|
}
|
|
69
69
|
: null,
|
|
70
|
-
escala_ref: d.escala_ref ? d.escala_ref.path : null,
|
|
70
|
+
escala_ref: d.escala_ref ? (_v = d.escala_ref) === null || _v === void 0 ? void 0 : _v.path : null,
|
|
71
71
|
esocial_categoria_de_trabalhador_ref: d.esocial_categoria_de_trabalhador_ref
|
|
72
|
-
? d.esocial_categoria_de_trabalhador_ref.path
|
|
72
|
+
? (_w = d.esocial_categoria_de_trabalhador_ref) === null || _w === void 0 ? void 0 : _w.path
|
|
73
73
|
: null,
|
|
74
74
|
excluido: boolean_helper_1.BooleanHelper.check(d.excluido, false),
|
|
75
75
|
id_externo: string_helper_1.StringHelper.trim(d.id_externo, null),
|
|
76
76
|
integracao: d.integracao
|
|
77
77
|
? {
|
|
78
|
-
id: string_helper_1.StringHelper.trim(d.integracao.id, null),
|
|
79
|
-
tipo: string_helper_1.StringHelper.trim(d.integracao.tipo, null),
|
|
78
|
+
id: string_helper_1.StringHelper.trim((_x = d.integracao) === null || _x === void 0 ? void 0 : _x.id, null),
|
|
79
|
+
tipo: string_helper_1.StringHelper.trim((_y = d.integracao) === null || _y === void 0 ? void 0 : _y.tipo, null),
|
|
80
80
|
}
|
|
81
81
|
: null,
|
|
82
82
|
interno: boolean_helper_1.BooleanHelper.check(d.interno, false),
|
|
83
|
-
nascimento: (
|
|
83
|
+
nascimento: (_0 = (_z = d.nascimento) === null || _z === void 0 ? void 0 : _z.toDate()) !== null && _0 !== void 0 ? _0 : null,
|
|
84
84
|
nome: string_helper_1.StringHelper.trim(d.nome, null),
|
|
85
85
|
nomeCompleto: string_helper_1.StringHelper.trim(d.nomeCompleto, null),
|
|
86
86
|
observacoes: string_helper_1.StringHelper.trim(d.observacoes, null),
|
|
@@ -91,15 +91,14 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
91
91
|
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_localizacao_marcacao_externa, null),
|
|
92
92
|
cargo_confianca: boolean_helper_1.BooleanHelper.check(d.parametros.cargo_confianca, null),
|
|
93
93
|
codigo_externo: string_helper_1.StringHelper.check(d.parametros.codigo_externo, null),
|
|
94
|
-
horario_noturno:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.hora_reduzida_segundos
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
},
|
|
94
|
+
horario_noturno: ((_2 = d.parametros) === null || _2 === void 0 ? void 0 : _2.horario_noturno)
|
|
95
|
+
? {
|
|
96
|
+
tipo: string_helper_1.StringHelper.check((_3 = d.parametros.horario_noturno) === null || _3 === void 0 ? void 0 : _3.tipo, null),
|
|
97
|
+
inicio: string_helper_1.StringHelper.check((_4 = d.parametros.horario_noturno) === null || _4 === void 0 ? void 0 : _4.inicio, null),
|
|
98
|
+
fim: string_helper_1.StringHelper.check((_5 = d.parametros.horario_noturno) === null || _5 === void 0 ? void 0 : _5.fim, null),
|
|
99
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_6 = d.parametros.horario_noturno) === null || _6 === void 0 ? void 0 : _6.hora_reduzida_segundos),
|
|
100
|
+
}
|
|
101
|
+
: null,
|
|
103
102
|
horista: boolean_helper_1.BooleanHelper.check(d.parametros.horista, null),
|
|
104
103
|
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(d.parametros.marcacao_whatsapp, null),
|
|
105
104
|
marca_ponto_web: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_web, null),
|
|
@@ -109,37 +108,36 @@ var UsuarioFireConvert = /** @class */ (function () {
|
|
|
109
108
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial_obrigatorio, null),
|
|
110
109
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_apenas_online, null),
|
|
111
110
|
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(d.parametros.configuracao_tipo_falta_jornada, null),
|
|
112
|
-
limite_minutos_interjornada: d.parametros
|
|
113
|
-
.limite_minutos_interjornada
|
|
114
|
-
? number_helper_1.NumberHelper.convertToNumber(d.parametros.limite_minutos_interjornada)
|
|
115
|
-
: null,
|
|
111
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_7 = d.parametros) === null || _7 === void 0 ? void 0 : _7.limite_minutos_interjornada),
|
|
116
112
|
regime_compensacao: string_helper_1.StringHelper.check(d.parametros.regime_compensacao, null),
|
|
117
113
|
}
|
|
118
114
|
: null,
|
|
119
|
-
perfil_ref: d.perfil_ref ? d.perfil_ref.path : null,
|
|
120
|
-
perimetros_refs:
|
|
121
|
-
|
|
115
|
+
perfil_ref: d.perfil_ref ? (_8 = d.perfil_ref) === null || _8 === void 0 ? void 0 : _8.path : null,
|
|
116
|
+
perimetros_refs: d.perimetros_refs
|
|
117
|
+
? d.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
|
|
118
|
+
: null,
|
|
119
|
+
pin: number_helper_1.NumberHelper.convertToNumber(d === null || d === void 0 ? void 0 : d.pin),
|
|
122
120
|
pis: string_helper_1.StringHelper.trim(d.pis, null),
|
|
123
121
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(d.sem_autenticacao, false),
|
|
124
|
-
status: string_helper_1.StringHelper.check(d.status,
|
|
125
|
-
status_data_ini: (
|
|
126
|
-
status_data_fim: (
|
|
122
|
+
status: string_helper_1.StringHelper.check(d.status, _1.StatusUsuario.Ativo),
|
|
123
|
+
status_data_ini: (_10 = (_9 = d.status_data_ini) === null || _9 === void 0 ? void 0 : _9.toDate()) !== null && _10 !== void 0 ? _10 : null,
|
|
124
|
+
status_data_fim: (_12 = (_11 = d.status_data_fim) === null || _11 === void 0 ? void 0 : _11.toDate()) !== null && _12 !== void 0 ? _12 : null,
|
|
127
125
|
status_programado: d.status_programado
|
|
128
126
|
? {
|
|
129
|
-
data_prevista: (
|
|
130
|
-
executado: boolean_helper_1.BooleanHelper.check(d.status_programado.executado, null),
|
|
131
|
-
tipo: string_helper_1.StringHelper.check(d.status_programado.tipo, null),
|
|
127
|
+
data_prevista: (_14 = (_13 = d.status_programado.data_prevista) === null || _13 === void 0 ? void 0 : _13.toDate()) !== null && _14 !== void 0 ? _14 : null,
|
|
128
|
+
executado: boolean_helper_1.BooleanHelper.check((_15 = d.status_programado) === null || _15 === void 0 ? void 0 : _15.executado, null),
|
|
129
|
+
tipo: string_helper_1.StringHelper.check((_16 = d.status_programado) === null || _16 === void 0 ? void 0 : _16.tipo, null),
|
|
132
130
|
}
|
|
133
131
|
: null,
|
|
134
132
|
telefone: string_helper_1.StringHelper.trim(d.telefone, null),
|
|
135
133
|
modificador: d.modificador
|
|
136
134
|
? (0, lodash_1.omitBy)({
|
|
137
|
-
id: (
|
|
138
|
-
ref: (
|
|
139
|
-
tipo: (
|
|
140
|
-
nome: string_helper_1.StringHelper.trim((
|
|
141
|
-
documento: string_helper_1.StringHelper.trim((
|
|
142
|
-
email: string_helper_1.StringHelper.trim((
|
|
135
|
+
id: (_19 = (_18 = (_17 = d.modificador) === null || _17 === void 0 ? void 0 : _17.ref) === null || _18 === void 0 ? void 0 : _18.id) !== null && _19 !== void 0 ? _19 : null,
|
|
136
|
+
ref: (_22 = (_21 = (_20 = d.modificador) === null || _20 === void 0 ? void 0 : _20.ref) === null || _21 === void 0 ? void 0 : _21.path) !== null && _22 !== void 0 ? _22 : null,
|
|
137
|
+
tipo: (_24 = (_23 = d.modificador) === null || _23 === void 0 ? void 0 : _23.tipo) !== null && _24 !== void 0 ? _24 : null,
|
|
138
|
+
nome: string_helper_1.StringHelper.trim((_25 = d.modificador) === null || _25 === void 0 ? void 0 : _25.nome, null),
|
|
139
|
+
documento: string_helper_1.StringHelper.trim((_26 = d.modificador) === null || _26 === void 0 ? void 0 : _26.documento, null),
|
|
140
|
+
email: string_helper_1.StringHelper.trim((_27 = d.modificador) === null || _27 === void 0 ? void 0 : _27.email, null),
|
|
143
141
|
}, lodash_1.isUndefined)
|
|
144
142
|
: undefined,
|
|
145
143
|
});
|
|
@@ -4,45 +4,45 @@ import { Endereco } from '../shared';
|
|
|
4
4
|
export declare class UsuarioJsonData implements UsuarioBase {
|
|
5
5
|
_id: string;
|
|
6
6
|
_path: string;
|
|
7
|
-
|
|
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;
|
|
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
|
-
|
|
21
|
-
desligamento?: string;
|
|
24
|
+
data_atualizacao_doc?: number;
|
|
25
|
+
data_criacao_doc?: number;
|
|
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;
|
|
32
34
|
interno?: boolean;
|
|
33
|
-
nascimento?:
|
|
35
|
+
nascimento?: number;
|
|
34
36
|
nome?: string;
|
|
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;
|
|
43
43
|
status?: StatusUsuario;
|
|
44
|
-
status_data_ini?:
|
|
45
|
-
status_data_fim?:
|
|
44
|
+
status_data_ini?: number;
|
|
45
|
+
status_data_fim?: number;
|
|
46
46
|
status_programado?: UsuarioStatusProgramado;
|
|
47
47
|
telefone?: string;
|
|
48
48
|
modificador?: AuditoriaModificadorFirestoreData;
|
|
@@ -2,7 +2,9 @@
|
|
|
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");
|
|
7
|
+
var date_helper_1 = require("../../utils/date-helper");
|
|
6
8
|
var number_helper_1 = require("../../utils/number-helper");
|
|
7
9
|
var string_helper_1 = require("../../utils/string-helper");
|
|
8
10
|
var UsuarioJsonData = /** @class */ (function () {
|
|
@@ -18,41 +20,33 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
18
20
|
// public static fromJson(obj: UsuarioJsonData): Usuario {
|
|
19
21
|
// }
|
|
20
22
|
UsuarioJsonConvert.toJson = function (usuario) {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
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;
|
|
22
24
|
var usuarioJson = {
|
|
23
|
-
_id: (_a = usuario._id) !== null && _a !== void 0 ? _a : null,
|
|
24
|
-
_path: (_b = usuario._path) !== null && _b !== void 0 ? _b : null,
|
|
25
|
-
admissao: usuario.admissao ?
|
|
25
|
+
_id: (_a = usuario === null || usuario === void 0 ? void 0 : usuario._id) !== null && _a !== void 0 ? _a : null,
|
|
26
|
+
_path: (_b = usuario === null || usuario === void 0 ? void 0 : usuario._path) !== null && _b !== void 0 ? _b : null,
|
|
27
|
+
admissao: (_c = date_helper_1.DateHelper.fromString(usuario.admissao, null)) === null || _c === void 0 ? void 0 : _c.getTime(),
|
|
26
28
|
ativo: boolean_helper_1.BooleanHelper.check(usuario.ativo, null),
|
|
27
|
-
avatar_atualizacao: usuario.avatar_atualizacao
|
|
28
|
-
? usuario.avatar_atualizacao.toISOString()
|
|
29
|
-
: null,
|
|
29
|
+
avatar_atualizacao: (_d = date_helper_1.DateHelper.fromString(usuario.avatar_atualizacao, null)) === null || _d === void 0 ? void 0 : _d.getTime(),
|
|
30
30
|
avatar_thumbnail_path: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_path, null),
|
|
31
31
|
avatar_thumbnail_url: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_url, null),
|
|
32
32
|
avatarUrl: string_helper_1.StringHelper.check(usuario.avatarUrl, null),
|
|
33
33
|
beneficios: usuario.beneficios
|
|
34
34
|
? {
|
|
35
|
-
vale_alimentacao: (
|
|
36
|
-
vale_refeicao: (
|
|
37
|
-
vale_transporte: (
|
|
35
|
+
vale_alimentacao: (_e = usuario.beneficios.vale_alimentacao) !== null && _e !== void 0 ? _e : false,
|
|
36
|
+
vale_refeicao: (_f = usuario.beneficios.vale_refeicao) !== null && _f !== void 0 ? _f : false,
|
|
37
|
+
vale_transporte: (_g = usuario.beneficios.vale_transporte) !== null && _g !== void 0 ? _g : false,
|
|
38
38
|
}
|
|
39
39
|
: null,
|
|
40
|
-
cargo_ref: (
|
|
40
|
+
cargo_ref: (_j = (_h = usuario.cargo_ref) === null || _h === void 0 ? void 0 : _h.path) !== null && _j !== void 0 ? _j : null,
|
|
41
41
|
celular: string_helper_1.StringHelper.trim(usuario.celular, null),
|
|
42
|
-
conta_ref: (
|
|
42
|
+
conta_ref: (_l = (_k = usuario.conta_ref) === null || _k === void 0 ? void 0 : _k.path) !== null && _l !== void 0 ? _l : null,
|
|
43
43
|
cpf: string_helper_1.StringHelper.trim(usuario.cpf, null),
|
|
44
|
-
data_atualizacao_doc: usuario.data_atualizacao_doc
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
? usuario.data_atualizacao_doc.toISOString()
|
|
49
|
-
: null,
|
|
50
|
-
departamento_ref: (_h = usuario.departamento_ref) !== null && _h !== void 0 ? _h : null,
|
|
51
|
-
desligamento: usuario.desligamento
|
|
52
|
-
? usuario.desligamento.toISOString()
|
|
53
|
-
: null,
|
|
44
|
+
data_atualizacao_doc: (_m = date_helper_1.DateHelper.fromString(usuario.data_atualizacao_doc, null)) === null || _m === void 0 ? void 0 : _m.getTime(),
|
|
45
|
+
data_criacao_doc: (_o = date_helper_1.DateHelper.fromString(usuario.data_criacao_doc, null)) === null || _o === void 0 ? void 0 : _o.getTime(),
|
|
46
|
+
departamento_ref: (_q = (_p = usuario.departamento_ref) === null || _p === void 0 ? void 0 : _p.path) !== null && _q !== void 0 ? _q : null,
|
|
47
|
+
desligamento: (_r = date_helper_1.DateHelper.fromString(usuario.desligamento, null)) === null || _r === void 0 ? void 0 : _r.getTime(),
|
|
54
48
|
email: string_helper_1.StringHelper.trim(usuario.email, null),
|
|
55
|
-
empresa_ref: (
|
|
49
|
+
empresa_ref: (_t = (_s = usuario.empresa_ref) === null || _s === void 0 ? void 0 : _s.path) !== null && _t !== void 0 ? _t : null,
|
|
56
50
|
endereco: usuario.endereco
|
|
57
51
|
? {
|
|
58
52
|
bairro: string_helper_1.StringHelper.trim(usuario.endereco.bairro, null),
|
|
@@ -76,18 +70,18 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
76
70
|
uf: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.uf, null),
|
|
77
71
|
}
|
|
78
72
|
: null,
|
|
79
|
-
escala_ref: (
|
|
80
|
-
esocial_categoria_de_trabalhador_ref: (
|
|
73
|
+
escala_ref: (_v = (_u = usuario.escala_ref) === null || _u === void 0 ? void 0 : _u.path) !== null && _v !== void 0 ? _v : null,
|
|
74
|
+
esocial_categoria_de_trabalhador_ref: (_x = (_w = usuario.esocial_categoria_de_trabalhador_ref) === null || _w === void 0 ? void 0 : _w.path) !== null && _x !== void 0 ? _x : null,
|
|
81
75
|
excluido: boolean_helper_1.BooleanHelper.check(usuario.excluido, false),
|
|
82
76
|
id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null),
|
|
83
77
|
integracao: usuario.integracao
|
|
84
78
|
? {
|
|
85
|
-
id: string_helper_1.StringHelper.trim(usuario.integracao.id, null),
|
|
86
|
-
tipo: string_helper_1.StringHelper.trim(usuario.integracao.tipo, null),
|
|
79
|
+
id: string_helper_1.StringHelper.trim((_y = usuario.integracao) === null || _y === void 0 ? void 0 : _y.id, null),
|
|
80
|
+
tipo: string_helper_1.StringHelper.trim((_z = usuario.integracao) === null || _z === void 0 ? void 0 : _z.tipo, null),
|
|
87
81
|
}
|
|
88
82
|
: null,
|
|
89
83
|
interno: boolean_helper_1.BooleanHelper.check(usuario.interno, false),
|
|
90
|
-
nascimento: usuario.nascimento ?
|
|
84
|
+
nascimento: (_0 = date_helper_1.DateHelper.fromString(usuario.nascimento, null)) === null || _0 === void 0 ? void 0 : _0.getTime(),
|
|
91
85
|
nome: string_helper_1.StringHelper.trim(usuario.nome, null),
|
|
92
86
|
nomeCompleto: string_helper_1.StringHelper.trim(usuario.nomeCompleto, null),
|
|
93
87
|
observacoes: string_helper_1.StringHelper.trim(usuario.observacoes, null),
|
|
@@ -98,15 +92,14 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
98
92
|
capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_localizacao_marcacao_externa, null),
|
|
99
93
|
cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca, null),
|
|
100
94
|
codigo_externo: string_helper_1.StringHelper.check(usuario.parametros.codigo_externo, null),
|
|
101
|
-
horario_noturno:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.hora_reduzida_segundos
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
95
|
+
horario_noturno: ((_2 = usuario.parametros) === null || _2 === void 0 ? void 0 : _2.horario_noturno)
|
|
96
|
+
? {
|
|
97
|
+
tipo: string_helper_1.StringHelper.check((_3 = usuario.parametros.horario_noturno) === null || _3 === void 0 ? void 0 : _3.tipo, null),
|
|
98
|
+
inicio: string_helper_1.StringHelper.check((_4 = usuario.parametros.horario_noturno) === null || _4 === void 0 ? void 0 : _4.inicio, null),
|
|
99
|
+
fim: string_helper_1.StringHelper.check((_5 = usuario.parametros.horario_noturno) === null || _5 === void 0 ? void 0 : _5.fim, null),
|
|
100
|
+
hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_6 = usuario.parametros.horario_noturno) === null || _6 === void 0 ? void 0 : _6.hora_reduzida_segundos),
|
|
101
|
+
}
|
|
102
|
+
: null,
|
|
110
103
|
horista: boolean_helper_1.BooleanHelper.check(usuario.parametros.horista, null),
|
|
111
104
|
marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(usuario.parametros.marcacao_whatsapp, null),
|
|
112
105
|
marca_ponto_web: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_web, null),
|
|
@@ -116,43 +109,36 @@ var UsuarioJsonConvert = /** @class */ (function () {
|
|
|
116
109
|
reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio, null),
|
|
117
110
|
marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online, null),
|
|
118
111
|
configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(usuario.parametros.configuracao_tipo_falta_jornada, null),
|
|
119
|
-
limite_minutos_interjornada: usuario.parametros
|
|
120
|
-
.limite_minutos_interjornada
|
|
121
|
-
? number_helper_1.NumberHelper.convertToNumber(usuario.parametros.limite_minutos_interjornada)
|
|
122
|
-
: null,
|
|
112
|
+
limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_7 = usuario.parametros) === null || _7 === void 0 ? void 0 : _7.limite_minutos_interjornada),
|
|
123
113
|
regime_compensacao: string_helper_1.StringHelper.check(usuario.parametros.regime_compensacao, null),
|
|
124
114
|
}
|
|
125
115
|
: null,
|
|
126
|
-
perfil_ref: (
|
|
127
|
-
perimetros_refs:
|
|
128
|
-
|
|
116
|
+
perfil_ref: (_9 = (_8 = usuario.perfil_ref) === null || _8 === void 0 ? void 0 : _8.path) !== null && _9 !== void 0 ? _9 : null,
|
|
117
|
+
perimetros_refs: usuario.perimetros_refs
|
|
118
|
+
? usuario.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
|
|
119
|
+
: null,
|
|
120
|
+
pin: number_helper_1.NumberHelper.convertToNumber(usuario === null || usuario === void 0 ? void 0 : usuario.pin),
|
|
129
121
|
pis: string_helper_1.StringHelper.trim(usuario.pis, null),
|
|
130
122
|
sem_autenticacao: boolean_helper_1.BooleanHelper.check(usuario.sem_autenticacao, null),
|
|
131
|
-
status: string_helper_1.StringHelper.check(usuario.status,
|
|
132
|
-
status_data_ini: usuario.status_data_ini
|
|
133
|
-
|
|
134
|
-
: null,
|
|
135
|
-
status_data_fim: usuario.status_data_fim
|
|
136
|
-
? usuario.status_data_fim.toISOString()
|
|
137
|
-
: null,
|
|
123
|
+
status: string_helper_1.StringHelper.check(usuario.status, _1.StatusUsuario.Ativo),
|
|
124
|
+
status_data_ini: (_10 = date_helper_1.DateHelper.fromString(usuario.status_data_ini, null)) === null || _10 === void 0 ? void 0 : _10.getTime(),
|
|
125
|
+
status_data_fim: (_11 = date_helper_1.DateHelper.fromString(usuario.status_data_fim, null)) === null || _11 === void 0 ? void 0 : _11.getTime(),
|
|
138
126
|
status_programado: usuario.status_programado
|
|
139
127
|
? {
|
|
140
|
-
data_prevista: usuario.status_programado.data_prevista
|
|
141
|
-
? usuario.status_programado.data_prevista.toISOString()
|
|
142
|
-
: null,
|
|
128
|
+
data_prevista: (_12 = date_helper_1.DateHelper.fromString(usuario.status_programado.data_prevista, null)) === null || _12 === void 0 ? void 0 : _12.getTime(),
|
|
143
129
|
executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado, null),
|
|
144
|
-
tipo: string_helper_1.StringHelper.check(usuario.status_programado.tipo, null),
|
|
130
|
+
tipo: string_helper_1.StringHelper.check((_13 = usuario.status_programado) === null || _13 === void 0 ? void 0 : _13.tipo, null),
|
|
145
131
|
}
|
|
146
132
|
: null,
|
|
147
133
|
telefone: string_helper_1.StringHelper.trim(usuario.telefone, null),
|
|
148
134
|
modificador: usuario.modificador
|
|
149
135
|
? (0, lodash_1.omitBy)({
|
|
150
|
-
id: (
|
|
151
|
-
ref: (
|
|
152
|
-
tipo: (
|
|
153
|
-
nome: string_helper_1.StringHelper.trim((
|
|
154
|
-
documento: string_helper_1.StringHelper.trim((
|
|
155
|
-
email: string_helper_1.StringHelper.trim((
|
|
136
|
+
id: (_16 = (_15 = (_14 = usuario.modificador) === null || _14 === void 0 ? void 0 : _14.ref) === null || _15 === void 0 ? void 0 : _15.id) !== null && _16 !== void 0 ? _16 : null,
|
|
137
|
+
ref: (_19 = (_18 = (_17 = usuario.modificador) === null || _17 === void 0 ? void 0 : _17.ref) === null || _18 === void 0 ? void 0 : _18.path) !== null && _19 !== void 0 ? _19 : null,
|
|
138
|
+
tipo: (_21 = (_20 = usuario.modificador) === null || _20 === void 0 ? void 0 : _20.tipo) !== null && _21 !== void 0 ? _21 : null,
|
|
139
|
+
nome: string_helper_1.StringHelper.trim((_22 = usuario.modificador) === null || _22 === void 0 ? void 0 : _22.nome, null),
|
|
140
|
+
documento: string_helper_1.StringHelper.trim((_23 = usuario.modificador) === null || _23 === void 0 ? void 0 : _23.documento, null),
|
|
141
|
+
email: string_helper_1.StringHelper.trim((_24 = usuario.modificador) === null || _24 === void 0 ? void 0 : _24.email, null),
|
|
156
142
|
}, lodash_1.isUndefined)
|
|
157
143
|
: undefined,
|
|
158
144
|
};
|