shopoflex-types 1.0.192 → 1.0.195
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 +35 -30
- package/package.json +1 -1
package/dist/common.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import mongoose from
|
|
2
|
-
import { Category, GroupedCategory, ProductType } from
|
|
3
|
-
import { NameType } from
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Category, GroupedCategory, ProductType } from "shopoflex-types";
|
|
3
|
+
import { NameType } from "./productCart";
|
|
4
4
|
export interface Discount {
|
|
5
5
|
_id?: mongoose.Types.ObjectId;
|
|
6
6
|
code?: string;
|
|
@@ -62,25 +62,25 @@ export interface Address {
|
|
|
62
62
|
details: string;
|
|
63
63
|
}
|
|
64
64
|
export interface PaymentMethod {
|
|
65
|
-
type:
|
|
65
|
+
type: "cash" | "card_terminal" | "knet" | "bank_transfer" | "wallet" | "external_link" | "crypto" | "whish" | "paypal" | "gift_card" | "stc_pay" | "benefit" | "apple_pay" | "google_pay" | "online_card";
|
|
66
66
|
}
|
|
67
67
|
export interface OrderStatus {
|
|
68
|
-
status:
|
|
68
|
+
status: "pending" | "cancelled" | "rejected" | "refunded" | "preparing" | "delivering" | "completed" | "awaiting_payment";
|
|
69
69
|
}
|
|
70
70
|
export interface OrderTypeOptions {
|
|
71
|
-
type:
|
|
71
|
+
type: "delivery" | "instore" | "pickup";
|
|
72
72
|
}
|
|
73
73
|
export interface UnitType {
|
|
74
|
-
unit:
|
|
74
|
+
unit: "piece" | "kg" | "g" | "liter" | "ml" | "meter" | "cm" | "pack" | "box" | "bottle" | "bag" | "dozen" | "sqm" | "hour" | "day" | "week" | "month" | "year";
|
|
75
75
|
}
|
|
76
|
-
export type PickType = OrderTypeOptions[
|
|
77
|
-
export type PaymentMethodType = PaymentMethod[
|
|
78
|
-
export type OrderStatusType = OrderStatus[
|
|
79
|
-
export type UnitTypeValue = UnitType[
|
|
76
|
+
export type PickType = OrderTypeOptions["type"];
|
|
77
|
+
export type PaymentMethodType = PaymentMethod["type"];
|
|
78
|
+
export type OrderStatusType = OrderStatus["status"];
|
|
79
|
+
export type UnitTypeValue = UnitType["unit"];
|
|
80
80
|
export interface CashTransactionType {
|
|
81
|
-
type:
|
|
81
|
+
type: "opening" | "sale" | "refund" | "owner_draw" | "transfer" | "expense" | "variance";
|
|
82
82
|
}
|
|
83
|
-
export type CashTransactionTypeValue = CashTransactionType[
|
|
83
|
+
export type CashTransactionTypeValue = CashTransactionType["type"];
|
|
84
84
|
export interface CashTransactionInterface {
|
|
85
85
|
_id?: mongoose.Types.ObjectId | string;
|
|
86
86
|
type: CashTransactionTypeValue;
|
|
@@ -123,7 +123,7 @@ export interface StockHandle {
|
|
|
123
123
|
stockByBranch: Record<string, {
|
|
124
124
|
storageLocations?: StorageLocation[];
|
|
125
125
|
stockQuantity: number;
|
|
126
|
-
ifOutOfStock:
|
|
126
|
+
ifOutOfStock: "showOutOfStock" | "allowOrdering" | "hideFromStore";
|
|
127
127
|
}>;
|
|
128
128
|
}
|
|
129
129
|
export interface Label {
|
|
@@ -206,7 +206,7 @@ export interface CurrentUserType extends IUser {
|
|
|
206
206
|
}>;
|
|
207
207
|
hasAccesstoVendor?: boolean;
|
|
208
208
|
}
|
|
209
|
-
export type Permission =
|
|
209
|
+
export type Permission = "products.read" | "products.create" | "products.update" | "products.delete" | "products.cost" | "products.inventory" | "orders.read" | "orders.create" | "orders.update" | "orders.delete" | "orders.refund" | "orders.status" | "customers.read" | "customers.create" | "customers.update" | "customers.delete" | "accounting.read" | "accounting.create" | "accounting.update" | "accounting.delete" | "analytics.dashboard" | "analytics.revenue" | "analytics.customers" | "analytics.products" | "analytics.traffic" | "analytics.financial" | "analytics.inventory" | "analytics.export" | "branches.read" | "branches.create" | "branches.update" | "branches.delete" | "users.read" | "users.create" | "users.update" | "users.delete" | "users.invite" | "users.permissions.view" | "roles.read" | "roles.create" | "roles.update" | "roles.delete" | "system.vendor.update" | "system.discounts.read" | "system.discounts.create" | "system.discounts.update" | "system.discounts.delete" | "system.wallet.view" | "traffic.read" | "traffic.analytics" | "traffic.network";
|
|
210
210
|
export interface IRole {
|
|
211
211
|
_id?: string;
|
|
212
212
|
name: NameType;
|
|
@@ -232,7 +232,7 @@ type PaymentConfig<T extends PaymentMethodType> = {
|
|
|
232
232
|
type VendorPayments = {
|
|
233
233
|
[K in PaymentMethodType]?: PaymentConfig<K>;
|
|
234
234
|
};
|
|
235
|
-
type LanguageCode =
|
|
235
|
+
type LanguageCode = "en" | "ar" | "fr" | "es" | "de" | "zh" | "ja" | "ru" | "hi" | "th" | "pt";
|
|
236
236
|
export interface LanguageConfig {
|
|
237
237
|
active: boolean;
|
|
238
238
|
font: string;
|
|
@@ -263,7 +263,7 @@ export interface PixelsOptions {
|
|
|
263
263
|
active?: boolean;
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
type LimitValue = number |
|
|
266
|
+
type LimitValue = number | "unlimited";
|
|
267
267
|
interface PlanLimits {
|
|
268
268
|
dailyOrders: LimitValue;
|
|
269
269
|
users: LimitValue;
|
|
@@ -281,7 +281,7 @@ interface PlanFeatures {
|
|
|
281
281
|
export interface IPlanPackage {
|
|
282
282
|
_id?: any;
|
|
283
283
|
name: string;
|
|
284
|
-
price: number |
|
|
284
|
+
price: number | "custom";
|
|
285
285
|
limits: PlanLimits;
|
|
286
286
|
features: PlanFeatures;
|
|
287
287
|
isActive: boolean;
|
|
@@ -291,7 +291,7 @@ export interface IPlanPackage {
|
|
|
291
291
|
interface TaxSettings {
|
|
292
292
|
active: boolean;
|
|
293
293
|
show: boolean;
|
|
294
|
-
payer:
|
|
294
|
+
payer: "vendor" | "customer";
|
|
295
295
|
percentage: number;
|
|
296
296
|
}
|
|
297
297
|
export type VendorUserInvitation = {
|
|
@@ -368,6 +368,11 @@ export interface Vendor {
|
|
|
368
368
|
country: string;
|
|
369
369
|
status?: "pending" | "active" | "inactive" | "suspended" | "blocked" | "expired" | "deleted";
|
|
370
370
|
isLive?: boolean;
|
|
371
|
+
storeTypeSettings?: {
|
|
372
|
+
informative: boolean;
|
|
373
|
+
addToCart?: 'default' | 'whatsapp';
|
|
374
|
+
hidePrice: boolean;
|
|
375
|
+
};
|
|
371
376
|
template: {
|
|
372
377
|
id: TemplateId;
|
|
373
378
|
name: NameType;
|
|
@@ -400,7 +405,7 @@ export interface Vendor {
|
|
|
400
405
|
taxIncludedInTotal: boolean;
|
|
401
406
|
};
|
|
402
407
|
setTaxConfig(config: {
|
|
403
|
-
type:
|
|
408
|
+
type: "fixed" | "perCountry";
|
|
404
409
|
settings: any;
|
|
405
410
|
}): Promise<any>;
|
|
406
411
|
setCountryTax(country: string, settings: TaxSettings): Promise<any>;
|
|
@@ -465,15 +470,15 @@ export type VendorUserUnpopulated = VendorUser<string, string>;
|
|
|
465
470
|
export interface NotificationType {
|
|
466
471
|
_id?: any;
|
|
467
472
|
recipientId?: string;
|
|
468
|
-
recipientType?:
|
|
473
|
+
recipientType?: "vendor" | "customer";
|
|
469
474
|
vendorId?: string;
|
|
470
|
-
type?:
|
|
475
|
+
type?: "new_order" | "order_update" | "stock_alert" | "product_update" | "system_update" | "wallet_alert";
|
|
471
476
|
title: string;
|
|
472
477
|
message?: string;
|
|
473
478
|
data?: any;
|
|
474
479
|
read: boolean;
|
|
475
480
|
readAt?: Date;
|
|
476
|
-
priority?:
|
|
481
|
+
priority?: "low" | "medium" | "high";
|
|
477
482
|
createdAt?: Date;
|
|
478
483
|
updatedAt?: Date;
|
|
479
484
|
}
|
|
@@ -554,7 +559,7 @@ export interface IDineInSettings {
|
|
|
554
559
|
menuSettings?: IMenuSettings;
|
|
555
560
|
openingHours?: IOpeningHours;
|
|
556
561
|
}
|
|
557
|
-
export type StandardType =
|
|
562
|
+
export type StandardType = "lebanese" | "ifrs" | "gaap" | "uk_gaap" | "simple" | "custom";
|
|
558
563
|
export interface IAccountingConfig {
|
|
559
564
|
enabled?: boolean;
|
|
560
565
|
accountingStandard?: StandardType;
|
|
@@ -591,7 +596,7 @@ export interface PaginationQuery {
|
|
|
591
596
|
page?: string;
|
|
592
597
|
limit?: string;
|
|
593
598
|
sortBy?: string;
|
|
594
|
-
sortOrder?:
|
|
599
|
+
sortOrder?: "asc" | "desc";
|
|
595
600
|
search?: string;
|
|
596
601
|
[key: string]: any;
|
|
597
602
|
}
|
|
@@ -600,7 +605,7 @@ export interface PaginationOptions {
|
|
|
600
605
|
limit: number;
|
|
601
606
|
skip: number;
|
|
602
607
|
sortBy: string;
|
|
603
|
-
sortOrder:
|
|
608
|
+
sortOrder: "asc" | "desc";
|
|
604
609
|
filters: Record<string, any>;
|
|
605
610
|
search?: string;
|
|
606
611
|
}
|
|
@@ -617,20 +622,20 @@ export interface PaginatedResponse<T> {
|
|
|
617
622
|
filters?: Record<string, any>;
|
|
618
623
|
sort?: {
|
|
619
624
|
sortBy: string;
|
|
620
|
-
sortOrder:
|
|
625
|
+
sortOrder: "asc" | "desc";
|
|
621
626
|
};
|
|
622
627
|
}
|
|
623
628
|
export interface FilterConfig {
|
|
624
629
|
[key: string]: {
|
|
625
|
-
type:
|
|
626
|
-
operator?:
|
|
630
|
+
type: "string" | "number" | "boolean" | "date" | "array" | "objectId";
|
|
631
|
+
operator?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "nin" | "regex" | "exists";
|
|
627
632
|
transform?: (value: any) => any;
|
|
628
633
|
};
|
|
629
634
|
}
|
|
630
635
|
export interface SortConfig {
|
|
631
636
|
allowedFields: string[];
|
|
632
637
|
defaultField: string;
|
|
633
|
-
defaultOrder:
|
|
638
|
+
defaultOrder: "asc" | "desc";
|
|
634
639
|
}
|
|
635
640
|
export interface SearchConfig {
|
|
636
641
|
fields: string[];
|