ptechcore_ui 1.0.19 → 1.0.20

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;
@@ -139,6 +205,45 @@ interface User {
139
205
  centers_access?: Entity[];
140
206
  }
141
207
 
208
+ type FromModule = 'accounting' | 'crm' | 'procurement';
209
+ interface Vendor {
210
+ id?: number;
211
+ legal_name: string;
212
+ trading_name?: string | null;
213
+ phone?: string | null;
214
+ email?: string | null;
215
+ logo?: string | null;
216
+ year_founded?: string | null;
217
+ activity_sector?: string | null;
218
+ description?: string | null;
219
+ accounting_account_number?: string | null;
220
+ capital?: number | null;
221
+ annual_turnover?: number | null;
222
+ payment_delay?: number | null;
223
+ country?: string | null;
224
+ city?: string | null;
225
+ address?: string | null;
226
+ legal_form?: string | null;
227
+ tax_regime?: string | null;
228
+ tax_account?: string | null;
229
+ rccm?: string | null;
230
+ legal_representative_name?: string | null;
231
+ legal_representative_address?: string | null;
232
+ legal_representative_phone?: string | null;
233
+ legal_representative_email?: string | null;
234
+ legal_representative_id_document?: string | null;
235
+ legal_representative_id_number?: string | null;
236
+ legal_representative_fonction?: string | null;
237
+ bank_name?: string | null;
238
+ bank_address?: string | null;
239
+ bank_email?: string | null;
240
+ bank_phone?: string | null;
241
+ iban?: string | null;
242
+ rib?: string | null;
243
+ from_module?: FromModule | null;
244
+ vendor_number: string;
245
+ }
246
+
142
247
  interface SessionContextType {
143
248
  isAuthenticated: boolean;
144
249
  token: string | null;
@@ -149,6 +254,11 @@ interface SessionContextType {
149
254
  logout: () => void;
150
255
  showAuthModal: boolean;
151
256
  setShowAuthModal: (data: boolean) => void;
257
+ vendors: Vendor[];
258
+ setVendors: (vendors: Vendor[]) => void;
259
+ loadingVendors: boolean;
260
+ setLoadingVendors: (loading: boolean) => void;
261
+ loadVendors: () => Promise<void>;
152
262
  }
153
263
  declare const useSession: () => SessionContextType;
154
264
  declare const SessionProvider: ({ children }: {
@@ -166,6 +276,13 @@ interface Toast {
166
276
  type: 'success' | 'error' | 'warning' | 'info';
167
277
  duration?: number;
168
278
  }
279
+ interface ConfirmOptions {
280
+ title?: string;
281
+ message: string;
282
+ confirmText?: string;
283
+ cancelText?: string;
284
+ type?: 'danger' | 'warning' | 'info';
285
+ }
169
286
  interface ToastContextType {
170
287
  toasts: Toast[];
171
288
  addToast: (toast: Omit<Toast, 'id'>) => void;
@@ -174,6 +291,7 @@ interface ToastContextType {
174
291
  error: (message: string, duration?: number) => void;
175
292
  warning: (message: string, duration?: number) => void;
176
293
  info: (message: string, duration?: number) => void;
294
+ confirm: (options: ConfirmOptions | string) => Promise<boolean>;
177
295
  }
178
296
  declare const useToast: () => ToastContextType;
179
297
  interface ToastProviderProps {
@@ -418,6 +536,14 @@ declare const ApprovalServices: {
418
536
  }>;
419
537
  };
420
538
 
539
+ type ImportField = {
540
+ value: string;
541
+ label: string;
542
+ };
543
+ type ImportFieldsConfig = {
544
+ required: ImportField[];
545
+ optional: ImportField[];
546
+ };
421
547
  type FDrawerColumn = {
422
548
  key: string;
423
549
  label: string;
@@ -444,6 +570,11 @@ interface FDrawerProps {
444
570
  actions: FDrawerLineAction[];
445
571
  ordering: string;
446
572
  toggle?: boolean;
573
+ importEndpoint?: string;
574
+ importFields?: ImportFieldsConfig;
575
+ onBulkDelete?: (ids: number[]) => Promise<void>;
576
+ onDuplicate?: (item: any) => Promise<void>;
577
+ title?: string;
447
578
  }
448
579
  declare const FDrawer: React$1.FC<FDrawerProps>;
449
580
 
@@ -604,4 +735,4 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
604
735
  declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
605
736
  declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
606
737
 
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 };
738
+ 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;
@@ -139,6 +205,45 @@ interface User {
139
205
  centers_access?: Entity[];
140
206
  }
141
207
 
208
+ type FromModule = 'accounting' | 'crm' | 'procurement';
209
+ interface Vendor {
210
+ id?: number;
211
+ legal_name: string;
212
+ trading_name?: string | null;
213
+ phone?: string | null;
214
+ email?: string | null;
215
+ logo?: string | null;
216
+ year_founded?: string | null;
217
+ activity_sector?: string | null;
218
+ description?: string | null;
219
+ accounting_account_number?: string | null;
220
+ capital?: number | null;
221
+ annual_turnover?: number | null;
222
+ payment_delay?: number | null;
223
+ country?: string | null;
224
+ city?: string | null;
225
+ address?: string | null;
226
+ legal_form?: string | null;
227
+ tax_regime?: string | null;
228
+ tax_account?: string | null;
229
+ rccm?: string | null;
230
+ legal_representative_name?: string | null;
231
+ legal_representative_address?: string | null;
232
+ legal_representative_phone?: string | null;
233
+ legal_representative_email?: string | null;
234
+ legal_representative_id_document?: string | null;
235
+ legal_representative_id_number?: string | null;
236
+ legal_representative_fonction?: string | null;
237
+ bank_name?: string | null;
238
+ bank_address?: string | null;
239
+ bank_email?: string | null;
240
+ bank_phone?: string | null;
241
+ iban?: string | null;
242
+ rib?: string | null;
243
+ from_module?: FromModule | null;
244
+ vendor_number: string;
245
+ }
246
+
142
247
  interface SessionContextType {
143
248
  isAuthenticated: boolean;
144
249
  token: string | null;
@@ -149,6 +254,11 @@ interface SessionContextType {
149
254
  logout: () => void;
150
255
  showAuthModal: boolean;
151
256
  setShowAuthModal: (data: boolean) => void;
257
+ vendors: Vendor[];
258
+ setVendors: (vendors: Vendor[]) => void;
259
+ loadingVendors: boolean;
260
+ setLoadingVendors: (loading: boolean) => void;
261
+ loadVendors: () => Promise<void>;
152
262
  }
153
263
  declare const useSession: () => SessionContextType;
154
264
  declare const SessionProvider: ({ children }: {
@@ -166,6 +276,13 @@ interface Toast {
166
276
  type: 'success' | 'error' | 'warning' | 'info';
167
277
  duration?: number;
168
278
  }
279
+ interface ConfirmOptions {
280
+ title?: string;
281
+ message: string;
282
+ confirmText?: string;
283
+ cancelText?: string;
284
+ type?: 'danger' | 'warning' | 'info';
285
+ }
169
286
  interface ToastContextType {
170
287
  toasts: Toast[];
171
288
  addToast: (toast: Omit<Toast, 'id'>) => void;
@@ -174,6 +291,7 @@ interface ToastContextType {
174
291
  error: (message: string, duration?: number) => void;
175
292
  warning: (message: string, duration?: number) => void;
176
293
  info: (message: string, duration?: number) => void;
294
+ confirm: (options: ConfirmOptions | string) => Promise<boolean>;
177
295
  }
178
296
  declare const useToast: () => ToastContextType;
179
297
  interface ToastProviderProps {
@@ -418,6 +536,14 @@ declare const ApprovalServices: {
418
536
  }>;
419
537
  };
420
538
 
539
+ type ImportField = {
540
+ value: string;
541
+ label: string;
542
+ };
543
+ type ImportFieldsConfig = {
544
+ required: ImportField[];
545
+ optional: ImportField[];
546
+ };
421
547
  type FDrawerColumn = {
422
548
  key: string;
423
549
  label: string;
@@ -444,6 +570,11 @@ interface FDrawerProps {
444
570
  actions: FDrawerLineAction[];
445
571
  ordering: string;
446
572
  toggle?: boolean;
573
+ importEndpoint?: string;
574
+ importFields?: ImportFieldsConfig;
575
+ onBulkDelete?: (ids: number[]) => Promise<void>;
576
+ onDuplicate?: (item: any) => Promise<void>;
577
+ title?: string;
447
578
  }
448
579
  declare const FDrawer: React$1.FC<FDrawerProps>;
449
580
 
@@ -604,4 +735,4 @@ declare const TaxSelector: React$1.FC<TaxSelectProps>;
604
735
  declare const LegalFormSelector: React$1.FC<ChoiceSelectProps>;
605
736
  declare const CountrySelector: React$1.FC<ChoiceSelectProps>;
606
737
 
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 };
738
+ 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 };