@silexpert/core 1.3.204 → 1.3.205-1
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.
- package/dist/cjs/api/resources/User.d.ts +1 -8
- package/dist/cjs/api/resources/User.d.ts.map +1 -1
- package/dist/cjs/api/resources/User.js +0 -58
- package/dist/cjs/api/resources/User.js.map +1 -1
- package/dist/cjs/api/resources/UsersHistory.d.ts +11 -0
- package/dist/cjs/api/resources/UsersHistory.d.ts.map +1 -0
- package/dist/cjs/api/resources/UsersHistory.js +26 -0
- package/dist/cjs/api/resources/UsersHistory.js.map +1 -0
- package/dist/cjs/api/resources/WorkingSchedule.d.ts +1 -2
- package/dist/cjs/api/resources/WorkingSchedule.d.ts.map +1 -1
- package/dist/cjs/api/resources/WorkingSchedule.js +0 -3
- package/dist/cjs/api/resources/WorkingSchedule.js.map +1 -1
- package/dist/cjs/api/resources.d.ts +2 -0
- package/dist/cjs/api/resources.d.ts.map +1 -1
- package/dist/cjs/api/resources.js +2 -0
- package/dist/cjs/api/resources.js.map +1 -1
- package/dist/cjs/types/Enum/BalanceSheet.js +2 -2
- package/dist/cjs/types/Enum/BalanceSheet.js.map +1 -1
- package/dist/cjs/types/Enum/EquipmentType.d.ts +0 -15
- package/dist/cjs/types/Enum/EquipmentType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/EquipmentType.js +0 -15
- package/dist/cjs/types/Enum/EquipmentType.js.map +1 -1
- package/dist/cjs/types/Enum/UsersHistory.d.ts +16 -0
- package/dist/cjs/types/Enum/UsersHistory.d.ts.map +1 -0
- package/dist/cjs/types/Enum/UsersHistory.js +38 -0
- package/dist/cjs/types/Enum/UsersHistory.js.map +1 -0
- package/dist/cjs/types/Interface/api/user/CreateCoworker.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/user/CreateCoworker.js +0 -11
- package/dist/cjs/types/Interface/api/user/CreateCoworker.js.map +1 -1
- package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.js +35 -0
- package/dist/cjs/types/Interface/api/usersHistory/Create.js.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.js +31 -0
- package/dist/cjs/types/Interface/api/usersHistory/Update.js.map +1 -0
- package/dist/cjs/types/Interface/models/IUser.d.ts +0 -1
- package/dist/cjs/types/Interface/models/IUser.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IUser.js.map +1 -1
- package/dist/cjs/types/Interface/models/IUsersHistory.d.ts +14 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.js +3 -0
- package/dist/cjs/types/Interface/models/IUsersHistory.js.map +1 -0
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +4 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/mjs/api/resources/User.d.ts +1 -8
- package/dist/mjs/api/resources/User.d.ts.map +1 -1
- package/dist/mjs/api/resources/User.js +0 -58
- package/dist/mjs/api/resources/User.js.map +1 -1
- package/dist/mjs/api/resources/UsersHistory.d.ts +11 -0
- package/dist/mjs/api/resources/UsersHistory.d.ts.map +1 -0
- package/dist/mjs/api/resources/UsersHistory.js +28 -0
- package/dist/mjs/api/resources/UsersHistory.js.map +1 -0
- package/dist/mjs/api/resources/WorkingSchedule.d.ts +1 -2
- package/dist/mjs/api/resources/WorkingSchedule.d.ts.map +1 -1
- package/dist/mjs/api/resources/WorkingSchedule.js +0 -3
- package/dist/mjs/api/resources/WorkingSchedule.js.map +1 -1
- package/dist/mjs/api/resources.d.ts +2 -0
- package/dist/mjs/api/resources.d.ts.map +1 -1
- package/dist/mjs/api/resources.js +2 -0
- package/dist/mjs/api/resources.js.map +1 -1
- package/dist/mjs/types/Enum/BalanceSheet.js +2 -2
- package/dist/mjs/types/Enum/BalanceSheet.js.map +1 -1
- package/dist/mjs/types/Enum/EquipmentType.d.ts +0 -15
- package/dist/mjs/types/Enum/EquipmentType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/EquipmentType.js +0 -15
- package/dist/mjs/types/Enum/EquipmentType.js.map +1 -1
- package/dist/mjs/types/Enum/UsersHistory.d.ts +16 -0
- package/dist/mjs/types/Enum/UsersHistory.d.ts.map +1 -0
- package/dist/mjs/types/Enum/UsersHistory.js +35 -0
- package/dist/mjs/types/Enum/UsersHistory.js.map +1 -0
- package/dist/mjs/types/Interface/api/user/CreateCoworker.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/user/CreateCoworker.js +0 -11
- package/dist/mjs/types/Interface/api/user/CreateCoworker.js.map +1 -1
- package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts +8 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.js +34 -0
- package/dist/mjs/types/Interface/api/usersHistory/Create.js.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts +7 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.js +29 -0
- package/dist/mjs/types/Interface/api/usersHistory/Update.js.map +1 -0
- package/dist/mjs/types/Interface/models/IUser.d.ts +0 -1
- package/dist/mjs/types/Interface/models/IUser.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IUser.js.map +1 -1
- package/dist/mjs/types/Interface/models/IUsersHistory.d.ts +14 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.js +2 -0
- package/dist/mjs/types/Interface/models/IUsersHistory.js.map +1 -0
- package/dist/mjs/types/index.d.ts +4 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +4 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/User.ts +0 -65
- package/ts/api/resources/UsersHistory.ts +35 -0
- package/ts/api/resources/WorkingSchedule.ts +0 -5
- package/ts/api/resources.ts +2 -0
- package/ts/types/Enum/BalanceSheet.ts +2 -2
- package/ts/types/Enum/EquipmentType.ts +0 -15
- package/ts/types/Enum/UsersHistory.ts +38 -0
- package/ts/types/Interface/api/user/CreateCoworker.ts +0 -11
- package/ts/types/Interface/api/usersHistory/Create.ts +21 -0
- package/ts/types/Interface/api/usersHistory/Update.ts +17 -0
- package/ts/types/Interface/models/IUser.ts +0 -1
- package/ts/types/Interface/models/IUsersHistory.ts +17 -0
- package/ts/types/index.ts +5 -0
- package/dist/cjs/utils/transforms/number.transform.d.ts +0 -3
- package/dist/cjs/utils/transforms/number.transform.d.ts.map +0 -1
- package/dist/cjs/utils/transforms/number.transform.js +0 -36
- package/dist/cjs/utils/transforms/number.transform.js.map +0 -1
- package/dist/mjs/utils/transforms/number.transform.d.ts +0 -3
- package/dist/mjs/utils/transforms/number.transform.d.ts.map +0 -1
- package/dist/mjs/utils/transforms/number.transform.js +0 -33
- package/dist/mjs/utils/transforms/number.transform.js.map +0 -1
- package/ts/utils/transforms/number.transform.ts +0 -38
package/ts/api/resources/User.ts
CHANGED
|
@@ -23,9 +23,6 @@ import {
|
|
|
23
23
|
BasePaginate,
|
|
24
24
|
QueryGetAllUsersPaginated,
|
|
25
25
|
QueryUpdatePassword,
|
|
26
|
-
CreateCollaboraterDetail,
|
|
27
|
-
IWorkingSchedule,
|
|
28
|
-
ICollaboraterDetail,
|
|
29
26
|
} from '../../types';
|
|
30
27
|
|
|
31
28
|
export class User extends Resource {
|
|
@@ -41,28 +38,6 @@ export class User extends Resource {
|
|
|
41
38
|
coworker(data: CreateCoworker): Promise<IUser> {
|
|
42
39
|
return this.axios.$post('user/coworker', data);
|
|
43
40
|
}
|
|
44
|
-
|
|
45
|
-
createCompletCoworker(data: CreateCoworker, file?: File): Promise<IUser> {
|
|
46
|
-
const formData = new FormData();
|
|
47
|
-
Object.entries(data).forEach(([key, value]) => {
|
|
48
|
-
if (value !== undefined && value !== null) {
|
|
49
|
-
if (Array.isArray(value)) {
|
|
50
|
-
value.forEach((v) => {
|
|
51
|
-
formData.append(`${key}[]`, `${v}`);
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
formData.append(key, `${value}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
if (file){
|
|
59
|
-
formData.append('file', file);
|
|
60
|
-
}
|
|
61
|
-
return this.axios.$post('user/coworker/complete', formData, {
|
|
62
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
41
|
updateCoworker(idUser: number, params: UpdateCorworker): Promise<IUser> {
|
|
67
42
|
const formData = new FormData();
|
|
68
43
|
Object.entries(params).forEach(([key, value]) => {
|
|
@@ -81,26 +56,6 @@ export class User extends Resource {
|
|
|
81
56
|
});
|
|
82
57
|
}
|
|
83
58
|
|
|
84
|
-
updateCompletCoworker(idUser: number, data: UpdateCorworker, file?: File): Promise<IUser> {
|
|
85
|
-
const formData = new FormData();
|
|
86
|
-
Object.entries(data).forEach(([key, value]) => {
|
|
87
|
-
if (value || value === false || value === 0) {
|
|
88
|
-
if (Array.isArray(value)) {
|
|
89
|
-
value.forEach((v: number | string) => {
|
|
90
|
-
formData.append(`${key}[]`, `${v}`);
|
|
91
|
-
});
|
|
92
|
-
} else if (key === 'file') formData.append('file', value);
|
|
93
|
-
else formData.append(key, `${value}`);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
if (file){
|
|
97
|
-
formData.append('file', file);
|
|
98
|
-
}
|
|
99
|
-
return this.axios.$put(`/user/coworker/complete/${idUser}`, formData, {
|
|
100
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
59
|
sendNewCode(id: number): Promise<IUser> {
|
|
105
60
|
return this.axios.$put(`user/${id}/sendNewSmsCode`);
|
|
106
61
|
}
|
|
@@ -189,24 +144,4 @@ export class User extends Resource {
|
|
|
189
144
|
registerProspect(body: RegisterProspectBody): Promise<RegisterProspectResponse> {
|
|
190
145
|
return this.axios.$post('users/prospect', body);
|
|
191
146
|
}
|
|
192
|
-
|
|
193
|
-
updateCoworkerWorkingSchedules(idUser: number, workingSchedules: IWorkingSchedule[]): Promise<IWorkingSchedule[]> {
|
|
194
|
-
return this.axios.$post(`users/coworker/${idUser}/working-schedules`, workingSchedules);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
createCoworkerWorkingSchedules(idUser: number, workingSchedules: Omit<IWorkingSchedule, 'id'>[]): Promise<IWorkingSchedule[]> {
|
|
198
|
-
return this.axios.$post(`users/coworker/${idUser}/working-schedules`, workingSchedules);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
createCollaboraterDetail(params: CreateCollaboraterDetail): Promise<ICollaboraterDetail> {
|
|
202
|
-
return this.axios.$post('collaboraters-details', params);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
getCollaboraterDetail(idUser: number): Promise<ICollaboraterDetail> {
|
|
206
|
-
return this.axios.$get(`collaboraters-details/user/${idUser}`);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
updateCollaboraterDetail(id: number, params: Partial<ICollaboraterDetail>): Promise<ICollaboraterDetail> {
|
|
210
|
-
return this.axios.$put(`collaboraters-details/${id}`, params);
|
|
211
|
-
}
|
|
212
147
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Resource } from '../Resource';
|
|
2
|
+
import { IUsersHistory, CreateUsersHistory, UpdateUsersHistory } from '../../types';
|
|
3
|
+
|
|
4
|
+
export class UsersHistory extends Resource {
|
|
5
|
+
createUserHistory(body: CreateUsersHistory): Promise<IUsersHistory> {
|
|
6
|
+
return this.axios.$post('usersHistory', body);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
getAllUserHistory(signal?: AbortSignal): Promise<IUsersHistory[]> {
|
|
10
|
+
return this.axios.$get('usersHistory', {
|
|
11
|
+
...signal && { signal }
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getUserHistoryById(id: number, signal?: AbortSignal): Promise<IUsersHistory> {
|
|
16
|
+
return this.axios.$get(`usersHistory/${id}`, {
|
|
17
|
+
...signal && { signal }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getUserHistoryByUserID(idUser: number, signal?: AbortSignal): Promise<IUsersHistory[]> {
|
|
22
|
+
return this.axios.$get(`usersHistory/user/${idUser}`, {
|
|
23
|
+
...signal && { signal }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
updateUserHistory(id: number, body: UpdateUsersHistory): Promise<IUsersHistory> {
|
|
28
|
+
return this.axios.$put(`usersHistory/${id}`, body);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
deleteUserHistory(id: number): Promise<boolean> {
|
|
32
|
+
return this.axios.$delete(`usersHistory/${id}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
ReadWorkingSchedule,
|
|
7
7
|
SpecialHours,
|
|
8
8
|
TimeSlots,
|
|
9
|
-
IWorkingSchedule
|
|
10
9
|
} from '../..';
|
|
11
10
|
|
|
12
11
|
export class WorkingSchedule extends Resource {
|
|
@@ -41,10 +40,6 @@ export class WorkingSchedule extends Resource {
|
|
|
41
40
|
return this.axios.$get('workingSchedule/all');
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
deleteAndCreate(idUser: number, workingSchedules: Omit<IWorkingSchedule, 'id'>[]): Promise<WorkingSchedule[]> {
|
|
45
|
-
return this.axios.$post(`workingSchedule/delete-and-create/${idUser}`, workingSchedules);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
getAvailableTimeSlots(params: QueryAvailableTimeSlot): Promise<TimeSlots[]> {
|
|
49
44
|
return this.axios.$get('workingSchedule/available-time-slots', {
|
|
50
45
|
params,
|
package/ts/api/resources.ts
CHANGED
|
@@ -190,6 +190,7 @@ import { InformationRequest } from './resources/InformationRequest';
|
|
|
190
190
|
import { AutomaticRegistration } from './resources/AutomaticRegistration';
|
|
191
191
|
import { LoginApproval } from './resources/LoginApproval';
|
|
192
192
|
import { SocietyApproval } from './resources/SocietyApproval';
|
|
193
|
+
import { UsersHistory } from './resources/UsersHistory';
|
|
193
194
|
import { Docoon } from './resources/Docoon';
|
|
194
195
|
|
|
195
196
|
export const resources = {
|
|
@@ -385,5 +386,6 @@ export const resources = {
|
|
|
385
386
|
automaticRegistration: AutomaticRegistration,
|
|
386
387
|
loginApproval: LoginApproval,
|
|
387
388
|
societyApproval: SocietyApproval,
|
|
389
|
+
usersHistory: UsersHistory,
|
|
388
390
|
docoon: Docoon,
|
|
389
391
|
};
|
|
@@ -939,10 +939,10 @@ export const BALANCE_SHEET_LIST_PASSIVE: BalanceSheetList = [
|
|
|
939
939
|
{
|
|
940
940
|
name: BalanceSheetPassiveLabel.AVANCES_ET_ACOMPTES_RECUES,
|
|
941
941
|
key: 'advancesAndDepositsReceived',
|
|
942
|
-
accounts: ['4191'],
|
|
942
|
+
accounts: ['4191'],
|
|
943
943
|
isSubcategory: true,
|
|
944
944
|
total: 0,
|
|
945
|
-
// type: 'passive',
|
|
945
|
+
// type: 'passive', Demandé par Angelo
|
|
946
946
|
accountsDescription: [],
|
|
947
947
|
},
|
|
948
948
|
{
|
|
@@ -20,76 +20,61 @@ export const EquipmentTypeDetail = [
|
|
|
20
20
|
{
|
|
21
21
|
id: EquipmentType.LAPTOP,
|
|
22
22
|
label: 'Ordinateur portable',
|
|
23
|
-
icon: 'i-lucide-laptop'
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
25
|
id: EquipmentType.PRINTER,
|
|
27
26
|
label: 'Imprimante',
|
|
28
|
-
icon: 'i-lucide-printer'
|
|
29
27
|
},
|
|
30
28
|
{
|
|
31
29
|
id: EquipmentType.PHONE,
|
|
32
30
|
label: 'Téléphone',
|
|
33
|
-
icon: 'i-lucide-smartphone'
|
|
34
31
|
},
|
|
35
32
|
{
|
|
36
33
|
id: EquipmentType.KEYBOARD,
|
|
37
34
|
label: 'Clavier',
|
|
38
|
-
icon: 'i-lucide-keyboard'
|
|
39
35
|
},
|
|
40
36
|
{
|
|
41
37
|
id: EquipmentType.MOUSE,
|
|
42
38
|
label: 'Souris',
|
|
43
|
-
icon: 'i-lucide-mouse'
|
|
44
39
|
},
|
|
45
40
|
{
|
|
46
41
|
id: EquipmentType.SCREEN,
|
|
47
42
|
label: 'Écran',
|
|
48
|
-
icon: 'i-lucide-monitor'
|
|
49
43
|
},
|
|
50
44
|
{
|
|
51
45
|
id: EquipmentType.HEADPHONE,
|
|
52
46
|
label: 'Casque',
|
|
53
|
-
icon: 'i-lucide-headphones'
|
|
54
47
|
},
|
|
55
48
|
{
|
|
56
49
|
id: EquipmentType.ADAPTER,
|
|
57
50
|
label: 'Adaptateur',
|
|
58
|
-
icon: 'i-lucide-box'
|
|
59
51
|
},
|
|
60
52
|
{
|
|
61
53
|
id: EquipmentType.WIRELESS_HEADPHONE,
|
|
62
54
|
label: 'Casque sans fil',
|
|
63
|
-
icon: 'i-lucide-headphones'
|
|
64
55
|
},
|
|
65
56
|
{
|
|
66
57
|
id: EquipmentType.POCKET,
|
|
67
58
|
label: 'Pochette',
|
|
68
|
-
icon: 'i-lucide-box'
|
|
69
59
|
},
|
|
70
60
|
{
|
|
71
61
|
id: EquipmentType.BADGE,
|
|
72
62
|
label: 'Badge',
|
|
73
|
-
icon: 'i-lucide-badge'
|
|
74
63
|
},
|
|
75
64
|
{
|
|
76
65
|
id: EquipmentType.CALCULATOR,
|
|
77
66
|
label: 'Calculatrice',
|
|
78
|
-
icon: 'i-lucide-calculator'
|
|
79
67
|
},
|
|
80
68
|
{
|
|
81
69
|
id: EquipmentType.USB_HUB,
|
|
82
70
|
label: 'Hub USB',
|
|
83
|
-
icon: 'i-lucide-box'
|
|
84
71
|
},
|
|
85
72
|
{
|
|
86
73
|
id: EquipmentType.NUMPAD,
|
|
87
74
|
label: 'Pavé numérique',
|
|
88
|
-
icon: 'i-lucide-box'
|
|
89
75
|
},
|
|
90
76
|
{
|
|
91
77
|
id: EquipmentType.EXTERN_SUPPORT,
|
|
92
78
|
label: 'Support externe',
|
|
93
|
-
icon: 'i-lucide-box'
|
|
94
79
|
},
|
|
95
80
|
] as const;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export enum TypeUserHistory {
|
|
2
|
+
// Cycle de vie Compte
|
|
3
|
+
CREATE = 1,
|
|
4
|
+
UPDATE = 2,
|
|
5
|
+
DELETE = 3,
|
|
6
|
+
RESTORE = 4,
|
|
7
|
+
|
|
8
|
+
// Validation & Modifications Spécifiques
|
|
9
|
+
INFO_UPDATE = 5, // Info ok
|
|
10
|
+
ROLE_UPDATE = 6, // Role ok
|
|
11
|
+
|
|
12
|
+
// Sécurité
|
|
13
|
+
PASSWORD_UPDATE = 7,
|
|
14
|
+
|
|
15
|
+
// Gestion Matériel
|
|
16
|
+
EQUIPMENT_ASSIGN = 8,
|
|
17
|
+
EQUIPMENT_BROKEN = 9,
|
|
18
|
+
EQUIPMENT_RETURN = 10,
|
|
19
|
+
EQUIPMENT_LOST = 11,
|
|
20
|
+
|
|
21
|
+
// Communication
|
|
22
|
+
MAIL_SENT_TO_TS = 12, // Mail envoyé à TS
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const TypeUserHistoryLabels: Record<TypeUserHistory, string> = {
|
|
26
|
+
[TypeUserHistory.CREATE]: 'Création',
|
|
27
|
+
[TypeUserHistory.UPDATE]: 'Mise à jour',
|
|
28
|
+
[TypeUserHistory.DELETE]: 'Suppression',
|
|
29
|
+
[TypeUserHistory.RESTORE]: 'Restauration',
|
|
30
|
+
[TypeUserHistory.INFO_UPDATE]: 'Mise à jour Info',
|
|
31
|
+
[TypeUserHistory.ROLE_UPDATE]: 'Mise à jour Rôle',
|
|
32
|
+
[TypeUserHistory.PASSWORD_UPDATE]: 'Changement Mot de passe',
|
|
33
|
+
[TypeUserHistory.EQUIPMENT_ASSIGN]: 'Assignation Matériel',
|
|
34
|
+
[TypeUserHistory.EQUIPMENT_BROKEN]: 'Matériel Cassé',
|
|
35
|
+
[TypeUserHistory.EQUIPMENT_RETURN]: 'Retour Matériel',
|
|
36
|
+
[TypeUserHistory.EQUIPMENT_LOST]: 'Matériel Perdu',
|
|
37
|
+
[TypeUserHistory.MAIL_SENT_TO_TS]: 'Mail envoyé à TS',
|
|
38
|
+
};
|
|
@@ -11,10 +11,8 @@ import {
|
|
|
11
11
|
IsPhoneNumber,
|
|
12
12
|
IsString,
|
|
13
13
|
} from 'class-validator';
|
|
14
|
-
import { Transform } from 'class-transformer';
|
|
15
14
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils/decorators';
|
|
16
15
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
17
|
-
import { ToNumber } from '../../../../utils/transforms/number.transform';
|
|
18
16
|
import { EntityType } from '../../../Enum/EntityType';
|
|
19
17
|
|
|
20
18
|
export class CreateCoworker {
|
|
@@ -51,7 +49,6 @@ export class CreateCoworker {
|
|
|
51
49
|
@ApiPropertyOptional()
|
|
52
50
|
@IsOptional()
|
|
53
51
|
@IsNumber()
|
|
54
|
-
@ToNumber()
|
|
55
52
|
idCivility?: number;
|
|
56
53
|
|
|
57
54
|
@ApiProperty({ default: true })
|
|
@@ -104,25 +101,17 @@ export class CreateCoworker {
|
|
|
104
101
|
@ApiProperty()
|
|
105
102
|
@IsDefined()
|
|
106
103
|
@IsInt()
|
|
107
|
-
@ToNumber()
|
|
108
104
|
idOffice: number;
|
|
109
105
|
|
|
110
106
|
@ApiProperty()
|
|
111
107
|
@IsDefined()
|
|
112
108
|
@IsEnum(EntityType)
|
|
113
|
-
@ToNumber()
|
|
114
109
|
entity: EntityType;
|
|
115
110
|
|
|
116
111
|
@ApiPropertyOptional()
|
|
117
112
|
@IsOptional()
|
|
118
113
|
@IsArray()
|
|
119
114
|
@IsInt({ each: true })
|
|
120
|
-
@Transform(({ value }: { value: any }) => {
|
|
121
|
-
if (Array.isArray(value)) {
|
|
122
|
-
return value.map((v) => Number(v));
|
|
123
|
-
}
|
|
124
|
-
return value as number;
|
|
125
|
-
})
|
|
126
115
|
idRoles?: number[];
|
|
127
116
|
|
|
128
117
|
@ApiPropertyOptional()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IsEnum, IsInt, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { ApiProperty, ApiPropertyOptional } from '../../../../utils/decorators';
|
|
3
|
+
import { TypeUserHistory } from '../../../Enum/UsersHistory';
|
|
4
|
+
import { IUsersHistory } from '../../models/IUsersHistory';
|
|
5
|
+
|
|
6
|
+
export class CreateUsersHistory implements Omit<IUsersHistory, 'id' | 'createdAt' | 'updatedAt' | 'idAuthor'> {
|
|
7
|
+
@ApiProperty()
|
|
8
|
+
@IsInt()
|
|
9
|
+
idUser: number;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@ApiPropertyOptional()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
comment?: string;
|
|
17
|
+
|
|
18
|
+
@ApiProperty()
|
|
19
|
+
@IsEnum(TypeUserHistory)
|
|
20
|
+
actionType: TypeUserHistory;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { ApiPropertyOptional } from '../../../../utils/decorators';
|
|
3
|
+
import { TypeUserHistory } from '../../../Enum/UsersHistory';
|
|
4
|
+
import { IUsersHistory } from '../../models/IUsersHistory';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class UpdateUsersHistory implements Partial<Omit<IUsersHistory, 'id' | 'idUser' | 'idAuthor'>> {
|
|
8
|
+
@ApiPropertyOptional()
|
|
9
|
+
@IsOptional()
|
|
10
|
+
@IsString()
|
|
11
|
+
comment?: string;
|
|
12
|
+
|
|
13
|
+
@ApiPropertyOptional()
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsEnum(TypeUserHistory)
|
|
16
|
+
actionType?: TypeUserHistory;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IUser } from './IUser';
|
|
2
|
+
import { TypeUserHistory } from '../../Enum/UsersHistory';
|
|
3
|
+
|
|
4
|
+
export interface IUsersHistory {
|
|
5
|
+
id?: number;
|
|
6
|
+
idUser: number;
|
|
7
|
+
idAuthor?: number | null;
|
|
8
|
+
comment?: string | null;
|
|
9
|
+
actionType: TypeUserHistory;
|
|
10
|
+
createdAt?: Date | null;
|
|
11
|
+
updatedAt?: Date | null;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
// Relations
|
|
15
|
+
user?: IUser;
|
|
16
|
+
author?: IUser;
|
|
17
|
+
}
|
package/ts/types/index.ts
CHANGED
|
@@ -329,6 +329,7 @@ export * from './Interface/models/IDocumentRequest';
|
|
|
329
329
|
export * from './Interface/models/IInformationRequest';
|
|
330
330
|
export * from './Interface/models/IRevenueMovement';
|
|
331
331
|
export * from './Interface/models/IRevenueSnapshot';
|
|
332
|
+
export * from './Interface/models/IUsersHistory';
|
|
332
333
|
|
|
333
334
|
// Schemas
|
|
334
335
|
export * from './Interface/schemas/IRegistrationDetail';
|
|
@@ -568,6 +569,7 @@ export * from './Enum/InformationRequestType';
|
|
|
568
569
|
export * from './Enum/InformationRequestState';
|
|
569
570
|
export * from './Enum/Revenue';
|
|
570
571
|
export * from './Enum/EbookIntention';
|
|
572
|
+
export * from './Enum/UsersHistory';
|
|
571
573
|
|
|
572
574
|
// Interfaces API
|
|
573
575
|
export * from './Interface/api/authentification/AuthenticationResponse';
|
|
@@ -792,6 +794,9 @@ export * from './Interface/api/constitutionHistory/QueryPaginatedConstitutionHis
|
|
|
792
794
|
export * from './Interface/api/userSpecialDay/BodyUserSpecialDay';
|
|
793
795
|
export * from './Interface/api/userSpecialDay/QueryUserSpecialDay';
|
|
794
796
|
export * from './Interface/api/oldExportInfo/OldExpertInfos';
|
|
797
|
+
export * from './Interface/api/usersHistory/Create';
|
|
798
|
+
export * from './Interface/api/usersHistory/Update';
|
|
799
|
+
|
|
795
800
|
|
|
796
801
|
// export * from './Interface/api/survey/QuerySurvey';
|
|
797
802
|
export * from './Interface/api/survey/ReadSurvey';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.transform.d.ts","sourceRoot":"","sources":["../../../../ts/utils/transforms/number.transform.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,QAAQ,SAYJ,QAAQ,GAAG,EAAE,KAAK,MAAM,SAIjC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToNumber = void 0;
|
|
4
|
-
const class_transformer_1 = require("class-transformer");
|
|
5
|
-
const valueToNumber = (value) => {
|
|
6
|
-
if (value === null || value === undefined || value === '') {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
if (typeof value === 'number') {
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
if (typeof value === 'string') {
|
|
13
|
-
const num = Number(value);
|
|
14
|
-
if (isNaN(num)) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return num;
|
|
18
|
-
}
|
|
19
|
-
return undefined;
|
|
20
|
-
};
|
|
21
|
-
const ToNumber = () => {
|
|
22
|
-
const toPlain = (0, class_transformer_1.Transform)(
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
24
|
-
({ value }) => value, {
|
|
25
|
-
toPlainOnly: true,
|
|
26
|
-
});
|
|
27
|
-
const toClass = (target, key) => (0, class_transformer_1.Transform)(({ obj }) => valueToNumber(obj[key]), {
|
|
28
|
-
toClassOnly: true,
|
|
29
|
-
})(target, key);
|
|
30
|
-
return (target, key) => {
|
|
31
|
-
toPlain(target, key);
|
|
32
|
-
toClass(target, key);
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
exports.ToNumber = ToNumber;
|
|
36
|
-
//# sourceMappingURL=number.transform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.transform.js","sourceRoot":"","sources":["../../../../ts/utils/transforms/number.transform.ts"],"names":[],"mappings":";;;AAAA,yDAA8C;AAE9C,MAAM,aAAa,GAAG,CAAC,KAAU,EAAE,EAAE;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,MAAM,OAAO,GAAG,IAAA,6BAAS;IACvB,+DAA+D;IAC/D,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,EACpB;QACE,WAAW,EAAE,IAAI;KAClB,CACF,CAAC;IACF,MAAM,OAAO,GAAG,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE,CAC3C,IAAA,6BAAS,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QAC9C,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClB,OAAO,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE;QAClC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACrB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEO,4BAAQ","sourcesContent":["import { Transform } from 'class-transformer';\n\nconst valueToNumber = (value: any) => {\n if (value === null || value === undefined || value === '') {\n return undefined;\n }\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const num = Number(value);\n if (isNaN(num)) {\n return undefined;\n }\n return num;\n }\n return undefined;\n};\n\nconst ToNumber = () => {\n const toPlain = Transform(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n ({ value }) => value,\n {\n toPlainOnly: true,\n },\n );\n const toClass = (target: any, key: string) =>\n Transform(({ obj }) => valueToNumber(obj[key]), {\n toClassOnly: true,\n })(target, key);\n return (target: any, key: string) => {\n toPlain(target, key);\n toClass(target, key);\n };\n};\n\nexport { ToNumber };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.transform.d.ts","sourceRoot":"","sources":["../../../../ts/utils/transforms/number.transform.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,QAAQ,SAYJ,QAAQ,GAAG,EAAE,KAAK,MAAM,SAIjC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Transform } from 'class-transformer';
|
|
2
|
-
const valueToNumber = (value) => {
|
|
3
|
-
if (value === null || value === undefined || value === '') {
|
|
4
|
-
return undefined;
|
|
5
|
-
}
|
|
6
|
-
if (typeof value === 'number') {
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
if (typeof value === 'string') {
|
|
10
|
-
const num = Number(value);
|
|
11
|
-
if (isNaN(num)) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return num;
|
|
15
|
-
}
|
|
16
|
-
return undefined;
|
|
17
|
-
};
|
|
18
|
-
const ToNumber = () => {
|
|
19
|
-
const toPlain = Transform(
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
21
|
-
({ value }) => value, {
|
|
22
|
-
toPlainOnly: true,
|
|
23
|
-
});
|
|
24
|
-
const toClass = (target, key) => Transform(({ obj }) => valueToNumber(obj[key]), {
|
|
25
|
-
toClassOnly: true,
|
|
26
|
-
})(target, key);
|
|
27
|
-
return (target, key) => {
|
|
28
|
-
toPlain(target, key);
|
|
29
|
-
toClass(target, key);
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export { ToNumber };
|
|
33
|
-
//# sourceMappingURL=number.transform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.transform.js","sourceRoot":"","sources":["../../../../ts/utils/transforms/number.transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,aAAa,GAAG,CAAC,KAAU,EAAE,EAAE;IACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,MAAM,OAAO,GAAG,SAAS;IACvB,+DAA+D;IAC/D,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,EACpB;QACE,WAAW,EAAE,IAAI;KAClB,CACF,CAAC;IACF,MAAM,OAAO,GAAG,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE,CAC3C,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;QAC9C,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClB,OAAO,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE;QAClC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACrB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import { Transform } from 'class-transformer';\n\nconst valueToNumber = (value: any) => {\n if (value === null || value === undefined || value === '') {\n return undefined;\n }\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n const num = Number(value);\n if (isNaN(num)) {\n return undefined;\n }\n return num;\n }\n return undefined;\n};\n\nconst ToNumber = () => {\n const toPlain = Transform(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n ({ value }) => value,\n {\n toPlainOnly: true,\n },\n );\n const toClass = (target: any, key: string) =>\n Transform(({ obj }) => valueToNumber(obj[key]), {\n toClassOnly: true,\n })(target, key);\n return (target: any, key: string) => {\n toPlain(target, key);\n toClass(target, key);\n };\n};\n\nexport { ToNumber };\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Transform } from 'class-transformer';
|
|
2
|
-
|
|
3
|
-
const valueToNumber = (value: any) => {
|
|
4
|
-
if (value === null || value === undefined || value === '') {
|
|
5
|
-
return undefined;
|
|
6
|
-
}
|
|
7
|
-
if (typeof value === 'number') {
|
|
8
|
-
return value;
|
|
9
|
-
}
|
|
10
|
-
if (typeof value === 'string') {
|
|
11
|
-
const num = Number(value);
|
|
12
|
-
if (isNaN(num)) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return num;
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const ToNumber = () => {
|
|
21
|
-
const toPlain = Transform(
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
23
|
-
({ value }) => value,
|
|
24
|
-
{
|
|
25
|
-
toPlainOnly: true,
|
|
26
|
-
},
|
|
27
|
-
);
|
|
28
|
-
const toClass = (target: any, key: string) =>
|
|
29
|
-
Transform(({ obj }) => valueToNumber(obj[key]), {
|
|
30
|
-
toClassOnly: true,
|
|
31
|
-
})(target, key);
|
|
32
|
-
return (target: any, key: string) => {
|
|
33
|
-
toPlain(target, key);
|
|
34
|
-
toClass(target, key);
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { ToNumber };
|