flit-models 3.3.44 → 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, _1.StatusUsuario.Ativo),
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
  });
@@ -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;
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,68 +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: d.perimetros_refs
121
+ perfil_ref: d.perfil_ref ? (_15 = d.perfil_ref) === null || _15 === void 0 ? void 0 : _15.path : null,
122
+ perimetros_refs: ((_17 = (_16 = d.perimetros_refs) === null || _16 === void 0 ? void 0 : _16.length) !== null && _17 !== void 0 ? _17 : 0) > 0
117
123
  ? d.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
118
124
  : null,
119
125
  pin: number_helper_1.NumberHelper.convertToNumber(d === null || d === void 0 ? void 0 : d.pin),
120
126
  pis: string_helper_1.StringHelper.trim(d.pis, null),
121
127
  sem_autenticacao: boolean_helper_1.BooleanHelper.check(d.sem_autenticacao, false),
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,
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,
125
131
  status_programado: d.status_programado
126
132
  ? {
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),
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),
130
136
  }
131
137
  : null,
132
138
  telefone: string_helper_1.StringHelper.trim(d.telefone, null),
133
139
  modificador: d.modificador
134
140
  ? (0, lodash_1.omitBy)({
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),
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,
141
147
  }, lodash_1.isUndefined)
142
148
  : undefined,
143
149
  });
@@ -20,125 +20,138 @@ var UsuarioJsonConvert = /** @class */ (function () {
20
20
  // public static fromJson(obj: UsuarioJsonData): Usuario {
21
21
  // }
22
22
  UsuarioJsonConvert.toJson = function (usuario) {
23
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
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;
24
24
  var usuarioJson = {
25
25
  _id: (_a = usuario === null || usuario === void 0 ? void 0 : usuario._id) !== null && _a !== void 0 ? _a : null,
26
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(),
28
- ativo: boolean_helper_1.BooleanHelper.check(usuario.ativo, null),
29
- avatar_atualizacao: (_d = date_helper_1.DateHelper.fromString(usuario.avatar_atualizacao, null)) === null || _d === void 0 ? void 0 : _d.getTime(),
30
- avatar_thumbnail_path: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_path, null),
31
- avatar_thumbnail_url: string_helper_1.StringHelper.check(usuario.avatar_thumbnail_url, null),
32
- 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,
33
33
  beneficios: usuario.beneficios
34
34
  ? {
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,
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,
38
38
  }
39
39
  : null,
40
- cargo_ref: (_j = (_h = usuario.cargo_ref) === null || _h === void 0 ? void 0 : _h.path) !== null && _j !== void 0 ? _j : null,
41
- celular: string_helper_1.StringHelper.trim(usuario.celular, null),
42
- conta_ref: (_l = (_k = usuario.conta_ref) === null || _k === void 0 ? void 0 : _k.path) !== null && _l !== void 0 ? _l : null,
43
- cpf: string_helper_1.StringHelper.trim(usuario.cpf, 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(),
48
- email: string_helper_1.StringHelper.trim(usuario.email, null),
49
- empresa_ref: (_t = (_s = usuario.empresa_ref) === null || _s === void 0 ? void 0 : _s.path) !== null && _t !== void 0 ? _t : 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,
50
50
  endereco: usuario.endereco
51
51
  ? {
52
- bairro: string_helper_1.StringHelper.trim(usuario.endereco.bairro, null),
53
- cep: string_helper_1.StringHelper.trim(usuario.endereco.cep, null),
54
- cidade: string_helper_1.StringHelper.trim(usuario.endereco.cidade, null),
55
- complemento: string_helper_1.StringHelper.trim(usuario.endereco.complemento, null),
56
- logradouro: string_helper_1.StringHelper.trim(usuario.endereco.logradouro, null),
57
- numero: string_helper_1.StringHelper.trim(usuario.endereco.numero, null),
58
- 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,
59
59
  }
60
60
  : null,
61
61
  endereco_prestacao_diferente_empresa: boolean_helper_1.BooleanHelper.check(usuario.endereco_prestacao_diferente_empresa, false),
62
62
  endereco_prestacao: usuario.endereco_prestacao
63
63
  ? {
64
- bairro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.bairro, null),
65
- cep: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cep, null),
66
- cidade: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.cidade, null),
67
- complemento: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.complemento, null),
68
- logradouro: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.logradouro, null),
69
- numero: string_helper_1.StringHelper.trim(usuario.endereco_prestacao.numero, null),
70
- 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,
71
76
  }
72
77
  : null,
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,
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,
75
80
  excluido: boolean_helper_1.BooleanHelper.check(usuario.excluido, false),
76
- id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null),
81
+ id_externo: string_helper_1.StringHelper.trim(usuario.id_externo, null) || null,
77
82
  integracao: usuario.integracao
78
83
  ? {
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),
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,
81
92
  }
82
93
  : null,
83
94
  interno: boolean_helper_1.BooleanHelper.check(usuario.interno, false),
84
- nascimento: (_0 = date_helper_1.DateHelper.fromString(usuario.nascimento, null)) === null || _0 === void 0 ? void 0 : _0.getTime(),
85
- nome: string_helper_1.StringHelper.trim(usuario.nome, null),
86
- nomeCompleto: string_helper_1.StringHelper.trim(usuario.nomeCompleto, null),
87
- 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,
88
99
  parametros: usuario.parametros
89
100
  ? {
90
- acessar_manager: boolean_helper_1.BooleanHelper.check(usuario.parametros.acessar_manager, null),
91
- capturar_foto_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_foto_marcacao_externa, null),
92
- capturar_localizacao_marcacao_externa: boolean_helper_1.BooleanHelper.check(usuario.parametros.capturar_localizacao_marcacao_externa, null),
93
- cargo_confianca: boolean_helper_1.BooleanHelper.check(usuario.parametros.cargo_confianca, null),
94
- codigo_externo: string_helper_1.StringHelper.check(usuario.parametros.codigo_externo, null),
95
- horario_noturno: ((_2 = usuario.parametros) === null || _2 === void 0 ? void 0 : _2.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)
96
108
  ? {
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),
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),
101
113
  }
102
114
  : null,
103
- horista: boolean_helper_1.BooleanHelper.check(usuario.parametros.horista, null),
104
- marcacao_whatsapp: boolean_helper_1.BooleanHelper.check(usuario.parametros.marcacao_whatsapp, null),
105
- marca_ponto_web: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_web, null),
106
- marca_ponto_multi_empresa: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_multi_empresa, null),
107
- marca_ponto_flit: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_flit, null),
108
- reconhecimento_facial: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial, null),
109
- reconhecimento_facial_obrigatorio: boolean_helper_1.BooleanHelper.check(usuario.parametros.reconhecimento_facial_obrigatorio, null),
110
- marca_ponto_apenas_online: boolean_helper_1.BooleanHelper.check(usuario.parametros.marca_ponto_apenas_online, null),
111
- configuracao_tipo_falta_jornada: string_helper_1.StringHelper.check(usuario.parametros.configuracao_tipo_falta_jornada, null),
112
- limite_minutos_interjornada: number_helper_1.NumberHelper.convertToNumber((_7 = usuario.parametros) === null || _7 === void 0 ? void 0 : _7.limite_minutos_interjornada),
113
- 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,
114
127
  }
115
128
  : null,
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
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
118
131
  ? usuario.perimetros_refs.map(function (ref) { return ref === null || ref === void 0 ? void 0 : ref.path; })
119
132
  : null,
120
133
  pin: number_helper_1.NumberHelper.convertToNumber(usuario === null || usuario === void 0 ? void 0 : usuario.pin),
121
- pis: string_helper_1.StringHelper.trim(usuario.pis, null),
122
- sem_autenticacao: boolean_helper_1.BooleanHelper.check(usuario.sem_autenticacao, 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(),
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,
126
139
  status_programado: usuario.status_programado
127
140
  ? {
128
- data_prevista: (_12 = date_helper_1.DateHelper.fromString(usuario.status_programado.data_prevista, null)) === null || _12 === void 0 ? void 0 : _12.getTime(),
129
- executado: boolean_helper_1.BooleanHelper.check(usuario.status_programado.executado, null),
130
- tipo: string_helper_1.StringHelper.check((_13 = usuario.status_programado) === null || _13 === void 0 ? void 0 : _13.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,
131
144
  }
132
145
  : null,
133
- telefone: string_helper_1.StringHelper.trim(usuario.telefone, null),
146
+ telefone: string_helper_1.StringHelper.trim(usuario.telefone, null) || null,
134
147
  modificador: usuario.modificador
135
148
  ? (0, lodash_1.omitBy)({
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),
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,
142
155
  }, lodash_1.isUndefined)
143
156
  : undefined,
144
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.44",
3
+ "version": "3.3.45",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",