@basedone/core 0.1.10 → 0.2.0
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/chunk-4GAKANLT.mjs +1987 -0
- package/dist/chunk-4UEJOM6W.mjs +1 -3
- package/dist/chunk-VBC6EQ7Q.mjs +235 -0
- package/dist/client-CgmiTuEX.d.mts +179 -0
- package/dist/client-CgmiTuEX.d.ts +179 -0
- package/dist/ecommerce.d.mts +3732 -0
- package/dist/ecommerce.d.ts +3732 -0
- package/dist/ecommerce.js +2031 -0
- package/dist/ecommerce.mjs +2 -0
- package/dist/index.d.mts +51 -43
- package/dist/index.d.ts +51 -43
- package/dist/index.js +2691 -205
- package/dist/index.mjs +68 -90
- package/dist/{meta-FVJIMALT.mjs → meta-JB5ITE27.mjs} +4 -10
- package/dist/meta-UOGUG3OW.mjs +3 -7
- package/dist/{perpDexs-GGL32HT4.mjs → perpDexs-3LRJ5ZHM.mjs} +37 -8
- package/dist/{perpDexs-G7V2QIM6.mjs → perpDexs-4ISLD7NX.mjs} +177 -32
- package/dist/react.d.mts +39 -0
- package/dist/react.d.ts +39 -0
- package/dist/react.js +268 -0
- package/dist/react.mjs +31 -0
- package/dist/{spotMeta-OD7S6HGW.mjs → spotMeta-GHXX7C5M.mjs} +24 -9
- package/dist/{spotMeta-PCN4Z4R3.mjs → spotMeta-IBBUP2SG.mjs} +54 -6
- package/dist/staticMeta-GM7T3OYL.mjs +3 -6
- package/dist/staticMeta-QV2KMX57.mjs +3 -6
- package/ecommerce.ts +15 -0
- package/index.ts +6 -0
- package/lib/ecommerce/QUICK_REFERENCE.md +211 -0
- package/lib/ecommerce/README.md +385 -0
- package/lib/ecommerce/USAGE_EXAMPLES.md +704 -0
- package/lib/ecommerce/client/base.ts +272 -0
- package/lib/ecommerce/client/customer.ts +522 -0
- package/lib/ecommerce/client/merchant.ts +1341 -0
- package/lib/ecommerce/index.ts +51 -0
- package/lib/ecommerce/types/entities.ts +722 -0
- package/lib/ecommerce/types/enums.ts +270 -0
- package/lib/ecommerce/types/index.ts +18 -0
- package/lib/ecommerce/types/requests.ts +525 -0
- package/lib/ecommerce/types/responses.ts +805 -0
- package/lib/ecommerce/utils/errors.ts +113 -0
- package/lib/ecommerce/utils/helpers.ts +131 -0
- package/lib/hip3/market-info.ts +1 -1
- package/lib/instrument/client.ts +351 -0
- package/lib/meta/data/mainnet/perpDexs.json +34 -4
- package/lib/meta/data/mainnet/spotMeta.json +21 -3
- package/lib/meta/data/testnet/meta.json +1 -3
- package/lib/meta/data/testnet/perpDexs.json +174 -28
- package/lib/meta/data/testnet/spotMeta.json +51 -0
- package/lib/react/InstrumentProvider.tsx +69 -0
- package/lib/utils/flooredDateTime.ts +55 -0
- package/lib/utils/time.ts +51 -0
- package/package.json +37 -11
- package/react.ts +1 -0
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ecommerce Entity Interfaces
|
|
3
|
+
*
|
|
4
|
+
* This module contains all core entity interfaces used in the ecommerce API.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
OrderStatus,
|
|
9
|
+
PaymentMethod,
|
|
10
|
+
PaymentStatus,
|
|
11
|
+
MerchantStatus,
|
|
12
|
+
ShipmentStatus,
|
|
13
|
+
ReturnStatus,
|
|
14
|
+
ReviewStatus,
|
|
15
|
+
DiscountType,
|
|
16
|
+
DiscountMethod,
|
|
17
|
+
DiscountScope,
|
|
18
|
+
BannerType,
|
|
19
|
+
TaxType,
|
|
20
|
+
TaxBehavior,
|
|
21
|
+
TaxReportPeriodType,
|
|
22
|
+
TaxReportStatus,
|
|
23
|
+
InventoryAuditAction,
|
|
24
|
+
} from "./enums";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Base entity interface with common fields
|
|
28
|
+
*/
|
|
29
|
+
export interface BaseEntity {
|
|
30
|
+
/** Unique identifier */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Creation timestamp */
|
|
33
|
+
createdAt: string;
|
|
34
|
+
/** Last update timestamp */
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
/** Tenant ID for multi-tenancy */
|
|
37
|
+
tenantId?: string | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Product dimensions
|
|
42
|
+
*/
|
|
43
|
+
export interface ProductDimensions {
|
|
44
|
+
/** Length in cm */
|
|
45
|
+
length?: number;
|
|
46
|
+
/** Width in cm */
|
|
47
|
+
width?: number;
|
|
48
|
+
/** Height in cm */
|
|
49
|
+
height?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Product entity
|
|
54
|
+
*/
|
|
55
|
+
export interface Product extends BaseEntity {
|
|
56
|
+
/** Merchant ID */
|
|
57
|
+
merchantId: string;
|
|
58
|
+
/** Product title */
|
|
59
|
+
title: string;
|
|
60
|
+
/** Product description (plain text) */
|
|
61
|
+
description?: string | null;
|
|
62
|
+
/** Rich description (HTML) */
|
|
63
|
+
richDescription?: string | null;
|
|
64
|
+
/** Product images URLs */
|
|
65
|
+
images: string[];
|
|
66
|
+
/** Legacy single image URL (for backward compatibility) */
|
|
67
|
+
imageUrl?: string | null;
|
|
68
|
+
/** Price in USDC */
|
|
69
|
+
priceUSDC: string;
|
|
70
|
+
/** Compare at price (original price for discount display) */
|
|
71
|
+
compareAtPrice?: string | null;
|
|
72
|
+
/** Stock keeping unit */
|
|
73
|
+
sku?: string | null;
|
|
74
|
+
/** Inventory count */
|
|
75
|
+
inventory?: number | null;
|
|
76
|
+
/** Minimum order quantity */
|
|
77
|
+
moq: number;
|
|
78
|
+
/** Product category slug */
|
|
79
|
+
category?: string | null;
|
|
80
|
+
/** Category ID */
|
|
81
|
+
categoryId?: string | null;
|
|
82
|
+
/** Product tags */
|
|
83
|
+
tags?: string[];
|
|
84
|
+
/** Weight in kg */
|
|
85
|
+
weight?: string | null;
|
|
86
|
+
/** Product dimensions */
|
|
87
|
+
dimensions?: ProductDimensions | null;
|
|
88
|
+
/** Is product active */
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
/** Is product featured */
|
|
91
|
+
featured: boolean;
|
|
92
|
+
/** View count */
|
|
93
|
+
viewCount: number;
|
|
94
|
+
/** Sold count */
|
|
95
|
+
soldCount: number;
|
|
96
|
+
/** Average rating (computed from reviews) */
|
|
97
|
+
averageRating?: number | null;
|
|
98
|
+
/** Review count */
|
|
99
|
+
reviewCount?: number;
|
|
100
|
+
/** Merchant information */
|
|
101
|
+
merchant?: Merchant;
|
|
102
|
+
/** Product variants */
|
|
103
|
+
variants?: ProductVariant[];
|
|
104
|
+
/** Product reviews */
|
|
105
|
+
reviews?: ProductReview[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Product variant entity
|
|
110
|
+
*/
|
|
111
|
+
export interface ProductVariant extends BaseEntity {
|
|
112
|
+
/** Product ID */
|
|
113
|
+
productId: string;
|
|
114
|
+
/** Variant name */
|
|
115
|
+
name: string;
|
|
116
|
+
/** SKU */
|
|
117
|
+
sku?: string | null;
|
|
118
|
+
/** Price override (if different from base product) */
|
|
119
|
+
priceUSDC?: string | null;
|
|
120
|
+
/** Inventory count */
|
|
121
|
+
inventory?: number | null;
|
|
122
|
+
/** Variant attributes (e.g., {color: "red", size: "L"}) */
|
|
123
|
+
attributes: Record<string, string>;
|
|
124
|
+
/** Is variant active */
|
|
125
|
+
isActive: boolean;
|
|
126
|
+
/** Sort order */
|
|
127
|
+
sortOrder: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Merchant entity
|
|
132
|
+
*/
|
|
133
|
+
export interface Merchant extends BaseEntity {
|
|
134
|
+
/** Owner user ID */
|
|
135
|
+
ownerUserId: string;
|
|
136
|
+
/** Merchant name */
|
|
137
|
+
name: string;
|
|
138
|
+
/** Merchant description */
|
|
139
|
+
description?: string | null;
|
|
140
|
+
/** Payout address (wallet) */
|
|
141
|
+
payoutAddress: string;
|
|
142
|
+
/** Merchant status */
|
|
143
|
+
status: MerchantStatus;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Shipping address
|
|
148
|
+
*/
|
|
149
|
+
export interface ShippingAddress {
|
|
150
|
+
/** Full name */
|
|
151
|
+
fullName: string;
|
|
152
|
+
/** Phone number */
|
|
153
|
+
phone: string;
|
|
154
|
+
/** Email address */
|
|
155
|
+
email?: string | null;
|
|
156
|
+
/** Address line 1 */
|
|
157
|
+
addressLine1: string;
|
|
158
|
+
/** Address line 2 */
|
|
159
|
+
addressLine2?: string | null;
|
|
160
|
+
/** City */
|
|
161
|
+
city: string;
|
|
162
|
+
/** State or province */
|
|
163
|
+
stateProvince: string;
|
|
164
|
+
/** Postal code */
|
|
165
|
+
postalCode: string;
|
|
166
|
+
/** Country */
|
|
167
|
+
country: string;
|
|
168
|
+
/** Delivery instructions */
|
|
169
|
+
deliveryInstructions?: string | null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* User shipping address entity (saved addresses)
|
|
174
|
+
*/
|
|
175
|
+
export interface UserShippingAddress extends BaseEntity, ShippingAddress {
|
|
176
|
+
/** User ID */
|
|
177
|
+
userId: string;
|
|
178
|
+
/** Is default address */
|
|
179
|
+
isDefault: boolean;
|
|
180
|
+
/** Address label (e.g., "Home", "Work") */
|
|
181
|
+
label?: string | null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Order item
|
|
186
|
+
*/
|
|
187
|
+
export interface OrderItem extends BaseEntity {
|
|
188
|
+
/** Order ID */
|
|
189
|
+
orderId: string;
|
|
190
|
+
/** Product ID */
|
|
191
|
+
productId: string;
|
|
192
|
+
/** Variant ID */
|
|
193
|
+
variantId?: string | null;
|
|
194
|
+
/** Quantity */
|
|
195
|
+
quantity: number;
|
|
196
|
+
/** Unit price in USDC (snapshot at order time) */
|
|
197
|
+
unitPriceUSDC: string;
|
|
198
|
+
/** Product title snapshot */
|
|
199
|
+
titleSnapshot: string;
|
|
200
|
+
/** Product details (for display) */
|
|
201
|
+
product?: Product;
|
|
202
|
+
/** Variant details (for display) */
|
|
203
|
+
variant?: ProductVariant;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Payment entity
|
|
208
|
+
*/
|
|
209
|
+
export interface Payment extends BaseEntity {
|
|
210
|
+
/** Order ID */
|
|
211
|
+
orderId: string;
|
|
212
|
+
/** Payment method */
|
|
213
|
+
method: PaymentMethod;
|
|
214
|
+
/** Payment status */
|
|
215
|
+
status: PaymentStatus;
|
|
216
|
+
/** Amount in USDC */
|
|
217
|
+
amountUSDC: string;
|
|
218
|
+
/** Deposit transaction hash */
|
|
219
|
+
depositTxHash?: string | null;
|
|
220
|
+
/** Settlement transaction hash */
|
|
221
|
+
settlementTxHash?: string | null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Settlement entity
|
|
226
|
+
*/
|
|
227
|
+
export interface Settlement extends BaseEntity {
|
|
228
|
+
/** Order ID */
|
|
229
|
+
orderId: string;
|
|
230
|
+
/** Merchant ID */
|
|
231
|
+
merchantId: string;
|
|
232
|
+
/** Merchant payout address */
|
|
233
|
+
merchantPayoutAddress: string;
|
|
234
|
+
/** Amount in USDC */
|
|
235
|
+
amountUSDC: string;
|
|
236
|
+
/** Settlement status */
|
|
237
|
+
status: string;
|
|
238
|
+
/** Transaction hash */
|
|
239
|
+
txHash?: string | null;
|
|
240
|
+
/** Next attempt timestamp */
|
|
241
|
+
nextAttemptAt?: string | null;
|
|
242
|
+
/** Attempt count */
|
|
243
|
+
attemptCount: number;
|
|
244
|
+
/** Last error */
|
|
245
|
+
lastError?: string | null;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Shipment entity
|
|
250
|
+
*/
|
|
251
|
+
export interface Shipment extends BaseEntity {
|
|
252
|
+
/** Order ID */
|
|
253
|
+
orderId: string;
|
|
254
|
+
/** Shipment status */
|
|
255
|
+
status: ShipmentStatus;
|
|
256
|
+
/** Carrier name */
|
|
257
|
+
carrier?: string | null;
|
|
258
|
+
/** Tracking number */
|
|
259
|
+
trackingNumber?: string | null;
|
|
260
|
+
/** Shipping label URL */
|
|
261
|
+
shippingLabel?: string | null;
|
|
262
|
+
/** Shipped timestamp */
|
|
263
|
+
shippedAt?: string | null;
|
|
264
|
+
/** Delivered timestamp */
|
|
265
|
+
deliveredAt?: string | null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Order entity
|
|
270
|
+
*/
|
|
271
|
+
export interface Order extends BaseEntity {
|
|
272
|
+
/** User ID (customer) */
|
|
273
|
+
userId: string;
|
|
274
|
+
/** Merchant ID */
|
|
275
|
+
merchantId: string;
|
|
276
|
+
/** Order status */
|
|
277
|
+
status: OrderStatus;
|
|
278
|
+
/** Total amount in USDC */
|
|
279
|
+
totalUSDC: string;
|
|
280
|
+
/** Payment method */
|
|
281
|
+
paymentMethod: PaymentMethod;
|
|
282
|
+
/** Shipping address */
|
|
283
|
+
shippingAddress: ShippingAddress;
|
|
284
|
+
/** Customer notes */
|
|
285
|
+
customerNotes?: string | null;
|
|
286
|
+
/** Order items */
|
|
287
|
+
items: OrderItem[];
|
|
288
|
+
/** Payment information */
|
|
289
|
+
payment?: Payment;
|
|
290
|
+
/** Settlement information */
|
|
291
|
+
settlement?: Settlement;
|
|
292
|
+
/** Shipment information */
|
|
293
|
+
shipment?: Shipment;
|
|
294
|
+
/** Merchant information */
|
|
295
|
+
merchant?: Merchant;
|
|
296
|
+
/** Customer information */
|
|
297
|
+
user?: {
|
|
298
|
+
id: string;
|
|
299
|
+
username?: string;
|
|
300
|
+
email?: string;
|
|
301
|
+
};
|
|
302
|
+
/** Order events */
|
|
303
|
+
events?: OrderEvent[];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Order event entity
|
|
308
|
+
*/
|
|
309
|
+
export interface OrderEvent extends BaseEntity {
|
|
310
|
+
/** Order ID */
|
|
311
|
+
orderId: string;
|
|
312
|
+
/** Event type */
|
|
313
|
+
eventType: string;
|
|
314
|
+
/** Event title */
|
|
315
|
+
title: string;
|
|
316
|
+
/** Event description */
|
|
317
|
+
description?: string | null;
|
|
318
|
+
/** Event metadata */
|
|
319
|
+
metadata?: Record<string, any> | null;
|
|
320
|
+
/** Performer user ID */
|
|
321
|
+
performedBy?: string | null;
|
|
322
|
+
/** Performer information */
|
|
323
|
+
performer?: {
|
|
324
|
+
id: string;
|
|
325
|
+
username?: string;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Product review entity
|
|
331
|
+
*/
|
|
332
|
+
export interface ProductReview extends BaseEntity {
|
|
333
|
+
/** Product ID */
|
|
334
|
+
productId: string;
|
|
335
|
+
/** User ID */
|
|
336
|
+
userId: string;
|
|
337
|
+
/** Order ID (for verified purchase) */
|
|
338
|
+
orderId?: string | null;
|
|
339
|
+
/** Rating (1-5) */
|
|
340
|
+
rating: number;
|
|
341
|
+
/** Review title */
|
|
342
|
+
title?: string | null;
|
|
343
|
+
/** Review comment */
|
|
344
|
+
comment?: string | null;
|
|
345
|
+
/** Review images */
|
|
346
|
+
images?: string[];
|
|
347
|
+
/** Merchant response */
|
|
348
|
+
merchantResponse?: string | null;
|
|
349
|
+
/** Merchant responded timestamp */
|
|
350
|
+
merchantRespondedAt?: string | null;
|
|
351
|
+
/** Is verified purchase */
|
|
352
|
+
isVerifiedPurchase: boolean;
|
|
353
|
+
/** Is visible */
|
|
354
|
+
isVisible: boolean;
|
|
355
|
+
/** Review status */
|
|
356
|
+
status: ReviewStatus;
|
|
357
|
+
/** Helpfulness count (thumbs up) */
|
|
358
|
+
helpfulCount: number;
|
|
359
|
+
/** User information */
|
|
360
|
+
user?: {
|
|
361
|
+
id: string;
|
|
362
|
+
address: string;
|
|
363
|
+
};
|
|
364
|
+
/** Product information */
|
|
365
|
+
product?: Product;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Return entity
|
|
370
|
+
*/
|
|
371
|
+
export interface Return extends BaseEntity {
|
|
372
|
+
/** Order ID */
|
|
373
|
+
orderId: string;
|
|
374
|
+
/** User ID */
|
|
375
|
+
userId: string;
|
|
376
|
+
/** Merchant ID */
|
|
377
|
+
merchantId: string;
|
|
378
|
+
/** Return status */
|
|
379
|
+
status: ReturnStatus;
|
|
380
|
+
/** Return reason */
|
|
381
|
+
reason?: string | null;
|
|
382
|
+
/** Requested timestamp */
|
|
383
|
+
requestedAt: string;
|
|
384
|
+
/** Approved timestamp */
|
|
385
|
+
approvedAt?: string | null;
|
|
386
|
+
/** Rejected timestamp */
|
|
387
|
+
rejectedAt?: string | null;
|
|
388
|
+
/** Received timestamp */
|
|
389
|
+
receivedAt?: string | null;
|
|
390
|
+
/** Completed timestamp */
|
|
391
|
+
completedAt?: string | null;
|
|
392
|
+
/** Return items */
|
|
393
|
+
items: ReturnItem[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Return item
|
|
398
|
+
*/
|
|
399
|
+
export interface ReturnItem {
|
|
400
|
+
/** Item ID */
|
|
401
|
+
id: string;
|
|
402
|
+
/** Product ID */
|
|
403
|
+
productId: string;
|
|
404
|
+
/** Quantity */
|
|
405
|
+
quantity: number;
|
|
406
|
+
/** Reason */
|
|
407
|
+
reason?: string | null;
|
|
408
|
+
/** Product information */
|
|
409
|
+
product?: Product;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Coupon entity
|
|
414
|
+
*/
|
|
415
|
+
export interface Coupon extends BaseEntity {
|
|
416
|
+
/** Merchant ID */
|
|
417
|
+
merchantId: string;
|
|
418
|
+
/** Coupon code */
|
|
419
|
+
code: string;
|
|
420
|
+
/** Coupon title */
|
|
421
|
+
title?: string | null;
|
|
422
|
+
/** Discount method */
|
|
423
|
+
discountMethod: DiscountMethod;
|
|
424
|
+
/** Discount type */
|
|
425
|
+
discountType: DiscountType;
|
|
426
|
+
/** Discount scope */
|
|
427
|
+
discountScope: DiscountScope;
|
|
428
|
+
/** Discount value */
|
|
429
|
+
discountValue: number;
|
|
430
|
+
/** Minimum purchase amount */
|
|
431
|
+
minPurchase?: number | null;
|
|
432
|
+
/** Minimum quantity */
|
|
433
|
+
minQuantity?: number | null;
|
|
434
|
+
/** Buy quantity (for BUY_X_GET_Y) */
|
|
435
|
+
buyQuantity?: number | null;
|
|
436
|
+
/** Get quantity (for BUY_X_GET_Y) */
|
|
437
|
+
getQuantity?: number | null;
|
|
438
|
+
/** Get discount value (for BUY_X_GET_Y) */
|
|
439
|
+
getDiscountValue?: number | null;
|
|
440
|
+
/** Maximum uses */
|
|
441
|
+
maxUses?: number | null;
|
|
442
|
+
/** Uses per customer */
|
|
443
|
+
usesPerCustomer?: number | null;
|
|
444
|
+
/** Used count */
|
|
445
|
+
usedCount: number;
|
|
446
|
+
/** Applicable product IDs */
|
|
447
|
+
applicableProducts: string[];
|
|
448
|
+
/** Applicable category IDs */
|
|
449
|
+
applicableCategories: string[];
|
|
450
|
+
/** Can be combined with other discounts */
|
|
451
|
+
combinable: boolean;
|
|
452
|
+
/** Start timestamp */
|
|
453
|
+
startsAt: string;
|
|
454
|
+
/** Expiry timestamp */
|
|
455
|
+
expiresAt: string;
|
|
456
|
+
/** Is active */
|
|
457
|
+
isActive: boolean;
|
|
458
|
+
/** Coupon usages */
|
|
459
|
+
usages?: CouponUsage[];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Coupon usage entity
|
|
464
|
+
*/
|
|
465
|
+
export interface CouponUsage extends BaseEntity {
|
|
466
|
+
/** Coupon ID */
|
|
467
|
+
couponId: string;
|
|
468
|
+
/** User ID */
|
|
469
|
+
userId: string;
|
|
470
|
+
/** Order ID */
|
|
471
|
+
orderId: string;
|
|
472
|
+
/** Discount amount */
|
|
473
|
+
discount: string;
|
|
474
|
+
/** Used timestamp */
|
|
475
|
+
usedAt: string;
|
|
476
|
+
/** User information */
|
|
477
|
+
user?: {
|
|
478
|
+
username?: string;
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Shipping method entity
|
|
484
|
+
*/
|
|
485
|
+
export interface ShippingMethod extends BaseEntity {
|
|
486
|
+
/** Merchant ID */
|
|
487
|
+
merchantId: string;
|
|
488
|
+
/** Method name */
|
|
489
|
+
name: string;
|
|
490
|
+
/** Carrier */
|
|
491
|
+
carrier?: string | null;
|
|
492
|
+
/** Estimated delivery days */
|
|
493
|
+
estimatedDays?: string | null;
|
|
494
|
+
/** Flat rate */
|
|
495
|
+
flatRate?: number | null;
|
|
496
|
+
/** Is weight-based */
|
|
497
|
+
weightBased: boolean;
|
|
498
|
+
/** Free shipping threshold */
|
|
499
|
+
freeThreshold?: number | null;
|
|
500
|
+
/** Is active */
|
|
501
|
+
isActive: boolean;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Banner entity
|
|
506
|
+
*/
|
|
507
|
+
export interface Banner extends BaseEntity {
|
|
508
|
+
/** Merchant ID (null for admin banners) */
|
|
509
|
+
merchantId?: string | null;
|
|
510
|
+
/** Banner type */
|
|
511
|
+
type: BannerType;
|
|
512
|
+
/** Title */
|
|
513
|
+
title: string;
|
|
514
|
+
/** Subtitle */
|
|
515
|
+
subtitle?: string | null;
|
|
516
|
+
/** Image URL */
|
|
517
|
+
imageUrl: string;
|
|
518
|
+
/** Link URL */
|
|
519
|
+
linkUrl?: string | null;
|
|
520
|
+
/** Call-to-action text */
|
|
521
|
+
ctaText?: string | null;
|
|
522
|
+
/** Start date */
|
|
523
|
+
startDate?: string | null;
|
|
524
|
+
/** End date */
|
|
525
|
+
endDate?: string | null;
|
|
526
|
+
/** Priority (higher = shown first) */
|
|
527
|
+
priority: number;
|
|
528
|
+
/** Is active */
|
|
529
|
+
isActive: boolean;
|
|
530
|
+
/** Impressions count */
|
|
531
|
+
impressions: number;
|
|
532
|
+
/** Clicks count */
|
|
533
|
+
clicks: number;
|
|
534
|
+
/** Merchant information */
|
|
535
|
+
merchant?: {
|
|
536
|
+
id: string;
|
|
537
|
+
name: string;
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Media asset entity
|
|
543
|
+
*/
|
|
544
|
+
export interface MediaAsset extends BaseEntity {
|
|
545
|
+
/** Merchant ID */
|
|
546
|
+
merchantId: string;
|
|
547
|
+
/** Blob URL */
|
|
548
|
+
blobUrl: string;
|
|
549
|
+
/** Blob pathname */
|
|
550
|
+
blobPathname: string;
|
|
551
|
+
/** Download URL */
|
|
552
|
+
downloadUrl: string;
|
|
553
|
+
/** Filename */
|
|
554
|
+
filename: string;
|
|
555
|
+
/** Content type */
|
|
556
|
+
contentType: string;
|
|
557
|
+
/** File size in bytes */
|
|
558
|
+
size: number;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Message entity
|
|
563
|
+
*/
|
|
564
|
+
export interface Message extends BaseEntity {
|
|
565
|
+
/** Order ID */
|
|
566
|
+
orderId: string;
|
|
567
|
+
/** Sender user ID */
|
|
568
|
+
senderId: string;
|
|
569
|
+
/** Recipient user ID */
|
|
570
|
+
recipientId: string;
|
|
571
|
+
/** Message text */
|
|
572
|
+
message: string;
|
|
573
|
+
/** Is read */
|
|
574
|
+
isRead: boolean;
|
|
575
|
+
/** Sender information */
|
|
576
|
+
sender?: {
|
|
577
|
+
id: string;
|
|
578
|
+
username?: string;
|
|
579
|
+
};
|
|
580
|
+
/** Recipient information */
|
|
581
|
+
recipient?: {
|
|
582
|
+
id: string;
|
|
583
|
+
username?: string;
|
|
584
|
+
};
|
|
585
|
+
/** Order information */
|
|
586
|
+
order?: Order;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Tax settings entity
|
|
591
|
+
*/
|
|
592
|
+
export interface TaxSettings extends BaseEntity {
|
|
593
|
+
/** Merchant ID */
|
|
594
|
+
merchantId: string;
|
|
595
|
+
/** Is tax enabled */
|
|
596
|
+
taxEnabled: boolean;
|
|
597
|
+
/** Prices include tax */
|
|
598
|
+
pricesIncludeTax: boolean;
|
|
599
|
+
/** Default tax behavior */
|
|
600
|
+
defaultTaxBehavior: TaxBehavior;
|
|
601
|
+
/** Tax registration number */
|
|
602
|
+
taxRegistrationNumber?: string | null;
|
|
603
|
+
/** Registration country */
|
|
604
|
+
registrationCountry?: string | null;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Tax rule entity
|
|
609
|
+
*/
|
|
610
|
+
export interface TaxRule extends BaseEntity {
|
|
611
|
+
/** Merchant ID */
|
|
612
|
+
merchantId: string;
|
|
613
|
+
/** Country */
|
|
614
|
+
country: string;
|
|
615
|
+
/** Region/state */
|
|
616
|
+
region?: string | null;
|
|
617
|
+
/** Postal code from */
|
|
618
|
+
postalCodeFrom?: string | null;
|
|
619
|
+
/** Postal code to */
|
|
620
|
+
postalCodeTo?: string | null;
|
|
621
|
+
/** Tax type */
|
|
622
|
+
taxType: TaxType;
|
|
623
|
+
/** Tax name */
|
|
624
|
+
taxName: string;
|
|
625
|
+
/** Tax rate (percentage) */
|
|
626
|
+
taxRate: number;
|
|
627
|
+
/** Priority (higher = applied first) */
|
|
628
|
+
priority: number;
|
|
629
|
+
/** Is compound tax */
|
|
630
|
+
isCompound: boolean;
|
|
631
|
+
/** Is active */
|
|
632
|
+
isActive: boolean;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Tax nexus entity
|
|
637
|
+
*/
|
|
638
|
+
export interface TaxNexus extends BaseEntity {
|
|
639
|
+
/** Merchant ID */
|
|
640
|
+
merchantId: string;
|
|
641
|
+
/** Country */
|
|
642
|
+
country: string;
|
|
643
|
+
/** Region/state */
|
|
644
|
+
region?: string | null;
|
|
645
|
+
/** Registration ID */
|
|
646
|
+
registrationId?: string | null;
|
|
647
|
+
/** Is active */
|
|
648
|
+
isActive: boolean;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Tax report entity
|
|
653
|
+
*/
|
|
654
|
+
export interface TaxReport extends BaseEntity {
|
|
655
|
+
/** Merchant ID */
|
|
656
|
+
merchantId: string;
|
|
657
|
+
/** Period type */
|
|
658
|
+
periodType: TaxReportPeriodType;
|
|
659
|
+
/** Period start */
|
|
660
|
+
periodStart: string;
|
|
661
|
+
/** Period end */
|
|
662
|
+
periodEnd: string;
|
|
663
|
+
/** Total taxable amount */
|
|
664
|
+
totalTaxable: string;
|
|
665
|
+
/** Total tax amount */
|
|
666
|
+
totalTax: string;
|
|
667
|
+
/** Report status */
|
|
668
|
+
status: TaxReportStatus;
|
|
669
|
+
/** Exported timestamp */
|
|
670
|
+
exportedAt?: string | null;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Inventory audit entry
|
|
675
|
+
*/
|
|
676
|
+
export interface InventoryAuditEntry extends BaseEntity {
|
|
677
|
+
/** Product ID */
|
|
678
|
+
productId: string;
|
|
679
|
+
/** Variant ID */
|
|
680
|
+
variantId?: string | null;
|
|
681
|
+
/** Action */
|
|
682
|
+
action: InventoryAuditAction;
|
|
683
|
+
/** Previous quantity */
|
|
684
|
+
previousQuantity?: number | null;
|
|
685
|
+
/** New quantity */
|
|
686
|
+
newQuantity?: number | null;
|
|
687
|
+
/** Change amount */
|
|
688
|
+
changeAmount: number;
|
|
689
|
+
/** Reason */
|
|
690
|
+
reason?: string | null;
|
|
691
|
+
/** Reference ID (e.g., order ID) */
|
|
692
|
+
referenceId?: string | null;
|
|
693
|
+
/** Product information */
|
|
694
|
+
product?: Product;
|
|
695
|
+
/** Variant information */
|
|
696
|
+
variant?: ProductVariant;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Customer summary (for merchant view)
|
|
701
|
+
*/
|
|
702
|
+
export interface CustomerSummary {
|
|
703
|
+
/** Customer user ID */
|
|
704
|
+
id: string;
|
|
705
|
+
/** Username */
|
|
706
|
+
username?: string;
|
|
707
|
+
/** Email */
|
|
708
|
+
email?: string;
|
|
709
|
+
/** Wallet address */
|
|
710
|
+
address?: string;
|
|
711
|
+
/** Total orders */
|
|
712
|
+
totalOrders: number;
|
|
713
|
+
/** Total spent */
|
|
714
|
+
totalSpent: string;
|
|
715
|
+
/** Average order value */
|
|
716
|
+
averageOrderValue: string;
|
|
717
|
+
/** Last order date */
|
|
718
|
+
lastOrderDate?: string;
|
|
719
|
+
/** First order date */
|
|
720
|
+
firstOrderDate?: string;
|
|
721
|
+
}
|
|
722
|
+
|