flit-models 3.3.47 → 3.3.49

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