shopoflex-types 1.0.165 → 1.0.166
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/common.d.ts +58 -9
- package/package.json +1 -1
package/dist/common.d.ts
CHANGED
|
@@ -305,6 +305,17 @@ export interface IPlanPackage {
|
|
|
305
305
|
createdAt: Date;
|
|
306
306
|
updatedAt: Date;
|
|
307
307
|
}
|
|
308
|
+
interface TaxSettings {
|
|
309
|
+
active: boolean;
|
|
310
|
+
show: boolean;
|
|
311
|
+
payer: 'vendor' | 'customer';
|
|
312
|
+
percentage: number;
|
|
313
|
+
}
|
|
314
|
+
export type VendorUserInvitation = {
|
|
315
|
+
email: string;
|
|
316
|
+
role: string;
|
|
317
|
+
status: "pending";
|
|
318
|
+
};
|
|
308
319
|
export interface Vendor {
|
|
309
320
|
_id?: string;
|
|
310
321
|
industry?: string;
|
|
@@ -352,17 +363,9 @@ export interface Vendor {
|
|
|
352
363
|
createdAt: Date;
|
|
353
364
|
orderType: PickType[];
|
|
354
365
|
socialLinks: string[];
|
|
355
|
-
users: VendorUser[];
|
|
366
|
+
users: VendorUserPopulated[] | VendorUser[] | VendorUserUnpopulated[] | VendorUserInvitation[];
|
|
356
367
|
areas: Record<string, unknown>;
|
|
357
368
|
payments: VendorPayments;
|
|
358
|
-
wallet: {
|
|
359
|
-
balance: number;
|
|
360
|
-
currency: string;
|
|
361
|
-
commissionRates: {
|
|
362
|
-
ecommerce: number;
|
|
363
|
-
pos: number;
|
|
364
|
-
};
|
|
365
|
-
};
|
|
366
369
|
usage: {
|
|
367
370
|
productsCount: number;
|
|
368
371
|
branchesCount: number;
|
|
@@ -372,6 +375,52 @@ export interface Vendor {
|
|
|
372
375
|
pixelsOptions?: PixelsOptions;
|
|
373
376
|
taxManagement?: TaxManagement;
|
|
374
377
|
currentPlan?: IPlanPackage;
|
|
378
|
+
getTaxConfig(country?: string): TaxSettings;
|
|
379
|
+
calculateTax(subtotal: number, country?: string): {
|
|
380
|
+
taxAmount: number;
|
|
381
|
+
taxConfig: TaxSettings;
|
|
382
|
+
taxIncludedInTotal: boolean;
|
|
383
|
+
};
|
|
384
|
+
setTaxConfig(config: {
|
|
385
|
+
type: 'fixed' | 'perCountry';
|
|
386
|
+
settings: any;
|
|
387
|
+
}): Promise<any>;
|
|
388
|
+
setCountryTax(country: string, settings: TaxSettings): Promise<any>;
|
|
389
|
+
validateLockPin(userId: string, lockPin: string): boolean;
|
|
390
|
+
setUserLockPin(userId: string, lockPin: string): Promise<any>;
|
|
391
|
+
updatePlan(planId: string, startDate?: Date, endDate?: Date): Promise<any>;
|
|
392
|
+
getCurrentPlan(): Promise<any>;
|
|
393
|
+
getCurrentUsage(): Promise<{
|
|
394
|
+
dailyOrders: number;
|
|
395
|
+
branches: number;
|
|
396
|
+
users: number;
|
|
397
|
+
}>;
|
|
398
|
+
calculateRemainingLimits(planLimits: any): Promise<any>;
|
|
399
|
+
getSubscriptionDetails(): any;
|
|
400
|
+
checkLimit(limitType: string): Promise<boolean>;
|
|
401
|
+
canCreateOrder(): Promise<boolean>;
|
|
402
|
+
canCreateUser(): Promise<boolean>;
|
|
403
|
+
canCreateBranch(): Promise<boolean>;
|
|
404
|
+
}
|
|
405
|
+
export interface VendorUser<TUser = string, TRole = string> {
|
|
406
|
+
user: TUser;
|
|
407
|
+
role: TRole;
|
|
408
|
+
status: "pending" | "active" | "disabled";
|
|
409
|
+
email: string;
|
|
410
|
+
lockPin: string;
|
|
411
|
+
notifications: {
|
|
412
|
+
tokens: string[];
|
|
413
|
+
email: boolean;
|
|
414
|
+
push: boolean;
|
|
415
|
+
inApp: boolean;
|
|
416
|
+
types: {
|
|
417
|
+
new_order: boolean;
|
|
418
|
+
order_update: boolean;
|
|
419
|
+
stock_alert: boolean;
|
|
420
|
+
product_update: boolean;
|
|
421
|
+
system_update: boolean;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
375
424
|
}
|
|
376
425
|
export interface VendorUser<TUser = string, TRole = string> {
|
|
377
426
|
user: TUser;
|