@silexpert/core 0.4.234 → 0.4.241

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 (74) hide show
  1. package/es/api/resources/Revision.d.ts +1 -0
  2. package/es/api/resources/Revision.d.ts.map +1 -1
  3. package/es/api/resources/Revision.js +3 -0
  4. package/es/api/resources/Revision.js.map +1 -1
  5. package/es/api/resources/TimeRecorder.d.ts +2 -1
  6. package/es/api/resources/TimeRecorder.d.ts.map +1 -1
  7. package/es/api/resources/TimeRecorder.js +3 -0
  8. package/es/api/resources/TimeRecorder.js.map +1 -1
  9. package/es/api/resources/Transaction.d.ts +1 -0
  10. package/es/api/resources/Transaction.d.ts.map +1 -1
  11. package/es/api/resources/Transaction.js +3 -0
  12. package/es/api/resources/Transaction.js.map +1 -1
  13. package/es/types/Enum/TaskResponseType.d.ts +11 -64
  14. package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
  15. package/es/types/Enum/TaskResponseType.js +77 -67
  16. package/es/types/Enum/TaskResponseType.js.map +1 -1
  17. package/es/types/Interface/api/mail/QueryCountMail.d.ts +6 -5
  18. package/es/types/Interface/api/mail/QueryCountMail.d.ts.map +1 -1
  19. package/es/types/Interface/api/mail/QueryCountMail.js +5 -25
  20. package/es/types/Interface/api/mail/QueryCountMail.js.map +1 -1
  21. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.d.ts +6 -0
  22. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.d.ts.map +1 -0
  23. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js +34 -0
  24. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js.map +1 -0
  25. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts +1 -1
  26. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts.map +1 -1
  27. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
  28. package/es/types/Interface/api/timeRecorder/UpdateRecorder.d.ts +5 -0
  29. package/es/types/Interface/api/timeRecorder/UpdateRecorder.d.ts.map +1 -0
  30. package/es/types/Interface/api/timeRecorder/UpdateRecorder.js +25 -0
  31. package/es/types/Interface/api/timeRecorder/UpdateRecorder.js.map +1 -0
  32. package/es/types/index.d.ts +3 -0
  33. package/es/types/index.d.ts.map +1 -1
  34. package/es/types/index.js +3 -0
  35. package/es/types/index.js.map +1 -1
  36. package/es/utils/date.d.ts +3 -0
  37. package/es/utils/date.d.ts.map +1 -0
  38. package/es/utils/date.js +38 -0
  39. package/es/utils/date.js.map +1 -0
  40. package/es/utils/webmail.js +4 -4
  41. package/es/utils/webmail.js.map +1 -1
  42. package/js/api/resources/Revision.js +7 -0
  43. package/js/api/resources/Revision.js.map +1 -1
  44. package/js/api/resources/TimeRecorder.js +4 -0
  45. package/js/api/resources/TimeRecorder.js.map +1 -1
  46. package/js/api/resources/Transaction.js +4 -0
  47. package/js/api/resources/Transaction.js.map +1 -1
  48. package/js/types/Enum/TaskResponseType.js +77 -67
  49. package/js/types/Enum/TaskResponseType.js.map +1 -1
  50. package/js/types/Interface/api/mail/QueryCountMail.js +2 -10
  51. package/js/types/Interface/api/mail/QueryCountMail.js.map +1 -1
  52. package/js/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js +35 -0
  53. package/js/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js.map +1 -0
  54. package/js/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
  55. package/js/types/Interface/api/timeRecorder/UpdateRecorder.js +31 -0
  56. package/js/types/Interface/api/timeRecorder/UpdateRecorder.js.map +1 -0
  57. package/js/types/index.js +36 -0
  58. package/js/types/index.js.map +1 -1
  59. package/js/utils/date.js +83 -0
  60. package/js/utils/date.js.map +1 -0
  61. package/js/utils/webmail.js +3 -3
  62. package/js/utils/webmail.js.map +1 -1
  63. package/package.json +1 -1
  64. package/ts/api/resources/Revision.ts +4 -0
  65. package/ts/api/resources/TimeRecorder.ts +4 -1
  66. package/ts/api/resources/Transaction.ts +5 -0
  67. package/ts/types/Enum/TaskResponseType.ts +77 -67
  68. package/ts/types/Interface/api/mail/QueryCountMail.ts +7 -21
  69. package/ts/types/Interface/api/mail/QueryCountUnprocessedByUserMail.ts +25 -0
  70. package/ts/types/Interface/api/revision/QueryRevisionSearchEntries.ts +1 -1
  71. package/ts/types/Interface/api/timeRecorder/UpdateRecorder.ts +13 -0
  72. package/ts/types/index.ts +3 -0
  73. package/ts/utils/date.ts +32 -0
  74. package/ts/utils/webmail.ts +3 -3
@@ -1,12 +1,15 @@
1
1
  import { Resource } from '../Resource';
2
2
  import {
3
- ReadAttendanceHours, QueryAttendance, QueryPaginatedDelays, ReadPaginatedDelays, BasePaginate, ReadUsersNotConnected, ITimeRecorder,
3
+ ReadAttendanceHours, QueryAttendance, QueryPaginatedDelays, ReadPaginatedDelays, BasePaginate, ReadUsersNotConnected, ITimeRecorder, UpdateRecorder,
4
4
  } from '../../types';
5
5
 
6
6
  export class TimeRecorder extends Resource {
7
7
  create(payload: ITimeRecorder): Promise<TimeRecorder> {
8
8
  return this.axios.$post('/time-recorders', payload);
9
9
  }
10
+ update(payload: UpdateRecorder): Promise<TimeRecorder> {
11
+ return this.axios.$put('/time-recorders', payload);
12
+ }
10
13
  getAllPresenceHoursByUser(idUser: number, params: QueryAttendance): Promise<ReadAttendanceHours> {
11
14
  return this.axios.$get(`/users/${idUser}/attendances`,
12
15
  { params });
@@ -20,6 +20,11 @@ export class Transaction extends Resource {
20
20
  },
21
21
  });
22
22
  }
23
+
24
+ update(id: number, params: Partial<IAccountingTransaction>): Promise<IAccountingTransaction> {
25
+ return this.axios.patch(`/transactions/${id}`, params);
26
+ }
27
+
23
28
  getAll(idSociety: number, query: QueryGetAllTransactions): Promise<IAccountingTransaction[]> {
24
29
  return this.axios.$get(`/society/${idSociety}/transactions/list`, { params: query });
25
30
  }
@@ -26,13 +26,14 @@ export enum StateTask {
26
26
  TODO = 1,
27
27
  DO = 2,
28
28
  NOTDO = 3,
29
+ REFUSED = 4,
29
30
  }
30
31
 
31
32
  export const TaskResponseType = {
32
33
  DEMANDE_ATTESTATION: {
33
34
  id: 1,
34
35
  label: 'Demande attestation',
35
- responseType: ResponseType.MAIL.id,
36
+ responseType: ResponseType.INTERN_ACTIVITY.id,
36
37
  weight: 2,
37
38
  isExterne: true,
38
39
  idMailAuto: null,
@@ -56,15 +57,15 @@ export const TaskResponseType = {
56
57
  idMailAuto: null,
57
58
  schedule: 15,
58
59
  },
59
- SUPPORT_TECHNIQUE: {
60
- id: 4,
61
- label: 'Support technique',
62
- responseType: ResponseType.CALL.id,
63
- weight: 6,
64
- isExterne: true,
65
- idMailAuto: null,
66
- schedule: 15,
67
- },
60
+ // SUPPORT_TECHNIQUE: {
61
+ // id: 4,
62
+ // label: 'Support technique',
63
+ // responseType: ResponseType.CALL.id,
64
+ // weight: 6,
65
+ // isExterne: true,
66
+ // idMailAuto: null,
67
+ // schedule: 15,
68
+ // },
68
69
  SUIVI_BILAN: {
69
70
  id: 5,
70
71
  label: 'Suivi bilan',
@@ -101,73 +102,73 @@ export const TaskResponseType = {
101
102
  idMailAuto: null,
102
103
  schedule: 30,
103
104
  },
104
- PV_AG_APPROBATION: {
105
- id: 9,
106
- label: 'Pv d\'AG/Approbation',
107
- responseType: ResponseType.INTERN_ACTIVITY.id,
108
- weight: 4,
109
- isExterne: true,
110
- idMailAuto: null,
111
- schedule: 15,
112
- },
113
- DIVIDENDES: {
114
- id: 10,
115
- label: 'Dividendes',
116
- responseType: ResponseType.INTERN_ACTIVITY.id,
117
- weight: 6,
118
- isExterne: true,
119
- idMailAuto: null,
120
- schedule: 15,
121
- },
122
- CREATION_SOCIETE: {
123
- id: 11,
124
- label: 'Creation société',
125
- responseType: ResponseType.INTERN_ACTIVITY.id,
126
- weight: 8,
127
- isExterne: true,
128
- idMailAuto: null,
129
- schedule: 15,
130
- },
105
+ // PV_AG_APPROBATION: {
106
+ // id: 9,
107
+ // label: 'Pv d\'AG/Approbation',
108
+ // responseType: ResponseType.INTERN_ACTIVITY.id,
109
+ // weight: 4,
110
+ // isExterne: true,
111
+ // idMailAuto: null,
112
+ // schedule: 15,
113
+ // },
114
+ // DIVIDENDES: {
115
+ // id: 10,
116
+ // label: 'Dividendes',
117
+ // responseType: ResponseType.INTERN_ACTIVITY.id,
118
+ // weight: 6,
119
+ // isExterne: true,
120
+ // idMailAuto: null,
121
+ // schedule: 15,
122
+ // },
123
+ // CREATION_SOCIETE: {
124
+ // id: 11,
125
+ // label: 'Creation société',
126
+ // responseType: ResponseType.INTERN_ACTIVITY.id,
127
+ // weight: 8,
128
+ // isExterne: true,
129
+ // idMailAuto: null,
130
+ // schedule: 15,
131
+ // },
131
132
  QUESTIONS_JURIDIQUES: {
132
133
  id: 12,
133
134
  label: 'Questions juridiques',
134
- responseType: ResponseType.CALL.id,
135
- weight: 6,
136
- isExterne: true,
137
- idMailAuto: null,
138
- schedule: 15,
139
- },
140
- BULLETIN_PAIE: {
141
- id: 13,
142
- label: 'Bulletin de paie',
143
- responseType: ResponseType.MAIL.id,
144
- weight: 2,
145
- isExterne: true,
146
- idMailAuto: null,
147
- schedule: 15,
148
- },
149
- DECLARATIONS: {
150
- id: 14,
151
- label: 'Déclarations',
152
- responseType: ResponseType.MAIL.id,
153
- weight: 3,
154
- isExterne: true,
155
- idMailAuto: null,
156
- schedule: 15,
157
- },
158
- EMBAUCHE: {
159
- id: 15,
160
- label: 'Embauche',
161
135
  responseType: ResponseType.INTERN_ACTIVITY.id,
162
- weight: 4,
136
+ weight: 6,
163
137
  isExterne: true,
164
138
  idMailAuto: null,
165
139
  schedule: 15,
166
140
  },
141
+ // BULLETIN_PAIE: {
142
+ // id: 13,
143
+ // label: 'Bulletin de paie',
144
+ // responseType: ResponseType.MAIL.id,
145
+ // weight: 2,
146
+ // isExterne: true,
147
+ // idMailAuto: null,
148
+ // schedule: 15,
149
+ // },
150
+ // DECLARATIONS: {
151
+ // id: 14,
152
+ // label: 'Déclarations',
153
+ // responseType: ResponseType.MAIL.id,
154
+ // weight: 3,
155
+ // isExterne: true,
156
+ // idMailAuto: null,
157
+ // schedule: 15,
158
+ // },
159
+ // EMBAUCHE: {
160
+ // id: 15,
161
+ // label: 'Embauche',
162
+ // responseType: ResponseType.INTERN_ACTIVITY.id,
163
+ // weight: 4,
164
+ // isExterne: true,
165
+ // idMailAuto: null,
166
+ // schedule: 15,
167
+ // },
167
168
  QUESTIONS_SOCIALES: {
168
169
  id: 16,
169
170
  label: 'Questions sociales',
170
- responseType: ResponseType.CALL.id,
171
+ responseType: ResponseType.INTERN_ACTIVITY.id,
171
172
  weight: 5,
172
173
  isExterne: true,
173
174
  idMailAuto: null,
@@ -275,7 +276,7 @@ export const TaskResponseType = {
275
276
  RESILIATION: {
276
277
  id: 28,
277
278
  label: 'Résiliation',
278
- responseType: ResponseType.CALL.id,
279
+ responseType: ResponseType.INTERN_ACTIVITY.id,
279
280
  weight: 6,
280
281
  isExterne: true,
281
282
  idMailAuto: null,
@@ -290,4 +291,13 @@ export const TaskResponseType = {
290
291
  idMailAuto: null,
291
292
  schedule: 30,
292
293
  },
294
+ RELATION_CLIENT: {
295
+ id: 30,
296
+ label: 'Relation client',
297
+ responseType: ResponseType.INTERN_ACTIVITY.id,
298
+ weight: 6,
299
+ isExterne: true,
300
+ idMailAuto: null,
301
+ schedule: 30,
302
+ },
293
303
  };
@@ -1,36 +1,22 @@
1
1
  import {
2
2
  IsBoolean,
3
- IsInt,
4
3
  IsOptional,
5
4
  } from 'class-validator';
6
- import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
5
+ import { WhereOptions, WhereValue } from 'sequelize';
6
+ import { Mail } from '../../../../api/resources/Mail';
7
+ import { ApiPropertyOptional } from '../../../../utils';
7
8
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
8
9
 
9
10
  export class QueryCountMail {
10
- @ApiProperty()
11
- @IsInt()
12
- idUser: number;
13
-
14
- @ApiPropertyOptional()
15
- @IsOptional()
16
- @IsBoolean()
17
- @ToBoolean()
18
- isWithoutSociety?: boolean;
19
-
20
- @ApiPropertyOptional()
21
- @IsOptional()
22
- @IsBoolean()
23
- @ToBoolean()
24
- isSent?: boolean;
25
-
26
11
  @ApiPropertyOptional()
27
12
  @IsOptional()
28
13
  @IsBoolean()
29
14
  @ToBoolean()
30
- isCountingManagerRoleMails?: boolean;
15
+ distinct?: boolean;
31
16
 
32
17
  @ApiPropertyOptional()
33
18
  @IsOptional()
34
- @IsInt({ each: true })
35
- listIdSocieties?: number[];
19
+ where?: {
20
+ [K in keyof Mail]?: WhereOptions | WhereValue
21
+ };
36
22
  }
@@ -0,0 +1,25 @@
1
+ import {
2
+ IsBoolean,
3
+ IsInt,
4
+ IsOptional,
5
+ } from 'class-validator';
6
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
7
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
8
+
9
+ export class QueryCountUnprocessedByUserMail {
10
+ @ApiProperty()
11
+ @IsInt()
12
+ idUser: number;
13
+
14
+ @ApiPropertyOptional()
15
+ @IsOptional()
16
+ @IsBoolean()
17
+ @ToBoolean()
18
+ isWithoutSociety?: boolean;
19
+
20
+ @ApiPropertyOptional()
21
+ @IsOptional()
22
+ @IsBoolean()
23
+ @ToBoolean()
24
+ isCountingManagerRoleMails?: boolean;
25
+ }
@@ -82,7 +82,7 @@ export class QueryRevisionSearchEntries {
82
82
  @ApiPropertyOptional({ default: 'date' })
83
83
  @IsString()
84
84
  @IsOptional()
85
- orderBy?: 'date' | 'accountNumber';
85
+ orderBy?: 'date' | 'accountNumber' | 'amount' | 'designation' | 'vatRate';
86
86
 
87
87
  @ApiPropertyOptional()
88
88
  @IsBoolean()
@@ -0,0 +1,13 @@
1
+ import { IsString, IsDateString, IsNumber } from 'class-validator';
2
+ import { ApiProperty } from '../../../../utils';
3
+
4
+ export class UpdateRecorder {
5
+ @ApiProperty()
6
+ @IsString()
7
+ @IsDateString()
8
+ date: string;
9
+
10
+ @ApiProperty()
11
+ @IsNumber()
12
+ idUser: number;
13
+ }
package/ts/types/index.ts CHANGED
@@ -480,6 +480,7 @@ export * from './Interface/api/mail/QueryPaginatedMail';
480
480
  export * from './Interface/api/mail/QueryCountProcessedByUser';
481
481
  export * from './Interface/api/mail/QueryGetAnsweringTimeByUser';
482
482
  export * from './Interface/api/mail/QueryCountMail';
483
+ export * from './Interface/api/mail/QueryCountUnprocessedByUserMail';
483
484
  export * from './Interface/api/mail/UpdateMail';
484
485
  export * from './Interface/api/mail/CreateMailParams';
485
486
  export * from './Interface/api/mail/UpdateMailParams';
@@ -570,6 +571,7 @@ export * from './Interface/api/timeRecorder/QueryPaginatedDelays';
570
571
  export * from './Interface/api/timeRecorder/ReadAttendanceHours';
571
572
  export * from './Interface/api/timeRecorder/ReadPaginatedDelays';
572
573
  export * from './Interface/api/timeRecorder/ReadUsersNotConnected';
574
+ export * from './Interface/api/timeRecorder/UpdateRecorder';
573
575
 
574
576
  // export * from './Interface/api/survey/QuerySurvey';
575
577
  export * from './Interface/api/survey/ReadSurvey';
@@ -757,6 +759,7 @@ export * from './Interface/enum/Date';
757
759
 
758
760
  export * from '../utils/cerfa';
759
761
  export * from '../utils/checklist';
762
+ export * from '../utils/date';
760
763
  export * from './Interface/api/affectedPatrimony/CreateAffectedPatrimony';
761
764
  export * from './Interface/api/affectedPatrimony/CreateInKindAffectedPatrimony';
762
765
  export * from './Interface/api/affectedPatrimony/ResultCreateAffectedPatrimony';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @param dateStart (format YYYY-MM-DD)
3
+ * @param dateEnd (format YYYY-MM-DD)
4
+ * @returns object of date (09:00-10:00, 12:00-13:00 et 14:00-17:00)
5
+ */
6
+ import * as dayjs from 'dayjs';
7
+ import * as isBetween from 'dayjs/plugin/isBetween';
8
+ import { ReadAttendanceHours, UpdateCalendarEvent } from '../types';
9
+
10
+ dayjs.extend(isBetween);
11
+
12
+ export async function checkRealHoursUser(customPayload: UpdateCalendarEvent, realHours: ReadAttendanceHours):Promise<UpdateCalendarEvent> {
13
+ const res = { ...customPayload };
14
+ if (realHours.datas.length > 0) {
15
+ const dateToCompareStart = dayjs(customPayload.dateStart).toDate();
16
+ const dateToCompareEnd = dayjs(customPayload.dateEnd).toDate();
17
+ const realHoursObject = realHours.datas;
18
+
19
+ // on cherche la bonne specialhour pour comparer les horaires
20
+ const realHoursOfPeriod = realHoursObject.filter((sh) => (sh.endTime && dayjs(dateToCompareStart).diff(dayjs(sh.endTime)) <= 0) && (sh.startTime && dayjs(dateToCompareEnd).diff(dayjs(sh.startTime)) >= 0));
21
+
22
+ if (realHoursOfPeriod?.length > 0 && realHoursOfPeriod[0].startTime && realHoursOfPeriod[0].endTime) {
23
+ const dateStart = dayjs(realHoursOfPeriod[0].startTime, 'YYYY-MM-DD HH:mm:ss').toDate();
24
+ const dateEnd = dayjs(realHoursOfPeriod[0].endTime, 'YYYY-MM-DD HH:mm:ss').toDate();
25
+
26
+ // on check si les horaires de l'event sont dans les horaires du collab sinon on les fait commencer à l'heure à laquelle il s'est connecté
27
+ res.dateStart = !(dayjs(dateToCompareStart).isBetween(dateStart, dateEnd, 'minutes', '[]')) ? dateStart : dateToCompareStart;
28
+ res.dateEnd = !(dayjs(dateToCompareEnd).isBetween(dateStart, dateEnd, 'minutes', '[]')) ? dateEnd : dateToCompareEnd;
29
+ }
30
+ }
31
+ return res;
32
+ }
@@ -2,7 +2,9 @@ import { Role } from '../types/Enum/Role';
2
2
 
3
3
  const getIdRoleUsedForEmail = (listRoles: number[]): number => {
4
4
  let idRole = Role.CUSTOMER_SUCCESS;
5
- if (listRoles.includes(Role.FRONT_OFFICE)) {
5
+ if (listRoles.includes(Role.BACK_MANAGER)) {
6
+ idRole = Role.BACK_MANAGER;
7
+ } else if (listRoles.includes(Role.FRONT_OFFICE)) {
6
8
  idRole = Role.FRONT_OFFICE;
7
9
  } else if (listRoles.includes(Role.FRONT_OFFICE_EXPRESS)) {
8
10
  idRole = Role.FRONT_OFFICE_EXPRESS;
@@ -16,8 +18,6 @@ const getIdRoleUsedForEmail = (listRoles: number[]): number => {
16
18
  idRole = Role.JURIDIC;
17
19
  } else if (listRoles.includes(Role.SOCIAL)) {
18
20
  idRole = Role.SOCIAL;
19
- } else if (listRoles.includes(Role.BACK_MANAGER)) {
20
- idRole = Role.BACK_MANAGER;
21
21
  }
22
22
  return idRole;
23
23
  };