ptechcore_ui 1.0.19 → 1.0.21

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.d.cts CHANGED
@@ -87,9 +87,75 @@ declare const RewiseLayout: React$1.FC<PrivateLayoutProps>;
87
87
 
88
88
  declare const ToastContainer: React$1.FC;
89
89
 
90
- interface Entity {
90
+ interface Module$1 {
91
+ id: number;
92
+ code: string;
93
+ name: string;
94
+ description?: string;
95
+ price: number;
96
+ is_active: boolean;
97
+ price_monthly: number;
98
+ price_yearly: number;
99
+ created_at: string;
100
+ updated_at: string;
101
+ is_deleted: boolean;
102
+ }
103
+ interface Plan {
104
+ id: number;
105
+ name: string;
106
+ description?: string;
107
+ price_monthly: number;
108
+ price_yearly: number;
109
+ max_users: number;
110
+ max_entities: number;
111
+ modules_included: Module$1[] | number[];
112
+ is_private: boolean;
113
+ private_for?: number | null;
114
+ created_at: string;
115
+ updated_at: string;
116
+ is_deleted: boolean;
117
+ }
118
+ interface Subscription {
91
119
  id: number;
92
120
  organization: number;
121
+ plan: Plan;
122
+ start_date: string;
123
+ end_date: string;
124
+ is_active: boolean;
125
+ created_at: string;
126
+ updated_at: string;
127
+ extra_modules?: Module$1[] | number[];
128
+ }
129
+
130
+ interface Module {
131
+ id: number;
132
+ code: string;
133
+ name: string;
134
+ description?: string;
135
+ price?: number;
136
+ price_monthly?: number;
137
+ price_yearly?: number;
138
+ is_active?: boolean;
139
+ is_deleted?: boolean;
140
+ deleted_at?: string | null;
141
+ }
142
+ interface Organization {
143
+ id: number;
144
+ legal_name: string;
145
+ trading_name?: string;
146
+ phone?: string;
147
+ email?: string;
148
+ address?: string;
149
+ owner: number;
150
+ active_subscription?: Subscription | null;
151
+ modules?: Module[];
152
+ created_at: string;
153
+ updated_at: string;
154
+ is_deleted: boolean;
155
+ }
156
+ interface Entity {
157
+ id: number;
158
+ organization: Organization | number;
93
159
  legal_name: string;
94
160
  trading_name?: string;
95
161
  phone?: string;
@@ -124,6 +190,7 @@ interface User {
124
190
  last_login: string | null;
125
191
  is_superuser: boolean;
126
192
  username: string;
193
+ department: number | null;
127
194
  first_name: string;
128
195
  last_name: string;
129
196
  email: string;
@@ -139,6 +206,45 @@ interface User {
139
206
  centers_access?: Entity[];
140
207
  }
141
208
 
209
+ type FromModule = 'accounting' | 'crm' | 'procurement';
210
+ interface Vendor {
211
+ id?: number;
212
+ legal_name: string;
213
+ trading_name?: string | null;
214
+ phone?: string | null;
215
+ email?: string | null;
216
+ logo?: string | null;
217
+ year_founded?: string | null;
218
+ activity_sector?: string | null;
219
+ description?: string | null;
220
+ accounting_account_number?: string | null;
221
+ capital?: number | null;
222
+ annual_turnover?: number | null;
223
+ payment_delay?: number | null;
224
+ country?: string | null;
225
+ city?: string | null;
226
+ address?: string | null;
227
+ legal_form?: string | null;
228
+ tax_regime?: string | null;
229
+ tax_account?: string | null;
230
+ rccm?: string | null;
231
+ legal_representative_name?: string | null;
232
+ legal_representative_address?: string | null;
233
+ legal_representative_phone?: string | null;
234
+ legal_representative_email?: string | null;
235
+ legal_representative_id_document?: string | null;
236
+ legal_representative_id_number?: string | null;
237
+ legal_representative_fonction?: string | null;
238
+ bank_name?: string | null;
239
+ bank_address?: string | null;
240
+ bank_email?: string | null;
241
+ bank_phone?: string | null;
242
+ iban?: string | null;
243
+ rib?: string | null;
244
+ from_module?: FromModule | null;
245
+ vendor_number: string;
246
+ }
247
+
142
248
  interface SessionContextType {
143
249
  isAuthenticated: boolean;
144
250
  token: string | null;
@@ -149,6 +255,11 @@ interface SessionContextType {
149
255
  logout: () => void;
150
256
  showAuthModal: boolean;
151
257
  setShowAuthModal: (data: boolean) => void;
258
+ vendors: Vendor[];
259
+ setVendors: (vendors: Vendor[]) => void;
260
+ loadingVendors: boolean;
261
+ setLoadingVendors: (loading: boolean) => void;
262
+ loadVendors: () => Promise<void>;
152
263
  }
153
264
  declare const useSession: () => SessionContextType;
154
265
  declare const SessionProvider: ({ children }: {
@@ -166,6 +277,13 @@ interface Toast {
166
277
  type: 'success' | 'error' | 'warning' | 'info';
167
278
  duration?: number;
168
279
  }
280
+ interface ConfirmOptions {
281
+ title?: string;
282
+ message: string;
283
+ confirmText?: string;
284
+ cancelText?: string;
285
+ type?: 'danger' | 'warning' | 'info';
286
+ }
169
287
  interface ToastContextType {
170
288
  toasts: Toast[];
171
289
  addToast: (toast: Omit<Toast, 'id'>) => void;
@@ -174,6 +292,7 @@ interface ToastContextType {
174
292
  error: (message: string, duration?: number) => void;
175
293
  warning: (message: string, duration?: number) => void;
176
294
  info: (message: string, duration?: number) => void;
295
+ confirm: (options: ConfirmOptions | string) => Promise<boolean>;
177
296
  }
178
297
  declare const useToast: () => ToastContextType;
179
298
  interface ToastProviderProps {
@@ -191,6 +310,19 @@ interface PagesProps {
191
310
  }
192
311
  declare const Pages: React$1.FC<PagesProps>;
193
312
 
313
+ interface UpdateProfileData {
314
+ first_name?: string;
315
+ last_name?: string;
316
+ email?: string;
317
+ phonenumber?: string;
318
+ job_title?: string;
319
+ department?: string;
320
+ }
321
+ interface ChangePasswordData {
322
+ current_password: string;
323
+ new_password: string;
324
+ confirm_password: string;
325
+ }
194
326
  declare const UserServices: {
195
327
  addUser: (data: Partial<User>, token: string) => Promise<unknown>;
196
328
  getUsers: (token: string) => Promise<unknown>;
@@ -202,6 +334,11 @@ declare const UserServices: {
202
334
  getEntityUsers: (entityId: number, token: string) => Promise<unknown>;
203
335
  getuserEntitiesAccess: (id: number, token: string) => Promise<unknown>;
204
336
  addUserToEntity: (entityId: number, userId: number, token: string) => Promise<unknown>;
337
+ updateMyProfile: (data: UpdateProfileData) => Promise<unknown>;
338
+ updateProfilePicture: (file: File) => Promise<unknown>;
339
+ deleteProfilePicture: () => Promise<unknown>;
340
+ changePassword: (data: ChangePasswordData) => Promise<unknown>;
341
+ getMyProfile: () => Promise<unknown>;
205
342
  };
206
343
 
207
344
  interface SendOtpPayload {
@@ -418,6 +555,14 @@ declare const ApprovalServices: {
418
555
  }>;
419
556
  };
420
557
 
558
+ type ImportField = {
559
+ value: string;
560
+ label: string;
561
+ };
562
+ type ImportFieldsConfig = {
563
+ required: ImportField[];
564
+ optional: ImportField[];
565
+ };
421
566
  type FDrawerColumn = {
422
567
  key: string;
423
568
  label: string;
@@ -444,6 +589,11 @@ interface FDrawerProps {
444
589
  actions: FDrawerLineAction[];
445
590
  ordering: string;
446
591
  toggle?: boolean;
592
+ importEndpoint?: string;
593
+ importFields?: ImportFieldsConfig;
594
+ onBulkDelete?: (ids: number[]) => Promise<void>;
595
+ onDuplicate?: (item: any) => Promise<void>;
596
+ title?: string;
447
597
  }
448
598
  declare const FDrawer: React$1.FC<FDrawerProps>;
449
599
 
@@ -476,6 +626,8 @@ declare class FetchApi {
476
626
  static get<T>(url: string, token?: string): Promise<T>;
477
627
  static put<T>(url: string, payload?: any, token?: string): Promise<T>;
478
628
  static delete<T>(url: string, token?: string): Promise<T>;
629
+ static uploadFile<T>(url: string, formData: FormData, token?: string): Promise<T>;
630
+ static patch<T>(url: string, payload?: any, token?: string): Promise<T>;
479
631
  }
480
632
 
481
633
  type AlertVariant = 'danger' | 'warning' | 'info' | 'success';
@@ -604,4 +756,4 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
604
756
  declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
605
757
  declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
606
758
 
607
- export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, useAlert, useSession, useToast };
759
+ export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, type ConfirmOptions, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, useAlert, useSession, useToast };
package/dist/index.d.ts CHANGED
@@ -87,9 +87,75 @@ declare const RewiseLayout: React$1.FC<PrivateLayoutProps>;
87
87
 
88
88
  declare const ToastContainer: React$1.FC;
89
89
 
90
- interface Entity {
90
+ interface Module$1 {
91
+ id: number;
92
+ code: string;
93
+ name: string;
94
+ description?: string;
95
+ price: number;
96
+ is_active: boolean;
97
+ price_monthly: number;
98
+ price_yearly: number;
99
+ created_at: string;
100
+ updated_at: string;
101
+ is_deleted: boolean;
102
+ }
103
+ interface Plan {
104
+ id: number;
105
+ name: string;
106
+ description?: string;
107
+ price_monthly: number;
108
+ price_yearly: number;
109
+ max_users: number;
110
+ max_entities: number;
111
+ modules_included: Module$1[] | number[];
112
+ is_private: boolean;
113
+ private_for?: number | null;
114
+ created_at: string;
115
+ updated_at: string;
116
+ is_deleted: boolean;
117
+ }
118
+ interface Subscription {
91
119
  id: number;
92
120
  organization: number;
121
+ plan: Plan;
122
+ start_date: string;
123
+ end_date: string;
124
+ is_active: boolean;
125
+ created_at: string;
126
+ updated_at: string;
127
+ extra_modules?: Module$1[] | number[];
128
+ }
129
+
130
+ interface Module {
131
+ id: number;
132
+ code: string;
133
+ name: string;
134
+ description?: string;
135
+ price?: number;
136
+ price_monthly?: number;
137
+ price_yearly?: number;
138
+ is_active?: boolean;
139
+ is_deleted?: boolean;
140
+ deleted_at?: string | null;
141
+ }
142
+ interface Organization {
143
+ id: number;
144
+ legal_name: string;
145
+ trading_name?: string;
146
+ phone?: string;
147
+ email?: string;
148
+ address?: string;
149
+ owner: number;
150
+ active_subscription?: Subscription | null;
151
+ modules?: Module[];
152
+ created_at: string;
153
+ updated_at: string;
154
+ is_deleted: boolean;
155
+ }
156
+ interface Entity {
157
+ id: number;
158
+ organization: Organization | number;
93
159
  legal_name: string;
94
160
  trading_name?: string;
95
161
  phone?: string;
@@ -124,6 +190,7 @@ interface User {
124
190
  last_login: string | null;
125
191
  is_superuser: boolean;
126
192
  username: string;
193
+ department: number | null;
127
194
  first_name: string;
128
195
  last_name: string;
129
196
  email: string;
@@ -139,6 +206,45 @@ interface User {
139
206
  centers_access?: Entity[];
140
207
  }
141
208
 
209
+ type FromModule = 'accounting' | 'crm' | 'procurement';
210
+ interface Vendor {
211
+ id?: number;
212
+ legal_name: string;
213
+ trading_name?: string | null;
214
+ phone?: string | null;
215
+ email?: string | null;
216
+ logo?: string | null;
217
+ year_founded?: string | null;
218
+ activity_sector?: string | null;
219
+ description?: string | null;
220
+ accounting_account_number?: string | null;
221
+ capital?: number | null;
222
+ annual_turnover?: number | null;
223
+ payment_delay?: number | null;
224
+ country?: string | null;
225
+ city?: string | null;
226
+ address?: string | null;
227
+ legal_form?: string | null;
228
+ tax_regime?: string | null;
229
+ tax_account?: string | null;
230
+ rccm?: string | null;
231
+ legal_representative_name?: string | null;
232
+ legal_representative_address?: string | null;
233
+ legal_representative_phone?: string | null;
234
+ legal_representative_email?: string | null;
235
+ legal_representative_id_document?: string | null;
236
+ legal_representative_id_number?: string | null;
237
+ legal_representative_fonction?: string | null;
238
+ bank_name?: string | null;
239
+ bank_address?: string | null;
240
+ bank_email?: string | null;
241
+ bank_phone?: string | null;
242
+ iban?: string | null;
243
+ rib?: string | null;
244
+ from_module?: FromModule | null;
245
+ vendor_number: string;
246
+ }
247
+
142
248
  interface SessionContextType {
143
249
  isAuthenticated: boolean;
144
250
  token: string | null;
@@ -149,6 +255,11 @@ interface SessionContextType {
149
255
  logout: () => void;
150
256
  showAuthModal: boolean;
151
257
  setShowAuthModal: (data: boolean) => void;
258
+ vendors: Vendor[];
259
+ setVendors: (vendors: Vendor[]) => void;
260
+ loadingVendors: boolean;
261
+ setLoadingVendors: (loading: boolean) => void;
262
+ loadVendors: () => Promise<void>;
152
263
  }
153
264
  declare const useSession: () => SessionContextType;
154
265
  declare const SessionProvider: ({ children }: {
@@ -166,6 +277,13 @@ interface Toast {
166
277
  type: 'success' | 'error' | 'warning' | 'info';
167
278
  duration?: number;
168
279
  }
280
+ interface ConfirmOptions {
281
+ title?: string;
282
+ message: string;
283
+ confirmText?: string;
284
+ cancelText?: string;
285
+ type?: 'danger' | 'warning' | 'info';
286
+ }
169
287
  interface ToastContextType {
170
288
  toasts: Toast[];
171
289
  addToast: (toast: Omit<Toast, 'id'>) => void;
@@ -174,6 +292,7 @@ interface ToastContextType {
174
292
  error: (message: string, duration?: number) => void;
175
293
  warning: (message: string, duration?: number) => void;
176
294
  info: (message: string, duration?: number) => void;
295
+ confirm: (options: ConfirmOptions | string) => Promise<boolean>;
177
296
  }
178
297
  declare const useToast: () => ToastContextType;
179
298
  interface ToastProviderProps {
@@ -191,6 +310,19 @@ interface PagesProps {
191
310
  }
192
311
  declare const Pages: React$1.FC<PagesProps>;
193
312
 
313
+ interface UpdateProfileData {
314
+ first_name?: string;
315
+ last_name?: string;
316
+ email?: string;
317
+ phonenumber?: string;
318
+ job_title?: string;
319
+ department?: string;
320
+ }
321
+ interface ChangePasswordData {
322
+ current_password: string;
323
+ new_password: string;
324
+ confirm_password: string;
325
+ }
194
326
  declare const UserServices: {
195
327
  addUser: (data: Partial<User>, token: string) => Promise<unknown>;
196
328
  getUsers: (token: string) => Promise<unknown>;
@@ -202,6 +334,11 @@ declare const UserServices: {
202
334
  getEntityUsers: (entityId: number, token: string) => Promise<unknown>;
203
335
  getuserEntitiesAccess: (id: number, token: string) => Promise<unknown>;
204
336
  addUserToEntity: (entityId: number, userId: number, token: string) => Promise<unknown>;
337
+ updateMyProfile: (data: UpdateProfileData) => Promise<unknown>;
338
+ updateProfilePicture: (file: File) => Promise<unknown>;
339
+ deleteProfilePicture: () => Promise<unknown>;
340
+ changePassword: (data: ChangePasswordData) => Promise<unknown>;
341
+ getMyProfile: () => Promise<unknown>;
205
342
  };
206
343
 
207
344
  interface SendOtpPayload {
@@ -418,6 +555,14 @@ declare const ApprovalServices: {
418
555
  }>;
419
556
  };
420
557
 
558
+ type ImportField = {
559
+ value: string;
560
+ label: string;
561
+ };
562
+ type ImportFieldsConfig = {
563
+ required: ImportField[];
564
+ optional: ImportField[];
565
+ };
421
566
  type FDrawerColumn = {
422
567
  key: string;
423
568
  label: string;
@@ -444,6 +589,11 @@ interface FDrawerProps {
444
589
  actions: FDrawerLineAction[];
445
590
  ordering: string;
446
591
  toggle?: boolean;
592
+ importEndpoint?: string;
593
+ importFields?: ImportFieldsConfig;
594
+ onBulkDelete?: (ids: number[]) => Promise<void>;
595
+ onDuplicate?: (item: any) => Promise<void>;
596
+ title?: string;
447
597
  }
448
598
  declare const FDrawer: React$1.FC<FDrawerProps>;
449
599
 
@@ -476,6 +626,8 @@ declare class FetchApi {
476
626
  static get<T>(url: string, token?: string): Promise<T>;
477
627
  static put<T>(url: string, payload?: any, token?: string): Promise<T>;
478
628
  static delete<T>(url: string, token?: string): Promise<T>;
629
+ static uploadFile<T>(url: string, formData: FormData, token?: string): Promise<T>;
630
+ static patch<T>(url: string, payload?: any, token?: string): Promise<T>;
479
631
  }
480
632
 
481
633
  type AlertVariant = 'danger' | 'warning' | 'info' | 'success';
@@ -604,4 +756,4 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
604
756
  declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
605
757
  declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
606
758
 
607
- export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, useAlert, useSession, useToast };
759
+ export { Alert, AlertProvider, ApprovalAnswerModal, ApprovalAnswerPage, ApprovalPreviewAnswer, ApprovalServices, ApprovalWorkflow, AuthServices, CHOICES, type ConfirmOptions, CountrySelector, DateInput, FDrawer, FetchApi, FileInput, ForeignCurrencySelector, InputField, InvoiceTypeSelector, LegalFormSelector, type MenuItem, Modal, NumberInput, Pages, PaymentMethodSelector, PrimaryButton, RewiseLayout, SecondaryButton, SelectCostCenter, SelectDepartment, SelectInput, SelectUser, SelectVendor, SessionProvider, TaxSelector, TemplateFNESelector, TextInput, ThemeProvider, ToastContainer, ToastProvider, type User, UserServices, useAlert, useSession, useToast };