ptechcore_ui 1.0.64 → 1.0.66
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/index.cjs +177 -192
- package/dist/index.d.cts +3457 -0
- package/dist/index.d.ts +3457 -0
- package/dist/index.js +181 -197
- package/package.json +3 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,3457 @@
|
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
interface PrimaryButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: 'full' | 'outline' | 'text' | 'ghost';
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
children?: React$1.ReactNode;
|
|
10
|
+
classname?: string;
|
|
11
|
+
icon?: React$1.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const PrimaryButton: React$1.FC<PrimaryButtonProps>;
|
|
14
|
+
declare const SecondaryButton: React$1.FC<PrimaryButtonProps>;
|
|
15
|
+
|
|
16
|
+
interface ModalProps {
|
|
17
|
+
title: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
sideactions?: React$1.ReactNode;
|
|
20
|
+
width?: string;
|
|
21
|
+
minContentHeight?: string;
|
|
22
|
+
open: boolean;
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
children: React$1.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare const Modal: React$1.FC<ModalProps>;
|
|
27
|
+
|
|
28
|
+
type InputProps = React$1.InputHTMLAttributes<HTMLInputElement> & {
|
|
29
|
+
label?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
32
|
+
};
|
|
33
|
+
declare const InputField: React$1.FC<InputProps>;
|
|
34
|
+
type TextInputProps = InputProps & {
|
|
35
|
+
multiline?: boolean;
|
|
36
|
+
rows?: number;
|
|
37
|
+
};
|
|
38
|
+
declare const TextInput: React$1.FC<TextInputProps>;
|
|
39
|
+
declare const NumberInput: React$1.FC<TextInputProps>;
|
|
40
|
+
declare const DateInput: React$1.FC<TextInputProps>;
|
|
41
|
+
type Option = {
|
|
42
|
+
label: string;
|
|
43
|
+
value: string | number;
|
|
44
|
+
};
|
|
45
|
+
type SelectInputProps = React$1.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
46
|
+
label?: string;
|
|
47
|
+
options: Option[];
|
|
48
|
+
error?: string;
|
|
49
|
+
};
|
|
50
|
+
declare const SelectInput: React$1.FC<SelectInputProps>;
|
|
51
|
+
type FileInputProps = {
|
|
52
|
+
label?: string;
|
|
53
|
+
name: string;
|
|
54
|
+
file?: string | File;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
readOnly?: boolean;
|
|
58
|
+
error?: string;
|
|
59
|
+
onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
60
|
+
};
|
|
61
|
+
declare const FileInput: React$1.FC<FileInputProps>;
|
|
62
|
+
|
|
63
|
+
interface MenuItem {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
icon: React$1.ReactNode;
|
|
67
|
+
path?: string;
|
|
68
|
+
badge?: string | number;
|
|
69
|
+
submenu?: MenuItem[];
|
|
70
|
+
ariaLabel?: string;
|
|
71
|
+
permission?: string;
|
|
72
|
+
}
|
|
73
|
+
interface PrivateLayoutProps {
|
|
74
|
+
children: React$1.ReactNode;
|
|
75
|
+
module_name: string;
|
|
76
|
+
module_description?: string;
|
|
77
|
+
primaryMenuItems: MenuItem[];
|
|
78
|
+
secondaryMenuItems: Record<string, MenuItem[]>;
|
|
79
|
+
}
|
|
80
|
+
declare const RewiseLayout: React$1.FC<PrivateLayoutProps>;
|
|
81
|
+
|
|
82
|
+
declare const ToastContainer: React$1.FC;
|
|
83
|
+
|
|
84
|
+
interface TrackableModel {
|
|
85
|
+
id?: number | null;
|
|
86
|
+
created_at?: string;
|
|
87
|
+
updated_at?: string;
|
|
88
|
+
}
|
|
89
|
+
interface BusinessEntityAbstract {
|
|
90
|
+
business_entity?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface Module$1 {
|
|
94
|
+
id: number;
|
|
95
|
+
code: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
price: number;
|
|
99
|
+
is_active: boolean;
|
|
100
|
+
price_monthly: number;
|
|
101
|
+
price_yearly: number;
|
|
102
|
+
created_at: string;
|
|
103
|
+
updated_at: string;
|
|
104
|
+
is_deleted: boolean;
|
|
105
|
+
}
|
|
106
|
+
interface Plan {
|
|
107
|
+
id: number;
|
|
108
|
+
name: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
price_monthly: number;
|
|
111
|
+
price_yearly: number;
|
|
112
|
+
max_users: number;
|
|
113
|
+
max_entities: number;
|
|
114
|
+
modules_included: Module$1[] | number[];
|
|
115
|
+
is_private: boolean;
|
|
116
|
+
private_for?: number | null;
|
|
117
|
+
created_at: string;
|
|
118
|
+
updated_at: string;
|
|
119
|
+
is_deleted: boolean;
|
|
120
|
+
}
|
|
121
|
+
interface Subscription {
|
|
122
|
+
id: number;
|
|
123
|
+
organization: number;
|
|
124
|
+
plan: Plan;
|
|
125
|
+
start_date: string;
|
|
126
|
+
end_date: string;
|
|
127
|
+
is_active: boolean;
|
|
128
|
+
created_at: string;
|
|
129
|
+
updated_at: string;
|
|
130
|
+
extra_modules?: Module$1[] | number[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface Module {
|
|
134
|
+
id: number;
|
|
135
|
+
code: string;
|
|
136
|
+
name: string;
|
|
137
|
+
description?: string;
|
|
138
|
+
price?: number;
|
|
139
|
+
price_monthly?: number;
|
|
140
|
+
price_yearly?: number;
|
|
141
|
+
is_active?: boolean;
|
|
142
|
+
is_deleted?: boolean;
|
|
143
|
+
deleted_at?: string | null;
|
|
144
|
+
}
|
|
145
|
+
interface Organization {
|
|
146
|
+
id: number;
|
|
147
|
+
legal_name: string;
|
|
148
|
+
trading_name?: string;
|
|
149
|
+
phone?: string;
|
|
150
|
+
email?: string;
|
|
151
|
+
address?: string;
|
|
152
|
+
owner: number;
|
|
153
|
+
active_subscription?: Subscription | null;
|
|
154
|
+
modules?: Module[];
|
|
155
|
+
created_at: string;
|
|
156
|
+
updated_at: string;
|
|
157
|
+
is_deleted: boolean;
|
|
158
|
+
}
|
|
159
|
+
interface Entity {
|
|
160
|
+
id: number;
|
|
161
|
+
organization: Organization | number;
|
|
162
|
+
legal_name: string;
|
|
163
|
+
trading_name?: string;
|
|
164
|
+
phone?: string;
|
|
165
|
+
email?: string;
|
|
166
|
+
logo?: string;
|
|
167
|
+
legal_representative_name?: string;
|
|
168
|
+
legal_representative_phone?: string;
|
|
169
|
+
legal_representative_email?: string;
|
|
170
|
+
country?: string;
|
|
171
|
+
city?: string;
|
|
172
|
+
address?: string;
|
|
173
|
+
rib?: string;
|
|
174
|
+
iban?: string;
|
|
175
|
+
bank_name?: string;
|
|
176
|
+
bank_address?: string;
|
|
177
|
+
tax_account?: string;
|
|
178
|
+
rccm?: string;
|
|
179
|
+
currency?: string;
|
|
180
|
+
centers_taxes?: string;
|
|
181
|
+
point_of_sale?: string;
|
|
182
|
+
establishment?: string;
|
|
183
|
+
fne_url?: string;
|
|
184
|
+
fne_auth_key?: string;
|
|
185
|
+
regime_taxes?: string;
|
|
186
|
+
balance_sticker_fne?: number;
|
|
187
|
+
permissions?: number[];
|
|
188
|
+
user_permissions?: string[];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
interface User$1 {
|
|
192
|
+
id: number;
|
|
193
|
+
last_login: string | null;
|
|
194
|
+
is_superuser: boolean;
|
|
195
|
+
username: string;
|
|
196
|
+
department: number | null;
|
|
197
|
+
first_name: string;
|
|
198
|
+
last_name: string;
|
|
199
|
+
email: string;
|
|
200
|
+
is_staff: boolean;
|
|
201
|
+
is_active: boolean;
|
|
202
|
+
date_joined: string;
|
|
203
|
+
profile_picture: string;
|
|
204
|
+
is_deleted: boolean;
|
|
205
|
+
deleted_at: string | null;
|
|
206
|
+
phonenumber: string | null;
|
|
207
|
+
groups: any[];
|
|
208
|
+
user_permissions: any[];
|
|
209
|
+
centers_access?: Entity[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
type FromModule$1 = 'accounting' | 'crm' | 'procurement';
|
|
213
|
+
interface Vendor {
|
|
214
|
+
id?: number;
|
|
215
|
+
legal_name: string;
|
|
216
|
+
trading_name?: string | null;
|
|
217
|
+
phone?: string | null;
|
|
218
|
+
email?: string | null;
|
|
219
|
+
logo?: string | null;
|
|
220
|
+
year_founded?: string | null;
|
|
221
|
+
activity_sector?: string | null;
|
|
222
|
+
description?: string | null;
|
|
223
|
+
accounting_account_number?: string | null;
|
|
224
|
+
account?: number | null;
|
|
225
|
+
capital?: number | null;
|
|
226
|
+
annual_turnover?: number | null;
|
|
227
|
+
payment_delay?: number | null;
|
|
228
|
+
country?: string | null;
|
|
229
|
+
city?: string | null;
|
|
230
|
+
address?: string | null;
|
|
231
|
+
legal_form?: string | null;
|
|
232
|
+
tax_regime?: string | null;
|
|
233
|
+
tax_account?: string | null;
|
|
234
|
+
rccm?: string | null;
|
|
235
|
+
legal_representative_name?: string | null;
|
|
236
|
+
legal_representative_address?: string | null;
|
|
237
|
+
legal_representative_phone?: string | null;
|
|
238
|
+
legal_representative_email?: string | null;
|
|
239
|
+
legal_representative_id_document?: string | null;
|
|
240
|
+
legal_representative_id_number?: string | null;
|
|
241
|
+
legal_representative_fonction?: string | null;
|
|
242
|
+
bank_name?: string | null;
|
|
243
|
+
bank_address?: string | null;
|
|
244
|
+
bank_email?: string | null;
|
|
245
|
+
bank_phone?: string | null;
|
|
246
|
+
iban?: string | null;
|
|
247
|
+
rib?: string | null;
|
|
248
|
+
from_module?: FromModule$1 | null;
|
|
249
|
+
vendor_number: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
interface SessionContextType {
|
|
253
|
+
isAuthenticated: boolean;
|
|
254
|
+
token: string | null;
|
|
255
|
+
setToken: (token: string | null) => void;
|
|
256
|
+
activeBusinessEntity: Entity | null;
|
|
257
|
+
setActiveBusinessEntity: (entity: Entity | null) => void;
|
|
258
|
+
loggedUser: User$1 | null;
|
|
259
|
+
login: (token: string) => void;
|
|
260
|
+
logout: () => void;
|
|
261
|
+
showAuthModal: boolean;
|
|
262
|
+
setShowAuthModal: (data: boolean) => void;
|
|
263
|
+
refreshSession: () => Promise<void>;
|
|
264
|
+
vendors: Vendor[];
|
|
265
|
+
setVendors: (vendors: Vendor[]) => void;
|
|
266
|
+
loadingVendors: boolean;
|
|
267
|
+
setLoadingVendors: (loading: boolean) => void;
|
|
268
|
+
loadVendors: () => Promise<void>;
|
|
269
|
+
}
|
|
270
|
+
declare const useSession: () => SessionContextType;
|
|
271
|
+
declare const SessionProvider: ({ children }: {
|
|
272
|
+
children: ReactNode;
|
|
273
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
interface ThemeColors {
|
|
276
|
+
primary: string;
|
|
277
|
+
primaryHover: string;
|
|
278
|
+
primaryLight: string;
|
|
279
|
+
secondary: string;
|
|
280
|
+
accent: string;
|
|
281
|
+
background: string;
|
|
282
|
+
surface: string;
|
|
283
|
+
surfaceHover: string;
|
|
284
|
+
text: {
|
|
285
|
+
primary: string;
|
|
286
|
+
secondary: string;
|
|
287
|
+
tertiary: string;
|
|
288
|
+
inverse: string;
|
|
289
|
+
};
|
|
290
|
+
border: string;
|
|
291
|
+
borderLight: string;
|
|
292
|
+
success: string;
|
|
293
|
+
successLight: string;
|
|
294
|
+
error: string;
|
|
295
|
+
errorLight: string;
|
|
296
|
+
warning: string;
|
|
297
|
+
warningLight: string;
|
|
298
|
+
info: string;
|
|
299
|
+
infoLight: string;
|
|
300
|
+
sidebar: {
|
|
301
|
+
bg: string;
|
|
302
|
+
bgHover: string;
|
|
303
|
+
text: string;
|
|
304
|
+
textHover: string;
|
|
305
|
+
border: string;
|
|
306
|
+
active: string;
|
|
307
|
+
activeBg: string;
|
|
308
|
+
};
|
|
309
|
+
card: {
|
|
310
|
+
bg: string;
|
|
311
|
+
border: string;
|
|
312
|
+
shadow: string;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
interface Theme {
|
|
316
|
+
name: string;
|
|
317
|
+
description: string;
|
|
318
|
+
colors: ThemeColors;
|
|
319
|
+
shadows: {
|
|
320
|
+
sm: string;
|
|
321
|
+
md: string;
|
|
322
|
+
lg: string;
|
|
323
|
+
xl: string;
|
|
324
|
+
};
|
|
325
|
+
transitions: {
|
|
326
|
+
fast: string;
|
|
327
|
+
normal: string;
|
|
328
|
+
slow: string;
|
|
329
|
+
};
|
|
330
|
+
borderRadius: {
|
|
331
|
+
sm: string;
|
|
332
|
+
md: string;
|
|
333
|
+
lg: string;
|
|
334
|
+
xl: string;
|
|
335
|
+
full: string;
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
declare const themes: {
|
|
339
|
+
elegant: Theme;
|
|
340
|
+
fintech: Theme;
|
|
341
|
+
minimalist: Theme;
|
|
342
|
+
neutralOdyssey: Theme;
|
|
343
|
+
};
|
|
344
|
+
declare const defaultTheme: Theme;
|
|
345
|
+
declare const getThemeCSSVariables: (theme: Theme) => {
|
|
346
|
+
'--color-primary': string;
|
|
347
|
+
'--color-primary-hover': string;
|
|
348
|
+
'--color-primary-light': string;
|
|
349
|
+
'--color-secondary': string;
|
|
350
|
+
'--color-accent': string;
|
|
351
|
+
'--color-background': string;
|
|
352
|
+
'--color-surface': string;
|
|
353
|
+
'--color-surface-hover': string;
|
|
354
|
+
'--color-text-primary': string;
|
|
355
|
+
'--color-text-secondary': string;
|
|
356
|
+
'--color-text-tertiary': string;
|
|
357
|
+
'--color-text-inverse': string;
|
|
358
|
+
'--color-border': string;
|
|
359
|
+
'--color-border-light': string;
|
|
360
|
+
'--color-success': string;
|
|
361
|
+
'--color-success-light': string;
|
|
362
|
+
'--color-error': string;
|
|
363
|
+
'--color-error-light': string;
|
|
364
|
+
'--color-warning': string;
|
|
365
|
+
'--color-warning-light': string;
|
|
366
|
+
'--color-info': string;
|
|
367
|
+
'--color-info-light': string;
|
|
368
|
+
'--shadow-sm': string;
|
|
369
|
+
'--shadow-md': string;
|
|
370
|
+
'--shadow-lg': string;
|
|
371
|
+
'--shadow-xl': string;
|
|
372
|
+
'--transition-fast': string;
|
|
373
|
+
'--transition-normal': string;
|
|
374
|
+
'--transition-slow': string;
|
|
375
|
+
'--radius-sm': string;
|
|
376
|
+
'--radius-md': string;
|
|
377
|
+
'--radius-lg': string;
|
|
378
|
+
'--radius-xl': string;
|
|
379
|
+
'--radius-full': string;
|
|
380
|
+
};
|
|
381
|
+
type ThemeType = 'elegant' | 'fintech' | 'minimalist' | 'neutralOdyssey';
|
|
382
|
+
interface ThemeContextValue {
|
|
383
|
+
theme: Theme;
|
|
384
|
+
themeType: ThemeType;
|
|
385
|
+
setTheme: (type: ThemeType) => void;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare const useTheme: () => ThemeContextValue;
|
|
389
|
+
interface ThemeProviderProps {
|
|
390
|
+
children: React$1.ReactNode;
|
|
391
|
+
}
|
|
392
|
+
declare const ThemeProvider: React$1.FC<ThemeProviderProps>;
|
|
393
|
+
|
|
394
|
+
interface Toast {
|
|
395
|
+
id: string;
|
|
396
|
+
message: string;
|
|
397
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
398
|
+
duration?: number;
|
|
399
|
+
}
|
|
400
|
+
interface ConfirmOptions {
|
|
401
|
+
title?: string;
|
|
402
|
+
message: string;
|
|
403
|
+
confirmText?: string;
|
|
404
|
+
cancelText?: string;
|
|
405
|
+
type?: 'danger' | 'warning' | 'info';
|
|
406
|
+
}
|
|
407
|
+
interface ToastContextType {
|
|
408
|
+
toasts: Toast[];
|
|
409
|
+
addToast: (toast: Omit<Toast, 'id'>) => void;
|
|
410
|
+
removeToast: (id: string) => void;
|
|
411
|
+
success: (message: string, duration?: number) => void;
|
|
412
|
+
error: (message: string, duration?: number) => void;
|
|
413
|
+
warning: (message: string, duration?: number) => void;
|
|
414
|
+
info: (message: string, duration?: number) => void;
|
|
415
|
+
confirm: (options: ConfirmOptions | string) => Promise<boolean>;
|
|
416
|
+
}
|
|
417
|
+
declare const useToast: () => ToastContextType;
|
|
418
|
+
interface ToastProviderProps {
|
|
419
|
+
children: ReactNode;
|
|
420
|
+
}
|
|
421
|
+
declare const ToastProvider: React$1.FC<ToastProviderProps>;
|
|
422
|
+
|
|
423
|
+
interface PagesProps {
|
|
424
|
+
title?: string;
|
|
425
|
+
description?: string;
|
|
426
|
+
sideAction?: React$1.ReactNode;
|
|
427
|
+
sidebar?: React$1.ReactNode;
|
|
428
|
+
tabs?: React$1.ReactNode;
|
|
429
|
+
children?: React$1.ReactNode;
|
|
430
|
+
}
|
|
431
|
+
declare const Pages: React$1.FC<PagesProps>;
|
|
432
|
+
|
|
433
|
+
interface UpdateProfileData {
|
|
434
|
+
first_name?: string;
|
|
435
|
+
last_name?: string;
|
|
436
|
+
email?: string;
|
|
437
|
+
phonenumber?: string;
|
|
438
|
+
job_title?: string;
|
|
439
|
+
department?: string;
|
|
440
|
+
}
|
|
441
|
+
interface ChangePasswordData {
|
|
442
|
+
current_password: string;
|
|
443
|
+
new_password: string;
|
|
444
|
+
confirm_password: string;
|
|
445
|
+
}
|
|
446
|
+
declare const UserServices: {
|
|
447
|
+
addUser: (data: Partial<User$1>, token: string) => Promise<unknown>;
|
|
448
|
+
getUsers: (token: string) => Promise<unknown>;
|
|
449
|
+
getUsersNotifications: () => Promise<unknown>;
|
|
450
|
+
markNotificationAsRead: (notificationId: number) => Promise<unknown>;
|
|
451
|
+
getUser: (id: number, token: string) => Promise<unknown>;
|
|
452
|
+
updateUser: (id: number, data: Partial<User$1>, token: string) => Promise<unknown>;
|
|
453
|
+
deleteUser: (id: number, token: string) => Promise<unknown>;
|
|
454
|
+
getEntityUsers: (entityId: number, token: string) => Promise<unknown>;
|
|
455
|
+
getuserEntitiesAccess: (id: number, token: string) => Promise<unknown>;
|
|
456
|
+
addUserToEntity: (entityId: number, userId: number, token: string) => Promise<unknown>;
|
|
457
|
+
updateMyProfile: (data: UpdateProfileData) => Promise<unknown>;
|
|
458
|
+
updateProfilePicture: (file: File) => Promise<unknown>;
|
|
459
|
+
deleteProfilePicture: () => Promise<unknown>;
|
|
460
|
+
changePassword: (data: ChangePasswordData) => Promise<unknown>;
|
|
461
|
+
getMyProfile: () => Promise<unknown>;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
interface SendOtpPayload {
|
|
465
|
+
email: string;
|
|
466
|
+
}
|
|
467
|
+
interface VerifyOtpPayload {
|
|
468
|
+
email: string;
|
|
469
|
+
otp: string;
|
|
470
|
+
}
|
|
471
|
+
interface CompleteRegistrationPayload {
|
|
472
|
+
email: string;
|
|
473
|
+
password: string;
|
|
474
|
+
confirmed_password: string;
|
|
475
|
+
firstname?: string;
|
|
476
|
+
lastname?: string;
|
|
477
|
+
phonenumber?: string;
|
|
478
|
+
}
|
|
479
|
+
interface LoginPayload {
|
|
480
|
+
username: string;
|
|
481
|
+
password: string;
|
|
482
|
+
}
|
|
483
|
+
declare const AuthServices: {
|
|
484
|
+
sendOtp: (payload: SendOtpPayload) => Promise<unknown>;
|
|
485
|
+
verifyOtp: (payload: VerifyOtpPayload) => Promise<unknown>;
|
|
486
|
+
completeRegistration: (payload: CompleteRegistrationPayload) => Promise<unknown>;
|
|
487
|
+
getInvitations: (token: string) => Promise<unknown>;
|
|
488
|
+
respondInvitationEmail: (payload: {
|
|
489
|
+
email: string;
|
|
490
|
+
token: string;
|
|
491
|
+
answer: string;
|
|
492
|
+
}) => Promise<unknown>;
|
|
493
|
+
change_password: (payload: {
|
|
494
|
+
token: string;
|
|
495
|
+
password: string;
|
|
496
|
+
confirmed_password: string;
|
|
497
|
+
}) => Promise<unknown>;
|
|
498
|
+
addUser: (payload: User$1) => Promise<unknown>;
|
|
499
|
+
login: (payload: LoginPayload) => Promise<unknown>;
|
|
500
|
+
getUserInformations: (token: string) => Promise<unknown>;
|
|
501
|
+
getUserInformationsByOldId: (id: number) => Promise<unknown>;
|
|
502
|
+
logout: () => Promise<unknown>;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
declare enum ApprovalStatus {
|
|
506
|
+
CANCEL = "cancel",
|
|
507
|
+
REFUSED = "refused",
|
|
508
|
+
NOT_SEND = "not-send",
|
|
509
|
+
SUGGEST_CORRECTION = "suggest-correction",
|
|
510
|
+
WAITING = "waiting",
|
|
511
|
+
APPROVED = "approved"
|
|
512
|
+
}
|
|
513
|
+
declare enum TypeAnswerApproval {
|
|
514
|
+
VERIFICATION = "verification",
|
|
515
|
+
VALIDATION = "validation"
|
|
516
|
+
}
|
|
517
|
+
interface ApprovalAnswer {
|
|
518
|
+
id?: number;
|
|
519
|
+
rank: number;
|
|
520
|
+
type_answer: TypeAnswerApproval;
|
|
521
|
+
answer: ApprovalStatus;
|
|
522
|
+
answered_at?: string | null;
|
|
523
|
+
answered_by?: User$1 | null;
|
|
524
|
+
user?: number;
|
|
525
|
+
user_detail?: User$1;
|
|
526
|
+
full_name?: string;
|
|
527
|
+
email?: string;
|
|
528
|
+
note?: string;
|
|
529
|
+
created_at?: string;
|
|
530
|
+
updated_at?: string;
|
|
531
|
+
}
|
|
532
|
+
interface ApprovalCase {
|
|
533
|
+
id?: number;
|
|
534
|
+
title?: string;
|
|
535
|
+
process?: number;
|
|
536
|
+
content_type?: number;
|
|
537
|
+
object_id?: number;
|
|
538
|
+
version?: number;
|
|
539
|
+
requested_by?: User$1;
|
|
540
|
+
requester?: User$1;
|
|
541
|
+
status: ApprovalStatus;
|
|
542
|
+
description?: string;
|
|
543
|
+
file?: string;
|
|
544
|
+
archived_object?: string;
|
|
545
|
+
html_content?: string;
|
|
546
|
+
closed: boolean;
|
|
547
|
+
closed_at?: string | null;
|
|
548
|
+
created_at?: string;
|
|
549
|
+
updated_at?: string;
|
|
550
|
+
verifications?: ApprovalAnswer[];
|
|
551
|
+
validations?: ApprovalAnswer[];
|
|
552
|
+
object_detail?: any;
|
|
553
|
+
}
|
|
554
|
+
interface ApprovalCaseCreatePayload {
|
|
555
|
+
title?: string;
|
|
556
|
+
process?: string;
|
|
557
|
+
object_id?: number;
|
|
558
|
+
status?: ApprovalStatus;
|
|
559
|
+
description?: string;
|
|
560
|
+
verifications?: Partial<ApprovalAnswer>[];
|
|
561
|
+
validations?: Partial<ApprovalAnswer>[];
|
|
562
|
+
}
|
|
563
|
+
interface ApprovalCaseUpdatePayload extends Partial<ApprovalCaseCreatePayload> {
|
|
564
|
+
id: number;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
declare const ApprovalServices: {
|
|
568
|
+
/**
|
|
569
|
+
* Créer un nouveau cas d'approbation avec vérifications et validations
|
|
570
|
+
*/
|
|
571
|
+
create: (data: ApprovalCaseCreatePayload, token: string) => Promise<{
|
|
572
|
+
success: boolean;
|
|
573
|
+
message: string;
|
|
574
|
+
data: {
|
|
575
|
+
case: ApprovalCase;
|
|
576
|
+
items: any[];
|
|
577
|
+
};
|
|
578
|
+
}>;
|
|
579
|
+
/**
|
|
580
|
+
* Obtenir tous les cas d'approbation
|
|
581
|
+
*/
|
|
582
|
+
list: (token: string) => Promise<{
|
|
583
|
+
success: boolean;
|
|
584
|
+
message: string;
|
|
585
|
+
data: ApprovalCase[];
|
|
586
|
+
}>;
|
|
587
|
+
/**
|
|
588
|
+
* Obtenir les détails d'un cas d'approbation par process et object_id
|
|
589
|
+
*/
|
|
590
|
+
getDetails: (process: string, object_id: number, token: string) => Promise<{
|
|
591
|
+
success: boolean;
|
|
592
|
+
message: string;
|
|
593
|
+
data: ApprovalCase;
|
|
594
|
+
}>;
|
|
595
|
+
getAnswerDetails: (link_token: string) => Promise<{
|
|
596
|
+
success: boolean;
|
|
597
|
+
message: string;
|
|
598
|
+
data: {
|
|
599
|
+
case: ApprovalCase;
|
|
600
|
+
answer_id: number;
|
|
601
|
+
};
|
|
602
|
+
}>;
|
|
603
|
+
/**
|
|
604
|
+
* Obtenir l'historique des versions d'un cas d'approbation
|
|
605
|
+
*/
|
|
606
|
+
getHistory: (process: string, object_id: number, token: string) => Promise<{
|
|
607
|
+
success: boolean;
|
|
608
|
+
message: string;
|
|
609
|
+
data: ApprovalCase[];
|
|
610
|
+
}>;
|
|
611
|
+
/**
|
|
612
|
+
* Mettre à jour un cas d'approbation
|
|
613
|
+
*/
|
|
614
|
+
update: (id: number, data: ApprovalCaseUpdatePayload, token: string) => Promise<{
|
|
615
|
+
success: boolean;
|
|
616
|
+
message: string;
|
|
617
|
+
data: {
|
|
618
|
+
case: ApprovalCase;
|
|
619
|
+
items: any[];
|
|
620
|
+
};
|
|
621
|
+
}>;
|
|
622
|
+
/**
|
|
623
|
+
* Démarrer le processus d'approbation d'un cas
|
|
624
|
+
*/
|
|
625
|
+
start: (id: number, token: string) => Promise<{
|
|
626
|
+
success: boolean;
|
|
627
|
+
message: string;
|
|
628
|
+
data: {};
|
|
629
|
+
}>;
|
|
630
|
+
/**
|
|
631
|
+
* Annuler un cas d'approbation
|
|
632
|
+
*/
|
|
633
|
+
cancel: (id: number, token: string) => Promise<{
|
|
634
|
+
success: boolean;
|
|
635
|
+
message: string;
|
|
636
|
+
data: {};
|
|
637
|
+
}>;
|
|
638
|
+
/**
|
|
639
|
+
* Redémarrer un cas d'approbation (nouvelle version)
|
|
640
|
+
*/
|
|
641
|
+
restart: (id: number, token: string) => Promise<{
|
|
642
|
+
success: boolean;
|
|
643
|
+
message: string;
|
|
644
|
+
data: {};
|
|
645
|
+
}>;
|
|
646
|
+
/**
|
|
647
|
+
* Supprimer un cas d'approbation
|
|
648
|
+
*/
|
|
649
|
+
delete: (id: number, token: string) => Promise<{
|
|
650
|
+
success: boolean;
|
|
651
|
+
message: string;
|
|
652
|
+
}>;
|
|
653
|
+
/**
|
|
654
|
+
* Approuver une réponse d'approbation
|
|
655
|
+
*/
|
|
656
|
+
approve: (answerId: number, note?: string) => Promise<{
|
|
657
|
+
success: boolean;
|
|
658
|
+
message: string;
|
|
659
|
+
data: {};
|
|
660
|
+
}>;
|
|
661
|
+
/**
|
|
662
|
+
* Rejeter une réponse d'approbation
|
|
663
|
+
*/
|
|
664
|
+
reject: (answerId: number, note?: string) => Promise<{
|
|
665
|
+
success: boolean;
|
|
666
|
+
message: string;
|
|
667
|
+
data: {};
|
|
668
|
+
}>;
|
|
669
|
+
/**
|
|
670
|
+
* Suggérer une correction pour une réponse d'approbation
|
|
671
|
+
*/
|
|
672
|
+
suggestChange: (answerId: number, note?: string) => Promise<{
|
|
673
|
+
success: boolean;
|
|
674
|
+
message: string;
|
|
675
|
+
data: {};
|
|
676
|
+
}>;
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
type UnitOccupancyStatus = 'occupiable' | 'non_occupiable' | 'in_negociated' | 'indeterminate';
|
|
680
|
+
type UnitStatus = 'long rental' | 'short rental' | 'other' | 'draft' | 'active';
|
|
681
|
+
type UnitDestination = 'Nl' | 'L';
|
|
682
|
+
type UnitArchived = 'archived' | 'not_archived';
|
|
683
|
+
interface Unit extends TrackableModel {
|
|
684
|
+
name?: string | null;
|
|
685
|
+
code?: string | null;
|
|
686
|
+
location?: string | null;
|
|
687
|
+
object_name?: string | null;
|
|
688
|
+
unit_description?: string | null;
|
|
689
|
+
unit_comment?: string | null;
|
|
690
|
+
area_gla?: number | null;
|
|
691
|
+
area_gfa?: number | null;
|
|
692
|
+
area_gfa_mezz?: number | null;
|
|
693
|
+
area_m_2?: number | null;
|
|
694
|
+
area_m_2_mezz?: number | null;
|
|
695
|
+
height?: number | null;
|
|
696
|
+
width?: number | null;
|
|
697
|
+
length?: number | null;
|
|
698
|
+
unit_destination?: UnitDestination;
|
|
699
|
+
no_leasable_occupancy_status?: string;
|
|
700
|
+
area_category?: string | null;
|
|
701
|
+
detail_cat?: string | null;
|
|
702
|
+
zoning?: number | null;
|
|
703
|
+
drawing?: string | null;
|
|
704
|
+
archived?: UnitArchived;
|
|
705
|
+
unit_start_date?: string | null;
|
|
706
|
+
unit_end_date?: string | null;
|
|
707
|
+
occupancy_status?: UnitOccupancyStatus;
|
|
708
|
+
status?: UnitStatus;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
declare const UnitServices: {
|
|
712
|
+
create: (data: Partial<Unit>) => Promise<unknown>;
|
|
713
|
+
get: (id: number) => Promise<unknown>;
|
|
714
|
+
list: (params?: any) => Promise<unknown>;
|
|
715
|
+
update: (id: number, data: Partial<Unit>) => Promise<unknown>;
|
|
716
|
+
delete: (id: number) => Promise<unknown>;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
interface VendorListResponse {
|
|
720
|
+
data: Vendor[];
|
|
721
|
+
paginate: {
|
|
722
|
+
total_pages: number;
|
|
723
|
+
current_page: number;
|
|
724
|
+
count: number;
|
|
725
|
+
next: string | null;
|
|
726
|
+
previous: string | null;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
declare const VendorServices: {
|
|
730
|
+
create: (data: Partial<Vendor>) => Promise<unknown>;
|
|
731
|
+
get: (id: number) => Promise<unknown>;
|
|
732
|
+
list: (params?: any) => Promise<unknown>;
|
|
733
|
+
search: (params?: Record<string, any>) => Promise<VendorListResponse>;
|
|
734
|
+
update: (id: number, data: Partial<Vendor>) => Promise<unknown>;
|
|
735
|
+
delete: (id: number) => Promise<unknown>;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
type FromModule = 'accounting' | 'crm' | 'procurement';
|
|
739
|
+
type TemplateFNE = 'B2B' | 'B2F' | 'B2G' | 'B2C';
|
|
740
|
+
interface Client extends TrackableModel, BusinessEntityAbstract {
|
|
741
|
+
client_number?: string;
|
|
742
|
+
from_module?: FromModule;
|
|
743
|
+
legal_name?: string;
|
|
744
|
+
trading_name?: string | null;
|
|
745
|
+
phone?: string | null;
|
|
746
|
+
email?: string | null;
|
|
747
|
+
logo?: string | null;
|
|
748
|
+
year_founded?: string | null;
|
|
749
|
+
activity_sector?: string | null;
|
|
750
|
+
description?: string | null;
|
|
751
|
+
country?: string | null;
|
|
752
|
+
city?: string | null;
|
|
753
|
+
address?: string | null;
|
|
754
|
+
accounting_account_number?: string | null;
|
|
755
|
+
account?: number | null;
|
|
756
|
+
capital?: number | null;
|
|
757
|
+
annual_turnover?: number | null;
|
|
758
|
+
payment_delay?: number;
|
|
759
|
+
legal_form?: string | null;
|
|
760
|
+
tax_regime?: string | null;
|
|
761
|
+
tax_account?: string | null;
|
|
762
|
+
rccm?: string | null;
|
|
763
|
+
legal_representative_name?: string | null;
|
|
764
|
+
legal_representative_email?: string | null;
|
|
765
|
+
legal_representative_phone?: string | null;
|
|
766
|
+
legal_representative_address?: string | null;
|
|
767
|
+
legal_representative_position?: string | null;
|
|
768
|
+
legal_representative_id_card?: string | null;
|
|
769
|
+
bank_name?: string | null;
|
|
770
|
+
bank_address?: string | null;
|
|
771
|
+
bank_email?: string | null;
|
|
772
|
+
bank_phone?: string | null;
|
|
773
|
+
iban?: string | null;
|
|
774
|
+
rib?: string | null;
|
|
775
|
+
template_fne?: TemplateFNE;
|
|
776
|
+
project_description?: string | null;
|
|
777
|
+
business_provider?: string | null;
|
|
778
|
+
target_clients?: string | null;
|
|
779
|
+
}
|
|
780
|
+
declare const TEMPLATE_FNE_CHOICES: {
|
|
781
|
+
value: string;
|
|
782
|
+
label: string;
|
|
783
|
+
}[];
|
|
784
|
+
declare const FROM_MODULE_CHOICES: {
|
|
785
|
+
value: string;
|
|
786
|
+
label: string;
|
|
787
|
+
}[];
|
|
788
|
+
|
|
789
|
+
interface ClientListResponse {
|
|
790
|
+
data: Client[];
|
|
791
|
+
paginate: {
|
|
792
|
+
total_pages: number;
|
|
793
|
+
current_page: number;
|
|
794
|
+
count: number;
|
|
795
|
+
next: string | null;
|
|
796
|
+
previous: string | null;
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
declare const ClientServices: {
|
|
800
|
+
create: (data: Partial<Client>) => Promise<unknown>;
|
|
801
|
+
get: (id: number) => Promise<Client>;
|
|
802
|
+
list: (params?: any) => Promise<unknown>;
|
|
803
|
+
search: (params?: Record<string, any>) => Promise<ClientListResponse>;
|
|
804
|
+
update: (id: number, data: Partial<Client>) => Promise<unknown>;
|
|
805
|
+
delete: (id: number) => Promise<unknown>;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
type AccountType = 'E' | 'V' | 'C' | 'TO' | 'D' | 'OR' | 'SC' | 'NSC' | 'FI' | 'FE' | 'NOI' | 'NOE' | 'B' | 'CC' | 'T' | 'TI' | 'R';
|
|
809
|
+
type BalanceType = '(Cr)' | 'Dr' | '(Cr) - Dr' | 'Cr';
|
|
810
|
+
interface Account {
|
|
811
|
+
id?: number;
|
|
812
|
+
account_number: string;
|
|
813
|
+
alias_account_number?: string;
|
|
814
|
+
external_account_number?: string;
|
|
815
|
+
name: string;
|
|
816
|
+
french_description?: string;
|
|
817
|
+
english_description?: string;
|
|
818
|
+
level: number;
|
|
819
|
+
parent?: number | null;
|
|
820
|
+
balance: BalanceType;
|
|
821
|
+
account_type: AccountType;
|
|
822
|
+
is_active: boolean;
|
|
823
|
+
business_entity?: number;
|
|
824
|
+
created_at?: string;
|
|
825
|
+
updated_at?: string;
|
|
826
|
+
children?: Account[];
|
|
827
|
+
}
|
|
828
|
+
declare const ACCOUNT_TYPE_LABELS: Record<AccountType, string>;
|
|
829
|
+
declare const BALANCE_TYPE_LABELS: Record<BalanceType, string>;
|
|
830
|
+
declare const SYSCOHADA_CLASSES: {
|
|
831
|
+
code: string;
|
|
832
|
+
name: string;
|
|
833
|
+
color: string;
|
|
834
|
+
}[];
|
|
835
|
+
|
|
836
|
+
interface AccountListResponse {
|
|
837
|
+
data: Account[];
|
|
838
|
+
paginate: {
|
|
839
|
+
total_pages: number;
|
|
840
|
+
current_page: number;
|
|
841
|
+
count: number;
|
|
842
|
+
next: string | null;
|
|
843
|
+
previous: string | null;
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
declare const AccountServices: {
|
|
847
|
+
create: (data: Partial<Account>) => Promise<Account>;
|
|
848
|
+
get: (id: number) => Promise<Account>;
|
|
849
|
+
list: (params?: Record<string, any>) => Promise<AccountListResponse>;
|
|
850
|
+
update: (id: number, data: Partial<Account>) => Promise<Account>;
|
|
851
|
+
delete: (id: number) => Promise<unknown>;
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
interface Tab {
|
|
855
|
+
id: string;
|
|
856
|
+
label: string;
|
|
857
|
+
icon?: LucideIcon;
|
|
858
|
+
badge?: number | string;
|
|
859
|
+
}
|
|
860
|
+
interface TabsProps {
|
|
861
|
+
tabs: Tab[];
|
|
862
|
+
activeTab: string;
|
|
863
|
+
onChange: (tabId: string) => void;
|
|
864
|
+
variant?: 'filled' | 'outline' | 'underline';
|
|
865
|
+
className?: string;
|
|
866
|
+
}
|
|
867
|
+
declare const Tabs: React$1.FC<TabsProps>;
|
|
868
|
+
|
|
869
|
+
type BadgeVariant = 'default' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'purple' | 'blue' | 'green';
|
|
870
|
+
interface BadgeProps {
|
|
871
|
+
children: React$1.ReactNode;
|
|
872
|
+
variant?: BadgeVariant;
|
|
873
|
+
className?: string;
|
|
874
|
+
}
|
|
875
|
+
declare const Badge: ({ children, variant, className }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
876
|
+
|
|
877
|
+
type ImportField = {
|
|
878
|
+
value: string;
|
|
879
|
+
label: string;
|
|
880
|
+
};
|
|
881
|
+
type ImportFieldsConfig = {
|
|
882
|
+
required: ImportField[];
|
|
883
|
+
optional: ImportField[];
|
|
884
|
+
};
|
|
885
|
+
type FDrawerColumn = {
|
|
886
|
+
key: string;
|
|
887
|
+
label: string;
|
|
888
|
+
type: 'text' | 'number' | 'date' | 'boolean' | 'custom';
|
|
889
|
+
filterable?: boolean;
|
|
890
|
+
filter_options?: {
|
|
891
|
+
value: string;
|
|
892
|
+
label: string;
|
|
893
|
+
}[];
|
|
894
|
+
sortable?: boolean;
|
|
895
|
+
search_name: string;
|
|
896
|
+
formule?: (item: any) => any | null;
|
|
897
|
+
};
|
|
898
|
+
type FDrawerLineAction = {
|
|
899
|
+
label: string;
|
|
900
|
+
permission: string;
|
|
901
|
+
navigate?: string;
|
|
902
|
+
onclick?: (item: any) => any;
|
|
903
|
+
};
|
|
904
|
+
type ViewMode$1 = 'table' | 'grid';
|
|
905
|
+
type FDrawerToolbarAction = {
|
|
906
|
+
label: string;
|
|
907
|
+
icon?: React$1.ReactNode;
|
|
908
|
+
onClick: () => void;
|
|
909
|
+
variant?: 'full' | 'outline' | 'text';
|
|
910
|
+
};
|
|
911
|
+
interface FDrawerProps {
|
|
912
|
+
children?: React$1.ReactNode;
|
|
913
|
+
apiEndpoint: string;
|
|
914
|
+
columns: FDrawerColumn[];
|
|
915
|
+
actions: FDrawerLineAction[];
|
|
916
|
+
ordering: string;
|
|
917
|
+
toggle?: boolean;
|
|
918
|
+
importEndpoint?: string;
|
|
919
|
+
importFields?: ImportFieldsConfig;
|
|
920
|
+
onBulkDelete?: (ids: number[]) => Promise<void>;
|
|
921
|
+
onDuplicate?: (item: any) => Promise<void>;
|
|
922
|
+
title?: string;
|
|
923
|
+
gridRenderer?: (item: any) => React$1.ReactNode;
|
|
924
|
+
defaultView?: ViewMode$1;
|
|
925
|
+
toolbarActions?: FDrawerToolbarAction[];
|
|
926
|
+
}
|
|
927
|
+
declare const FDrawer: React$1.FC<FDrawerProps>;
|
|
928
|
+
|
|
929
|
+
interface FormVendorProps {
|
|
930
|
+
isOpen: boolean;
|
|
931
|
+
onClose: () => void;
|
|
932
|
+
object: Vendor | null;
|
|
933
|
+
refresh: () => void;
|
|
934
|
+
from?: FromModule$1;
|
|
935
|
+
}
|
|
936
|
+
declare const FormVendor: React$1.FC<FormVendorProps>;
|
|
937
|
+
declare const MinimalVendorForm: React$1.FC<FormVendorProps>;
|
|
938
|
+
|
|
939
|
+
interface FormClientProps {
|
|
940
|
+
isOpen: boolean;
|
|
941
|
+
onClose: () => void;
|
|
942
|
+
object: Client | null;
|
|
943
|
+
refresh: () => void;
|
|
944
|
+
}
|
|
945
|
+
declare const FormClient: React$1.FC<FormClientProps>;
|
|
946
|
+
|
|
947
|
+
interface ApprovalWorkflowProps {
|
|
948
|
+
process: string;
|
|
949
|
+
object_id: number;
|
|
950
|
+
title?: string;
|
|
951
|
+
readOnly?: boolean;
|
|
952
|
+
CustomBtn?: React$1.ComponentType<{
|
|
953
|
+
onClick?: () => void;
|
|
954
|
+
}>;
|
|
955
|
+
}
|
|
956
|
+
declare const ApprovalWorkflow: React$1.FC<ApprovalWorkflowProps>;
|
|
957
|
+
|
|
958
|
+
interface ApprovalAnswerModalProps {
|
|
959
|
+
answer_id: number;
|
|
960
|
+
link_token?: string;
|
|
961
|
+
object_detail: ApprovalCase;
|
|
962
|
+
}
|
|
963
|
+
declare const ApprovalAnswerModal: React$1.FC<ApprovalAnswerModalProps>;
|
|
964
|
+
declare const ApprovalAnswerPage: React$1.FC;
|
|
965
|
+
declare const ApprovalPreviewAnswer: React$1.FC<{
|
|
966
|
+
loadCase: () => void;
|
|
967
|
+
answerId: number | null;
|
|
968
|
+
caseData: ApprovalCase | null;
|
|
969
|
+
}>;
|
|
970
|
+
|
|
971
|
+
declare const API_URL: string;
|
|
972
|
+
declare class FetchApi {
|
|
973
|
+
static post<T>(url: string, payload?: any, token?: string): Promise<T>;
|
|
974
|
+
static get<T>(url: string, token?: string): Promise<T>;
|
|
975
|
+
static put<T>(url: string, payload?: any, token?: string): Promise<T>;
|
|
976
|
+
static delete<T>(url: string, token?: string): Promise<T>;
|
|
977
|
+
static uploadFile<T>(url: string, formData: FormData, token?: string): Promise<T>;
|
|
978
|
+
static patch<T>(url: string, payload?: any, token?: string): Promise<T>;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
type AlertVariant = 'danger' | 'warning' | 'info' | 'success';
|
|
982
|
+
interface AlertProps {
|
|
983
|
+
title: string;
|
|
984
|
+
description?: string;
|
|
985
|
+
variant?: AlertVariant;
|
|
986
|
+
open: boolean;
|
|
987
|
+
onConfirm: () => void;
|
|
988
|
+
onCancel: () => void;
|
|
989
|
+
confirmText?: string;
|
|
990
|
+
cancelText?: string;
|
|
991
|
+
confirmButtonVariant?: 'danger' | 'primary' | 'success';
|
|
992
|
+
}
|
|
993
|
+
declare const Alert: React$1.FC<AlertProps>;
|
|
994
|
+
|
|
995
|
+
interface AlertOptions {
|
|
996
|
+
title: string;
|
|
997
|
+
description?: string;
|
|
998
|
+
variant?: AlertVariant;
|
|
999
|
+
confirmText?: string;
|
|
1000
|
+
cancelText?: string;
|
|
1001
|
+
confirmButtonVariant?: 'danger' | 'primary' | 'success';
|
|
1002
|
+
}
|
|
1003
|
+
interface AlertContextType {
|
|
1004
|
+
showConfirmation: (options: AlertOptions) => Promise<boolean>;
|
|
1005
|
+
showAlert: (title: string, confirmText?: string, cancelText?: string, description?: string, variant?: AlertVariant) => Promise<boolean>;
|
|
1006
|
+
}
|
|
1007
|
+
declare const AlertProvider: React$1.FC<{
|
|
1008
|
+
children: ReactNode;
|
|
1009
|
+
}>;
|
|
1010
|
+
declare const useAlert: () => AlertContextType;
|
|
1011
|
+
|
|
1012
|
+
declare const usePermissions: () => {
|
|
1013
|
+
hasPermission: (permissionCode: string) => boolean;
|
|
1014
|
+
hasAnyPermission: (permissionCodes: string[]) => boolean;
|
|
1015
|
+
hasAllPermissions: (permissionCodes: string[]) => boolean;
|
|
1016
|
+
isSuperuser: boolean;
|
|
1017
|
+
permissions: string[];
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
interface SearchableSelectOption {
|
|
1021
|
+
value: string | number;
|
|
1022
|
+
label: string;
|
|
1023
|
+
object?: any;
|
|
1024
|
+
content?: React$1.ReactNode;
|
|
1025
|
+
image?: string;
|
|
1026
|
+
}
|
|
1027
|
+
interface SearchableSelectProps {
|
|
1028
|
+
options: SearchableSelectOption[];
|
|
1029
|
+
value?: string | number;
|
|
1030
|
+
placeholder?: string;
|
|
1031
|
+
searchPlaceholder?: string;
|
|
1032
|
+
onSelect: (option: SearchableSelectOption) => void;
|
|
1033
|
+
onRemove?: () => void;
|
|
1034
|
+
disabled?: boolean;
|
|
1035
|
+
allowClear?: boolean;
|
|
1036
|
+
filterFunction?: (option: SearchableSelectOption, searchTerm: string) => boolean;
|
|
1037
|
+
addElement?: () => void;
|
|
1038
|
+
refresh?: () => void;
|
|
1039
|
+
}
|
|
1040
|
+
declare const SearchableSelect: React$1.FC<SearchableSelectProps>;
|
|
1041
|
+
|
|
1042
|
+
interface SelectProps$1 {
|
|
1043
|
+
value?: any;
|
|
1044
|
+
onSelect: (option: SearchableSelectOption) => void;
|
|
1045
|
+
allowClear?: boolean;
|
|
1046
|
+
onRemove?: () => void;
|
|
1047
|
+
label?: string;
|
|
1048
|
+
}
|
|
1049
|
+
declare const SelectVendor: React.FC<SelectProps$1>;
|
|
1050
|
+
declare const SelectUser: React.FC<SelectProps$1>;
|
|
1051
|
+
declare const SelectDepartment: React.FC<SelectProps$1>;
|
|
1052
|
+
declare const SelectCostCenter: React.FC<SelectProps$1>;
|
|
1053
|
+
declare const SelectUnit: React.FC<SelectProps$1>;
|
|
1054
|
+
interface SelectAccountProps extends SelectProps$1 {
|
|
1055
|
+
filterClass?: string;
|
|
1056
|
+
filterType?: string;
|
|
1057
|
+
showInactive?: boolean;
|
|
1058
|
+
label?: string;
|
|
1059
|
+
}
|
|
1060
|
+
declare const SelectAccount: React.FC<SelectAccountProps>;
|
|
1061
|
+
declare const SelectClient: React.FC<SelectProps$1>;
|
|
1062
|
+
|
|
1063
|
+
interface SelectProps {
|
|
1064
|
+
value?: any;
|
|
1065
|
+
onSelect: (option: SearchableSelectOption) => void;
|
|
1066
|
+
}
|
|
1067
|
+
interface ChoiceSelectProps extends SelectProps {
|
|
1068
|
+
disabled?: boolean;
|
|
1069
|
+
language?: 'fr' | 'en' | 'default';
|
|
1070
|
+
}
|
|
1071
|
+
interface TaxSelectProps extends ChoiceSelectProps {
|
|
1072
|
+
handleChange?: (value: any) => void;
|
|
1073
|
+
}
|
|
1074
|
+
declare const CHOICES: {
|
|
1075
|
+
INVOICE_TYPES: {
|
|
1076
|
+
value: string;
|
|
1077
|
+
label: {
|
|
1078
|
+
fr: string;
|
|
1079
|
+
en: string;
|
|
1080
|
+
default: string;
|
|
1081
|
+
};
|
|
1082
|
+
}[];
|
|
1083
|
+
PAYMENT_METHODS: {
|
|
1084
|
+
value: string;
|
|
1085
|
+
label: {
|
|
1086
|
+
fr: string;
|
|
1087
|
+
en: string;
|
|
1088
|
+
default: string;
|
|
1089
|
+
};
|
|
1090
|
+
}[];
|
|
1091
|
+
TEMPLATES: {
|
|
1092
|
+
value: string;
|
|
1093
|
+
label: {
|
|
1094
|
+
fr: string;
|
|
1095
|
+
en: string;
|
|
1096
|
+
default: string;
|
|
1097
|
+
};
|
|
1098
|
+
}[];
|
|
1099
|
+
FOREIGN_CURRENCIES: {
|
|
1100
|
+
value: string;
|
|
1101
|
+
label: {
|
|
1102
|
+
fr: string;
|
|
1103
|
+
en: string;
|
|
1104
|
+
default: string;
|
|
1105
|
+
};
|
|
1106
|
+
}[];
|
|
1107
|
+
TAXES: {
|
|
1108
|
+
value: string;
|
|
1109
|
+
label: {
|
|
1110
|
+
fr: string;
|
|
1111
|
+
en: string;
|
|
1112
|
+
default: string;
|
|
1113
|
+
};
|
|
1114
|
+
}[];
|
|
1115
|
+
LEGAL_FORMS: {
|
|
1116
|
+
value: string;
|
|
1117
|
+
label: {
|
|
1118
|
+
fr: string;
|
|
1119
|
+
en: string;
|
|
1120
|
+
default: string;
|
|
1121
|
+
};
|
|
1122
|
+
}[];
|
|
1123
|
+
COUNTRIES: {
|
|
1124
|
+
value: string;
|
|
1125
|
+
label: {
|
|
1126
|
+
fr: string;
|
|
1127
|
+
en: string;
|
|
1128
|
+
default: string;
|
|
1129
|
+
};
|
|
1130
|
+
}[];
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
declare const InvoiceTypeSelector: React$1.FC<ChoiceSelectProps>;
|
|
1134
|
+
declare const PaymentMethodSelector: React$1.FC<ChoiceSelectProps>;
|
|
1135
|
+
declare const TemplateFNESelector: React$1.FC<ChoiceSelectProps>;
|
|
1136
|
+
declare const ForeignCurrencySelector: React$1.FC<ChoiceSelectProps>;
|
|
1137
|
+
declare const TaxSelector: React$1.FC<TaxSelectProps>;
|
|
1138
|
+
declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
|
|
1139
|
+
declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
|
|
1140
|
+
|
|
1141
|
+
interface FileItem {
|
|
1142
|
+
id: string;
|
|
1143
|
+
name: string;
|
|
1144
|
+
type: 'file' | 'folder';
|
|
1145
|
+
mimeType?: string;
|
|
1146
|
+
size?: number;
|
|
1147
|
+
path: string;
|
|
1148
|
+
parentId?: string | null;
|
|
1149
|
+
children?: FileItem[];
|
|
1150
|
+
createdAt?: Date | string;
|
|
1151
|
+
updatedAt?: Date | string;
|
|
1152
|
+
createdBy?: string;
|
|
1153
|
+
updatedBy?: string;
|
|
1154
|
+
url?: string;
|
|
1155
|
+
metadata?: Record<string, unknown>;
|
|
1156
|
+
}
|
|
1157
|
+
type ViewMode = 'grid' | 'list';
|
|
1158
|
+
interface FileManagerProps {
|
|
1159
|
+
data: FileItem[];
|
|
1160
|
+
rootName?: string;
|
|
1161
|
+
/** ID du dossier racine réel (code backend, ex: FO000001). Si fourni, utilisé à la place de '__root__' */
|
|
1162
|
+
rootFolderId?: string;
|
|
1163
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
1164
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
1165
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
1166
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
1167
|
+
onDownload?: (item: FileItem) => void;
|
|
1168
|
+
onSelect?: (items: FileItem[]) => void;
|
|
1169
|
+
onOpen?: (item: FileItem) => void;
|
|
1170
|
+
/** Callback pour rafraîchir les données */
|
|
1171
|
+
onRefresh?: () => Promise<void>;
|
|
1172
|
+
viewMode?: ViewMode;
|
|
1173
|
+
allowMultiSelect?: boolean;
|
|
1174
|
+
allowUpload?: boolean;
|
|
1175
|
+
allowCreateFolder?: boolean;
|
|
1176
|
+
allowRename?: boolean;
|
|
1177
|
+
allowDelete?: boolean;
|
|
1178
|
+
allowDownload?: boolean;
|
|
1179
|
+
acceptedFileTypes?: string[];
|
|
1180
|
+
maxFileSize?: number;
|
|
1181
|
+
className?: string;
|
|
1182
|
+
texts?: FileManagerTexts;
|
|
1183
|
+
}
|
|
1184
|
+
interface FileManagerTexts {
|
|
1185
|
+
createFolder?: string;
|
|
1186
|
+
uploadFiles?: string;
|
|
1187
|
+
rename?: string;
|
|
1188
|
+
delete?: string;
|
|
1189
|
+
download?: string;
|
|
1190
|
+
open?: string;
|
|
1191
|
+
deselectAll?: string;
|
|
1192
|
+
newFolderName?: string;
|
|
1193
|
+
confirmDelete?: string;
|
|
1194
|
+
noFiles?: string;
|
|
1195
|
+
dropFilesHere?: string;
|
|
1196
|
+
cancel?: string;
|
|
1197
|
+
confirm?: string;
|
|
1198
|
+
refresh?: string;
|
|
1199
|
+
}
|
|
1200
|
+
interface ContextMenuPosition {
|
|
1201
|
+
x: number;
|
|
1202
|
+
y: number;
|
|
1203
|
+
}
|
|
1204
|
+
interface ContextMenuAction {
|
|
1205
|
+
label: string;
|
|
1206
|
+
icon?: ReactNode;
|
|
1207
|
+
onClick: () => void;
|
|
1208
|
+
disabled?: boolean;
|
|
1209
|
+
danger?: boolean;
|
|
1210
|
+
}
|
|
1211
|
+
interface FileManagerContextValue {
|
|
1212
|
+
data: FileItem[];
|
|
1213
|
+
currentFolder: FileItem | null;
|
|
1214
|
+
currentFolderContents: FileItem[];
|
|
1215
|
+
pathHistory: FileItem[];
|
|
1216
|
+
selectedItems: FileItem[];
|
|
1217
|
+
viewMode: ViewMode;
|
|
1218
|
+
/** ID du dossier racine (code backend ou '__root__') */
|
|
1219
|
+
rootFolderId: string;
|
|
1220
|
+
contextMenu: {
|
|
1221
|
+
visible: boolean;
|
|
1222
|
+
position: ContextMenuPosition;
|
|
1223
|
+
item: FileItem | null;
|
|
1224
|
+
};
|
|
1225
|
+
renamingItem: FileItem | null;
|
|
1226
|
+
navigateToFolder: (folder: FileItem | null) => void;
|
|
1227
|
+
navigateBack: () => void;
|
|
1228
|
+
navigateToPath: (index: number) => void;
|
|
1229
|
+
selectItem: (item: FileItem, multiSelect?: boolean) => void;
|
|
1230
|
+
deselectAll: () => void;
|
|
1231
|
+
setViewMode: (mode: ViewMode) => void;
|
|
1232
|
+
showContextMenu: (item: FileItem, position: ContextMenuPosition) => void;
|
|
1233
|
+
hideContextMenu: () => void;
|
|
1234
|
+
startRenaming: (item: FileItem) => void;
|
|
1235
|
+
stopRenaming: () => void;
|
|
1236
|
+
onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
1237
|
+
onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
1238
|
+
onRename?: (item: FileItem, newName: string) => Promise<void>;
|
|
1239
|
+
onDelete?: (item: FileItem) => Promise<void>;
|
|
1240
|
+
onDownload?: (item: FileItem) => void;
|
|
1241
|
+
onOpen?: (item: FileItem) => void;
|
|
1242
|
+
onRefresh?: () => Promise<void>;
|
|
1243
|
+
allowUpload: boolean;
|
|
1244
|
+
allowCreateFolder: boolean;
|
|
1245
|
+
allowRename: boolean;
|
|
1246
|
+
allowDelete: boolean;
|
|
1247
|
+
allowDownload: boolean;
|
|
1248
|
+
allowMultiSelect: boolean;
|
|
1249
|
+
texts: Required<FileManagerTexts>;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Types d'entités supportées par la GED.
|
|
1253
|
+
*
|
|
1254
|
+
* Chaque type correspond à un modèle Django backend :
|
|
1255
|
+
* - CLIENT → accounting.models.Client
|
|
1256
|
+
* - VENDOR → accounting.models.Vendor
|
|
1257
|
+
* - RFQ → procurement.models.RFQ
|
|
1258
|
+
* - DEPT → core.models.Departments
|
|
1259
|
+
* - PROJECT → core.models.Project
|
|
1260
|
+
*
|
|
1261
|
+
* POUR AJOUTER UN NOUVEAU TYPE :
|
|
1262
|
+
* 1. Ajouter le type ici
|
|
1263
|
+
* 2. Mettre à jour ENTITY_MODEL_MAP dans fileManagerApi.ts
|
|
1264
|
+
* 3. Mettre à jour getRootName dans EntityFileManager.tsx
|
|
1265
|
+
*/
|
|
1266
|
+
type EntityType = 'CLIENT' | 'VENDOR' | 'RFQ' | 'DEPT' | 'PROJECT';
|
|
1267
|
+
/**
|
|
1268
|
+
* Structure d'un dossier retourné par l'API backend.
|
|
1269
|
+
* Correspond au FolderTreeSerializer Django.
|
|
1270
|
+
*/
|
|
1271
|
+
interface BackendFolder {
|
|
1272
|
+
id: number;
|
|
1273
|
+
code: string;
|
|
1274
|
+
name: string;
|
|
1275
|
+
folder_type: string;
|
|
1276
|
+
folder_type_display: string;
|
|
1277
|
+
category_type?: string;
|
|
1278
|
+
is_system_folder: boolean;
|
|
1279
|
+
file_count: number;
|
|
1280
|
+
total_size?: number;
|
|
1281
|
+
children?: BackendFolder[];
|
|
1282
|
+
files?: BackendFile[];
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Structure d'un fichier retourné par l'API backend.
|
|
1286
|
+
* Correspond au FileListSerializer Django.
|
|
1287
|
+
*/
|
|
1288
|
+
interface BackendFile {
|
|
1289
|
+
id: number;
|
|
1290
|
+
code: string;
|
|
1291
|
+
name: string;
|
|
1292
|
+
file_url: string;
|
|
1293
|
+
size: number;
|
|
1294
|
+
mime_type: string;
|
|
1295
|
+
extension: string;
|
|
1296
|
+
folder: number;
|
|
1297
|
+
folder_name?: string;
|
|
1298
|
+
created_at: string;
|
|
1299
|
+
updated_at?: string;
|
|
1300
|
+
created_by?: string;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Props pour le composant EntityFileManager.
|
|
1304
|
+
*
|
|
1305
|
+
* Ce composant est un wrapper qui intègre FileManager avec l'API backend GED.
|
|
1306
|
+
* Il charge automatiquement les dossiers de l'entité et gère les opérations CRUD.
|
|
1307
|
+
*
|
|
1308
|
+
* EXEMPLE D'UTILISATION :
|
|
1309
|
+
* ```tsx
|
|
1310
|
+
* <EntityFileManager
|
|
1311
|
+
* entityType="VENDOR"
|
|
1312
|
+
* entityId={vendor.id}
|
|
1313
|
+
* businessEntityId={businessEntity.id}
|
|
1314
|
+
* onFileSelect={(files) => console.log('Sélection:', files)}
|
|
1315
|
+
* />
|
|
1316
|
+
* ```
|
|
1317
|
+
*/
|
|
1318
|
+
interface EntityFileManagerProps {
|
|
1319
|
+
/** Type d'entité (CLIENT, VENDOR, RFQ, DEPT, PROJECT) */
|
|
1320
|
+
entityType: EntityType;
|
|
1321
|
+
/** ID de l'entité */
|
|
1322
|
+
entityId: number | string;
|
|
1323
|
+
/** ID du BusinessEntity (pour le contexte) */
|
|
1324
|
+
businessEntityId: number | string;
|
|
1325
|
+
/** Classes CSS additionnelles */
|
|
1326
|
+
className?: string;
|
|
1327
|
+
/** Hauteur du composant (défaut: '600px') */
|
|
1328
|
+
height?: string;
|
|
1329
|
+
/** Autoriser l'upload de fichiers (défaut: true) */
|
|
1330
|
+
allowUpload?: boolean;
|
|
1331
|
+
/** Autoriser la création de dossiers (défaut: true) */
|
|
1332
|
+
allowCreateFolder?: boolean;
|
|
1333
|
+
/** Autoriser le renommage (défaut: true) */
|
|
1334
|
+
allowRename?: boolean;
|
|
1335
|
+
/** Autoriser la suppression (défaut: true) */
|
|
1336
|
+
allowDelete?: boolean;
|
|
1337
|
+
/** Autoriser le téléchargement (défaut: true) */
|
|
1338
|
+
allowDownload?: boolean;
|
|
1339
|
+
/** Appelé quand l'utilisateur sélectionne des fichiers */
|
|
1340
|
+
onFileSelect?: (files: FileItem[]) => void;
|
|
1341
|
+
/** Appelé quand l'utilisateur ouvre un fichier */
|
|
1342
|
+
onFileOpen?: (file: FileItem) => void;
|
|
1343
|
+
/** Appelé après un upload réussi */
|
|
1344
|
+
onUploadSuccess?: (files: FileItem[]) => void;
|
|
1345
|
+
/** Appelé en cas d'erreur */
|
|
1346
|
+
onError?: (error: Error) => void;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Valeur retournée par le hook useFileManagerApi.
|
|
1350
|
+
*/
|
|
1351
|
+
interface UseFileManagerApiReturn {
|
|
1352
|
+
/** Données transformées pour FileManager */
|
|
1353
|
+
data: FileItem[];
|
|
1354
|
+
/** État de chargement */
|
|
1355
|
+
loading: boolean;
|
|
1356
|
+
/** Erreur éventuelle */
|
|
1357
|
+
error: Error | null;
|
|
1358
|
+
/** Code du dossier racine de l'entité */
|
|
1359
|
+
rootFolderCode: string | null;
|
|
1360
|
+
/** Rafraîchir les données */
|
|
1361
|
+
refresh: () => Promise<void>;
|
|
1362
|
+
/** Handlers pour FileManager */
|
|
1363
|
+
handlers: {
|
|
1364
|
+
onCreateFolder: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
1365
|
+
onUploadFiles: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
1366
|
+
onRename: (item: FileItem, newName: string) => Promise<void>;
|
|
1367
|
+
onDelete: (item: FileItem) => Promise<void>;
|
|
1368
|
+
onDownload: (item: FileItem) => void;
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
declare const FileManager: React$1.FC<FileManagerProps>;
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* EntityFileManager - FileManager scopé à une entité métier.
|
|
1376
|
+
*
|
|
1377
|
+
* Ce composant encapsule le FileManager générique et l'intègre avec l'API
|
|
1378
|
+
* backend GED pour afficher les documents d'une entité spécifique
|
|
1379
|
+
* (Client, Vendor, RFQ, Département, Projet).
|
|
1380
|
+
*
|
|
1381
|
+
* FONCTIONNALITÉS :
|
|
1382
|
+
* =================
|
|
1383
|
+
* - Charge automatiquement les dossiers de l'entité au montage
|
|
1384
|
+
* - Navigation limitée au dossier racine de l'entité (scopé)
|
|
1385
|
+
* - Gestion des états loading/error/empty
|
|
1386
|
+
* - Opérations CRUD complètes (upload, création, renommage, suppression)
|
|
1387
|
+
* - Permissions configurables
|
|
1388
|
+
*
|
|
1389
|
+
* ARCHITECTURE :
|
|
1390
|
+
* ==============
|
|
1391
|
+
* EntityFileManager
|
|
1392
|
+
* └── useFileManagerApi (hook)
|
|
1393
|
+
* └── fileManagerApi (service)
|
|
1394
|
+
* └── API Backend Django
|
|
1395
|
+
*
|
|
1396
|
+
* EXEMPLE D'UTILISATION :
|
|
1397
|
+
* =======================
|
|
1398
|
+
* ```tsx
|
|
1399
|
+
* // Dans la vue d'un Vendor
|
|
1400
|
+
* <EntityFileManager
|
|
1401
|
+
* entityType="VENDOR"
|
|
1402
|
+
* entityId={vendor.id}
|
|
1403
|
+
* businessEntityId={businessEntity.id}
|
|
1404
|
+
* />
|
|
1405
|
+
*
|
|
1406
|
+
* // Avec permissions limitées (lecture seule)
|
|
1407
|
+
* <EntityFileManager
|
|
1408
|
+
* entityType="CLIENT"
|
|
1409
|
+
* entityId={client.id}
|
|
1410
|
+
* businessEntityId={businessEntity.id}
|
|
1411
|
+
* allowUpload={false}
|
|
1412
|
+
* allowCreateFolder={false}
|
|
1413
|
+
* allowRename={false}
|
|
1414
|
+
* allowDelete={false}
|
|
1415
|
+
* />
|
|
1416
|
+
*
|
|
1417
|
+
* // Avec callbacks personnalisés
|
|
1418
|
+
* <EntityFileManager
|
|
1419
|
+
* entityType="RFQ"
|
|
1420
|
+
* entityId={rfq.id}
|
|
1421
|
+
* businessEntityId={businessEntity.id}
|
|
1422
|
+
* onFileSelect={(files) => console.log('Sélection:', files)}
|
|
1423
|
+
* onFileOpen={(file) => openPreview(file)}
|
|
1424
|
+
* />
|
|
1425
|
+
* ```
|
|
1426
|
+
*/
|
|
1427
|
+
|
|
1428
|
+
/**
|
|
1429
|
+
* FileManager scopé à une entité métier.
|
|
1430
|
+
*
|
|
1431
|
+
* Ce composant charge automatiquement les dossiers de l'entité et fournit
|
|
1432
|
+
* une interface complète pour la gestion des documents.
|
|
1433
|
+
*/
|
|
1434
|
+
declare const EntityFileManager: React$1.FC<EntityFileManagerProps>;
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* RootFileManager - FileManager intégré pour l'arborescence ROOT d'un BusinessEntity.
|
|
1438
|
+
*
|
|
1439
|
+
* Ce composant affiche l'intégralité de l'arborescence GED d'un BusinessEntity,
|
|
1440
|
+
* incluant toutes les catégories (Clients, Fournisseurs, RFQ, etc.) et leurs contenus.
|
|
1441
|
+
*
|
|
1442
|
+
* DIFFÉRENCE AVEC EntityFileManager :
|
|
1443
|
+
* ===================================
|
|
1444
|
+
* - EntityFileManager : Affiche les dossiers d'une entité spécifique (Client, Vendor, etc.)
|
|
1445
|
+
* - RootFileManager : Affiche TOUTE l'arborescence depuis ROOT
|
|
1446
|
+
*
|
|
1447
|
+
* STRUCTURE AFFICHÉE :
|
|
1448
|
+
* ====================
|
|
1449
|
+
* 📁 [Nom du BusinessEntity]
|
|
1450
|
+
* ├── 📁 Clients
|
|
1451
|
+
* │ └── 📁 CLI_Client ABC
|
|
1452
|
+
* │ └── 📁 Contrats, Factures, etc.
|
|
1453
|
+
* ├── 📁 Fournisseurs
|
|
1454
|
+
* │ └── 📁 FRN_Fournisseur XYZ
|
|
1455
|
+
* │ └── ...
|
|
1456
|
+
* ├── 📁 Appels d'offres
|
|
1457
|
+
* │ └── ...
|
|
1458
|
+
* └── 📁 Documents généraux
|
|
1459
|
+
*
|
|
1460
|
+
* EXEMPLE D'UTILISATION :
|
|
1461
|
+
* =======================
|
|
1462
|
+
* ```tsx
|
|
1463
|
+
* <RootFileManager
|
|
1464
|
+
* businessEntityId={entity.id}
|
|
1465
|
+
* height="600px"
|
|
1466
|
+
* allowUpload={true}
|
|
1467
|
+
* allowCreateFolder={true}
|
|
1468
|
+
* />
|
|
1469
|
+
* ```
|
|
1470
|
+
*/
|
|
1471
|
+
|
|
1472
|
+
interface RootFileManagerProps {
|
|
1473
|
+
/** ID du BusinessEntity */
|
|
1474
|
+
businessEntityId: number | string;
|
|
1475
|
+
/** Hauteur du composant (CSS) */
|
|
1476
|
+
height?: string;
|
|
1477
|
+
/** Autoriser l'upload de fichiers */
|
|
1478
|
+
allowUpload?: boolean;
|
|
1479
|
+
/** Autoriser la création de dossiers */
|
|
1480
|
+
allowCreateFolder?: boolean;
|
|
1481
|
+
/** Autoriser le renommage */
|
|
1482
|
+
allowRename?: boolean;
|
|
1483
|
+
/** Autoriser la suppression */
|
|
1484
|
+
allowDelete?: boolean;
|
|
1485
|
+
/** Autoriser le téléchargement */
|
|
1486
|
+
allowDownload?: boolean;
|
|
1487
|
+
/** Callback lors de la sélection de fichiers */
|
|
1488
|
+
onFileSelect?: (files: FileItem[]) => void;
|
|
1489
|
+
/** Callback lors de l'ouverture d'un fichier */
|
|
1490
|
+
onFileOpen?: (file: FileItem) => void;
|
|
1491
|
+
/** Callback après upload réussi */
|
|
1492
|
+
onUploadSuccess?: (files: FileItem[]) => void;
|
|
1493
|
+
/** Callback en cas d'erreur */
|
|
1494
|
+
onError?: (error: Error) => void;
|
|
1495
|
+
}
|
|
1496
|
+
declare const RootFileManager: React$1.FC<RootFileManagerProps>;
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* AttachmentUploader - Composant simplifié pour attacher des fichiers à un objet
|
|
1500
|
+
*
|
|
1501
|
+
* Utilisation:
|
|
1502
|
+
* ```tsx
|
|
1503
|
+
* // Avec sélection de dossier dynamique (recommandé)
|
|
1504
|
+
* <AttachmentUploader
|
|
1505
|
+
* model="accounting.FundCall"
|
|
1506
|
+
* objectId={fundCall.id}
|
|
1507
|
+
* businessEntityId={businessEntity.id}
|
|
1508
|
+
* linkType="attachment"
|
|
1509
|
+
* onUploadSuccess={(files) => console.log('Uploaded:', files)}
|
|
1510
|
+
* />
|
|
1511
|
+
*
|
|
1512
|
+
* // Avec dossier fixe
|
|
1513
|
+
* <AttachmentUploader
|
|
1514
|
+
* model="accounting.FundCall"
|
|
1515
|
+
* objectId={fundCall.id}
|
|
1516
|
+
* folderCode="FO000123"
|
|
1517
|
+
* linkType="attachment"
|
|
1518
|
+
* />
|
|
1519
|
+
* ```
|
|
1520
|
+
*/
|
|
1521
|
+
|
|
1522
|
+
interface AttachmentUploaderProps {
|
|
1523
|
+
/** Chemin du modèle Django (ex: 'accounting.FundCall') */
|
|
1524
|
+
model: string;
|
|
1525
|
+
/** ID de l'objet à lier */
|
|
1526
|
+
objectId: number | string;
|
|
1527
|
+
/** ID du BusinessEntity (pour le sélecteur de dossier dynamique) */
|
|
1528
|
+
businessEntityId?: number | string;
|
|
1529
|
+
/** Code du dossier où uploader (optionnel si businessEntityId est fourni) */
|
|
1530
|
+
folderCode?: string;
|
|
1531
|
+
/** Code du dossier de départ pour la navigation (optionnel, root par défaut) */
|
|
1532
|
+
startingFolderCode?: string;
|
|
1533
|
+
/** Type de liaison (défaut: 'attachment') */
|
|
1534
|
+
linkType?: string;
|
|
1535
|
+
/** Titre affiché (défaut: 'Pièces jointes') */
|
|
1536
|
+
title?: string;
|
|
1537
|
+
/** Autoriser l'upload (défaut: true) */
|
|
1538
|
+
allowUpload?: boolean;
|
|
1539
|
+
/** Autoriser la suppression (défaut: true) */
|
|
1540
|
+
allowDelete?: boolean;
|
|
1541
|
+
/** Autoriser la création de dossiers (défaut: true) */
|
|
1542
|
+
allowCreateFolder?: boolean;
|
|
1543
|
+
/** Types de fichiers acceptés */
|
|
1544
|
+
accept?: string;
|
|
1545
|
+
/** Callback après upload réussi */
|
|
1546
|
+
onUploadSuccess?: (files: BackendFile[]) => void;
|
|
1547
|
+
/** Callback en cas d'erreur */
|
|
1548
|
+
onError?: (error: Error) => void;
|
|
1549
|
+
/** Classes CSS additionnelles */
|
|
1550
|
+
className?: string;
|
|
1551
|
+
}
|
|
1552
|
+
declare const AttachmentUploader: React$1.FC<AttachmentUploaderProps>;
|
|
1553
|
+
|
|
1554
|
+
declare const useFileManager: () => FileManagerContextValue;
|
|
1555
|
+
interface FileManagerProviderProps extends FileManagerProps {
|
|
1556
|
+
children: React$1.ReactNode;
|
|
1557
|
+
}
|
|
1558
|
+
declare const FileManagerProvider: React$1.FC<FileManagerProviderProps>;
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Hook pour intégrer le FileManager avec l'API backend GED.
|
|
1562
|
+
*
|
|
1563
|
+
* Ce hook gère :
|
|
1564
|
+
* - Le chargement des données depuis l'API
|
|
1565
|
+
* - La transformation des données backend → frontend
|
|
1566
|
+
* - Les opérations CRUD (création, renommage, suppression, upload)
|
|
1567
|
+
* - Le rafraîchissement des données après mutation
|
|
1568
|
+
*
|
|
1569
|
+
* ARCHITECTURE :
|
|
1570
|
+
* ==============
|
|
1571
|
+
* 1. Chargement initial :
|
|
1572
|
+
* - Récupère les dossiers de l'entité via /folders/for_entity/
|
|
1573
|
+
* - Trouve le dossier ENTITY (racine de l'entité)
|
|
1574
|
+
* - Charge l'arborescence complète via /folders/{code}/tree/
|
|
1575
|
+
*
|
|
1576
|
+
* 2. Transformation :
|
|
1577
|
+
* - Convertit BackendFolder/BackendFile → FileItem
|
|
1578
|
+
* - Construit les chemins (path) récursivement
|
|
1579
|
+
* - Aplatit la structure pour le FileManager
|
|
1580
|
+
*
|
|
1581
|
+
* 3. Mutations :
|
|
1582
|
+
* - Chaque mutation rafraîchit les données après succès
|
|
1583
|
+
* - Les erreurs sont capturées et exposées via l'état error
|
|
1584
|
+
*
|
|
1585
|
+
* EXEMPLE D'UTILISATION :
|
|
1586
|
+
* =======================
|
|
1587
|
+
* ```tsx
|
|
1588
|
+
* const { data, loading, error, handlers } = useFileManagerApi(
|
|
1589
|
+
* 'VENDOR',
|
|
1590
|
+
* vendor.id,
|
|
1591
|
+
* businessEntity.id
|
|
1592
|
+
* );
|
|
1593
|
+
*
|
|
1594
|
+
* if (loading) return <Spinner />;
|
|
1595
|
+
* if (error) return <Error message={error.message} />;
|
|
1596
|
+
*
|
|
1597
|
+
* return (
|
|
1598
|
+
* <FileManager
|
|
1599
|
+
* data={data}
|
|
1600
|
+
* onCreateFolder={handlers.onCreateFolder}
|
|
1601
|
+
* onUploadFiles={handlers.onUploadFiles}
|
|
1602
|
+
* ...
|
|
1603
|
+
* />
|
|
1604
|
+
* );
|
|
1605
|
+
* ```
|
|
1606
|
+
*/
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Hook pour gérer l'intégration FileManager avec l'API GED.
|
|
1610
|
+
*
|
|
1611
|
+
* @param entityType - Type d'entité (CLIENT, VENDOR, RFQ, DEPT, PROJECT)
|
|
1612
|
+
* @param entityId - ID de l'entité
|
|
1613
|
+
* @param businessEntityId - ID du BusinessEntity
|
|
1614
|
+
* @returns État et handlers pour le FileManager
|
|
1615
|
+
*/
|
|
1616
|
+
declare function useFileManagerApi(entityType: EntityType, entityId: string | number, businessEntityId: string | number): UseFileManagerApiReturn;
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* Hook pour intégrer le FileManager avec l'arborescence ROOT d'un BusinessEntity.
|
|
1620
|
+
*
|
|
1621
|
+
* Ce hook charge l'intégralité de l'arborescence GED depuis le dossier ROOT,
|
|
1622
|
+
* incluant toutes les catégories (Clients, Fournisseurs, RFQ, etc.) et leurs sous-dossiers.
|
|
1623
|
+
*
|
|
1624
|
+
* DIFFÉRENCE AVEC useFileManagerApi :
|
|
1625
|
+
* ===================================
|
|
1626
|
+
* - useFileManagerApi : Charge les dossiers d'une entité spécifique (Client, Vendor, etc.)
|
|
1627
|
+
* - useRootFileManagerApi : Charge TOUTE l'arborescence depuis ROOT
|
|
1628
|
+
*
|
|
1629
|
+
* STRUCTURE CHARGÉE :
|
|
1630
|
+
* ===================
|
|
1631
|
+
* 📁 ROOT (BusinessEntity)
|
|
1632
|
+
* ├── 📁 Clients (CATEGORY)
|
|
1633
|
+
* │ └── 📁 CLI_Client ABC (ENTITY)
|
|
1634
|
+
* │ └── ...
|
|
1635
|
+
* ├── 📁 Fournisseurs (CATEGORY)
|
|
1636
|
+
* │ └── ...
|
|
1637
|
+
* ├── 📁 Appels d'offres (CATEGORY)
|
|
1638
|
+
* │ └── ...
|
|
1639
|
+
* └── 📁 Documents généraux (CATEGORY)
|
|
1640
|
+
*
|
|
1641
|
+
* EXEMPLE D'UTILISATION :
|
|
1642
|
+
* =======================
|
|
1643
|
+
* ```tsx
|
|
1644
|
+
* const { data, loading, error, handlers, rootName } = useRootFileManagerApi(
|
|
1645
|
+
* businessEntity.id
|
|
1646
|
+
* );
|
|
1647
|
+
*
|
|
1648
|
+
* if (loading) return <Spinner />;
|
|
1649
|
+
* if (error) return <Error message={error.message} />;
|
|
1650
|
+
*
|
|
1651
|
+
* return (
|
|
1652
|
+
* <FileManager
|
|
1653
|
+
* data={data}
|
|
1654
|
+
* rootName={rootName}
|
|
1655
|
+
* onCreateFolder={handlers.onCreateFolder}
|
|
1656
|
+
* onUploadFiles={handlers.onUploadFiles}
|
|
1657
|
+
* ...
|
|
1658
|
+
* />
|
|
1659
|
+
* );
|
|
1660
|
+
* ```
|
|
1661
|
+
*/
|
|
1662
|
+
|
|
1663
|
+
interface UseRootFileManagerApiReturn {
|
|
1664
|
+
/** Données transformées pour le FileManager */
|
|
1665
|
+
data: FileItem[];
|
|
1666
|
+
/** État de chargement */
|
|
1667
|
+
loading: boolean;
|
|
1668
|
+
/** Erreur éventuelle */
|
|
1669
|
+
error: Error | null;
|
|
1670
|
+
/** Code du dossier ROOT */
|
|
1671
|
+
rootFolderCode: string | null;
|
|
1672
|
+
/** Nom du dossier ROOT (nom du BusinessEntity) */
|
|
1673
|
+
rootName: string;
|
|
1674
|
+
/** Rafraîchir les données */
|
|
1675
|
+
refresh: () => Promise<void>;
|
|
1676
|
+
/** Handlers pour le FileManager */
|
|
1677
|
+
handlers: {
|
|
1678
|
+
onCreateFolder: (name: string, parentId: string) => Promise<FileItem | void>;
|
|
1679
|
+
onUploadFiles: (files: File[], parentId: string) => Promise<FileItem[] | void>;
|
|
1680
|
+
onRename: (item: FileItem, newName: string) => Promise<void>;
|
|
1681
|
+
onDelete: (item: FileItem) => Promise<void>;
|
|
1682
|
+
onDownload: (item: FileItem) => void;
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
/**
|
|
1686
|
+
* Hook pour gérer l'intégration FileManager avec l'arborescence ROOT.
|
|
1687
|
+
*
|
|
1688
|
+
* @param businessEntityId - ID du BusinessEntity
|
|
1689
|
+
* @returns État et handlers pour le FileManager
|
|
1690
|
+
*/
|
|
1691
|
+
declare function useRootFileManagerApi(businessEntityId: string | number): UseRootFileManagerApiReturn;
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* Service API pour la GED (Gestion Électronique de Documents).
|
|
1695
|
+
*
|
|
1696
|
+
* Ce service gère toutes les communications avec le backend Django files_manager.
|
|
1697
|
+
*
|
|
1698
|
+
* ENDPOINTS UTILISÉS :
|
|
1699
|
+
* ====================
|
|
1700
|
+
* - GET /api/files_manager/folders/for_entity/?model=...&id=... → Dossiers d'une entité
|
|
1701
|
+
* - GET /api/files_manager/folders/{code}/tree/ → Arborescence d'un dossier
|
|
1702
|
+
* - GET /api/files_manager/folders/{code}/ → Détails d'un dossier
|
|
1703
|
+
* - POST /api/files_manager/folders/ → Créer un dossier
|
|
1704
|
+
* - PUT /api/files_manager/folders/{code}/ → Modifier un dossier
|
|
1705
|
+
* - DELETE /api/files_manager/folders/{code}/ → Supprimer un dossier
|
|
1706
|
+
* - GET /api/files_manager/files/ → Liste des fichiers
|
|
1707
|
+
* - POST /api/files_manager/files/ → Upload un fichier
|
|
1708
|
+
* - PUT /api/files_manager/files/{code}/ → Modifier un fichier
|
|
1709
|
+
* - DELETE /api/files_manager/files/{code}/ → Supprimer un fichier
|
|
1710
|
+
*
|
|
1711
|
+
* POUR AJOUTER UN NOUVEAU TYPE D'ENTITÉ :
|
|
1712
|
+
* =======================================
|
|
1713
|
+
* 1. Ajouter le type dans EntityType (types.ts)
|
|
1714
|
+
* 2. Ajouter le mapping dans ENTITY_MODEL_MAP ci-dessous
|
|
1715
|
+
*/
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Récupère les dossiers d'une entité.
|
|
1719
|
+
*
|
|
1720
|
+
* Utilise l'endpoint /folders/for_entity/ pour récupérer tous les dossiers
|
|
1721
|
+
* associés à une entité spécifique (Client, Vendor, RFQ, etc.).
|
|
1722
|
+
*
|
|
1723
|
+
* @param entityType - Type d'entité (CLIENT, VENDOR, etc.)
|
|
1724
|
+
* @param entityId - ID de l'entité
|
|
1725
|
+
* @param folderType - Optionnel: filtrer par type de dossier
|
|
1726
|
+
* @returns Liste des dossiers
|
|
1727
|
+
*
|
|
1728
|
+
* @example
|
|
1729
|
+
* const folders = await fileManagerApi.getEntityFolders('VENDOR', 123);
|
|
1730
|
+
*/
|
|
1731
|
+
declare function getEntityFolders(entityType: EntityType, entityId: string | number, folderType?: string): Promise<BackendFolder[]>;
|
|
1732
|
+
/**
|
|
1733
|
+
* Récupère l'arborescence complète d'un dossier.
|
|
1734
|
+
*
|
|
1735
|
+
* Retourne le dossier avec tous ses sous-dossiers et fichiers
|
|
1736
|
+
* de manière récursive.
|
|
1737
|
+
*
|
|
1738
|
+
* @param folderCode - Code du dossier (ex: 'FO000001')
|
|
1739
|
+
* @returns Structure hiérarchique du dossier
|
|
1740
|
+
*
|
|
1741
|
+
* @example
|
|
1742
|
+
* const tree = await fileManagerApi.getFolderTree('FO000001');
|
|
1743
|
+
*/
|
|
1744
|
+
declare function getFolderTree(folderCode: string): Promise<BackendFolder>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Récupère les détails d'un dossier.
|
|
1747
|
+
*
|
|
1748
|
+
* @param folderCode - Code du dossier
|
|
1749
|
+
* @returns Détails du dossier
|
|
1750
|
+
*/
|
|
1751
|
+
declare function getFolder(folderCode: string): Promise<BackendFolder>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Crée un nouveau dossier.
|
|
1754
|
+
*
|
|
1755
|
+
* @param name - Nom du dossier
|
|
1756
|
+
* @param parentCode - Code du dossier parent
|
|
1757
|
+
* @param businessEntityId - ID du BusinessEntity
|
|
1758
|
+
* @returns Dossier créé
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* const folder = await fileManagerApi.createFolder('Mon dossier', 'FO000001', 1);
|
|
1762
|
+
*/
|
|
1763
|
+
declare function createFolder(name: string, parentCode: string, businessEntityId: string | number): Promise<BackendFolder>;
|
|
1764
|
+
/**
|
|
1765
|
+
* Renomme un dossier.
|
|
1766
|
+
*
|
|
1767
|
+
* @param folderCode - Code du dossier
|
|
1768
|
+
* @param newName - Nouveau nom
|
|
1769
|
+
* @returns Dossier mis à jour
|
|
1770
|
+
*/
|
|
1771
|
+
declare function renameFolder(folderCode: string, newName: string): Promise<BackendFolder>;
|
|
1772
|
+
/**
|
|
1773
|
+
* Supprime un dossier.
|
|
1774
|
+
*
|
|
1775
|
+
* Note: Un dossier système (is_system_folder=true) ne peut pas être supprimé.
|
|
1776
|
+
*
|
|
1777
|
+
* @param folderCode - Code du dossier à supprimer
|
|
1778
|
+
*/
|
|
1779
|
+
declare function deleteFolder(folderCode: string): Promise<void>;
|
|
1780
|
+
/**
|
|
1781
|
+
* Récupère les fichiers d'un dossier.
|
|
1782
|
+
*
|
|
1783
|
+
* @param folderId - ID du dossier
|
|
1784
|
+
* @returns Liste des fichiers
|
|
1785
|
+
*/
|
|
1786
|
+
declare function getFolderFiles(folderId: number | string): Promise<BackendFile[]>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Upload un fichier dans un dossier.
|
|
1789
|
+
*
|
|
1790
|
+
* @param file - Fichier à uploader
|
|
1791
|
+
* @param folderCode - Code du dossier de destination
|
|
1792
|
+
* @param options - Options additionnelles (nom, description, tags)
|
|
1793
|
+
* @returns Fichier créé
|
|
1794
|
+
*
|
|
1795
|
+
* @example
|
|
1796
|
+
* const uploadedFile = await fileManagerApi.uploadFile(
|
|
1797
|
+
* file,
|
|
1798
|
+
* 'FO000001',
|
|
1799
|
+
* { name: 'Mon document.pdf', description: 'Contrat 2024' }
|
|
1800
|
+
* );
|
|
1801
|
+
*/
|
|
1802
|
+
declare function uploadFile(file: File, folderCode: string, options?: {
|
|
1803
|
+
name?: string;
|
|
1804
|
+
description?: string;
|
|
1805
|
+
tags?: string[];
|
|
1806
|
+
}): Promise<BackendFile>;
|
|
1807
|
+
/**
|
|
1808
|
+
* Upload plusieurs fichiers dans un dossier.
|
|
1809
|
+
*
|
|
1810
|
+
* @param files - Fichiers à uploader
|
|
1811
|
+
* @param folderCode - Code du dossier de destination
|
|
1812
|
+
* @returns Liste des fichiers créés
|
|
1813
|
+
*/
|
|
1814
|
+
declare function uploadFiles(files: File[], folderCode: string): Promise<BackendFile[]>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Renomme un fichier.
|
|
1817
|
+
*
|
|
1818
|
+
* @param fileCode - Code du fichier
|
|
1819
|
+
* @param newName - Nouveau nom
|
|
1820
|
+
* @returns Fichier mis à jour
|
|
1821
|
+
*/
|
|
1822
|
+
declare function renameFile(fileCode: string, newName: string): Promise<BackendFile>;
|
|
1823
|
+
/**
|
|
1824
|
+
* Supprime un fichier.
|
|
1825
|
+
*
|
|
1826
|
+
* @param fileCode - Code du fichier à supprimer
|
|
1827
|
+
*/
|
|
1828
|
+
declare function deleteFile(fileCode: string): Promise<void>;
|
|
1829
|
+
/**
|
|
1830
|
+
* Construit l'URL de téléchargement d'un fichier.
|
|
1831
|
+
*
|
|
1832
|
+
* @param fileCode - Code du fichier
|
|
1833
|
+
* @returns URL de téléchargement
|
|
1834
|
+
*/
|
|
1835
|
+
declare function getDownloadUrl(fileCode: string): string;
|
|
1836
|
+
/**
|
|
1837
|
+
* Construit l'URL directe d'un fichier.
|
|
1838
|
+
*
|
|
1839
|
+
* @param fileUrl - URL relative du fichier depuis l'API
|
|
1840
|
+
* @returns URL complète
|
|
1841
|
+
*/
|
|
1842
|
+
declare function getFileUrl(fileUrl: string): string;
|
|
1843
|
+
/**
|
|
1844
|
+
* Récupère le dossier ROOT d'un BusinessEntity.
|
|
1845
|
+
*
|
|
1846
|
+
* @param businessEntityId - ID du BusinessEntity
|
|
1847
|
+
* @returns Dossier ROOT
|
|
1848
|
+
*
|
|
1849
|
+
* @example
|
|
1850
|
+
* const rootFolder = await fileManagerApi.getRootFolder(1);
|
|
1851
|
+
*/
|
|
1852
|
+
declare function getRootFolder(businessEntityId: string | number): Promise<BackendFolder | null>;
|
|
1853
|
+
/**
|
|
1854
|
+
* Récupère l'arborescence complète depuis le ROOT d'un BusinessEntity.
|
|
1855
|
+
*
|
|
1856
|
+
* Utilise le nouvel endpoint optimisé /folders/root_tree/ qui retourne
|
|
1857
|
+
* l'arborescence complète en une seule requête avec prefetch.
|
|
1858
|
+
*
|
|
1859
|
+
* @param businessEntityId - ID du BusinessEntity
|
|
1860
|
+
* @returns Arborescence complète depuis ROOT avec tous les dossiers et fichiers
|
|
1861
|
+
*
|
|
1862
|
+
* @example
|
|
1863
|
+
* const tree = await fileManagerApi.getRootTree(1);
|
|
1864
|
+
* // Retourne:
|
|
1865
|
+
* // {
|
|
1866
|
+
* // code: 'FO000001',
|
|
1867
|
+
* // name: 'Ma Société - Documents',
|
|
1868
|
+
* // folder_type: 'ROOT',
|
|
1869
|
+
* // children: [
|
|
1870
|
+
* // { name: 'Clients', folder_type: 'CATEGORY', children: [...], files: [...] },
|
|
1871
|
+
* // { name: 'Fournisseurs', ... },
|
|
1872
|
+
* // ...
|
|
1873
|
+
* // ],
|
|
1874
|
+
* // files: [...]
|
|
1875
|
+
* // }
|
|
1876
|
+
*/
|
|
1877
|
+
declare function getRootTree(businessEntityId: string | number): Promise<BackendFolder | null>;
|
|
1878
|
+
/**
|
|
1879
|
+
* Service API pour la GED.
|
|
1880
|
+
*
|
|
1881
|
+
* @example
|
|
1882
|
+
* // Récupérer les dossiers d'un vendor
|
|
1883
|
+
* const folders = await fileManagerApi.getEntityFolders('VENDOR', vendorId);
|
|
1884
|
+
*
|
|
1885
|
+
* // Récupérer l'arborescence
|
|
1886
|
+
* const tree = await fileManagerApi.getFolderTree(folders[0].code);
|
|
1887
|
+
*
|
|
1888
|
+
* // Uploader un fichier
|
|
1889
|
+
* const file = await fileManagerApi.uploadFile(myFile, 'FO000001');
|
|
1890
|
+
*
|
|
1891
|
+
* // Récupérer l'arborescence ROOT d'un BusinessEntity
|
|
1892
|
+
* const rootTree = await fileManagerApi.getRootTree(businessEntityId);
|
|
1893
|
+
*/
|
|
1894
|
+
declare const fileManagerApi: {
|
|
1895
|
+
getEntityFolders: typeof getEntityFolders;
|
|
1896
|
+
getFolderTree: typeof getFolderTree;
|
|
1897
|
+
getFolder: typeof getFolder;
|
|
1898
|
+
createFolder: typeof createFolder;
|
|
1899
|
+
renameFolder: typeof renameFolder;
|
|
1900
|
+
deleteFolder: typeof deleteFolder;
|
|
1901
|
+
getRootFolder: typeof getRootFolder;
|
|
1902
|
+
getRootTree: typeof getRootTree;
|
|
1903
|
+
getFolderFiles: typeof getFolderFiles;
|
|
1904
|
+
uploadFile: typeof uploadFile;
|
|
1905
|
+
uploadFiles: typeof uploadFiles;
|
|
1906
|
+
renameFile: typeof renameFile;
|
|
1907
|
+
deleteFile: typeof deleteFile;
|
|
1908
|
+
getDownloadUrl: typeof getDownloadUrl;
|
|
1909
|
+
getFileUrl: typeof getFileUrl;
|
|
1910
|
+
ENTITY_MODEL_MAP: Record<EntityType, string>;
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
declare const getFileIcon: (mimeType?: string, isFolder?: boolean, isOpen?: boolean) => LucideIcon;
|
|
1914
|
+
/**
|
|
1915
|
+
* Retourne la classe de couleur Tailwind pour un type de fichier
|
|
1916
|
+
*/
|
|
1917
|
+
declare const getFileIconColor: (mimeType?: string, isFolder?: boolean) => string;
|
|
1918
|
+
declare const getMimeTypeFromExtension: (filename: string) => string;
|
|
1919
|
+
declare const formatFileSize: (bytes?: number) => string;
|
|
1920
|
+
declare const formatDate: (date?: Date | string) => string;
|
|
1921
|
+
declare const formatDateTime: (date?: Date | string) => string;
|
|
1922
|
+
declare const isImageFile: (mimeType?: string) => boolean;
|
|
1923
|
+
declare const getFileExtension: (filename: string) => string;
|
|
1924
|
+
declare const findFolderById: (items: FileItem[], id: string) => FileItem | null;
|
|
1925
|
+
declare const getAllFolders: (items: FileItem[]) => FileItem[];
|
|
1926
|
+
|
|
1927
|
+
interface FileCardProps {
|
|
1928
|
+
item: FileItem;
|
|
1929
|
+
variant?: 'grid' | 'list';
|
|
1930
|
+
}
|
|
1931
|
+
declare const FileCard: React$1.FC<FileCardProps>;
|
|
1932
|
+
|
|
1933
|
+
declare const FolderTree: React$1.FC;
|
|
1934
|
+
|
|
1935
|
+
declare const FileGrid: React$1.FC;
|
|
1936
|
+
|
|
1937
|
+
declare const FileList: React$1.FC;
|
|
1938
|
+
|
|
1939
|
+
declare const Breadcrumb: React$1.FC;
|
|
1940
|
+
|
|
1941
|
+
declare const Toolbar: React$1.FC;
|
|
1942
|
+
|
|
1943
|
+
declare const ContextMenu: React$1.FC;
|
|
1944
|
+
|
|
1945
|
+
interface PrintPreviewProps {
|
|
1946
|
+
/** Contenu à imprimer */
|
|
1947
|
+
children: ReactNode;
|
|
1948
|
+
/** Contrôle l'affichage du modal */
|
|
1949
|
+
isOpen: boolean;
|
|
1950
|
+
/** Callback pour fermer le modal */
|
|
1951
|
+
onClose: () => void;
|
|
1952
|
+
/** Titre affiché dans l'en-tête du modal */
|
|
1953
|
+
title?: string;
|
|
1954
|
+
/** Nom du fichier pour le PDF (sans extension) */
|
|
1955
|
+
documentName?: string;
|
|
1956
|
+
/** Largeur du document (ex: '210mm' pour A4) */
|
|
1957
|
+
pageWidth?: string;
|
|
1958
|
+
/** Hauteur minimale du document */
|
|
1959
|
+
pageMinHeight?: string;
|
|
1960
|
+
/** Orientation de la page */
|
|
1961
|
+
orientation?: 'portrait' | 'landscape';
|
|
1962
|
+
/** Callback appelé après l'impression */
|
|
1963
|
+
onAfterPrint?: () => void;
|
|
1964
|
+
/** Callback appelé avant l'impression */
|
|
1965
|
+
onBeforePrint?: () => Promise<void>;
|
|
1966
|
+
}
|
|
1967
|
+
interface PrintableDocumentProps {
|
|
1968
|
+
/** Contenu du document */
|
|
1969
|
+
children: ReactNode;
|
|
1970
|
+
/** Classes CSS additionnelles */
|
|
1971
|
+
className?: string;
|
|
1972
|
+
/** Style inline additionnel */
|
|
1973
|
+
style?: React$1.CSSProperties;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Wrapper pour le contenu imprimable
|
|
1977
|
+
* Applique les styles de base pour l'impression
|
|
1978
|
+
*/
|
|
1979
|
+
declare const PrintableDocument: React$1.FC<PrintableDocumentProps>;
|
|
1980
|
+
/**
|
|
1981
|
+
* Composant de prévisualisation d'impression
|
|
1982
|
+
* Affiche un modal avec le document et permet l'impression/export PDF
|
|
1983
|
+
*/
|
|
1984
|
+
declare const PrintPreview: React$1.FC<PrintPreviewProps>;
|
|
1985
|
+
/** Couleur verte standard pour les en-têtes */
|
|
1986
|
+
declare const PRINT_GREEN = "#2d7d46";
|
|
1987
|
+
interface DocumentHeaderProps {
|
|
1988
|
+
/** Nom de l'entreprise ou logo */
|
|
1989
|
+
companyName: string;
|
|
1990
|
+
/** Adresse (optionnel) */
|
|
1991
|
+
address?: string;
|
|
1992
|
+
/** Téléphone (optionnel) */
|
|
1993
|
+
phone?: string;
|
|
1994
|
+
/** Email (optionnel) */
|
|
1995
|
+
email?: string;
|
|
1996
|
+
/** Site web (optionnel) */
|
|
1997
|
+
website?: string;
|
|
1998
|
+
/** Titre du document (ex: DEVIS, BON DE COMMANDE) */
|
|
1999
|
+
documentTitle: string;
|
|
2000
|
+
/** Numéro du document */
|
|
2001
|
+
documentNumber: string;
|
|
2002
|
+
/** Date du document */
|
|
2003
|
+
date: string;
|
|
2004
|
+
/** Informations supplémentaires à afficher */
|
|
2005
|
+
extraInfo?: {
|
|
2006
|
+
label: string;
|
|
2007
|
+
value: string;
|
|
2008
|
+
}[];
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* En-tête de document standard
|
|
2012
|
+
*/
|
|
2013
|
+
declare const DocumentHeader: React$1.FC<DocumentHeaderProps>;
|
|
2014
|
+
interface InfoBoxProps {
|
|
2015
|
+
/** Titre de la box */
|
|
2016
|
+
title: string;
|
|
2017
|
+
/** Contenu de la box */
|
|
2018
|
+
children: ReactNode;
|
|
2019
|
+
/** Variante de couleur */
|
|
2020
|
+
variant?: 'green' | 'gray';
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Box d'information avec en-tête coloré
|
|
2024
|
+
*/
|
|
2025
|
+
declare const InfoBox: React$1.FC<InfoBoxProps>;
|
|
2026
|
+
interface DataTableColumn<T> {
|
|
2027
|
+
/** Clé de la propriété dans l'objet data */
|
|
2028
|
+
key: keyof T | string;
|
|
2029
|
+
/** Titre de la colonne */
|
|
2030
|
+
header: string;
|
|
2031
|
+
/** Largeur de la colonne (ex: '10%', '100px') */
|
|
2032
|
+
width?: string;
|
|
2033
|
+
/** Alignement du contenu */
|
|
2034
|
+
align?: 'left' | 'center' | 'right';
|
|
2035
|
+
/** Fonction de rendu personnalisé */
|
|
2036
|
+
render?: (value: any, item: T, index: number) => ReactNode;
|
|
2037
|
+
}
|
|
2038
|
+
interface DataTableProps<T> {
|
|
2039
|
+
/** Colonnes du tableau */
|
|
2040
|
+
columns: DataTableColumn<T>[];
|
|
2041
|
+
/** Données à afficher */
|
|
2042
|
+
data: T[];
|
|
2043
|
+
/** Nombre minimum de lignes vides à afficher */
|
|
2044
|
+
minEmptyRows?: number;
|
|
2045
|
+
/** Clé unique pour chaque ligne */
|
|
2046
|
+
keyExtractor: (item: T, index: number) => string | number;
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Tableau de données pour documents
|
|
2050
|
+
*/
|
|
2051
|
+
declare function DataTable<T>({ columns, data, minEmptyRows, keyExtractor }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
2052
|
+
interface TotalsRowProps {
|
|
2053
|
+
/** Label de la ligne */
|
|
2054
|
+
label: string;
|
|
2055
|
+
/** Valeur à afficher */
|
|
2056
|
+
value: string | number;
|
|
2057
|
+
/** Est-ce la ligne de total final? */
|
|
2058
|
+
isTotal?: boolean;
|
|
2059
|
+
/** Couleur du texte pour la valeur */
|
|
2060
|
+
valueColor?: string;
|
|
2061
|
+
}
|
|
2062
|
+
interface TotalsSectionProps {
|
|
2063
|
+
/** Lignes de totaux */
|
|
2064
|
+
rows: TotalsRowProps[];
|
|
2065
|
+
/** Montant en lettres (optionnel) */
|
|
2066
|
+
amountInWords?: string;
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Section des totaux
|
|
2070
|
+
*/
|
|
2071
|
+
declare const TotalsSection: React$1.FC<TotalsSectionProps>;
|
|
2072
|
+
interface SignatureSectionProps {
|
|
2073
|
+
/** Date à afficher */
|
|
2074
|
+
date?: string;
|
|
2075
|
+
/** Label pour la signature de gauche */
|
|
2076
|
+
leftLabel?: string;
|
|
2077
|
+
/** Label pour la signature de droite */
|
|
2078
|
+
rightLabel?: string;
|
|
2079
|
+
/** Nom à afficher sous la signature de droite */
|
|
2080
|
+
rightName?: string;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Section des signatures
|
|
2084
|
+
*/
|
|
2085
|
+
declare const SignatureSection: React$1.FC<SignatureSectionProps>;
|
|
2086
|
+
interface DocumentFooterProps {
|
|
2087
|
+
/** Lignes de texte à afficher */
|
|
2088
|
+
lines: string[];
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Pied de page du document
|
|
2092
|
+
*/
|
|
2093
|
+
declare const DocumentFooter: React$1.FC<DocumentFooterProps>;
|
|
2094
|
+
/**
|
|
2095
|
+
* Convertit un nombre en lettres (français)
|
|
2096
|
+
*/
|
|
2097
|
+
declare const numberToWords: (num: number) => string;
|
|
2098
|
+
/**
|
|
2099
|
+
* Formate une date en français
|
|
2100
|
+
*/
|
|
2101
|
+
declare const formatDateFR: (date: Date | string, format?: "short" | "long") => string;
|
|
2102
|
+
/**
|
|
2103
|
+
* Formate un montant en monnaie
|
|
2104
|
+
*/
|
|
2105
|
+
declare const formatCurrency: (amount: number, currency?: string, showDecimals?: boolean) => string;
|
|
2106
|
+
|
|
2107
|
+
declare const RewiseCard: React$1.FC<{
|
|
2108
|
+
children: React$1.ReactNode;
|
|
2109
|
+
className?: string;
|
|
2110
|
+
style?: React$1.CSSProperties;
|
|
2111
|
+
}>;
|
|
2112
|
+
declare const RewiseBasicCard: React$1.FC<{
|
|
2113
|
+
title: React$1.ReactNode;
|
|
2114
|
+
children?: React$1.ReactNode;
|
|
2115
|
+
}>;
|
|
2116
|
+
|
|
2117
|
+
interface ModernCardProps {
|
|
2118
|
+
children: React$1.ReactNode;
|
|
2119
|
+
className?: string;
|
|
2120
|
+
hoverable?: boolean;
|
|
2121
|
+
bordered?: boolean;
|
|
2122
|
+
elevated?: boolean;
|
|
2123
|
+
gradient?: boolean;
|
|
2124
|
+
onClick?: () => void;
|
|
2125
|
+
}
|
|
2126
|
+
declare const ModernCard: React$1.FC<ModernCardProps>;
|
|
2127
|
+
interface CardHeaderProps {
|
|
2128
|
+
title: string;
|
|
2129
|
+
subtitle?: string;
|
|
2130
|
+
icon?: LucideIcon;
|
|
2131
|
+
action?: React$1.ReactNode;
|
|
2132
|
+
className?: string;
|
|
2133
|
+
children?: React$1.ReactNode;
|
|
2134
|
+
}
|
|
2135
|
+
declare const CardHeader: React$1.FC<CardHeaderProps>;
|
|
2136
|
+
interface CardBodyProps {
|
|
2137
|
+
children: React$1.ReactNode;
|
|
2138
|
+
className?: string;
|
|
2139
|
+
noPadding?: boolean;
|
|
2140
|
+
}
|
|
2141
|
+
declare const CardBody: React$1.FC<CardBodyProps>;
|
|
2142
|
+
interface StatCardProps {
|
|
2143
|
+
title: string;
|
|
2144
|
+
value: string | number;
|
|
2145
|
+
change?: {
|
|
2146
|
+
value: number;
|
|
2147
|
+
type: 'increase' | 'decrease';
|
|
2148
|
+
};
|
|
2149
|
+
icon?: LucideIcon;
|
|
2150
|
+
color?: 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
2151
|
+
className?: string;
|
|
2152
|
+
}
|
|
2153
|
+
declare const StatCard: React$1.FC<StatCardProps>;
|
|
2154
|
+
|
|
2155
|
+
interface ProcurementWorkspaceStats {
|
|
2156
|
+
purchase_requests: {
|
|
2157
|
+
total: number;
|
|
2158
|
+
draft: number;
|
|
2159
|
+
pending_approval: number;
|
|
2160
|
+
approved: number;
|
|
2161
|
+
in_sourcing: number;
|
|
2162
|
+
completed: number;
|
|
2163
|
+
rejected: number;
|
|
2164
|
+
trend: number;
|
|
2165
|
+
};
|
|
2166
|
+
rfqs: {
|
|
2167
|
+
total: number;
|
|
2168
|
+
draft: number;
|
|
2169
|
+
open: number;
|
|
2170
|
+
pending_evaluation: number;
|
|
2171
|
+
closed: number;
|
|
2172
|
+
};
|
|
2173
|
+
purchase_orders: {
|
|
2174
|
+
total: number;
|
|
2175
|
+
pending_delivery: number;
|
|
2176
|
+
delivered: number;
|
|
2177
|
+
total_value: number;
|
|
2178
|
+
trend: number;
|
|
2179
|
+
};
|
|
2180
|
+
receipts: {
|
|
2181
|
+
total: number;
|
|
2182
|
+
pending_validation: number;
|
|
2183
|
+
validated: number;
|
|
2184
|
+
};
|
|
2185
|
+
vendors: {
|
|
2186
|
+
total: number;
|
|
2187
|
+
active: number;
|
|
2188
|
+
};
|
|
2189
|
+
alerts: {
|
|
2190
|
+
overdue_deliveries: number;
|
|
2191
|
+
expiring_contracts: number;
|
|
2192
|
+
pending_approvals: number;
|
|
2193
|
+
};
|
|
2194
|
+
recent_activities: RecentActivity[];
|
|
2195
|
+
pending_tasks: PendingTask[];
|
|
2196
|
+
}
|
|
2197
|
+
interface RecentActivity {
|
|
2198
|
+
id: string;
|
|
2199
|
+
type: 'pr_created' | 'rfq_sent' | 'quote_received' | 'po_issued' | 'receipt_created' | 'approval_pending';
|
|
2200
|
+
title: string;
|
|
2201
|
+
description: string;
|
|
2202
|
+
timestamp: string | null;
|
|
2203
|
+
status: 'info' | 'success' | 'warning' | 'error';
|
|
2204
|
+
}
|
|
2205
|
+
interface PendingTask {
|
|
2206
|
+
id: string;
|
|
2207
|
+
type: 'approval' | 'evaluation' | 'receipt' | 'follow_up';
|
|
2208
|
+
title: string;
|
|
2209
|
+
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
2210
|
+
dueDate: string;
|
|
2211
|
+
link: string;
|
|
2212
|
+
}
|
|
2213
|
+
declare const WorkspaceServices: {
|
|
2214
|
+
/**
|
|
2215
|
+
* Récupère les données du workspace Procurement (Achats)
|
|
2216
|
+
*/
|
|
2217
|
+
getProcurementWorkspace: (businessEntityId?: string) => Promise<ProcurementWorkspaceStats>;
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
type ModuleType = 'purchase' | 'accounting' | 'crm' | 'facility' | 'core';
|
|
2221
|
+
interface ModuleConfig {
|
|
2222
|
+
id: ModuleType;
|
|
2223
|
+
label: string;
|
|
2224
|
+
description: string;
|
|
2225
|
+
icon: React$1.ElementType;
|
|
2226
|
+
color: string;
|
|
2227
|
+
bgColor: string;
|
|
2228
|
+
component: React$1.FC;
|
|
2229
|
+
}
|
|
2230
|
+
declare const WorkSpace: React$1.FC<{
|
|
2231
|
+
module?: ModuleType;
|
|
2232
|
+
}>;
|
|
2233
|
+
|
|
2234
|
+
declare const PurchaseWorkspace: React$1.FC;
|
|
2235
|
+
|
|
2236
|
+
declare const AccountingWorkspace: React$1.FC;
|
|
2237
|
+
|
|
2238
|
+
declare const CrmWorkspace: React$1.FC;
|
|
2239
|
+
|
|
2240
|
+
declare const FacilityWorkspace: React$1.FC;
|
|
2241
|
+
|
|
2242
|
+
declare const HRConnectPage: React$1.FC;
|
|
2243
|
+
|
|
2244
|
+
declare const MeetingHubPage: React$1.FC;
|
|
2245
|
+
|
|
2246
|
+
declare const BudgetPage: React$1.FC;
|
|
2247
|
+
|
|
2248
|
+
declare function TeamChat(): react_jsx_runtime.JSX.Element;
|
|
2249
|
+
|
|
2250
|
+
declare function AssetsDashboard(): react_jsx_runtime.JSX.Element;
|
|
2251
|
+
|
|
2252
|
+
declare function TeamCalendar(): react_jsx_runtime.JSX.Element;
|
|
2253
|
+
|
|
2254
|
+
declare const TaskPilot: React$1.FC;
|
|
2255
|
+
|
|
2256
|
+
declare const PurchaseRequestsPage: () => react_jsx_runtime.JSX.Element;
|
|
2257
|
+
|
|
2258
|
+
type PurchaseRequestStatus = 'draft' | 'submitted' | 'approved' | 'rejected' | 'in_sourcing' | 'completed' | 'cancelled';
|
|
2259
|
+
type UrgencyLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
2260
|
+
interface User {
|
|
2261
|
+
id: number;
|
|
2262
|
+
username: string;
|
|
2263
|
+
}
|
|
2264
|
+
interface PurchaseRequestItem {
|
|
2265
|
+
id?: number;
|
|
2266
|
+
request?: number;
|
|
2267
|
+
product?: number | null;
|
|
2268
|
+
product_info?: {
|
|
2269
|
+
id: number;
|
|
2270
|
+
reference: string;
|
|
2271
|
+
name: string;
|
|
2272
|
+
category: string;
|
|
2273
|
+
unit: string;
|
|
2274
|
+
} | null;
|
|
2275
|
+
cost_center?: number | null;
|
|
2276
|
+
cost_center_info?: {
|
|
2277
|
+
id: number;
|
|
2278
|
+
code: string;
|
|
2279
|
+
name: string;
|
|
2280
|
+
} | null;
|
|
2281
|
+
product_code?: string | null;
|
|
2282
|
+
description: string;
|
|
2283
|
+
specifications?: string | null;
|
|
2284
|
+
quantity: number;
|
|
2285
|
+
unit: string;
|
|
2286
|
+
comments: string;
|
|
2287
|
+
unit_price?: number;
|
|
2288
|
+
total_price?: number;
|
|
2289
|
+
notes?: string | null;
|
|
2290
|
+
created_at?: string;
|
|
2291
|
+
updated_at?: string;
|
|
2292
|
+
}
|
|
2293
|
+
interface PurchaseRequest {
|
|
2294
|
+
id?: number;
|
|
2295
|
+
request_number: string;
|
|
2296
|
+
title: string;
|
|
2297
|
+
description: string;
|
|
2298
|
+
category: string;
|
|
2299
|
+
requester: User | number | null;
|
|
2300
|
+
department?: number | null;
|
|
2301
|
+
cost_center?: number | null;
|
|
2302
|
+
estimated_amount: number;
|
|
2303
|
+
currency: string;
|
|
2304
|
+
budget_available: boolean;
|
|
2305
|
+
urgency: UrgencyLevel;
|
|
2306
|
+
needed_date: string;
|
|
2307
|
+
delivery_address: string;
|
|
2308
|
+
delivery_contact: string;
|
|
2309
|
+
delivery_phone: string;
|
|
2310
|
+
sourcing_id?: number | null;
|
|
2311
|
+
status: PurchaseRequestStatus;
|
|
2312
|
+
approval_date?: string | null;
|
|
2313
|
+
approved_by?: string | number | null;
|
|
2314
|
+
vendor?: number | null;
|
|
2315
|
+
suggered_vendor?: number | null;
|
|
2316
|
+
vendor_info?: Vendor | null;
|
|
2317
|
+
created_at?: string;
|
|
2318
|
+
updated_at?: string;
|
|
2319
|
+
comments?: string | null;
|
|
2320
|
+
evaluation_score?: number | null;
|
|
2321
|
+
evaluation_notes?: string | null;
|
|
2322
|
+
evaluated_by?: User | number | null;
|
|
2323
|
+
evaluated_at?: string | null;
|
|
2324
|
+
assigned_buyer?: User | number | null;
|
|
2325
|
+
budget_approval_requested_at?: string | null;
|
|
2326
|
+
items: PurchaseRequestItem[];
|
|
2327
|
+
rfq?: number | null;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
declare const FormPurchaseRequest: React$1.FC<{
|
|
2331
|
+
isOpen: boolean;
|
|
2332
|
+
onClose: () => void;
|
|
2333
|
+
object: PurchaseRequest | null;
|
|
2334
|
+
refresh: () => void;
|
|
2335
|
+
}>;
|
|
2336
|
+
|
|
2337
|
+
interface SelectedProductLine {
|
|
2338
|
+
productId: number;
|
|
2339
|
+
reference: string;
|
|
2340
|
+
designation: string;
|
|
2341
|
+
unit: string;
|
|
2342
|
+
quantity: number;
|
|
2343
|
+
unitPriceHT: number;
|
|
2344
|
+
supplierId: number;
|
|
2345
|
+
supplierName: string;
|
|
2346
|
+
}
|
|
2347
|
+
interface CatalogueProductSelectorProps {
|
|
2348
|
+
isOpen: boolean;
|
|
2349
|
+
onClose: () => void;
|
|
2350
|
+
onSelect: (lines: SelectedProductLine[]) => void;
|
|
2351
|
+
selectedSupplierId?: number;
|
|
2352
|
+
onShowToast?: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
2353
|
+
}
|
|
2354
|
+
declare const CatalogueProductSelector: ({ isOpen, onClose, onSelect, selectedSupplierId, onShowToast }: CatalogueProductSelectorProps) => react_jsx_runtime.JSX.Element;
|
|
2355
|
+
|
|
2356
|
+
type ProductType = 'product' | 'service';
|
|
2357
|
+
type ProductStatus = 'active' | 'inactive' | 'pending' | 'discontinued';
|
|
2358
|
+
type HomologationStatus = 'none' | 'pending' | 'approved' | 'rejected' | 'expired';
|
|
2359
|
+
type DocumentType = 'fiche_technique' | 'certificat' | 'image' | 'contrat' | 'autre';
|
|
2360
|
+
interface ProductSpecification {
|
|
2361
|
+
id?: number;
|
|
2362
|
+
product?: number;
|
|
2363
|
+
key: string;
|
|
2364
|
+
value: string;
|
|
2365
|
+
created_at?: string;
|
|
2366
|
+
updated_at?: string;
|
|
2367
|
+
}
|
|
2368
|
+
interface ProductDocument {
|
|
2369
|
+
id?: number;
|
|
2370
|
+
product?: number;
|
|
2371
|
+
name: string;
|
|
2372
|
+
type: DocumentType;
|
|
2373
|
+
file?: string | null;
|
|
2374
|
+
url?: string | null;
|
|
2375
|
+
size?: number;
|
|
2376
|
+
uploaded_at?: string;
|
|
2377
|
+
created_at?: string;
|
|
2378
|
+
updated_at?: string;
|
|
2379
|
+
}
|
|
2380
|
+
interface ProductNote {
|
|
2381
|
+
id?: number;
|
|
2382
|
+
product?: number;
|
|
2383
|
+
content: string;
|
|
2384
|
+
created_by_info?: {
|
|
2385
|
+
id: number;
|
|
2386
|
+
username: string;
|
|
2387
|
+
};
|
|
2388
|
+
created_at?: string;
|
|
2389
|
+
updated_at?: string;
|
|
2390
|
+
}
|
|
2391
|
+
interface CatalogueSupplierPrice {
|
|
2392
|
+
id?: number;
|
|
2393
|
+
product?: number;
|
|
2394
|
+
vendor?: number;
|
|
2395
|
+
vendor_info?: Vendor;
|
|
2396
|
+
unit_price: number;
|
|
2397
|
+
min_quantity: number;
|
|
2398
|
+
currency: string;
|
|
2399
|
+
valid_from: string;
|
|
2400
|
+
valid_to: string;
|
|
2401
|
+
is_homologated: boolean;
|
|
2402
|
+
homologation_status: HomologationStatus;
|
|
2403
|
+
homologation_requested_at?: string | null;
|
|
2404
|
+
homologation_requested_by?: number | null;
|
|
2405
|
+
homologation_approved_at?: string | null;
|
|
2406
|
+
homologation_approved_by?: number | null;
|
|
2407
|
+
homologation_expires_at?: string | null;
|
|
2408
|
+
homologation_duration_months?: number;
|
|
2409
|
+
homologation_rejection_reason?: string | null;
|
|
2410
|
+
lead_time: number;
|
|
2411
|
+
discount_percent: number;
|
|
2412
|
+
last_updated?: string;
|
|
2413
|
+
created_at?: string;
|
|
2414
|
+
updated_at?: string;
|
|
2415
|
+
}
|
|
2416
|
+
interface CatalogueProduct {
|
|
2417
|
+
data(data: any): unknown;
|
|
2418
|
+
id?: number;
|
|
2419
|
+
reference: string;
|
|
2420
|
+
name: string;
|
|
2421
|
+
description?: string | null;
|
|
2422
|
+
category: string;
|
|
2423
|
+
subcategory?: string | null;
|
|
2424
|
+
type: ProductType;
|
|
2425
|
+
unit: string;
|
|
2426
|
+
status: ProductStatus;
|
|
2427
|
+
supplier_prices?: CatalogueSupplierPrice[];
|
|
2428
|
+
specifications?: ProductSpecification[];
|
|
2429
|
+
documents?: ProductDocument[];
|
|
2430
|
+
notes?: ProductNote[];
|
|
2431
|
+
average_price?: number;
|
|
2432
|
+
lowest_price?: number;
|
|
2433
|
+
highest_price?: number;
|
|
2434
|
+
homologated_suppliers_count?: number;
|
|
2435
|
+
created_by_info?: {
|
|
2436
|
+
id: number;
|
|
2437
|
+
username: string;
|
|
2438
|
+
};
|
|
2439
|
+
updated_by_info?: {
|
|
2440
|
+
id: number;
|
|
2441
|
+
username: string;
|
|
2442
|
+
};
|
|
2443
|
+
created_at?: string;
|
|
2444
|
+
updated_at?: string;
|
|
2445
|
+
}
|
|
2446
|
+
interface CatalogueProductListItem {
|
|
2447
|
+
id: number;
|
|
2448
|
+
reference: string;
|
|
2449
|
+
name: string;
|
|
2450
|
+
category: string;
|
|
2451
|
+
subcategory?: string | null;
|
|
2452
|
+
type: ProductType;
|
|
2453
|
+
unit: string;
|
|
2454
|
+
status: ProductStatus;
|
|
2455
|
+
average_price?: number;
|
|
2456
|
+
lowest_price?: number;
|
|
2457
|
+
highest_price?: number;
|
|
2458
|
+
homologated_suppliers_count?: number;
|
|
2459
|
+
suppliers_count?: number;
|
|
2460
|
+
created_at?: string;
|
|
2461
|
+
}
|
|
2462
|
+
interface HomologationConfig {
|
|
2463
|
+
id?: number;
|
|
2464
|
+
default_duration_months: number;
|
|
2465
|
+
created_at?: string;
|
|
2466
|
+
updated_at?: string;
|
|
2467
|
+
}
|
|
2468
|
+
interface CatalogueProductListResponse {
|
|
2469
|
+
data: CatalogueProductListItem[];
|
|
2470
|
+
paginate: {
|
|
2471
|
+
total_pages: number;
|
|
2472
|
+
current_page: number;
|
|
2473
|
+
count: number;
|
|
2474
|
+
next: string | null;
|
|
2475
|
+
previous: string | null;
|
|
2476
|
+
};
|
|
2477
|
+
}
|
|
2478
|
+
interface CatalogueSupplierPriceListResponse {
|
|
2479
|
+
data: CatalogueSupplierPrice[];
|
|
2480
|
+
paginate: {
|
|
2481
|
+
total_pages: number;
|
|
2482
|
+
current_page: number;
|
|
2483
|
+
count: number;
|
|
2484
|
+
next: string | null;
|
|
2485
|
+
previous: string | null;
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
interface CreateCatalogueProductPayload {
|
|
2489
|
+
reference: string;
|
|
2490
|
+
name: string;
|
|
2491
|
+
description?: string;
|
|
2492
|
+
category: string;
|
|
2493
|
+
subcategory?: string;
|
|
2494
|
+
type: ProductType;
|
|
2495
|
+
unit: string;
|
|
2496
|
+
status?: ProductStatus;
|
|
2497
|
+
supplier_prices?: Omit<CatalogueSupplierPrice, 'id' | 'product' | 'vendor_info' | 'created_at' | 'updated_at'>[];
|
|
2498
|
+
specifications?: Omit<ProductSpecification, 'id' | 'product' | 'created_at' | 'updated_at'>[];
|
|
2499
|
+
documents?: Omit<ProductDocument, 'id' | 'product' | 'created_at' | 'updated_at'>[];
|
|
2500
|
+
notes?: Omit<ProductNote, 'id' | 'product' | 'created_by_info' | 'created_at' | 'updated_at'>[];
|
|
2501
|
+
}
|
|
2502
|
+
interface UpdateCatalogueProductPayload extends Partial<CreateCatalogueProductPayload> {
|
|
2503
|
+
}
|
|
2504
|
+
interface AddSupplierPricePayload {
|
|
2505
|
+
vendor: number;
|
|
2506
|
+
unit_price: number;
|
|
2507
|
+
min_quantity?: number;
|
|
2508
|
+
currency?: string;
|
|
2509
|
+
valid_from: string;
|
|
2510
|
+
valid_to: string;
|
|
2511
|
+
lead_time?: number;
|
|
2512
|
+
discount_percent?: number;
|
|
2513
|
+
request_homologation?: boolean;
|
|
2514
|
+
homologation_duration_months?: number;
|
|
2515
|
+
}
|
|
2516
|
+
interface HomologationRequestPayload {
|
|
2517
|
+
duration_months?: number;
|
|
2518
|
+
}
|
|
2519
|
+
interface HomologationRejectionPayload {
|
|
2520
|
+
reason: string;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
declare const CatalogueProductServices: {
|
|
2524
|
+
create: (data: CreateCatalogueProductPayload) => Promise<CatalogueProduct>;
|
|
2525
|
+
get: (id: number) => Promise<CatalogueProduct>;
|
|
2526
|
+
list: (params?: Record<string, any>) => Promise<CatalogueProductListResponse>;
|
|
2527
|
+
search: (params?: Record<string, any>) => Promise<CatalogueProductListResponse>;
|
|
2528
|
+
update: (id: number, data: UpdateCatalogueProductPayload) => Promise<CatalogueProduct>;
|
|
2529
|
+
delete: (id: number) => Promise<unknown>;
|
|
2530
|
+
searchSimilar: (name: string, category: string) => Promise<CatalogueProduct[]>;
|
|
2531
|
+
checkReference: (reference: string, excludeId?: number) => Promise<{
|
|
2532
|
+
exists: boolean;
|
|
2533
|
+
}>;
|
|
2534
|
+
addSupplierPrice: (productId: number, data: AddSupplierPricePayload) => Promise<CatalogueProduct>;
|
|
2535
|
+
};
|
|
2536
|
+
declare const CatalogueSupplierPriceServices: {
|
|
2537
|
+
get: (id: number) => Promise<CatalogueSupplierPrice>;
|
|
2538
|
+
list: (params?: Record<string, any>) => Promise<CatalogueSupplierPriceListResponse>;
|
|
2539
|
+
update: (id: number, data: Partial<CatalogueSupplierPrice>) => Promise<CatalogueSupplierPrice>;
|
|
2540
|
+
delete: (id: number) => Promise<unknown>;
|
|
2541
|
+
requestHomologation: (id: number, data?: HomologationRequestPayload) => Promise<CatalogueSupplierPrice>;
|
|
2542
|
+
approveHomologation: (id: number) => Promise<CatalogueSupplierPrice>;
|
|
2543
|
+
rejectHomologation: (id: number, data: HomologationRejectionPayload) => Promise<CatalogueSupplierPrice>;
|
|
2544
|
+
getPendingHomologations: (params?: Record<string, any>) => Promise<CatalogueSupplierPriceListResponse>;
|
|
2545
|
+
};
|
|
2546
|
+
declare const ProductDocumentServices: {
|
|
2547
|
+
get: (id: number) => Promise<ProductDocument>;
|
|
2548
|
+
list: (params?: Record<string, any>) => Promise<unknown>;
|
|
2549
|
+
create: (data: Partial<ProductDocument>) => Promise<ProductDocument>;
|
|
2550
|
+
update: (id: number, data: Partial<ProductDocument>) => Promise<ProductDocument>;
|
|
2551
|
+
delete: (id: number) => Promise<unknown>;
|
|
2552
|
+
};
|
|
2553
|
+
declare const ProductNoteServices: {
|
|
2554
|
+
get: (id: number) => Promise<ProductNote>;
|
|
2555
|
+
list: (params?: Record<string, any>) => Promise<unknown>;
|
|
2556
|
+
create: (data: Partial<ProductNote>) => Promise<ProductNote>;
|
|
2557
|
+
update: (id: number, data: Partial<ProductNote>) => Promise<ProductNote>;
|
|
2558
|
+
delete: (id: number) => Promise<unknown>;
|
|
2559
|
+
};
|
|
2560
|
+
declare const HomologationConfigServices: {
|
|
2561
|
+
getCurrent: () => Promise<HomologationConfig>;
|
|
2562
|
+
update: (id: number, data: Partial<HomologationConfig>) => Promise<HomologationConfig>;
|
|
2563
|
+
};
|
|
2564
|
+
|
|
2565
|
+
declare const PurchaseRequestServices: {
|
|
2566
|
+
createPurchaseRequest: (data: Partial<PurchaseRequest>, token: string) => Promise<unknown>;
|
|
2567
|
+
getPurchaseRequest: (id: number, token: string) => Promise<unknown>;
|
|
2568
|
+
getPurchaseRequests: (token: string) => Promise<unknown>;
|
|
2569
|
+
updatePurchaseRequest: (id: number, data: Partial<PurchaseRequest>, token: string) => Promise<unknown>;
|
|
2570
|
+
deletePurchaseRequest: (id: number, token: string) => Promise<unknown>;
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
declare const WorkSpaceRoutes: React.FC<{
|
|
2574
|
+
module_name: string;
|
|
2575
|
+
module_id: ModuleType;
|
|
2576
|
+
module_description: string;
|
|
2577
|
+
}>;
|
|
2578
|
+
|
|
2579
|
+
type ContractType = 'cadre' | 'ponctuel' | 'framework' | 'master' | 'call_off' | 'purchase' | 'service' | 'maintenance' | 'lease' | 'license' | 'sla' | 'nda' | 'mou' | 'partnership';
|
|
2580
|
+
type DurationUnit = 'jours' | 'mois' | 'annees';
|
|
2581
|
+
type ContractStatus = 'brouillon' | 'draft' | 'review' | 'approved' | 'actif' | 'active' | 'suspended' | 'expire' | 'expired' | 'resilie' | 'terminated' | 'annule' | 'renewed';
|
|
2582
|
+
type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
2583
|
+
type Incoterm = 'EXW' | 'FCA' | 'CPT' | 'CIP' | 'DAP' | 'DPU' | 'DDP' | 'FAS' | 'FOB' | 'CFR' | 'CIF';
|
|
2584
|
+
type SLACategory = 'delivery' | 'quality' | 'availability' | 'response' | 'resolution' | 'performance' | 'compliance' | 'custom';
|
|
2585
|
+
type SLAStatus = 'achieved' | 'warning' | 'failed' | 'not_measured';
|
|
2586
|
+
type MeasurementFrequency = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
|
|
2587
|
+
interface Contract$1 {
|
|
2588
|
+
id: number;
|
|
2589
|
+
number: string | null;
|
|
2590
|
+
title: string | null;
|
|
2591
|
+
contract_type: ContractType;
|
|
2592
|
+
object: string | null;
|
|
2593
|
+
description: string | null;
|
|
2594
|
+
category: string | null;
|
|
2595
|
+
signature_date: string | null;
|
|
2596
|
+
duration: number;
|
|
2597
|
+
duration_unit: DurationUnit;
|
|
2598
|
+
auto_renewal: boolean;
|
|
2599
|
+
renewal_notice: number;
|
|
2600
|
+
renewal_conditions: string | null;
|
|
2601
|
+
status: ContractStatus;
|
|
2602
|
+
risk_level: RiskLevel;
|
|
2603
|
+
supplier: number | null;
|
|
2604
|
+
supplier_details?: Vendor;
|
|
2605
|
+
buyer: number | null;
|
|
2606
|
+
buyer_details?: User$1;
|
|
2607
|
+
lawyer: number | null;
|
|
2608
|
+
lawyer_details?: User$1;
|
|
2609
|
+
validator: number | null;
|
|
2610
|
+
validator_details?: User$1;
|
|
2611
|
+
contract_manager: number | null;
|
|
2612
|
+
amount: number;
|
|
2613
|
+
currency: string;
|
|
2614
|
+
incoterm: Incoterm;
|
|
2615
|
+
incoterm_location: string | null;
|
|
2616
|
+
penalties: string | null;
|
|
2617
|
+
bonus_clause: string | null;
|
|
2618
|
+
payment_terms: string | null;
|
|
2619
|
+
start_date: string | null;
|
|
2620
|
+
end_date: string | null;
|
|
2621
|
+
renewal_date: string | null;
|
|
2622
|
+
internal_comments: string | null;
|
|
2623
|
+
department: number | null;
|
|
2624
|
+
department_detail: string | null;
|
|
2625
|
+
cost_center: number | null;
|
|
2626
|
+
cost_center_detail: string | null;
|
|
2627
|
+
reminder_days: number | null;
|
|
2628
|
+
evaluation_frequency: MeasurementFrequency | null;
|
|
2629
|
+
evaluation_start_date: string | null;
|
|
2630
|
+
price_schedule_items?: PriceScheduleItem[];
|
|
2631
|
+
sla_indicators?: SLAIndicator[];
|
|
2632
|
+
days_until_expiry?: number;
|
|
2633
|
+
is_expiring_soon?: boolean;
|
|
2634
|
+
sla_indicators_count?: number;
|
|
2635
|
+
sla_status?: SLAStatus | null;
|
|
2636
|
+
created_at?: string;
|
|
2637
|
+
updated_at?: string;
|
|
2638
|
+
created_by?: number;
|
|
2639
|
+
updated_by?: number;
|
|
2640
|
+
}
|
|
2641
|
+
interface SLAIndicator {
|
|
2642
|
+
id: number;
|
|
2643
|
+
contract: number;
|
|
2644
|
+
contract_number?: string;
|
|
2645
|
+
name: string;
|
|
2646
|
+
description: string | null;
|
|
2647
|
+
category: SLACategory;
|
|
2648
|
+
measurement_unit: string;
|
|
2649
|
+
target_type: 'max' | 'min';
|
|
2650
|
+
target_value: number;
|
|
2651
|
+
minimum_acceptable: number;
|
|
2652
|
+
measurement_frequency: MeasurementFrequency;
|
|
2653
|
+
current_value: number | null;
|
|
2654
|
+
last_evaluation: string | null;
|
|
2655
|
+
status: SLAStatus;
|
|
2656
|
+
penalty_type: 'percentage' | 'fixed' | null;
|
|
2657
|
+
penalty_value: number | null;
|
|
2658
|
+
bonus_type: 'percentage' | 'fixed' | null;
|
|
2659
|
+
bonus_value: number | null;
|
|
2660
|
+
bonus_threshold: number | null;
|
|
2661
|
+
is_active: boolean;
|
|
2662
|
+
evaluations?: SLAEvaluation[];
|
|
2663
|
+
evaluations_count?: number;
|
|
2664
|
+
created_at?: string;
|
|
2665
|
+
updated_at?: string;
|
|
2666
|
+
}
|
|
2667
|
+
interface SLAEvaluation {
|
|
2668
|
+
id: number;
|
|
2669
|
+
session?: number | null;
|
|
2670
|
+
sla_indicator: number;
|
|
2671
|
+
evaluation_date: string;
|
|
2672
|
+
value: number;
|
|
2673
|
+
status: 'achieved' | 'warning' | 'failed';
|
|
2674
|
+
comments: string | null;
|
|
2675
|
+
evaluated_by: number | null;
|
|
2676
|
+
evaluated_by_name?: string;
|
|
2677
|
+
automatic_evaluation: boolean;
|
|
2678
|
+
created_at?: string;
|
|
2679
|
+
updated_at?: string;
|
|
2680
|
+
}
|
|
2681
|
+
interface SLAEvaluationSession {
|
|
2682
|
+
id: number;
|
|
2683
|
+
contract: number;
|
|
2684
|
+
contract_number?: string;
|
|
2685
|
+
session_date: string;
|
|
2686
|
+
title: string | null;
|
|
2687
|
+
status: 'draft' | 'completed' | 'validated';
|
|
2688
|
+
comments: string | null;
|
|
2689
|
+
evaluated_by: number | null;
|
|
2690
|
+
evaluated_by_name?: string;
|
|
2691
|
+
validated_by: number | null;
|
|
2692
|
+
validated_by_name?: string;
|
|
2693
|
+
validated_at: string | null;
|
|
2694
|
+
overall_score: number;
|
|
2695
|
+
achieved_count: number;
|
|
2696
|
+
warning_count: number;
|
|
2697
|
+
failed_count: number;
|
|
2698
|
+
evaluations?: SLAEvaluation[];
|
|
2699
|
+
evaluations_count?: number;
|
|
2700
|
+
created_at?: string;
|
|
2701
|
+
updated_at?: string;
|
|
2702
|
+
}
|
|
2703
|
+
interface BulkEvaluationItem {
|
|
2704
|
+
sla_indicator: number;
|
|
2705
|
+
value: number;
|
|
2706
|
+
comments?: string;
|
|
2707
|
+
}
|
|
2708
|
+
interface CreateBulkEvaluationPayload {
|
|
2709
|
+
contract: number;
|
|
2710
|
+
session_date: string;
|
|
2711
|
+
title?: string;
|
|
2712
|
+
comments?: string;
|
|
2713
|
+
evaluations: BulkEvaluationItem[];
|
|
2714
|
+
}
|
|
2715
|
+
interface PriceScheduleItem {
|
|
2716
|
+
id: number;
|
|
2717
|
+
contract: number;
|
|
2718
|
+
contract_number?: string;
|
|
2719
|
+
reference: string;
|
|
2720
|
+
designation: string;
|
|
2721
|
+
unit: string;
|
|
2722
|
+
unit_price: number;
|
|
2723
|
+
currency: string;
|
|
2724
|
+
vat_rate: number;
|
|
2725
|
+
unit_price_ttc?: number;
|
|
2726
|
+
discounted_price?: number;
|
|
2727
|
+
min_quantity: number | null;
|
|
2728
|
+
max_quantity: number | null;
|
|
2729
|
+
estimated_quantity?: number | null;
|
|
2730
|
+
discount?: number | null;
|
|
2731
|
+
category?: string | null;
|
|
2732
|
+
price_valid_from: string;
|
|
2733
|
+
price_valid_until: string | null;
|
|
2734
|
+
price_revision_index: string | null;
|
|
2735
|
+
is_active: boolean;
|
|
2736
|
+
notes: string | null;
|
|
2737
|
+
created_at?: string;
|
|
2738
|
+
updated_at?: string;
|
|
2739
|
+
}
|
|
2740
|
+
interface ContractListResponse {
|
|
2741
|
+
count: number;
|
|
2742
|
+
next: string | null;
|
|
2743
|
+
previous: string | null;
|
|
2744
|
+
results: Contract$1[];
|
|
2745
|
+
data: Contract$1[];
|
|
2746
|
+
}
|
|
2747
|
+
interface FMSite {
|
|
2748
|
+
id: string;
|
|
2749
|
+
name: string;
|
|
2750
|
+
address: string;
|
|
2751
|
+
city: string;
|
|
2752
|
+
postalCode: string;
|
|
2753
|
+
surface: number;
|
|
2754
|
+
floors: number;
|
|
2755
|
+
occupants: number;
|
|
2756
|
+
serviceFrequency: 'daily' | 'weekly' | 'biweekly' | 'monthly';
|
|
2757
|
+
specificRequirements?: string;
|
|
2758
|
+
isMainSite: boolean;
|
|
2759
|
+
}
|
|
2760
|
+
declare const FM_SERVICE_LABELS: Record<FMServiceType, string>;
|
|
2761
|
+
type FMServiceType = 'nettoyage' | 'maintenance_technique' | 'securite' | 'multi_services' | 'espaces_verts' | 'restauration' | 'accueil' | 'courrier' | 'demenagement' | 'energie';
|
|
2762
|
+
interface CreateSLAIndicatorPayload {
|
|
2763
|
+
contract: number;
|
|
2764
|
+
name: string;
|
|
2765
|
+
description?: string;
|
|
2766
|
+
category?: SLACategory;
|
|
2767
|
+
measurement_unit: string;
|
|
2768
|
+
target_value: number;
|
|
2769
|
+
minimum_acceptable: number;
|
|
2770
|
+
measurement_frequency?: MeasurementFrequency;
|
|
2771
|
+
penalty_type?: 'percentage' | 'fixed';
|
|
2772
|
+
penalty_value?: number;
|
|
2773
|
+
bonus_type?: 'percentage' | 'fixed';
|
|
2774
|
+
bonus_value?: number;
|
|
2775
|
+
bonus_threshold?: number;
|
|
2776
|
+
is_active?: boolean;
|
|
2777
|
+
}
|
|
2778
|
+
interface SLATemplate {
|
|
2779
|
+
id: string;
|
|
2780
|
+
name: string;
|
|
2781
|
+
description: string;
|
|
2782
|
+
category: SLAIndicator['category'];
|
|
2783
|
+
measurementUnit: string;
|
|
2784
|
+
targetValue: number;
|
|
2785
|
+
minimumAcceptable: number;
|
|
2786
|
+
measurementFrequency: SLAIndicator['measurement_frequency'];
|
|
2787
|
+
penalties?: {
|
|
2788
|
+
type: 'percentage' | 'fixed';
|
|
2789
|
+
baseValue: number;
|
|
2790
|
+
thresholds: {
|
|
2791
|
+
level: string;
|
|
2792
|
+
threshold: number;
|
|
2793
|
+
penaltyMultiplier: number;
|
|
2794
|
+
}[];
|
|
2795
|
+
};
|
|
2796
|
+
bonus?: {
|
|
2797
|
+
type: 'percentage' | 'fixed';
|
|
2798
|
+
value: number;
|
|
2799
|
+
threshold: number;
|
|
2800
|
+
};
|
|
2801
|
+
applicableServices: FMServiceType[];
|
|
2802
|
+
isDefault: boolean;
|
|
2803
|
+
}
|
|
2804
|
+
/**
|
|
2805
|
+
* Récupère les templates SLA par défaut pour un type de service FM
|
|
2806
|
+
*/
|
|
2807
|
+
declare function getDefaultSLATemplates(serviceType: FMServiceType): SLATemplate[];
|
|
2808
|
+
/**
|
|
2809
|
+
* Récupère tous les templates SLA pour un type de service FM
|
|
2810
|
+
*/
|
|
2811
|
+
declare function getAllSLATemplates(serviceType: FMServiceType): SLATemplate[];
|
|
2812
|
+
/**
|
|
2813
|
+
* Récupère les templates SLA applicables à plusieurs services
|
|
2814
|
+
*/
|
|
2815
|
+
declare function getSLATemplatesForServices(serviceTypes: FMServiceType[]): SLATemplate[];
|
|
2816
|
+
/**
|
|
2817
|
+
* Calcule le plafond de pénalités recommandé (% du contrat)
|
|
2818
|
+
*/
|
|
2819
|
+
declare function getRecommendedPenaltyCap(serviceType: FMServiceType): number;
|
|
2820
|
+
declare const FM_SLA_TEMPLATES: Record<FMServiceType, SLATemplate[]>;
|
|
2821
|
+
interface CreateSLAEvaluationPayload {
|
|
2822
|
+
sla_indicator: number;
|
|
2823
|
+
evaluation_date: string;
|
|
2824
|
+
value: number;
|
|
2825
|
+
comments?: string;
|
|
2826
|
+
evaluated_by?: number;
|
|
2827
|
+
automatic_evaluation?: boolean;
|
|
2828
|
+
}
|
|
2829
|
+
interface CreatePriceScheduleItemPayload {
|
|
2830
|
+
contract: number;
|
|
2831
|
+
reference: string;
|
|
2832
|
+
designation: string;
|
|
2833
|
+
unit: string;
|
|
2834
|
+
unit_price: number;
|
|
2835
|
+
currency?: string;
|
|
2836
|
+
vat_rate?: number;
|
|
2837
|
+
min_quantity?: number;
|
|
2838
|
+
max_quantity?: number;
|
|
2839
|
+
estimated_quantity?: number;
|
|
2840
|
+
discount?: number;
|
|
2841
|
+
category?: string;
|
|
2842
|
+
price_valid_from: string;
|
|
2843
|
+
price_valid_until?: string;
|
|
2844
|
+
price_revision_index?: string;
|
|
2845
|
+
is_active?: boolean;
|
|
2846
|
+
notes?: string;
|
|
2847
|
+
}
|
|
2848
|
+
type CreateContractPayload = Omit<Contract$1, 'id' | 'created_at' | 'updated_at' | 'created_by' | 'updated_by' | 'supplier_details' | 'buyer_details' | 'lawyer_details' | 'validator_details' | 'price_schedule_items' | 'sla_indicators' | 'days_until_expiry' | 'is_expiring_soon' | 'sla_indicators_count' | 'sla_status'> & {
|
|
2849
|
+
sla_indicators?: Omit<CreateSLAIndicatorPayload, 'contract'>[];
|
|
2850
|
+
price_schedule_items?: Omit<CreatePriceScheduleItemPayload, 'contract'>[];
|
|
2851
|
+
};
|
|
2852
|
+
type UpdateContractPayload = Partial<CreateContractPayload> & {
|
|
2853
|
+
sla_indicators?: (Partial<SLAIndicator> & {
|
|
2854
|
+
id?: number;
|
|
2855
|
+
})[];
|
|
2856
|
+
price_schedule_items?: (Partial<PriceScheduleItem> & {
|
|
2857
|
+
id?: number;
|
|
2858
|
+
})[];
|
|
2859
|
+
};
|
|
2860
|
+
declare const CONTRACT_TYPE_OPTIONS: {
|
|
2861
|
+
value: ContractType;
|
|
2862
|
+
label: string;
|
|
2863
|
+
description?: string;
|
|
2864
|
+
}[];
|
|
2865
|
+
declare const DURATION_UNIT_OPTIONS: {
|
|
2866
|
+
value: DurationUnit;
|
|
2867
|
+
label: string;
|
|
2868
|
+
}[];
|
|
2869
|
+
declare const CONTRACT_STATUS_OPTIONS: {
|
|
2870
|
+
value: ContractStatus;
|
|
2871
|
+
label: string;
|
|
2872
|
+
}[];
|
|
2873
|
+
declare const RISK_LEVEL_OPTIONS: {
|
|
2874
|
+
value: RiskLevel;
|
|
2875
|
+
label: string;
|
|
2876
|
+
color: string;
|
|
2877
|
+
}[];
|
|
2878
|
+
declare const INCOTERM_OPTIONS: {
|
|
2879
|
+
value: Incoterm;
|
|
2880
|
+
label: string;
|
|
2881
|
+
description: string;
|
|
2882
|
+
category: 'any' | 'sea';
|
|
2883
|
+
}[];
|
|
2884
|
+
declare const CURRENCY_OPTIONS: {
|
|
2885
|
+
value: string;
|
|
2886
|
+
label: string;
|
|
2887
|
+
}[];
|
|
2888
|
+
declare const SLA_CATEGORY_OPTIONS: {
|
|
2889
|
+
value: SLACategory;
|
|
2890
|
+
label: string;
|
|
2891
|
+
}[];
|
|
2892
|
+
declare const MEASUREMENT_FREQUENCY_OPTIONS: {
|
|
2893
|
+
value: MeasurementFrequency;
|
|
2894
|
+
label: string;
|
|
2895
|
+
}[];
|
|
2896
|
+
type ContractNoteType = 'comment' | 'decision' | 'action' | 'meeting';
|
|
2897
|
+
interface ContractNote {
|
|
2898
|
+
id: number;
|
|
2899
|
+
contract: number;
|
|
2900
|
+
content: string;
|
|
2901
|
+
note_type: ContractNoteType;
|
|
2902
|
+
is_important: boolean;
|
|
2903
|
+
related_indicator: number | null;
|
|
2904
|
+
related_indicator_name: string | null;
|
|
2905
|
+
author: number | null;
|
|
2906
|
+
author_name: string;
|
|
2907
|
+
created_at: string;
|
|
2908
|
+
updated_at: string;
|
|
2909
|
+
}
|
|
2910
|
+
interface CreateContractNotePayload {
|
|
2911
|
+
content: string;
|
|
2912
|
+
note_type: ContractNoteType;
|
|
2913
|
+
is_important?: boolean;
|
|
2914
|
+
related_indicator?: number;
|
|
2915
|
+
}
|
|
2916
|
+
declare const CONTRACT_NOTE_TYPE_OPTIONS: {
|
|
2917
|
+
value: ContractNoteType;
|
|
2918
|
+
label: string;
|
|
2919
|
+
}[];
|
|
2920
|
+
|
|
2921
|
+
declare const ContractsPage: () => react_jsx_runtime.JSX.Element;
|
|
2922
|
+
interface SLAManagementModalProps {
|
|
2923
|
+
isOpen: boolean;
|
|
2924
|
+
onClose: () => void;
|
|
2925
|
+
contract: Contract$1;
|
|
2926
|
+
onUpdateContract: (contract: Contract$1) => void;
|
|
2927
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
2928
|
+
}
|
|
2929
|
+
declare const SLAManagementModal: React$1.FC<SLAManagementModalProps>;
|
|
2930
|
+
|
|
2931
|
+
interface ContractFormProps {
|
|
2932
|
+
contract?: Partial<Contract$1>;
|
|
2933
|
+
onSubmit: (data: Partial<Contract$1>, pendingSLAs?: Omit<CreateSLAIndicatorPayload, 'contract'>[], pendingPriceSchedule?: Omit<CreatePriceScheduleItemPayload, 'contract'>[]) => Promise<Contract$1 | void>;
|
|
2934
|
+
onCancel: () => void;
|
|
2935
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
2936
|
+
isEdit?: boolean;
|
|
2937
|
+
}
|
|
2938
|
+
declare const ContractForm: ({ contract, onSubmit, onCancel, onShowToast, isEdit }: ContractFormProps) => react_jsx_runtime.JSX.Element;
|
|
2939
|
+
|
|
2940
|
+
interface ContractModalProps {
|
|
2941
|
+
isOpen: boolean;
|
|
2942
|
+
onClose: () => void;
|
|
2943
|
+
contract?: Contract$1 | null;
|
|
2944
|
+
initialMode: 'view' | 'create' | 'edit';
|
|
2945
|
+
onContractUpdated: () => void;
|
|
2946
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
2947
|
+
}
|
|
2948
|
+
declare const ContractModal: ({ isOpen, onClose, contract, initialMode, onContractUpdated, onShowToast, }: ContractModalProps) => react_jsx_runtime.JSX.Element;
|
|
2949
|
+
|
|
2950
|
+
interface ExtendedContract extends Contract$1 {
|
|
2951
|
+
financialTerms?: {
|
|
2952
|
+
totalValue?: number;
|
|
2953
|
+
currency?: string;
|
|
2954
|
+
paymentTerms?: string;
|
|
2955
|
+
paymentMethod?: string;
|
|
2956
|
+
retentionRate?: number;
|
|
2957
|
+
priceRevisionClause?: boolean;
|
|
2958
|
+
priceRevisionFormula?: string;
|
|
2959
|
+
priceRevisionIndex?: string;
|
|
2960
|
+
priceRevisionFrequency?: string;
|
|
2961
|
+
paymentSchedule?: Array<{
|
|
2962
|
+
id: string;
|
|
2963
|
+
description: string;
|
|
2964
|
+
amount: number;
|
|
2965
|
+
dueDate: string;
|
|
2966
|
+
status: 'pending' | 'paid' | 'overdue' | 'invoiced';
|
|
2967
|
+
paidDate?: string;
|
|
2968
|
+
triggerEvent?: string;
|
|
2969
|
+
percentage?: number;
|
|
2970
|
+
}>;
|
|
2971
|
+
penaltyClause?: string;
|
|
2972
|
+
penaltyRate?: number;
|
|
2973
|
+
penaltyCap?: number;
|
|
2974
|
+
bonusClause?: string;
|
|
2975
|
+
earlyDeliveryBonus?: number;
|
|
2976
|
+
};
|
|
2977
|
+
governance?: {
|
|
2978
|
+
contractManager?: {
|
|
2979
|
+
name: string;
|
|
2980
|
+
department?: string;
|
|
2981
|
+
email?: string;
|
|
2982
|
+
phone?: string;
|
|
2983
|
+
};
|
|
2984
|
+
businessOwner?: {
|
|
2985
|
+
name: string;
|
|
2986
|
+
department?: string;
|
|
2987
|
+
email?: string;
|
|
2988
|
+
};
|
|
2989
|
+
approvers?: Array<{
|
|
2990
|
+
name: string;
|
|
2991
|
+
userName?: string;
|
|
2992
|
+
role: string;
|
|
2993
|
+
status: string;
|
|
2994
|
+
date?: string;
|
|
2995
|
+
comments?: string;
|
|
2996
|
+
level?: number;
|
|
2997
|
+
approvalDate?: string;
|
|
2998
|
+
}>;
|
|
2999
|
+
escalationMatrix?: Array<{
|
|
3000
|
+
level: number;
|
|
3001
|
+
contact: string;
|
|
3002
|
+
department?: string;
|
|
3003
|
+
responseTime: string;
|
|
3004
|
+
triggerCondition?: string;
|
|
3005
|
+
buyerContact?: string;
|
|
3006
|
+
supplierContact?: string;
|
|
3007
|
+
}>;
|
|
3008
|
+
steeringCommittee?: {
|
|
3009
|
+
members: Array<{
|
|
3010
|
+
name: string;
|
|
3011
|
+
role: string;
|
|
3012
|
+
organization?: string;
|
|
3013
|
+
}>;
|
|
3014
|
+
meetingFrequency: string;
|
|
3015
|
+
lastMeetingDate?: string;
|
|
3016
|
+
nextMeetingDate?: string;
|
|
3017
|
+
};
|
|
3018
|
+
supplierContacts?: Array<{
|
|
3019
|
+
name: string;
|
|
3020
|
+
role: string;
|
|
3021
|
+
email?: string;
|
|
3022
|
+
phone?: string;
|
|
3023
|
+
}>;
|
|
3024
|
+
};
|
|
3025
|
+
classification?: {
|
|
3026
|
+
strategicImportance?: 'strategic' | 'tactical' | 'operational';
|
|
3027
|
+
};
|
|
3028
|
+
priceSchedule?: Array<{
|
|
3029
|
+
id: string;
|
|
3030
|
+
reference: string;
|
|
3031
|
+
designation: string;
|
|
3032
|
+
unit: string;
|
|
3033
|
+
unitPrice: number;
|
|
3034
|
+
quantity?: number;
|
|
3035
|
+
vatRate?: number;
|
|
3036
|
+
discount?: number;
|
|
3037
|
+
category?: string;
|
|
3038
|
+
isActive?: boolean;
|
|
3039
|
+
estimatedQuantity?: number;
|
|
3040
|
+
notes?: string;
|
|
3041
|
+
currency?: string;
|
|
3042
|
+
}>;
|
|
3043
|
+
guarantees?: Array<{
|
|
3044
|
+
id: string;
|
|
3045
|
+
type: 'performance' | 'performance_bond' | 'advance_payment' | 'retention' | 'bid' | 'bid_bond' | 'bank_guarantee' | 'parent_company' | 'warranty';
|
|
3046
|
+
description?: string;
|
|
3047
|
+
status: 'active' | 'released' | 'expired' | 'called' | 'pending';
|
|
3048
|
+
amount: number;
|
|
3049
|
+
currency: string;
|
|
3050
|
+
percentage?: number;
|
|
3051
|
+
issuer: {
|
|
3052
|
+
name: string;
|
|
3053
|
+
type: string;
|
|
3054
|
+
};
|
|
3055
|
+
issueDate: string;
|
|
3056
|
+
expiryDate: string;
|
|
3057
|
+
releaseConditions?: string;
|
|
3058
|
+
}>;
|
|
3059
|
+
insuranceRequirements?: Array<{
|
|
3060
|
+
id: string;
|
|
3061
|
+
type: string;
|
|
3062
|
+
description?: string;
|
|
3063
|
+
status: 'compliant' | 'expired' | 'non_compliant' | 'pending' | 'required';
|
|
3064
|
+
minimumCoverage: number;
|
|
3065
|
+
currency: string;
|
|
3066
|
+
insurer?: string;
|
|
3067
|
+
policyNumber?: string;
|
|
3068
|
+
validUntil?: string;
|
|
3069
|
+
}>;
|
|
3070
|
+
complianceStatus?: 'compliant' | 'warning' | 'non_compliant';
|
|
3071
|
+
riskAssessment?: {
|
|
3072
|
+
overallRiskScore?: number;
|
|
3073
|
+
risks?: Array<{
|
|
3074
|
+
id: string;
|
|
3075
|
+
category: string;
|
|
3076
|
+
title: string;
|
|
3077
|
+
description?: string;
|
|
3078
|
+
likelihood: string;
|
|
3079
|
+
impact: string;
|
|
3080
|
+
status: string;
|
|
3081
|
+
mitigationPlan?: string;
|
|
3082
|
+
riskScore?: number;
|
|
3083
|
+
mitigationStatus?: string;
|
|
3084
|
+
probability?: number;
|
|
3085
|
+
owner?: string;
|
|
3086
|
+
}>;
|
|
3087
|
+
};
|
|
3088
|
+
regulatoryCompliance?: {
|
|
3089
|
+
gdprCompliance?: {
|
|
3090
|
+
status: string;
|
|
3091
|
+
applicable?: boolean;
|
|
3092
|
+
dataProcessingAgreement?: boolean;
|
|
3093
|
+
};
|
|
3094
|
+
antiCorruption?: {
|
|
3095
|
+
status: string;
|
|
3096
|
+
applicable?: boolean;
|
|
3097
|
+
dueDiligenceCompleted?: boolean;
|
|
3098
|
+
riskRating?: string;
|
|
3099
|
+
};
|
|
3100
|
+
sanctionsScreening?: {
|
|
3101
|
+
status: string;
|
|
3102
|
+
lastScreeningDate?: string;
|
|
3103
|
+
};
|
|
3104
|
+
};
|
|
3105
|
+
esgCriteria?: {
|
|
3106
|
+
overallScore?: number;
|
|
3107
|
+
lastAssessmentDate?: string;
|
|
3108
|
+
environmental?: {
|
|
3109
|
+
score?: number;
|
|
3110
|
+
carbonFootprintReduction?: boolean;
|
|
3111
|
+
wasteManagement?: boolean;
|
|
3112
|
+
sustainableMaterials?: boolean;
|
|
3113
|
+
energyEfficiency?: boolean;
|
|
3114
|
+
certifications?: string[];
|
|
3115
|
+
};
|
|
3116
|
+
social?: {
|
|
3117
|
+
score?: number;
|
|
3118
|
+
fairLaborPractices?: boolean;
|
|
3119
|
+
healthAndSafety?: boolean;
|
|
3120
|
+
diversityInclusion?: boolean;
|
|
3121
|
+
communityEngagement?: boolean;
|
|
3122
|
+
certifications?: string[];
|
|
3123
|
+
};
|
|
3124
|
+
governance?: {
|
|
3125
|
+
score?: number;
|
|
3126
|
+
ethicsPolicy?: boolean;
|
|
3127
|
+
antiCorruption?: boolean;
|
|
3128
|
+
transparencyReporting?: boolean;
|
|
3129
|
+
dataPrivacy?: boolean;
|
|
3130
|
+
};
|
|
3131
|
+
sdgAlignment?: Array<{
|
|
3132
|
+
goal: number;
|
|
3133
|
+
description?: string;
|
|
3134
|
+
}>;
|
|
3135
|
+
};
|
|
3136
|
+
obligations?: Array<{
|
|
3137
|
+
id: string;
|
|
3138
|
+
party: 'buyer' | 'supplier';
|
|
3139
|
+
category: string;
|
|
3140
|
+
description: string;
|
|
3141
|
+
status: 'pending' | 'overdue' | 'completed' | 'in_progress' | 'waived';
|
|
3142
|
+
dueDate: string;
|
|
3143
|
+
priority: string;
|
|
3144
|
+
completedDate?: string;
|
|
3145
|
+
comments?: string;
|
|
3146
|
+
title?: string;
|
|
3147
|
+
obligor?: string;
|
|
3148
|
+
type?: string;
|
|
3149
|
+
frequency?: string;
|
|
3150
|
+
responsiblePerson?: string;
|
|
3151
|
+
}>;
|
|
3152
|
+
slaIndicators?: Array<{
|
|
3153
|
+
id: string;
|
|
3154
|
+
name: string;
|
|
3155
|
+
category: string;
|
|
3156
|
+
targetValue: number;
|
|
3157
|
+
measurementUnit: string;
|
|
3158
|
+
currentValue?: number;
|
|
3159
|
+
status: 'achieved' | 'warning' | 'failed' | 'not_measured';
|
|
3160
|
+
lastMeasurement?: string;
|
|
3161
|
+
history?: Array<{
|
|
3162
|
+
date: string;
|
|
3163
|
+
value: number;
|
|
3164
|
+
status: string;
|
|
3165
|
+
}>;
|
|
3166
|
+
}>;
|
|
3167
|
+
evaluations?: Array<{
|
|
3168
|
+
id: string;
|
|
3169
|
+
evaluatorName: string;
|
|
3170
|
+
evaluatorDepartment?: string;
|
|
3171
|
+
evaluationDate: string;
|
|
3172
|
+
overallScore: number;
|
|
3173
|
+
status: 'pending' | 'completed' | 'reviewed';
|
|
3174
|
+
categories?: Array<{
|
|
3175
|
+
name: string;
|
|
3176
|
+
score: number;
|
|
3177
|
+
weight: number;
|
|
3178
|
+
}>;
|
|
3179
|
+
strengths?: string;
|
|
3180
|
+
weaknesses?: string;
|
|
3181
|
+
recommendations?: string;
|
|
3182
|
+
}>;
|
|
3183
|
+
documents?: Array<{
|
|
3184
|
+
id: string;
|
|
3185
|
+
name: string;
|
|
3186
|
+
type: string;
|
|
3187
|
+
version?: string;
|
|
3188
|
+
uploadedBy?: string;
|
|
3189
|
+
uploadedAt?: string;
|
|
3190
|
+
size?: number;
|
|
3191
|
+
category?: string;
|
|
3192
|
+
description?: string;
|
|
3193
|
+
}>;
|
|
3194
|
+
auditTrail?: Array<{
|
|
3195
|
+
id: string;
|
|
3196
|
+
action: string;
|
|
3197
|
+
user: string;
|
|
3198
|
+
userName?: string;
|
|
3199
|
+
timestamp: string;
|
|
3200
|
+
field?: string;
|
|
3201
|
+
oldValue?: string;
|
|
3202
|
+
newValue?: string;
|
|
3203
|
+
notes?: string;
|
|
3204
|
+
changes?: Array<{
|
|
3205
|
+
field: string;
|
|
3206
|
+
oldValue?: string;
|
|
3207
|
+
newValue?: string;
|
|
3208
|
+
}>;
|
|
3209
|
+
}>;
|
|
3210
|
+
fm_services?: Array<{
|
|
3211
|
+
service_type?: string;
|
|
3212
|
+
name?: string;
|
|
3213
|
+
is_active?: boolean;
|
|
3214
|
+
description?: string;
|
|
3215
|
+
frequency?: string;
|
|
3216
|
+
unit_price?: number;
|
|
3217
|
+
}>;
|
|
3218
|
+
fm_sites?: Array<{
|
|
3219
|
+
name: string;
|
|
3220
|
+
address?: string;
|
|
3221
|
+
surface?: number;
|
|
3222
|
+
}>;
|
|
3223
|
+
amendments?: Array<{
|
|
3224
|
+
id: string;
|
|
3225
|
+
number: string;
|
|
3226
|
+
status: string;
|
|
3227
|
+
description: string;
|
|
3228
|
+
date: string;
|
|
3229
|
+
reason: string;
|
|
3230
|
+
}>;
|
|
3231
|
+
maxRenewalPeriods?: number;
|
|
3232
|
+
businessUnit?: string;
|
|
3233
|
+
projectCode?: string;
|
|
3234
|
+
createdBy?: string;
|
|
3235
|
+
version?: number;
|
|
3236
|
+
tags?: string[];
|
|
3237
|
+
}
|
|
3238
|
+
type Contract = ExtendedContract;
|
|
3239
|
+
interface ViewContractContentProps {
|
|
3240
|
+
contract: Contract;
|
|
3241
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3242
|
+
onEdit?: () => void;
|
|
3243
|
+
onDelete?: (contractId: string) => void;
|
|
3244
|
+
onOpenSLA?: (contract: Contract) => void;
|
|
3245
|
+
onOpenEvaluation?: (contract: Contract) => void;
|
|
3246
|
+
}
|
|
3247
|
+
declare const ViewContractContent: ({ contract, onShowToast, onEdit, onDelete, onOpenSLA, onOpenEvaluation }: ViewContractContentProps) => react_jsx_runtime.JSX.Element;
|
|
3248
|
+
|
|
3249
|
+
interface SLAIndicatorFormData {
|
|
3250
|
+
name: string;
|
|
3251
|
+
description: string;
|
|
3252
|
+
category: SLACategory;
|
|
3253
|
+
measurement_unit: string;
|
|
3254
|
+
target_value: number;
|
|
3255
|
+
minimum_acceptable: number;
|
|
3256
|
+
target_type: 'max' | 'min';
|
|
3257
|
+
measurement_frequency: MeasurementFrequency;
|
|
3258
|
+
penalty_type: 'percentage' | 'fixed' | null;
|
|
3259
|
+
penalty_value: number | null;
|
|
3260
|
+
bonus_type: 'percentage' | 'fixed' | null;
|
|
3261
|
+
bonus_value: number | null;
|
|
3262
|
+
bonus_threshold: number | null;
|
|
3263
|
+
is_active: boolean;
|
|
3264
|
+
}
|
|
3265
|
+
interface SLAIndicatorFormProps {
|
|
3266
|
+
indicator?: Partial<SLAIndicator>;
|
|
3267
|
+
onSubmit: (data: SLAIndicatorFormData) => void;
|
|
3268
|
+
onCancel: () => void;
|
|
3269
|
+
onShowToast?: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3270
|
+
isEdit?: boolean;
|
|
3271
|
+
compact?: boolean;
|
|
3272
|
+
}
|
|
3273
|
+
declare const SLAIndicatorForm: React$1.FC<SLAIndicatorFormProps>;
|
|
3274
|
+
|
|
3275
|
+
interface SLAEvaluationFormProps {
|
|
3276
|
+
indicator: SLAIndicator;
|
|
3277
|
+
evaluation?: SLAEvaluation;
|
|
3278
|
+
onSubmit: (evaluation: CreateSLAEvaluationPayload) => void;
|
|
3279
|
+
onCancel: () => void;
|
|
3280
|
+
onShowToast?: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3281
|
+
isEdit?: boolean;
|
|
3282
|
+
}
|
|
3283
|
+
declare const SLAEvaluationForm: React$1.FC<SLAEvaluationFormProps>;
|
|
3284
|
+
|
|
3285
|
+
interface AddSLAIndicatorModalProps {
|
|
3286
|
+
isOpen: boolean;
|
|
3287
|
+
onClose: () => void;
|
|
3288
|
+
indicator?: SLAIndicator;
|
|
3289
|
+
onSubmit: (indicator: Partial<SLAIndicator>) => void;
|
|
3290
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3291
|
+
isEdit?: boolean;
|
|
3292
|
+
}
|
|
3293
|
+
declare const AddSLAIndicatorModal: React$1.FC<AddSLAIndicatorModalProps>;
|
|
3294
|
+
|
|
3295
|
+
interface AddSLAEvaluationModalProps {
|
|
3296
|
+
isOpen: boolean;
|
|
3297
|
+
onClose: () => void;
|
|
3298
|
+
indicator: SLAIndicator;
|
|
3299
|
+
evaluation?: SLAEvaluation;
|
|
3300
|
+
onSubmit: (evaluation: CreateSLAEvaluationPayload) => void;
|
|
3301
|
+
onShowToast?: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3302
|
+
isEdit?: boolean;
|
|
3303
|
+
}
|
|
3304
|
+
declare const AddSLAEvaluationModal: React$1.FC<AddSLAEvaluationModalProps>;
|
|
3305
|
+
|
|
3306
|
+
interface BulkSLAEvaluationModalProps {
|
|
3307
|
+
isOpen: boolean;
|
|
3308
|
+
onClose: () => void;
|
|
3309
|
+
contract: Contract$1;
|
|
3310
|
+
onSuccess: () => void;
|
|
3311
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3312
|
+
}
|
|
3313
|
+
declare const BulkSLAEvaluationModal: React$1.FC<BulkSLAEvaluationModalProps>;
|
|
3314
|
+
|
|
3315
|
+
interface ContractReportsModalProps {
|
|
3316
|
+
isOpen: boolean;
|
|
3317
|
+
onClose: () => void;
|
|
3318
|
+
contracts: Contract$1[];
|
|
3319
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3320
|
+
}
|
|
3321
|
+
declare const ContractReportsModal: React$1.FC<ContractReportsModalProps>;
|
|
3322
|
+
|
|
3323
|
+
interface AlertsManagementModalProps {
|
|
3324
|
+
isOpen: boolean;
|
|
3325
|
+
onClose: () => void;
|
|
3326
|
+
contracts: Contract$1[];
|
|
3327
|
+
onShowToast: (message: string, type: 'success' | 'error' | 'warning' | 'info') => void;
|
|
3328
|
+
}
|
|
3329
|
+
declare const AlertsManagementModal: React$1.FC<AlertsManagementModalProps>;
|
|
3330
|
+
|
|
3331
|
+
declare const ContractServices: {
|
|
3332
|
+
create: (data: CreateContractPayload) => Promise<Contract$1>;
|
|
3333
|
+
get: (id: number) => Promise<Contract$1>;
|
|
3334
|
+
list: (params?: Record<string, any>) => Promise<ContractListResponse>;
|
|
3335
|
+
slaSummary: (params?: Record<string, any>) => Promise<ContractListResponse>;
|
|
3336
|
+
update: (id: number, data: UpdateContractPayload) => Promise<Contract$1>;
|
|
3337
|
+
patch: (id: number, data: Partial<UpdateContractPayload>) => Promise<Contract$1>;
|
|
3338
|
+
delete: (id: number) => Promise<unknown>;
|
|
3339
|
+
getNotes: (contractId: number) => Promise<{
|
|
3340
|
+
success: boolean;
|
|
3341
|
+
count: number;
|
|
3342
|
+
data: ContractNote[];
|
|
3343
|
+
}>;
|
|
3344
|
+
addNote: (contractId: number, data: CreateContractNotePayload) => Promise<{
|
|
3345
|
+
success: boolean;
|
|
3346
|
+
message: string;
|
|
3347
|
+
data: ContractNote;
|
|
3348
|
+
}>;
|
|
3349
|
+
deleteNote: (contractId: number, noteId: number) => Promise<{
|
|
3350
|
+
success: boolean;
|
|
3351
|
+
message: string;
|
|
3352
|
+
}>;
|
|
3353
|
+
updateNote: (contractId: number, noteId: number, data: Partial<CreateContractNotePayload>) => Promise<{
|
|
3354
|
+
success: boolean;
|
|
3355
|
+
message: string;
|
|
3356
|
+
data: ContractNote;
|
|
3357
|
+
}>;
|
|
3358
|
+
};
|
|
3359
|
+
|
|
3360
|
+
interface SLAIndicatorListResponse {
|
|
3361
|
+
count: number;
|
|
3362
|
+
next: string | null;
|
|
3363
|
+
previous: string | null;
|
|
3364
|
+
results: SLAIndicator[];
|
|
3365
|
+
}
|
|
3366
|
+
interface SLAEvaluationListResponse {
|
|
3367
|
+
count: number;
|
|
3368
|
+
next: string | null;
|
|
3369
|
+
previous: string | null;
|
|
3370
|
+
results: SLAEvaluation[];
|
|
3371
|
+
}
|
|
3372
|
+
interface SLADashboard {
|
|
3373
|
+
total_indicators: number;
|
|
3374
|
+
achieved: number;
|
|
3375
|
+
warning: number;
|
|
3376
|
+
failed: number;
|
|
3377
|
+
not_measured: number;
|
|
3378
|
+
average_performance: number;
|
|
3379
|
+
by_category: Record<string, number>;
|
|
3380
|
+
recent_evaluations: SLAEvaluation[];
|
|
3381
|
+
}
|
|
3382
|
+
declare const SLAIndicatorServices: {
|
|
3383
|
+
create: (data: CreateSLAIndicatorPayload) => Promise<SLAIndicator>;
|
|
3384
|
+
get: (id: number) => Promise<SLAIndicator>;
|
|
3385
|
+
list: (params?: Record<string, any>) => Promise<SLAIndicatorListResponse>;
|
|
3386
|
+
listByContract: (contractId: number) => Promise<SLAIndicator[]>;
|
|
3387
|
+
update: (id: number, data: Partial<CreateSLAIndicatorPayload>) => Promise<SLAIndicator>;
|
|
3388
|
+
patch: (id: number, data: Partial<CreateSLAIndicatorPayload>) => Promise<SLAIndicator>;
|
|
3389
|
+
delete: (id: number) => Promise<unknown>;
|
|
3390
|
+
dashboard: () => Promise<SLADashboard>;
|
|
3391
|
+
};
|
|
3392
|
+
declare const SLAEvaluationServices: {
|
|
3393
|
+
create: (data: CreateSLAEvaluationPayload) => Promise<SLAEvaluation>;
|
|
3394
|
+
get: (id: number) => Promise<SLAEvaluation>;
|
|
3395
|
+
list: (params?: Record<string, any>) => Promise<SLAEvaluationListResponse>;
|
|
3396
|
+
listByIndicator: (indicatorId: number) => Promise<SLAEvaluation[]>;
|
|
3397
|
+
update: (id: number, data: Partial<CreateSLAEvaluationPayload>) => Promise<SLAEvaluation>;
|
|
3398
|
+
patch: (id: number, data: Partial<CreateSLAEvaluationPayload>) => Promise<SLAEvaluation>;
|
|
3399
|
+
delete: (id: number) => Promise<unknown>;
|
|
3400
|
+
};
|
|
3401
|
+
interface SLAEvaluationSessionListResponse {
|
|
3402
|
+
count: number;
|
|
3403
|
+
next: string | null;
|
|
3404
|
+
previous: string | null;
|
|
3405
|
+
results: SLAEvaluationSession[];
|
|
3406
|
+
}
|
|
3407
|
+
interface ApiResponse<T> {
|
|
3408
|
+
success: boolean;
|
|
3409
|
+
message?: string;
|
|
3410
|
+
data: T;
|
|
3411
|
+
}
|
|
3412
|
+
declare const SLAEvaluationSessionServices: {
|
|
3413
|
+
/**
|
|
3414
|
+
* Créer une session d'évaluation avec toutes les évaluations en une seule requête
|
|
3415
|
+
* (évaluation groupée de tous les indicateurs SLA d'un contrat)
|
|
3416
|
+
*/
|
|
3417
|
+
bulkCreate: (data: CreateBulkEvaluationPayload) => Promise<ApiResponse<SLAEvaluationSession>>;
|
|
3418
|
+
create: (data: Partial<SLAEvaluationSession>) => Promise<SLAEvaluationSession>;
|
|
3419
|
+
get: (id: number) => Promise<{
|
|
3420
|
+
success: boolean;
|
|
3421
|
+
data: SLAEvaluationSession;
|
|
3422
|
+
}>;
|
|
3423
|
+
list: (params?: Record<string, any>) => Promise<SLAEvaluationSessionListResponse>;
|
|
3424
|
+
listByContract: (contractId: number) => Promise<{
|
|
3425
|
+
success: boolean;
|
|
3426
|
+
count: number;
|
|
3427
|
+
data: SLAEvaluationSession[];
|
|
3428
|
+
}>;
|
|
3429
|
+
update: (id: number, data: Partial<SLAEvaluationSession>) => Promise<SLAEvaluationSession>;
|
|
3430
|
+
patch: (id: number, data: Partial<SLAEvaluationSession>) => Promise<SLAEvaluationSession>;
|
|
3431
|
+
delete: (id: number) => Promise<unknown>;
|
|
3432
|
+
validate: (id: number) => Promise<SLAEvaluationSession>;
|
|
3433
|
+
addEvaluation: (sessionId: number, data: {
|
|
3434
|
+
sla_indicator: number;
|
|
3435
|
+
value: number;
|
|
3436
|
+
comments?: string;
|
|
3437
|
+
}) => Promise<SLAEvaluation>;
|
|
3438
|
+
};
|
|
3439
|
+
|
|
3440
|
+
interface PriceScheduleItemListResponse {
|
|
3441
|
+
count: number;
|
|
3442
|
+
next: string | null;
|
|
3443
|
+
previous: string | null;
|
|
3444
|
+
results: PriceScheduleItem[];
|
|
3445
|
+
}
|
|
3446
|
+
declare const PriceScheduleServices: {
|
|
3447
|
+
create: (data: CreatePriceScheduleItemPayload) => Promise<PriceScheduleItem>;
|
|
3448
|
+
get: (id: number) => Promise<PriceScheduleItem>;
|
|
3449
|
+
list: (params?: Record<string, any>) => Promise<PriceScheduleItemListResponse>;
|
|
3450
|
+
listByContract: (contractId: number) => Promise<PriceScheduleItem[]>;
|
|
3451
|
+
update: (id: number, data: Partial<CreatePriceScheduleItemPayload>) => Promise<PriceScheduleItem>;
|
|
3452
|
+
patch: (id: number, data: Partial<CreatePriceScheduleItemPayload>) => Promise<PriceScheduleItem>;
|
|
3453
|
+
delete: (id: number) => Promise<unknown>;
|
|
3454
|
+
bulkCreate: (items: CreatePriceScheduleItemPayload[]) => Promise<PriceScheduleItem[]>;
|
|
3455
|
+
};
|
|
3456
|
+
|
|
3457
|
+
export { ACCOUNT_TYPE_LABELS, API_URL, type Account, type AccountListResponse, AccountServices, type AccountType, AccountingWorkspace, AssetsDashboard as ActifsPage, AddSLAEvaluationModal, AddSLAIndicatorModal, type AddSupplierPricePayload, Alert, AlertProvider, AlertsManagementModal, type ApiResponse, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AttachmentUploader, type AttachmentUploaderProps, AuthServices, BALANCE_TYPE_LABELS, type BackendFile, type BackendFolder, Badge, type BalanceType, Breadcrumb, BudgetPage, type BulkEvaluationItem, BulkSLAEvaluationModal, CHOICES, CONTRACT_NOTE_TYPE_OPTIONS, CONTRACT_STATUS_OPTIONS, CONTRACT_TYPE_OPTIONS, CURRENCY_OPTIONS, CardBody, CardHeader, type CatalogueProduct, type CatalogueProductListItem, type CatalogueProductListResponse, CatalogueProductSelector, CatalogueProductServices, type CatalogueSupplierPrice, type CatalogueSupplierPriceListResponse, CatalogueSupplierPriceServices, TeamChat as ChatEquipePage, type Client, type ClientListResponse, ClientServices, type ConfirmOptions, ContextMenu, type ContextMenuAction, type ContextMenuPosition, type Contract$1 as Contract, ContractForm, type ContractListResponse, ContractModal, type ContractNote, type ContractNoteType, ContractReportsModal, ContractServices, type ContractStatus, type ContractType, ContractsPage, CountrySelector, type CreateBulkEvaluationPayload, type CreateCatalogueProductPayload, type CreateContractNotePayload, type CreateContractPayload, type CreatePriceScheduleItemPayload, type CreateSLAEvaluationPayload, type CreateSLAIndicatorPayload, CrmWorkspace, DURATION_UNIT_OPTIONS, DataTable, DateInput, DocumentFooter, DocumentHeader, type DocumentType, type DurationUnit, EntityFileManager, type EntityFileManagerProps, type EntityType, FDrawer, type FMServiceType, type FMSite, FM_SERVICE_LABELS, FM_SLA_TEMPLATES, FROM_MODULE_CHOICES, FacilityWorkspace, FetchApi, FileCard, FileGrid, FileInput, type FileItem, FileList, FileManager, type FileManagerContextValue, type FileManagerProps, FileManagerProvider, type FileManagerTexts, FolderTree, ForeignCurrencySelector, FormClient, FormPurchaseRequest, FormVendor, type FromModule, HRConnectPage, type HomologationConfig, HomologationConfigServices, type HomologationRejectionPayload, type HomologationRequestPayload, type HomologationStatus, INCOTERM_OPTIONS, type Incoterm, InfoBox, InputField, InvoiceTypeSelector, LegalFormSelector, MEASUREMENT_FREQUENCY_OPTIONS, type MeasurementFrequency, MeetingHubPage, type MenuItem, MinimalVendorForm, Modal, ModernCard, type ModuleConfig, type ModuleType, NumberInput, PRINT_GREEN, Pages, PaymentMethodSelector, type PendingTask, TeamCalendar as PlanningPage, type PriceScheduleItem, type PriceScheduleItemListResponse, PriceScheduleServices, PrimaryButton, PrintPreview, type PrintPreviewProps, PrintableDocument, type PrintableDocumentProps, type ProcurementWorkspaceStats, type ProductDocument, ProductDocumentServices, type ProductNote, ProductNoteServices, type ProductSpecification, type ProductStatus, type ProductType, type PurchaseRequest, type PurchaseRequestItem, PurchaseRequestServices, type PurchaseRequestStatus, PurchaseRequestsPage, PurchaseWorkspace, RISK_LEVEL_OPTIONS, type RecentActivity, RewiseBasicCard, RewiseCard, RewiseLayout, type RiskLevel, RootFileManager, type SLACategory, type SLADashboard, type SLAEvaluation, SLAEvaluationForm, type SLAEvaluationListResponse, SLAEvaluationServices, type SLAEvaluationSession, type SLAEvaluationSessionListResponse, SLAEvaluationSessionServices, type SLAIndicator, SLAIndicatorForm, type SLAIndicatorListResponse, SLAIndicatorServices, SLAManagementModal, type SLAStatus, type SLATemplate, SLA_CATEGORY_OPTIONS, SYSCOHADA_CLASSES, SearchableSelect, type SearchableSelectOption, SecondaryButton, SelectAccount, SelectClient, SelectCostCenter, SelectDepartment, SelectInput, SelectUnit, SelectUser, SelectVendor, type SelectedProductLine, SessionProvider, SignatureSection, StatCard, TEMPLATE_FNE_CHOICES, type Tab, Tabs, type TabsProps, TaskPilot, TaxSelector, type TemplateFNE, TemplateFNESelector, TextInput, type Theme, type ThemeColors, type ThemeContextValue, ThemeProvider, type ThemeType, ToastContainer, ToastProvider, Toolbar, TotalsSection, type Unit, UnitServices, type UpdateCatalogueProductPayload, type UpdateContractPayload, type UrgencyLevel, type UseFileManagerApiReturn, type User$1 as User, UserServices, type Vendor, type VendorListResponse, VendorServices, ViewContractContent, type ViewMode, WorkSpace, WorkSpaceRoutes, WorkspaceServices, defaultTheme, fileManagerApi, findFolderById, formatCurrency, formatDate, formatDateFR, formatDateTime, formatFileSize, getAllFolders, getAllSLATemplates, getDefaultSLATemplates, getFileExtension, getFileIcon, getFileIconColor, getMimeTypeFromExtension, getRecommendedPenaltyCap, getSLATemplatesForServices, getThemeCSSVariables, isImageFile, numberToWords, themes, useAlert, useFileManager, useFileManagerApi, usePermissions, useRootFileManagerApi, useSession, useTheme, useToast };
|