feeef 0.0.23 → 0.0.24
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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export enum OrderStatus {
|
|
2
2
|
draft = 'draft',
|
|
3
3
|
pending = 'pending',
|
|
4
|
+
accepted = 'accepted',
|
|
4
5
|
processing = 'processing',
|
|
5
6
|
completed = 'completed',
|
|
6
7
|
cancelled = 'cancelled',
|
|
@@ -50,3 +51,29 @@ export interface OrderItem {
|
|
|
50
51
|
quantity: number
|
|
51
52
|
price: number
|
|
52
53
|
}
|
|
54
|
+
|
|
55
|
+
// order track entity
|
|
56
|
+
export interface OrderTrackEntity {
|
|
57
|
+
id: string
|
|
58
|
+
customerName?: string | null
|
|
59
|
+
customerPhone: string
|
|
60
|
+
customerIp?: string | null
|
|
61
|
+
shippingAddress?: string | null
|
|
62
|
+
shippingCity?: string | null
|
|
63
|
+
shippingState?: string | null
|
|
64
|
+
shippingMethodId?: string | null
|
|
65
|
+
paymentMethodId?: string | null
|
|
66
|
+
items: OrderItem[]
|
|
67
|
+
subtotal: number
|
|
68
|
+
shippingPrice: number
|
|
69
|
+
total: number
|
|
70
|
+
discount: number
|
|
71
|
+
coupon?: string | null
|
|
72
|
+
storeId: string
|
|
73
|
+
metadata: any
|
|
74
|
+
status: OrderStatus
|
|
75
|
+
paymentStatus: PaymentStatus
|
|
76
|
+
deliveryStatus: DeliveryStatus
|
|
77
|
+
createdAt: any
|
|
78
|
+
updatedAt: any
|
|
79
|
+
}
|
|
@@ -1,110 +1,107 @@
|
|
|
1
|
-
import { EmbaddedCategory } from
|
|
2
|
-
import { ShippingMethodEntity } from
|
|
3
|
-
import { StoreEntity } from
|
|
1
|
+
import { EmbaddedCategory } from '../embadded/category.js'
|
|
2
|
+
import { ShippingMethodEntity } from './shipping_method.js'
|
|
3
|
+
import { StoreEntity } from './store.js'
|
|
4
4
|
|
|
5
5
|
export interface ProductEntity {
|
|
6
|
-
id: string
|
|
6
|
+
id: string
|
|
7
7
|
|
|
8
|
-
slug: string
|
|
8
|
+
slug: string
|
|
9
9
|
|
|
10
|
-
decoration: ProductDecoration | null
|
|
10
|
+
decoration: ProductDecoration | null
|
|
11
11
|
|
|
12
|
-
name: string | null
|
|
12
|
+
name: string | null
|
|
13
13
|
|
|
14
|
-
photoUrl: string | null
|
|
14
|
+
photoUrl: string | null
|
|
15
15
|
|
|
16
|
-
media: string[]
|
|
16
|
+
media: string[]
|
|
17
17
|
|
|
18
|
-
storeId: string
|
|
18
|
+
storeId: string
|
|
19
19
|
|
|
20
|
-
shippingMethodId?: string | null
|
|
20
|
+
shippingMethodId?: string | null
|
|
21
21
|
|
|
22
|
-
category: EmbaddedCategory
|
|
22
|
+
category: EmbaddedCategory
|
|
23
23
|
|
|
24
|
-
title: string | null
|
|
24
|
+
title: string | null
|
|
25
25
|
|
|
26
|
-
description: string | null
|
|
26
|
+
description: string | null
|
|
27
27
|
|
|
28
|
-
body: string | null
|
|
28
|
+
body: string | null
|
|
29
29
|
|
|
30
30
|
// sku
|
|
31
|
-
sku: string | null
|
|
31
|
+
sku: string | null
|
|
32
32
|
|
|
33
|
-
price: number
|
|
33
|
+
price: number
|
|
34
34
|
|
|
35
|
-
discount: number | null
|
|
35
|
+
discount: number | null
|
|
36
36
|
|
|
37
|
-
stock: number
|
|
37
|
+
stock: number
|
|
38
38
|
|
|
39
|
-
sold: number
|
|
39
|
+
sold: number
|
|
40
40
|
|
|
41
|
-
views: number
|
|
41
|
+
views: number
|
|
42
42
|
|
|
43
|
-
likes: number
|
|
43
|
+
likes: number
|
|
44
44
|
|
|
45
|
-
dislikes: number
|
|
45
|
+
dislikes: number
|
|
46
46
|
|
|
47
|
-
variant?: ProductVariant | null
|
|
47
|
+
variant?: ProductVariant | null
|
|
48
48
|
|
|
49
|
-
metadata: Record<string, any
|
|
49
|
+
metadata: Record<string, any>
|
|
50
50
|
|
|
51
|
-
status: ProductStatus
|
|
51
|
+
status: ProductStatus
|
|
52
52
|
|
|
53
|
-
type: ProductType
|
|
53
|
+
type: ProductType
|
|
54
54
|
|
|
55
|
-
verifiedAt: any | null
|
|
55
|
+
verifiedAt: any | null
|
|
56
56
|
|
|
57
|
-
blockedAt: any | null
|
|
57
|
+
blockedAt: any | null
|
|
58
58
|
|
|
59
|
-
createdAt: any
|
|
59
|
+
createdAt: any
|
|
60
60
|
|
|
61
|
-
updatedAt: any
|
|
61
|
+
updatedAt: any
|
|
62
62
|
|
|
63
63
|
// relations
|
|
64
|
-
store?: StoreEntity
|
|
65
|
-
shippingMethod?: ShippingMethodEntity
|
|
64
|
+
store?: StoreEntity
|
|
65
|
+
shippingMethod?: ShippingMethodEntity
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export enum ProductStatus {
|
|
69
|
-
draft =
|
|
70
|
-
published =
|
|
71
|
-
archived =
|
|
72
|
-
deleted =
|
|
69
|
+
draft = 'draft',
|
|
70
|
+
published = 'published',
|
|
71
|
+
archived = 'archived',
|
|
72
|
+
deleted = 'deleted',
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export interface ProductDecoration {
|
|
76
|
-
metadata: Record<string, any
|
|
76
|
+
metadata: Record<string, any>
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface ProductVariant {
|
|
80
|
-
name: string
|
|
81
|
-
options: ProductVariantOption[]
|
|
80
|
+
name: string
|
|
81
|
+
options: ProductVariantOption[]
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export interface ProductVariantOption {
|
|
85
|
-
name: string
|
|
86
|
-
sku?: string | null
|
|
87
|
-
price?: number | null
|
|
88
|
-
discount?: number | null
|
|
89
|
-
stock?: number | null
|
|
90
|
-
sold?: number | null
|
|
91
|
-
type?: VariantOptionType
|
|
92
|
-
child?: ProductVariant | null
|
|
93
|
-
mediaIndex?: number | null
|
|
94
|
-
hint?: string | null
|
|
95
|
-
// value is the actual value of the option
|
|
96
|
-
// its dynamic and can be any type
|
|
97
|
-
value: any;
|
|
85
|
+
name: string
|
|
86
|
+
sku?: string | null
|
|
87
|
+
price?: number | null
|
|
88
|
+
discount?: number | null
|
|
89
|
+
stock?: number | null
|
|
90
|
+
sold?: number | null
|
|
91
|
+
type?: VariantOptionType
|
|
92
|
+
child?: ProductVariant | null
|
|
93
|
+
mediaIndex?: number | null
|
|
94
|
+
hint?: string | null
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
export enum VariantOptionType {
|
|
101
|
-
color =
|
|
102
|
-
image =
|
|
103
|
-
text =
|
|
98
|
+
color = 'color',
|
|
99
|
+
image = 'image',
|
|
100
|
+
text = 'text',
|
|
104
101
|
}
|
|
105
102
|
|
|
106
103
|
export enum ProductType {
|
|
107
|
-
physical =
|
|
108
|
-
digital =
|
|
109
|
-
service =
|
|
104
|
+
physical = 'physical',
|
|
105
|
+
digital = 'digital',
|
|
106
|
+
service = 'service',
|
|
110
107
|
}
|
|
@@ -4,6 +4,7 @@ import { EmbaddedContact } from '../embadded/contact.js'
|
|
|
4
4
|
// import { OrderEntity } from "./order.js";
|
|
5
5
|
// import { ShippingMethodEntity } from "./shipping_method.js";
|
|
6
6
|
import { UserEntity } from './user.js'
|
|
7
|
+
import { DateTime } from 'luxon'
|
|
7
8
|
|
|
8
9
|
export interface StoreEntity {
|
|
9
10
|
id: string
|
|
@@ -32,6 +33,25 @@ export interface StoreEntity {
|
|
|
32
33
|
// orders: OrderEntity[];
|
|
33
34
|
// shippingMethods: ShippingMethodEntity[];
|
|
34
35
|
defaultShippingRates: (number | null)[][] | null
|
|
36
|
+
|
|
37
|
+
// subscription
|
|
38
|
+
subscriptio?: any
|
|
39
|
+
due?: number
|
|
40
|
+
|
|
41
|
+
// StoreConfigs
|
|
42
|
+
configs?: StoreConfigs
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface StoreConfigs {
|
|
46
|
+
currencies: StoreCurrencyConfig[]
|
|
47
|
+
defaultCurrency: number
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface StoreCurrencyConfig {
|
|
51
|
+
code: string
|
|
52
|
+
symbol: string
|
|
53
|
+
precision: number
|
|
54
|
+
rate: number
|
|
35
55
|
}
|
|
36
56
|
|
|
37
57
|
export interface StoreDomain {
|
|
@@ -80,4 +100,39 @@ export interface StoreIntegrations {
|
|
|
80
100
|
yalidine?: any
|
|
81
101
|
maystroDelivery?: any
|
|
82
102
|
echotrak?: any
|
|
103
|
+
procolis?: any
|
|
104
|
+
noest?: any
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export enum StoreSubscriptionStatus {
|
|
108
|
+
active = 'active',
|
|
109
|
+
inactive = 'inactive',
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export enum StoreSubscriptionType {
|
|
113
|
+
free = 'free',
|
|
114
|
+
quota = 'quota',
|
|
115
|
+
percentage = 'percentage',
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface StoreSubscription {
|
|
119
|
+
type: StoreSubscriptionType
|
|
120
|
+
status: StoreSubscriptionStatus
|
|
121
|
+
startedAt: DateTime
|
|
122
|
+
expiresAt: DateTime | null
|
|
123
|
+
metadata: Record<string, any>
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface StoreFreeSubscription extends StoreSubscription {
|
|
127
|
+
type: StoreSubscriptionType.free
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface StoreQuotaSubscription extends StoreSubscription {
|
|
131
|
+
type: StoreSubscriptionType.quota
|
|
132
|
+
quota: number
|
|
133
|
+
}
|
|
134
|
+
// another way is by taking percentage of the sales
|
|
135
|
+
export interface StorePercentageSubscription extends StoreSubscription {
|
|
136
|
+
type: StoreSubscriptionType.percentage
|
|
137
|
+
percentage: number
|
|
83
138
|
}
|
|
@@ -12,6 +12,12 @@ export interface UserEntity {
|
|
|
12
12
|
createdAt: any
|
|
13
13
|
updatedAt: any | null
|
|
14
14
|
metadata: Record<string, any>
|
|
15
|
+
wallet: EmbaddedWallet
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface EmbaddedWallet {
|
|
19
|
+
currency: 'DZD' | 'USD' | 'EUR'
|
|
20
|
+
balance: number
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
export interface AuthToken {
|