flit-models 3.3.42 → 3.3.44

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