@silexpert/core 0.4.263 → 0.4.265

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 (93) hide show
  1. package/es/api/resources/Exercice.d.ts +1 -0
  2. package/es/api/resources/Exercice.d.ts.map +1 -1
  3. package/es/api/resources/Exercice.js +3 -0
  4. package/es/api/resources/Exercice.js.map +1 -1
  5. package/es/api/resources/User.d.ts +2 -2
  6. package/es/api/resources/User.d.ts.map +1 -1
  7. package/es/api/resources/User.js +2 -11
  8. package/es/api/resources/User.js.map +1 -1
  9. package/es/types/Enum/BrandClementine.d.ts +3 -1
  10. package/es/types/Enum/BrandClementine.d.ts.map +1 -1
  11. package/es/types/Enum/BrandClementine.js +3 -0
  12. package/es/types/Enum/BrandClementine.js.map +1 -1
  13. package/es/types/Enum/Role.d.ts +6 -11
  14. package/es/types/Enum/Role.d.ts.map +1 -1
  15. package/es/types/Enum/Role.js +15 -10
  16. package/es/types/Enum/Role.js.map +1 -1
  17. package/es/types/Enum/RoleDetail.d.ts +40 -56
  18. package/es/types/Enum/RoleDetail.d.ts.map +1 -1
  19. package/es/types/Enum/RoleDetail.js +120 -64
  20. package/es/types/Enum/RoleDetail.js.map +1 -1
  21. package/es/types/Enum/TaskResponseType.d.ts +9 -0
  22. package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
  23. package/es/types/Enum/TaskResponseType.js +35 -2
  24. package/es/types/Enum/TaskResponseType.js.map +1 -1
  25. package/es/types/Enum/TimeCounterType.js +7 -7
  26. package/es/types/Enum/TimeCounterType.js.map +1 -1
  27. package/es/types/Interface/api/task/QueryCountTask.d.ts +1 -1
  28. package/es/types/Interface/api/task/QueryCountTask.d.ts.map +1 -1
  29. package/es/types/Interface/api/task/QueryCountTask.js +1 -1
  30. package/es/types/Interface/api/task/QueryCountTask.js.map +1 -1
  31. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts +2 -0
  32. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts.map +1 -1
  33. package/es/types/Interface/api/task/QueryPaginatedTask.js +11 -0
  34. package/es/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  35. package/es/types/Interface/api/user/ParamsGetAllCollaborators.d.ts +1 -0
  36. package/es/types/Interface/api/user/ParamsGetAllCollaborators.d.ts.map +1 -1
  37. package/es/types/Interface/api/user/ParamsGetAllCollaborators.js +10 -1
  38. package/es/types/Interface/api/user/ParamsGetAllCollaborators.js.map +1 -1
  39. package/es/types/Interface/api/user/QueryGetAllCollaborators.d.ts +1 -0
  40. package/es/types/Interface/api/user/QueryGetAllCollaborators.d.ts.map +1 -1
  41. package/es/types/Interface/api/user/QueryGetAllCollaborators.js +11 -1
  42. package/es/types/Interface/api/user/QueryGetAllCollaborators.js.map +1 -1
  43. package/es/types/Interface/models/ITask.d.ts +2 -2
  44. package/es/types/Interface/models/ITask.d.ts.map +1 -1
  45. package/es/types/Interface/models/ITask.js.map +1 -1
  46. package/es/utils/task.d.ts +3 -2
  47. package/es/utils/task.d.ts.map +1 -1
  48. package/es/utils/task.js +23 -19
  49. package/es/utils/task.js.map +1 -1
  50. package/es/utils/webmail.d.ts.map +1 -1
  51. package/es/utils/webmail.js +1 -4
  52. package/es/utils/webmail.js.map +1 -1
  53. package/js/api/resources/Exercice.js +4 -0
  54. package/js/api/resources/Exercice.js.map +1 -1
  55. package/js/api/resources/User.js +5 -3
  56. package/js/api/resources/User.js.map +1 -1
  57. package/js/types/Enum/BrandClementine.js +3 -0
  58. package/js/types/Enum/BrandClementine.js.map +1 -1
  59. package/js/types/Enum/Role.js +18 -13
  60. package/js/types/Enum/Role.js.map +1 -1
  61. package/js/types/Enum/RoleDetail.js +142 -86
  62. package/js/types/Enum/RoleDetail.js.map +1 -1
  63. package/js/types/Enum/TaskResponseType.js +36 -3
  64. package/js/types/Enum/TaskResponseType.js.map +1 -1
  65. package/js/types/Enum/TimeCounterType.js +7 -7
  66. package/js/types/Enum/TimeCounterType.js.map +1 -1
  67. package/js/types/Interface/api/task/QueryCountTask.js +1 -1
  68. package/js/types/Interface/api/task/QueryCountTask.js.map +1 -1
  69. package/js/types/Interface/api/task/QueryPaginatedTask.js +6 -0
  70. package/js/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  71. package/js/types/Interface/api/user/ParamsGetAllCollaborators.js +6 -0
  72. package/js/types/Interface/api/user/ParamsGetAllCollaborators.js.map +1 -1
  73. package/js/types/Interface/api/user/QueryGetAllCollaborators.js +8 -0
  74. package/js/types/Interface/api/user/QueryGetAllCollaborators.js.map +1 -1
  75. package/js/utils/task.js +29 -20
  76. package/js/utils/task.js.map +1 -1
  77. package/js/utils/webmail.js +1 -3
  78. package/js/utils/webmail.js.map +1 -1
  79. package/package.json +1 -1
  80. package/ts/api/resources/Exercice.ts +4 -0
  81. package/ts/api/resources/User.ts +3 -12
  82. package/ts/types/Enum/BrandClementine.ts +3 -0
  83. package/ts/types/Enum/Role.ts +15 -10
  84. package/ts/types/Enum/RoleDetail.ts +120 -64
  85. package/ts/types/Enum/TaskResponseType.ts +35 -2
  86. package/ts/types/Enum/TimeCounterType.ts +7 -7
  87. package/ts/types/Interface/api/task/QueryCountTask.ts +1 -1
  88. package/ts/types/Interface/api/task/QueryPaginatedTask.ts +9 -0
  89. package/ts/types/Interface/api/user/ParamsGetAllCollaborators.ts +9 -0
  90. package/ts/types/Interface/api/user/QueryGetAllCollaborators.ts +10 -1
  91. package/ts/types/Interface/models/ITask.ts +2 -2
  92. package/ts/utils/task.ts +24 -16
  93. package/ts/utils/webmail.ts +1 -3
@@ -4,30 +4,35 @@ export const RoleDetail = {
4
4
  name: 'Client',
5
5
  colorPrimary: '#8765D0',
6
6
  colorSecondary: '#DED7F6',
7
+ subRole: false,
7
8
  },
8
9
  ADMIN: {
9
10
  id: 2,
10
11
  name: 'Admin',
11
12
  colorPrimary: '#8765D0',
12
13
  colorSecondary: '#DED7F6',
14
+ subRole: false,
13
15
  },
14
16
  FRONT_OFFICE: {
15
17
  id: 3,
16
18
  name: 'Front Office',
17
19
  colorPrimary: '#8765D0',
18
20
  colorSecondary: '#DED7F6',
21
+ subRole: false,
19
22
  },
20
23
  COMMERCIAL: {
21
24
  id: 9,
22
25
  name: 'Commercial',
23
26
  colorPrimary: '#8765D0',
24
27
  colorSecondary: '#DED7F6',
28
+ subRole: false,
25
29
  },
26
30
  CUSTOMER_SUCCESS: {
27
31
  id: 10,
28
32
  name: 'Customer success',
29
33
  colorPrimary: '#5894EF',
30
34
  colorSecondary: '#DAEEFC',
35
+ subRole: false,
31
36
  handledInUserSocietyPermissionTable: false,
32
37
  },
33
38
  SOCIAL: {
@@ -35,182 +40,233 @@ export const RoleDetail = {
35
40
  name: 'Social',
36
41
  colorPrimary: '#8765D0',
37
42
  colorSecondary: '#DED7F6',
43
+ subRole: false,
38
44
  },
39
45
  JURIDIC: {
40
46
  id: 12,
41
47
  name: 'Juridique',
42
48
  colorPrimary: '#8765D0',
43
49
  colorSecondary: '#DED7F6',
44
- },
45
- CHIEF_ACCOUNTANT: {
46
- id: 13,
47
- name: 'Chef comptable',
48
- colorPrimary: '#8765D0',
49
- colorSecondary: '#DED7F6',
50
- },
51
- SUPERVISOR: {
52
- id: 14,
53
- name: 'Superviseur',
54
- colorPrimary: '#8765D0',
55
- colorSecondary: '#DED7F6',
56
- },
50
+ subRole: false,
51
+ },
52
+ // CHIEF_ACCOUNTANT: {
53
+ // id: 13,
54
+ // name: 'Chef comptable',
55
+ // colorPrimary: '#8765D0',
56
+ // colorSecondary: '#DED7F6',
57
+ // subRole: false,
58
+ // },
59
+ // SUPERVISOR: {
60
+ // id: 14,
61
+ // name: 'Superviseur',
62
+ // colorPrimary: '#8765D0',
63
+ // colorSecondary: '#DED7F6',
64
+ // subRole: false,
65
+ // },
57
66
  FRONT_OFFICE_EXPRESS: {
58
67
  id: 15,
59
68
  name: 'Front office express',
60
69
  colorPrimary: '#8765D0',
61
70
  colorSecondary: '#DED7F6',
71
+ subRole: false,
62
72
  },
63
73
  SUPER_ADMIN: {
64
74
  id: 16,
65
75
  name: 'Super admin',
66
76
  colorPrimary: '#8765D0',
67
77
  colorSecondary: '#DED7F6',
78
+ subRole: false,
68
79
  },
69
80
  EXPERT_SUB_CONTRACTOR: {
70
81
  id: 17,
71
82
  name: 'Expert sous-traitant',
72
83
  colorPrimary: '#B5D33C',
73
84
  colorSecondary: '#EEF4C3',
85
+ subRole: false,
74
86
  },
75
87
  MAINTAINER: {
76
88
  id: 18,
77
89
  name: 'Admin partenaire',
78
90
  colorPrimary: '#8765D0',
79
91
  colorSecondary: '#DED7F6',
92
+ subRole: false,
80
93
  },
81
94
  MANAGER: {
82
95
  id: 19,
83
96
  name: 'Manager',
84
97
  colorPrimary: '#8765D0',
85
98
  colorSecondary: '#DED7F6',
99
+ subRole: false,
86
100
  },
87
101
  EXPERT_ACCOUNTANT: {
88
102
  id: 20,
89
103
  name: 'Expert-comptable',
90
104
  colorPrimary: '#B5D33C',
91
105
  colorSecondary: '#EEF4C3',
106
+ subRole: false,
92
107
  handledInUserSocietyPermissionTable: false,
93
108
  },
94
- MFA_PENDING: {
95
- id: 21,
96
- name: 'Attente MFA',
97
- colorPrimary: '#8765D0',
98
- colorSecondary: '#DED7F6',
99
- },
100
- VAT: {
101
- id: 22,
102
- name: 'VAT',
103
- colorPrimary: '#8765D0',
104
- colorSecondary: '#DED7F6',
105
- },
109
+ // MFA_PENDING: {
110
+ // id: 21,
111
+ // name: 'Attente MFA',
112
+ // colorPrimary: '#8765D0',
113
+ // colorSecondary: '#DED7F6',
114
+ // subRole: false,
115
+ // },
116
+ // VAT: {
117
+ // id: 22,
118
+ // name: 'VAT',
119
+ // colorPrimary: '#8765D0',
120
+ // colorSecondary: '#DED7F6',
121
+ // subRole: false,
122
+ // },
106
123
  CANDIDAT: {
107
124
  id: 24,
108
125
  name: 'Candidat',
109
126
  colorPrimary: '#8765D0',
110
127
  colorSecondary: '#DED7F6',
128
+ subRole: false,
111
129
  },
112
130
  DEVELOPER: {
113
131
  id: 25,
114
132
  name: 'Développeur',
115
133
  colorPrimary: '#8765D0',
116
134
  colorSecondary: '#DED7F6',
135
+ subRole: false,
117
136
  },
118
137
  API: {
119
138
  id: 26,
120
139
  name: 'API',
121
140
  colorPrimary: '#8765D0',
122
141
  colorSecondary: '#DED7F6',
123
- },
124
- BACK_OFFICE: {
125
- id: 27,
126
- name: 'Back office',
127
- colorPrimary: '#8765D0',
128
- colorSecondary: '#DED7F6',
129
- },
130
- BACK_OFFICE_EXPRESS: {
131
- id: 28,
132
- name: 'Back office express',
133
- colorPrimary: '#8765D0',
134
- colorSecondary: '#DED7F6',
135
- },
136
- BACK_MANAGER: {
137
- id: 30,
138
- name: 'Manager back',
139
- colorPrimary: '#8765D0',
140
- colorSecondary: '#DED7F6',
141
- handledInUserSocietyPermissionTable: false,
142
- },
143
- FRONT_MANAGER: {
144
- id: 31,
145
- name: 'Manager front',
146
- colorPrimary: '#8765D0',
147
- colorSecondary: '#DED7F6',
148
- },
149
- CUSTOMER_SUCCESS_MANAGER: {
150
- id: 32,
151
- name: 'Customer success manager',
152
- colorPrimary: '#5894EF',
153
- colorSecondary: '#DAEEFC',
154
- handledInUserSocietyPermissionTable: false,
155
- },
156
- COMMERCIAL_MANAGER: {
157
- id: 33,
158
- name: 'Manager commercial',
159
- colorPrimary: '#8765D0',
160
- colorSecondary: '#DED7F6',
161
- },
142
+ subRole: false,
143
+ },
144
+ // BACK_OFFICE: {
145
+ // id: 27,
146
+ // name: 'Back office',
147
+ // colorPrimary: '#8765D0',
148
+ // colorSecondary: '#DED7F6',
149
+ // subRole: false,
150
+ // },
151
+ // BACK_OFFICE_EXPRESS: {
152
+ // id: 28,
153
+ // name: 'Back office express',
154
+ // colorPrimary: '#8765D0',
155
+ // colorSecondary: '#DED7F6',
156
+ // subRole: false,
157
+ // },
158
+ // BACK_MANAGER: {
159
+ // id: 30,
160
+ // name: 'Manager back',
161
+ // colorPrimary: '#8765D0',
162
+ // colorSecondary: '#DED7F6',
163
+ // subRole: false,
164
+ // handledInUserSocietyPermissionTable: false,
165
+ // },
166
+ // FRONT_MANAGER: {
167
+ // id: 31,
168
+ // name: 'Manager front',
169
+ // colorPrimary: '#8765D0',
170
+ // colorSecondary: '#DED7F6',
171
+ // subRole: false,
172
+ // },
173
+ // CUSTOMER_SUCCESS_MANAGER: {
174
+ // id: 32,
175
+ // name: 'Customer success manager',
176
+ // colorPrimary: '#5894EF',
177
+ // colorSecondary: '#DAEEFC',
178
+ // subRole: false,
179
+ // handledInUserSocietyPermissionTable: false,
180
+ // },
181
+ // COMMERCIAL_MANAGER: {
182
+ // id: 33,
183
+ // name: 'Manager commercial',
184
+ // colorPrimary: '#8765D0',
185
+ // colorSecondary: '#DED7F6',
186
+ // subRole: false,
187
+ // },
162
188
  FACTURATION: {
163
189
  id: 34,
164
190
  name: 'Facturation',
165
191
  colorPrimary: '#8765D0',
166
192
  colorSecondary: '#DED7F6',
193
+ subRole: false,
167
194
  },
168
195
  HUMAN_RESSOURCES: {
169
196
  id: 35,
170
197
  name: 'Ressources humaines',
171
198
  colorPrimary: '#8765D0',
172
199
  colorSecondary: '#DED7F6',
200
+ subRole: false,
173
201
  },
174
202
  PARTNERED_ACCOUNTANT: {
175
203
  id: 36,
176
204
  name: 'Comptable partenaire',
177
205
  colorPrimary: '#8765D0',
178
206
  colorSecondary: '#DED7F6',
207
+ subRole: false,
179
208
  },
180
209
  FORECAST_MANAGER: {
181
210
  id: 38,
182
211
  name: 'Gestionnaire Prévisionnels',
183
212
  colorPrimary: '#8765D0',
184
213
  colorSecondary: '#DED7F6',
214
+ subRole: false,
185
215
  },
186
216
  TERMINATION_MANAGER: {
187
217
  id: 39,
188
218
  name: 'Gestionnaire Résiliations',
189
219
  colorPrimary: '#8765D0',
190
220
  colorSecondary: '#DED7F6',
221
+ subRole: false,
191
222
  },
192
223
  EXPRESS_MANAGER: {
193
224
  id: 40,
194
225
  name: 'Gestionnaire Express',
195
226
  colorPrimary: '#8765D0',
196
227
  colorSecondary: '#DED7F6',
228
+ subRole: false,
197
229
  },
198
230
  CONFLICT_MANAGER: {
199
231
  id: 41,
200
232
  name: 'Gestionnaire Conflits',
201
233
  colorPrimary: '#8765D0',
202
234
  colorSecondary: '#DED7F6',
235
+ subRole: false,
203
236
  },
204
237
  ATTESTATION_MANAGER: {
205
238
  id: 42,
206
239
  name: 'Gestionnaire Attestations',
207
240
  colorPrimary: '#8765D0',
208
241
  colorSecondary: '#DED7F6',
242
+ subRole: false,
209
243
  },
210
244
  JURIDICAL_SUPPORT: {
211
245
  id: 43,
212
246
  name: 'Support juridique',
213
247
  colorPrimary: '#8765D0',
214
248
  colorSecondary: '#DED7F6',
249
+ subRole: false,
250
+ },
251
+ INTERN: {
252
+ id: 44,
253
+ name: 'Stagiaire',
254
+ colorPrimary: '#FFF',
255
+ colorSecondary: '#FFF',
256
+ subRole: true,
257
+ },
258
+ ALTERNATE: {
259
+ id: 45,
260
+ name: 'Alternant',
261
+ colorPrimary: '#FFF',
262
+ colorSecondary: '#FFF',
263
+ subRole: true,
264
+ },
265
+ DIRECTOR: {
266
+ id: 46,
267
+ name: 'Directeur',
268
+ colorPrimary: '#FFF',
269
+ colorSecondary: '#FFF',
270
+ subRole: true,
215
271
  },
216
272
  };
@@ -24,6 +24,17 @@ export enum StateTask {
24
24
  REFUSED = 4,
25
25
  }
26
26
 
27
+ export enum RoleAvailableForTask {
28
+ SOCIAL = Role.SOCIAL,
29
+ FACTURATION = Role.FACTURATION,
30
+ JURIDIC = Role.JURIDIC,
31
+ CUSTOMER_SUCCESS = Role.CUSTOMER_SUCCESS,
32
+ FRONT_OFFICE = Role.FRONT_OFFICE,
33
+ COMMERCIAL = Role.COMMERCIAL,
34
+ // BACK_MANAGER = Role.BACK_MANAGER,
35
+ EXPERT_ACCOUNTANT = Role.EXPERT_ACCOUNTANT,
36
+ }
37
+
27
38
  export const TaskResponseType = {
28
39
  INTERN: {
29
40
  id: 1,
@@ -131,7 +142,7 @@ export const TaskResponseType = {
131
142
  {
132
143
  id: 10,
133
144
  label: 'Préparation d\'un bilan',
134
- role: Role.BACK_MANAGER,
145
+ role: Role.MANAGER,
135
146
  deadline: Deadline,
136
147
  isForWholeRole: false,
137
148
  backToClient: false,
@@ -139,6 +150,17 @@ export const TaskResponseType = {
139
150
  responseType: null,
140
151
  description: 'Controle de la DADS.',
141
152
  },
153
+ {
154
+ id: 11,
155
+ label: 'Comptable express',
156
+ role: Role.FRONT_OFFICE_EXPRESS,
157
+ deadline: Deadline,
158
+ isForWholeRole: false,
159
+ backToClient: false,
160
+ goToCalendar: false,
161
+ responseType: null,
162
+ description: 'Est-ce que nous pouvons réaliser le bilan 2020 de ce client ?',
163
+ },
142
164
  ],
143
165
  },
144
166
  EXTERN: {
@@ -258,7 +280,7 @@ export const TaskResponseType = {
258
280
  {
259
281
  id: 14,
260
282
  label: 'Litige dossier',
261
- role: Role.BACK_MANAGER,
283
+ role: Role.MANAGER,
262
284
  deadline: Deadline,
263
285
  isForWholeRole: false,
264
286
  backToClient: true,
@@ -266,6 +288,17 @@ export const TaskResponseType = {
266
288
  responseType: ResponseType.MAIL,
267
289
  description: 'Le client veut avoir une explication de bilan par le responsable comptable',
268
290
  },
291
+ {
292
+ id: 15,
293
+ label: 'Comptable express',
294
+ role: Role.FRONT_OFFICE_EXPRESS,
295
+ deadline: Deadline,
296
+ isForWholeRole: false,
297
+ backToClient: true,
298
+ goToCalendar: false,
299
+ responseType: ResponseType.MAIL,
300
+ description: 'Bilan express à envoyer au SIE.',
301
+ },
269
302
  ],
270
303
 
271
304
  },
@@ -5,25 +5,25 @@ export const TimeCounterType = {
5
5
  id: 1,
6
6
  label: 'OnBoarding',
7
7
  aberrantTime: 60,
8
- limitedRoles: [Role.FRONT_OFFICE, Role.BACK_OFFICE],
8
+ limitedRoles: [Role.FRONT_OFFICE],
9
9
  },
10
10
  VAT: {
11
11
  id: 2,
12
12
  label: 'TVA',
13
13
  aberrantTime: 60,
14
- limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.BACK_OFFICE],
14
+ limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE],
15
15
  },
16
16
  REVISION: {
17
17
  id: 3,
18
18
  label: 'Révision',
19
19
  aberrantTime: 120,
20
- limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.BACK_OFFICE],
20
+ limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE],
21
21
  },
22
22
  FOLDER_REVIEW: {
23
23
  id: 4,
24
24
  label: 'Revue dossier',
25
25
  aberrantTime: 60,
26
- limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE, Role.BACK_OFFICE],
26
+ limitedRoles: [Role.MANAGER, Role.EXPERT_ACCOUNTANT, Role.FRONT_OFFICE],
27
27
  },
28
28
  REPORTING: {
29
29
  id: 5,
@@ -65,7 +65,7 @@ export const TimeCounterType = {
65
65
  id: 11,
66
66
  label: 'Prévisionnel',
67
67
  aberrantTime: null,
68
- limitedRoles: [Role.FRONT_OFFICE, Role.BACK_OFFICE],
68
+ limitedRoles: [Role.FRONT_OFFICE],
69
69
  },
70
70
  CERTIFICATE: {
71
71
  id: 12,
@@ -77,7 +77,7 @@ export const TimeCounterType = {
77
77
  id: 13,
78
78
  label: 'Mission complémentaire',
79
79
  aberrantTime: null,
80
- limitedRoles: [Role.FRONT_OFFICE, Role.BACK_OFFICE],
80
+ limitedRoles: [Role.FRONT_OFFICE],
81
81
  },
82
82
  ORGANISATION: {
83
83
  id: 14,
@@ -119,7 +119,7 @@ export const TimeCounterType = {
119
119
  id: 20,
120
120
  label: 'Bilan',
121
121
  aberrantTime: 120,
122
- limitedRoles: [Role.FRONT_OFFICE, Role.BACK_OFFICE, Role.FRONT_MANAGER, Role.BACK_MANAGER, Role.EXPERT_ACCOUNTANT],
122
+ limitedRoles: [Role.FRONT_OFFICE, Role.EXPERT_ACCOUNTANT],
123
123
  },
124
124
  PAYSLIP: {
125
125
  id: 21,
@@ -14,7 +14,7 @@ export class QueryCountTask {
14
14
  @ApiPropertyOptional()
15
15
  @IsOptional()
16
16
  @IsInt()
17
- idRole?: number;
17
+ idService?: number;
18
18
 
19
19
  @ApiPropertyOptional()
20
20
  @IsOptional()
@@ -5,6 +5,10 @@ import { ApiPropertyOptional } from '../../../../utils';
5
5
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
6
 
7
7
  export class QueryPaginatedTask {
8
+ @ApiPropertyOptional()
9
+ @IsOptional()
10
+ isIntern?: boolean;
11
+
8
12
  @ApiPropertyOptional()
9
13
  @IsOptional()
10
14
  @IsInt()
@@ -36,6 +40,11 @@ export class QueryPaginatedTask {
36
40
  @IsInt()
37
41
  idUser?: number;
38
42
 
43
+ @ApiPropertyOptional({ description: 'roles for filter tasks' })
44
+ @IsOptional()
45
+ @IsInt()
46
+ idService?: number;
47
+
39
48
  @ApiPropertyOptional({ description: 'user who terminate the task' })
40
49
  @IsOptional()
41
50
  @IsInt()
@@ -1,4 +1,5 @@
1
1
  import {
2
+ IsIn,
2
3
  IsNumber,
3
4
  IsOptional, IsString,
4
5
  } from 'class-validator';
@@ -26,4 +27,12 @@ export class ParamsGetAllCollaborators {
26
27
  @IsOptional()
27
28
  @IsNumber()
28
29
  idUser?: number[];
30
+
31
+ @ApiPropertyOptional()
32
+ @IsOptional()
33
+ @IsString({
34
+ each: true,
35
+ })
36
+ @IsIn(['avatar', 'teams', 'businessLines'], { each: true })
37
+ include?: string[];
29
38
  }
@@ -1,4 +1,5 @@
1
- import { ApiProperty } from '../../../../utils';
1
+ import { IsIn, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
3
 
3
4
  export class QueryGetAllCollaborators {
4
5
  @ApiProperty({
@@ -8,4 +9,12 @@ export class QueryGetAllCollaborators {
8
9
  example: [1, 13],
9
10
  })
10
11
  idUser?: number[];
12
+
13
+ @ApiPropertyOptional()
14
+ @IsOptional()
15
+ @IsString({
16
+ each: true,
17
+ })
18
+ @IsIn(['avatar', 'teams', 'businessLines'], { each: true })
19
+ include?: string[];
11
20
  }
@@ -16,7 +16,7 @@ export interface ITask {
16
16
  idSociety: number,
17
17
  description?: string | null,
18
18
  idRole?: number,
19
- idUser?: number,
19
+ idService?: number,
20
20
  idMail?: number,
21
21
  deadlineAt: Date,
22
22
  idUserWhoProcessed?: number,
@@ -29,7 +29,7 @@ export interface ITask {
29
29
  userWhoCreated?: IUser;
30
30
  society?: ISociety;
31
31
  role?: IRole;
32
- user?: IUser;
32
+ service?: IRole;
33
33
  userWhoProcessed?: IUser;
34
34
  userWhoRefused?: IUser;
35
35
  calendarEvent?: ICalendarEvent;
package/ts/utils/task.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Role } from '../types/Enum/Role';
2
+ import { TaskResponseType, RoleAvailableForTask } from '../types/Enum/TaskResponseType';
2
3
 
3
4
  const getIdRoleUsedForTask = (listRoles: number[]): number => {
4
5
  let idRole = 0;
5
- if (listRoles.includes(Role.COMMERCIAL) || listRoles.includes(Role.COMMERCIAL_MANAGER)) {
6
+ if (listRoles.includes(Role.COMMERCIAL)) {
6
7
  idRole = Role.COMMERCIAL;
7
8
  } else if (listRoles.includes(Role.JURIDIC)) {
8
9
  idRole = Role.JURIDIC;
@@ -10,28 +11,35 @@ const getIdRoleUsedForTask = (listRoles: number[]): number => {
10
11
  idRole = Role.SOCIAL;
11
12
  } else if (listRoles.includes(Role.FACTURATION)) {
12
13
  idRole = Role.FACTURATION;
13
- } else if (listRoles.includes(Role.CUSTOMER_SUCCESS) || listRoles.includes(Role.CUSTOMER_SUCCESS_MANAGER)) {
14
+ } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
14
15
  idRole = Role.CUSTOMER_SUCCESS;
15
- } else if (listRoles.includes(Role.FRONT_OFFICE) || listRoles.includes(Role.FRONT_MANAGER)) {
16
+ } else if (listRoles.includes(Role.FRONT_OFFICE)) {
16
17
  idRole = Role.FRONT_OFFICE;
17
18
  }
18
19
  return idRole;
19
20
  };
20
21
 
21
- const getIdRoleUsedForManagerTask = (listRoles: number[]): number => {
22
- let idRole = 0;
23
- if (listRoles.includes(Role.COMMERCIAL)) {
24
- idRole = Role.COMMERCIAL_MANAGER;
25
- } else if (listRoles.includes(Role.JURIDIC) || listRoles.includes(Role.SOCIAL) || listRoles.includes(Role.FACTURATION)) {
26
- idRole = Role.MANAGER;
27
- } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
28
- idRole = Role.CUSTOMER_SUCCESS_MANAGER;
29
- } else if (listRoles.includes(Role.FRONT_OFFICE)) {
30
- idRole = Role.FRONT_MANAGER;
31
- }
32
- return idRole;
22
+ // const getIdRoleUsedForManagerTask = (listRoles: number[]): number => {
23
+ // let idRole = 0;
24
+ // if (listRoles.includes(Role.COMMERCIAL)) {
25
+ // idRole = Role.MANAGER;
26
+ // } else if (listRoles.includes(Role.JURIDIC) || listRoles.includes(Role.SOCIAL) || listRoles.includes(Role.FACTURATION)) {
27
+ // idRole = Role.MANAGER;
28
+ // } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
29
+ // idRole = Role.MANAGER;
30
+ // } else if (listRoles.includes(Role.FRONT_OFFICE)) {
31
+ // idRole = Role.MANAGER;
32
+ // }
33
+ // return idRole;
34
+ // };
35
+
36
+ const getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): number | undefined => {
37
+ const taskTypeList = isIntern ? TaskResponseType.INTERN.types : TaskResponseType.EXTERN.types;
38
+ return taskTypeList.find((taskType) => taskType.id === idTaskType)?.role;
33
39
  };
34
40
 
41
+ const getIdRoleUsedForGetTaskOfUser = (idRole: number): boolean => !!Object.values(RoleAvailableForTask).find((role) => role === idRole);
42
+
35
43
  export {
36
- getIdRoleUsedForTask, getIdRoleUsedForManagerTask,
44
+ getIdRoleUsedForTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser,
37
45
  };
@@ -4,13 +4,11 @@ const getIdRoleUsedForEmail = (listRoles: number[]): number => {
4
4
  let idRole = Role.CUSTOMER_SUCCESS;
5
5
  if (listRoles.includes(Role.FACTURATION)) {
6
6
  idRole = Role.FACTURATION;
7
- } else if (listRoles.includes(Role.BACK_MANAGER)) {
8
- idRole = Role.BACK_MANAGER;
9
7
  } else if (listRoles.includes(Role.FRONT_OFFICE)) {
10
8
  idRole = Role.FRONT_OFFICE;
11
9
  } else if (listRoles.includes(Role.FRONT_OFFICE_EXPRESS)) {
12
10
  idRole = Role.FRONT_OFFICE_EXPRESS;
13
- } else if (listRoles.includes(Role.COMMERCIAL) || listRoles.includes(Role.COMMERCIAL_MANAGER)) {
11
+ } else if (listRoles.includes(Role.COMMERCIAL)) {
14
12
  idRole = Role.COMMERCIAL;
15
13
  } else if (listRoles.includes(Role.EXPERT_ACCOUNTANT)) {
16
14
  idRole = Role.EXPERT_ACCOUNTANT;