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.
@@ -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
- cep: string_helper_1.StringHelper.trim(docData.endereco_prestacao.cep, null),
58
- cidade: string_helper_1.StringHelper.trim(docData.endereco_prestacao.cidade, null),
59
- complemento: string_helper_1.StringHelper.trim(docData.endereco_prestacao.complemento, null),
60
- logradouro: string_helper_1.StringHelper.trim(docData.endereco_prestacao.logradouro, null),
61
- numero: string_helper_1.StringHelper.trim(docData.endereco_prestacao.numero, null),
62
- uf: string_helper_1.StringHelper.trim(docData.endereco_prestacao.uf, null),
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
- tipo: string_helper_1.StringHelper.trim((_u = docData.integracao) === null || _u === void 0 ? void 0 : _u.tipo, null),
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, null),
83
- capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_foto_marcacao_externa, null),
84
- capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(docData.parametros.capturar_localizacao_marcacao_externa, null),
85
- cargo_confianca: boolean_helper_1.BooleanHelper.check(docData.parametros.cargo_confianca, null),
86
- codigo_externo: string_helper_1.StringHelper.check(docData.parametros.codigo_externo, null),
87
- horario_noturno: ((_v = docData.parametros) === null || _v === void 0 ? void 0 : _v.horario_noturno)
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.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),
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, null),
96
- marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(docData.parametros.marcacao_whatsapp, null),
97
- marca_ponto_web: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_web, null),
98
- marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_multi_empresa, null),
99
- marca_ponto_flit: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_flit, null),
100
- reconhecimento_facial: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial, null),
101
- reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(docData.parametros.reconhecimento_facial_obrigatorio, null),
102
- marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(docData.parametros.marca_ponto_apenas_online, null),
103
- configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(docData.parametros.configuracao_tipo_falta_jornada, null),
104
- limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_0 = docData.parametros) === null || _0 === void 0 ? void 0 : _0.limite_minutos_interjornada),
105
- regime_compensacao: string_helper_1.StringHelper.check(docData.parametros.regime_compensacao, null),
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: (_3 = (_2 = docData.perfil_ref) === null || _2 === void 0 ? void 0 : _2.i_path) !== null && _3 !== void 0 ? _3 : null,
109
- perimetros_refs: docData.perimetros_refs && docData.perimetros_refs.length
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.check(docData.status, null),
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, null),
122
- tipo: string_helper_1.StringHelper.check((_4 = docData.status_programado) === null || _4 === void 0 ? void 0 : _4.tipo, null),
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: (_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),
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
- tipo: string_helper_1.StringHelper.trim((_y = d.integracao) === null || _y === void 0 ? void 0 : _y.tipo, null),
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: (_0 = (_z = d.nascimento) === null || _z === void 0 ? void 0 : _z.toDate()) !== null && _0 !== void 0 ? _0 : null,
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, null),
90
- capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_foto_marcacao_externa, null),
91
- capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(d.parametros.capturar_localizacao_marcacao_externa, null),
92
- cargo_confianca: boolean_helper_1.BooleanHelper.check(d.parametros.cargo_confianca, null),
93
- codigo_externo: string_helper_1.StringHelper.check(d.parametros.codigo_externo, null),
94
- horario_noturno: ((_2 = d.parametros) === null || _2 === void 0 ? void 0 : _2.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.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),
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, null),
103
- marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(d.parametros.marcacao_whatsapp, null),
104
- marca_ponto_web: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_web, null),
105
- marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_multi_empresa, null),
106
- marca_ponto_flit: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_flit, null),
107
- reconhecimento_facial: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial, null),
108
- reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(d.parametros.reconhecimento_facial_obrigatorio, null),
109
- marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(d.parametros.marca_ponto_apenas_online, null),
110
- configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(d.parametros.configuracao_tipo_falta_jornada, null),
111
- limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_7 = d.parametros) === null || _7 === void 0 ? void 0 : _7.limite_minutos_interjornada),
112
- regime_compensacao: string_helper_1.StringHelper.check(d.parametros.regime_compensacao, null),
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 ? (_8 = d.perfil_ref) === null || _8 === void 0 ? void 0 : _8.path : null,
116
- perimetros_refs: (_9 = d.perimetros_refs) !== null && _9 !== void 0 ? _9 : [],
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.check(d.status, null),
121
- status_data_ini: (_11 = (_10 = d.status_data_ini) === null || _10 === void 0 ? void 0 : _10.toDate()) !== null && _11 !== void 0 ? _11 : null,
122
- status_data_fim: (_13 = (_12 = d.status_data_fim) === null || _12 === void 0 ? void 0 : _12.toDate()) !== null && _13 !== void 0 ? _13 : null,
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: (_15 = (_14 = d.status_programado.data_prevista) === null || _14 === void 0 ? void 0 : _14.toDate()) !== null && _15 !== void 0 ? _15 : null,
126
- executado: boolean_helper_1.BooleanHelper.check((_16 = d.status_programado) === null || _16 === void 0 ? void 0 : _16.executado, null),
127
- tipo: string_helper_1.StringHelper.check((_17 = d.status_programado) === null || _17 === void 0 ? void 0 : _17.tipo, null),
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: (_20 = (_19 = (_18 = d.modificador) === null || _18 === void 0 ? void 0 : _18.ref) === null || _19 === void 0 ? void 0 : _19.id) !== null && _20 !== void 0 ? _20 : null,
134
- ref: (_23 = (_22 = (_21 = d.modificador) === null || _21 === void 0 ? void 0 : _21.ref) === null || _22 === void 0 ? void 0 : _22.path) !== null && _23 !== void 0 ? _23 : null,
135
- tipo: (_25 = (_24 = d.modificador) === null || _24 === void 0 ? void 0 : _24.tipo) !== null && _25 !== void 0 ? _25 : null,
136
- nome: string_helper_1.StringHelper.trim((_26 = d.modificador) === null || _26 === void 0 ? void 0 : _26.nome, null),
137
- documento: string_helper_1.StringHelper.trim((_27 = d.modificador) === null || _27 === void 0 ? void 0 : _27.documento, null),
138
- email: string_helper_1.StringHelper.trim((_28 = d.modificador) === null || _28 === void 0 ? void 0 : _28.email, null),
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?: string;
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?: string;
19
- data_criacao_doc?: string;
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, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
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.fromString(usuario.admissao, null)) === null || _c === void 0 ? void 0 : _c.getTime(),
27
- ativo: boolean_helper_1.BooleanHelper.check(usuario.ativo, null),
28
- avatar_atualizacao: usuario.avatar_atualizacao
29
- ? usuario.avatar_atualizacao.toISOString()
30
- : null,
31
- avatar_thumbnail_path: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_path, null),
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: (_d = usuario.beneficios.vale_alimentacao) !== null && _d !== void 0 ? _d : false,
37
- vale_refeicao: (_e = usuario.beneficios.vale_refeicao) !== null && _e !== void 0 ? _e : false,
38
- vale_transporte: (_f = usuario.beneficios.vale_transporte) !== null && _f !== void 0 ? _f : false,
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: (_g = usuario.cargo_ref) !== null && _g !== void 0 ? _g : null,
42
- celular: string_helper_1.StringHelper.trim(usuario.celular, null),
43
- conta_ref: (_h = usuario.conta_ref) !== null && _h !== void 0 ? _h : null,
44
- cpf: string_helper_1.StringHelper.trim(usuario.cpf, null),
45
- data_atualizacao_doc: usuario.data_atualizacao_doc
46
- ? usuario.data_atualizacao_doc.toISOString()
47
- : null,
48
- data_criacao_doc: usuario.data_criacao_doc
49
- ? usuario.data_atualizacao_doc.toISOString()
50
- : null,
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
- cep: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cep, null),
71
- cidade: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cidade, null),
72
- complemento: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.complemento, null),
73
- logradouro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.logradouro, null),
74
- numero: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.numero, null),
75
- uf: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.uf, null),
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: (_m = usuario.escala_ref) !== null && _m !== void 0 ? _m : null,
79
- esocial_categoria_de_trabalhador_ref: (_o = usuario.esocial_categoria_de_trabalhador_ref) !== null && _o !== void 0 ? _o : null,
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((_p = usuario.integracao) === null || _p === void 0 ? void 0 : _p.id, null),
85
- tipo: string_helper_1.StringHelper.trim((_q = usuario.integracao) === null || _q === void 0 ? void 0 : _q.tipo, null),
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: (_r = date_helper_1.DateHelper.fromString(usuario.nascimento, null)) === null || _r === void 0 ? void 0 : _r.getTime(),
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, null),
96
- capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_foto_marcacao_externa, null),
97
- capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_localizacao_marcacao_externa, null),
98
- cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca, null),
99
- codigo_externo: string_helper_1.StringHelper.check(usuario.parametros.codigo_externo, null),
100
- horario_noturno: ((_s = usuario.parametros) === null || _s === void 0 ? void 0 : _s.horario_noturno)
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.check((_t = usuario.parametros.horario_noturno) === null || _t === void 0 ? void 0 : _t.tipo, null),
103
- inicio: string_helper_1.StringHelper.check((_u = usuario.parametros.horario_noturno) === null || _u === void 0 ? void 0 : _u.inicio, null),
104
- fim: string_helper_1.StringHelper.check((_v = usuario.parametros.horario_noturno) === null || _v === void 0 ? void 0 : _v.fim, null),
105
- hora_reduzida_segundos: number_helper_1.NumberHelper.convertToNumber((_w = usuario.parametros.horario_noturno) === null || _w === void 0 ? void 0 : _w.hora_reduzida_segundos),
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, null),
109
- marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(usuario.parametros.marcacao_whatsapp, null),
110
- marca_ponto_web: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_web, null),
111
- marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_multi_empresa, null),
112
- marca_ponto_flit: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_flit, null),
113
- reconhecimento_facial: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial, null),
114
- reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio, null),
115
- marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online, null),
116
- configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(usuario.parametros.configuracao_tipo_falta_jornada, null),
117
- limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_x = usuario.parametros) === null || _x === void 0 ? void 0 : _x.limite_minutos_interjornada),
118
- regime_compensacao: string_helper_1.StringHelper.check(usuario.parametros.regime_compensacao, null),
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: (_y = usuario.perfil_ref) !== null && _y !== void 0 ? _y : null,
122
- perimetros_refs: (_z = usuario.perimetros_refs) !== null && _z !== void 0 ? _z : null,
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, null),
126
- status: string_helper_1.StringHelper.check(usuario.status, null),
127
- status_data_ini: (_0 = date_helper_1.DateHelper.fromString(usuario.status_data_ini, null)) === null || _0 === void 0 ? void 0 : _0.getTime(),
128
- status_data_fim: (_1 = date_helper_1.DateHelper.fromString(usuario.status_data_fim, null)) === null || _1 === void 0 ? void 0 : _1.getTime(),
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: (_2 = date_helper_1.DateHelper.fromString(usuario.status_programado.data_prevista, null)) === null || _2 === void 0 ? void 0 : _2.getTime(),
132
- executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado, null),
133
- tipo: string_helper_1.StringHelper.check((_3 = usuario.status_programado) === null || _3 === void 0 ? void 0 : _3.tipo, null),
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: (_6 = (_5 = (_4 = usuario.modificador) === null || _4 === void 0 ? void 0 : _4.ref) === null || _5 === void 0 ? void 0 : _5.id) !== null && _6 !== void 0 ? _6 : null,
140
- ref: (_9 = (_8 = (_7 = usuario.modificador) === null || _7 === void 0 ? void 0 : _7.ref) === null || _8 === void 0 ? void 0 : _8.path) !== null && _9 !== void 0 ? _9 : null,
141
- tipo: (_11 = (_10 = usuario.modificador) === null || _10 === void 0 ? void 0 : _10.tipo) !== null && _11 !== void 0 ? _11 : null,
142
- nome: string_helper_1.StringHelper.trim((_12 = usuario.modificador) === null || _12 === void 0 ? void 0 : _12.nome, null),
143
- documento: string_helper_1.StringHelper.trim((_13 = usuario.modificador) === null || _13 === void 0 ? void 0 : _13.documento, null),
144
- email: string_helper_1.StringHelper.trim((_14 = usuario.modificador) === null || _14 === void 0 ? void 0 : _14.email, null),
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flit-models",
3
- "version": "3.3.43",
3
+ "version": "3.3.45",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",