@classytic/commerce-sdk 0.1.1

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.
Files changed (133) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +164 -0
  3. package/dist/adjustment-MNH3AT6S.js +5 -0
  4. package/dist/adjustment-MNH3AT6S.js.map +1 -0
  5. package/dist/analytics/index.d.ts +27 -0
  6. package/dist/analytics/index.js +6 -0
  7. package/dist/analytics/index.js.map +1 -0
  8. package/dist/analytics-DMcD-o8w.d.ts +76 -0
  9. package/dist/api-factory-B_h4RKBm.d.ts +280 -0
  10. package/dist/auth/index.d.ts +39 -0
  11. package/dist/auth/index.js +5 -0
  12. package/dist/auth/index.js.map +1 -0
  13. package/dist/catalog/index.d.ts +571 -0
  14. package/dist/catalog/index.js +9 -0
  15. package/dist/catalog/index.js.map +1 -0
  16. package/dist/chunk-24FDD6UR.js +75 -0
  17. package/dist/chunk-24FDD6UR.js.map +1 -0
  18. package/dist/chunk-2TF7QNYV.js +159 -0
  19. package/dist/chunk-2TF7QNYV.js.map +1 -0
  20. package/dist/chunk-2YAZ5WG6.js +479 -0
  21. package/dist/chunk-2YAZ5WG6.js.map +1 -0
  22. package/dist/chunk-36NLLAVH.js +177 -0
  23. package/dist/chunk-36NLLAVH.js.map +1 -0
  24. package/dist/chunk-3OYSJB3P.js +126 -0
  25. package/dist/chunk-3OYSJB3P.js.map +1 -0
  26. package/dist/chunk-5E57JODA.js +135 -0
  27. package/dist/chunk-5E57JODA.js.map +1 -0
  28. package/dist/chunk-7LZCW4VF.js +13 -0
  29. package/dist/chunk-7LZCW4VF.js.map +1 -0
  30. package/dist/chunk-ANYGZ6O5.js +830 -0
  31. package/dist/chunk-ANYGZ6O5.js.map +1 -0
  32. package/dist/chunk-AQAISI4F.js +183 -0
  33. package/dist/chunk-AQAISI4F.js.map +1 -0
  34. package/dist/chunk-B6MPVOV7.js +328 -0
  35. package/dist/chunk-B6MPVOV7.js.map +1 -0
  36. package/dist/chunk-CILP56G2.js +94 -0
  37. package/dist/chunk-CILP56G2.js.map +1 -0
  38. package/dist/chunk-ERQ52WHY.js +534 -0
  39. package/dist/chunk-ERQ52WHY.js.map +1 -0
  40. package/dist/chunk-FOTUJPM4.js +640 -0
  41. package/dist/chunk-FOTUJPM4.js.map +1 -0
  42. package/dist/chunk-IHCBBLLW.js +198 -0
  43. package/dist/chunk-IHCBBLLW.js.map +1 -0
  44. package/dist/chunk-J4JBQET2.js +76 -0
  45. package/dist/chunk-J4JBQET2.js.map +1 -0
  46. package/dist/chunk-L4OEI4VZ.js +123 -0
  47. package/dist/chunk-L4OEI4VZ.js.map +1 -0
  48. package/dist/chunk-LRV7MWWX.js +616 -0
  49. package/dist/chunk-LRV7MWWX.js.map +1 -0
  50. package/dist/chunk-N43VE355.js +126 -0
  51. package/dist/chunk-N43VE355.js.map +1 -0
  52. package/dist/chunk-PYYLHUV6.js +3 -0
  53. package/dist/chunk-PYYLHUV6.js.map +1 -0
  54. package/dist/chunk-QCTXAMLA.js +261 -0
  55. package/dist/chunk-QCTXAMLA.js.map +1 -0
  56. package/dist/chunk-RIKAPJNG.js +40 -0
  57. package/dist/chunk-RIKAPJNG.js.map +1 -0
  58. package/dist/chunk-U3XT35GZ.js +202 -0
  59. package/dist/chunk-U3XT35GZ.js.map +1 -0
  60. package/dist/chunk-W22WB3WZ.js +148 -0
  61. package/dist/chunk-W22WB3WZ.js.map +1 -0
  62. package/dist/chunk-WTIJMKML.js +27 -0
  63. package/dist/chunk-WTIJMKML.js.map +1 -0
  64. package/dist/chunk-X2CQFJPR.js +75 -0
  65. package/dist/chunk-X2CQFJPR.js.map +1 -0
  66. package/dist/chunk-YYFKLOKO.js +769 -0
  67. package/dist/chunk-YYFKLOKO.js.map +1 -0
  68. package/dist/client-Cs7E_usr.d.ts +113 -0
  69. package/dist/content/index.d.ts +309 -0
  70. package/dist/content/index.js +6 -0
  71. package/dist/content/index.js.map +1 -0
  72. package/dist/core/index.d.ts +166 -0
  73. package/dist/core/index.js +5 -0
  74. package/dist/core/index.js.map +1 -0
  75. package/dist/core/react.d.ts +107 -0
  76. package/dist/core/react.js +5 -0
  77. package/dist/core/react.js.map +1 -0
  78. package/dist/coupon-BZSZ0y3n.d.ts +129 -0
  79. package/dist/coupon-CDzL4bJG.d.ts +655 -0
  80. package/dist/crud.factory-DyKaPHcU.d.ts +181 -0
  81. package/dist/finance/index.d.ts +81 -0
  82. package/dist/finance/index.js +5 -0
  83. package/dist/finance/index.js.map +1 -0
  84. package/dist/finance-BJdfKRw0.d.ts +135 -0
  85. package/dist/index.d.ts +32 -0
  86. package/dist/index.js +29 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/inventory/index.d.ts +512 -0
  89. package/dist/inventory/index.js +16 -0
  90. package/dist/inventory/index.js.map +1 -0
  91. package/dist/inventory-B5pssqRx.d.ts +748 -0
  92. package/dist/logistics/index.d.ts +248 -0
  93. package/dist/logistics/index.js +7 -0
  94. package/dist/logistics/index.js.map +1 -0
  95. package/dist/logistics-CrpKadKE.d.ts +410 -0
  96. package/dist/media-CNLJK93J.d.ts +721 -0
  97. package/dist/movement-R3CERFAM.js +5 -0
  98. package/dist/movement-R3CERFAM.js.map +1 -0
  99. package/dist/order-B3dCvHgK.d.ts +360 -0
  100. package/dist/payment-BRboLqvU.d.ts +127 -0
  101. package/dist/payments/index.d.ts +55 -0
  102. package/dist/payments/index.js +6 -0
  103. package/dist/payments/index.js.map +1 -0
  104. package/dist/platform/index.d.ts +645 -0
  105. package/dist/platform/index.js +8 -0
  106. package/dist/platform/index.js.map +1 -0
  107. package/dist/pos-BCqkx2-K.d.ts +527 -0
  108. package/dist/product-p09zXkXB.d.ts +260 -0
  109. package/dist/purchase-54PER2PY.js +5 -0
  110. package/dist/purchase-54PER2PY.js.map +1 -0
  111. package/dist/request-MP6NV5ZE.js +5 -0
  112. package/dist/request-MP6NV5ZE.js.map +1 -0
  113. package/dist/sales/index.d.ts +587 -0
  114. package/dist/sales/index.js +9 -0
  115. package/dist/sales/index.js.map +1 -0
  116. package/dist/server.d.ts +23 -0
  117. package/dist/server.js +37 -0
  118. package/dist/server.js.map +1 -0
  119. package/dist/size-guide-DgjzjM5P.d.ts +554 -0
  120. package/dist/stock-2LP4HJSB.js +5 -0
  121. package/dist/stock-2LP4HJSB.js.map +1 -0
  122. package/dist/stock-CfrU5_Wr.d.ts +632 -0
  123. package/dist/supplier-BWJTRZ5Z.js +5 -0
  124. package/dist/supplier-BWJTRZ5Z.js.map +1 -0
  125. package/dist/transaction/index.d.ts +104 -0
  126. package/dist/transaction/index.js +8 -0
  127. package/dist/transaction/index.js.map +1 -0
  128. package/dist/transaction-Bf6WjYCh.d.ts +84 -0
  129. package/dist/transaction-dL3WW-er.d.ts +442 -0
  130. package/dist/transfer-4XSS6HWT.js +5 -0
  131. package/dist/transfer-4XSS6HWT.js.map +1 -0
  132. package/dist/user-data-DdLjAGwO.d.ts +132 -0
  133. package/package.json +147 -0
@@ -0,0 +1,655 @@
1
+ import { P as PaginatedResponse, A as ApiResponse, B as BaseApi, R as RequestOptions } from './api-factory-B_h4RKBm.js';
2
+
3
+ /**
4
+ * Platform Config Types
5
+ *
6
+ * Mirrors `modules/platform/platform.model.js` (PlatformConfig singleton).
7
+ * Includes payment methods, checkout, logistics, VAT, and policies.
8
+ */
9
+ type PaymentMethodType = "cash" | "mfs" | "bank_transfer" | "card";
10
+ interface PaymentMethodConfig {
11
+ _id?: string;
12
+ type: PaymentMethodType;
13
+ name: string;
14
+ provider?: "bkash" | "nagad" | "rocket" | "upay";
15
+ walletNumber?: string;
16
+ walletName?: string;
17
+ bankName?: string;
18
+ accountNumber?: string;
19
+ accountName?: string;
20
+ branchName?: string;
21
+ routingNumber?: string;
22
+ cardTypes?: ("visa" | "mastercard" | "amex" | "unionpay" | "other")[];
23
+ note?: string;
24
+ isActive?: boolean;
25
+ }
26
+ interface PlatformVatCategoryRate {
27
+ category: string;
28
+ rate: number;
29
+ description?: string;
30
+ }
31
+ interface PlatformVatInvoiceConfig {
32
+ showVatBreakdown?: boolean;
33
+ prefix?: string;
34
+ startNumber?: number;
35
+ currentNumber?: number;
36
+ footerText?: string;
37
+ }
38
+ interface PlatformSupplementaryDutyConfig {
39
+ enabled?: boolean;
40
+ defaultRate?: number;
41
+ }
42
+ interface PlatformVatConfig {
43
+ isRegistered: boolean;
44
+ bin?: string;
45
+ registeredName?: string;
46
+ vatCircle?: string;
47
+ defaultRate: number;
48
+ pricesIncludeVat: boolean;
49
+ categoryRates?: PlatformVatCategoryRate[];
50
+ invoice?: PlatformVatInvoiceConfig;
51
+ supplementaryDuty?: PlatformSupplementaryDutyConfig;
52
+ }
53
+ interface DeliveryZone {
54
+ _id?: string;
55
+ name: string;
56
+ region: string;
57
+ price: number;
58
+ estimatedDays?: number;
59
+ isActive?: boolean;
60
+ }
61
+ interface CheckoutPickupBranch {
62
+ branchId?: string;
63
+ branchCode?: string;
64
+ branchName?: string;
65
+ }
66
+ type DeliveryFeeSource = "static" | "provider";
67
+ interface CheckoutSettings {
68
+ allowStorePickup: boolean;
69
+ pickupBranches: CheckoutPickupBranch[];
70
+ deliveryFeeSource: DeliveryFeeSource;
71
+ freeDeliveryThreshold: number;
72
+ deliveryZones: DeliveryZone[];
73
+ }
74
+ interface LogisticsSettings {
75
+ defaultPickupStoreId?: number;
76
+ defaultPickupStoreName?: string;
77
+ defaultPickupAreaId?: number;
78
+ defaultPickupAreaName?: string;
79
+ webhookSecret?: string;
80
+ autoCreateShipment: boolean;
81
+ autoCreateOnStatus: string;
82
+ }
83
+ interface PlatformPolicies {
84
+ termsAndConditions?: string;
85
+ privacyPolicy?: string;
86
+ refundPolicy?: string;
87
+ shippingPolicy?: string;
88
+ }
89
+ type MembershipRoundingMode = "floor" | "round" | "ceil";
90
+ interface MembershipTierConfig {
91
+ name: string;
92
+ minPoints: number;
93
+ pointsMultiplier: number;
94
+ discountPercent: number;
95
+ color?: string;
96
+ }
97
+ interface MembershipRedemptionConfig {
98
+ enabled: boolean;
99
+ minRedeemPoints: number;
100
+ minOrderAmount: number;
101
+ maxRedeemPercent: number;
102
+ pointsPerBdt: number;
103
+ }
104
+ interface MembershipConfig {
105
+ enabled: boolean;
106
+ pointsPerAmount: number;
107
+ amountPerPoint: number;
108
+ roundingMode: MembershipRoundingMode;
109
+ tiers: MembershipTierConfig[];
110
+ cardPrefix: string;
111
+ cardDigits: number;
112
+ redemption?: MembershipRedemptionConfig;
113
+ }
114
+ interface PlatformConfig {
115
+ _id: string;
116
+ platformName: string;
117
+ /** Flexible payment methods array */
118
+ paymentMethods: PaymentMethodConfig[];
119
+ checkout: CheckoutSettings;
120
+ logistics: LogisticsSettings;
121
+ vat: PlatformVatConfig;
122
+ membership?: MembershipConfig;
123
+ policies?: PlatformPolicies;
124
+ isSingleton: boolean;
125
+ createdAt: string;
126
+ updatedAt: string;
127
+ }
128
+ interface UpdatePlatformConfigPayload {
129
+ platformName?: string;
130
+ paymentMethods?: PaymentMethodConfig[];
131
+ checkout?: Partial<CheckoutSettings>;
132
+ logistics?: Partial<LogisticsSettings>;
133
+ vat?: Partial<PlatformVatConfig>;
134
+ membership?: Partial<MembershipConfig>;
135
+ policies?: Partial<PlatformPolicies>;
136
+ }
137
+
138
+ /**
139
+ * Branch Types
140
+ *
141
+ * Type definitions for store/warehouse locations.
142
+ * Separated from inventory types for better organization and single responsibility.
143
+ */
144
+ type BranchType = 'store' | 'warehouse' | 'outlet' | 'franchise';
145
+ /**
146
+ * Branch Hierarchy Role
147
+ * Determines the branch's position in the inventory flow hierarchy.
148
+ *
149
+ * - head_office: Central warehouse/HQ that receives purchases and distributes to sub-branches
150
+ * - sub_branch: Store/outlet that receives stock from head office
151
+ */
152
+ type BranchRole = 'head_office' | 'sub_branch';
153
+ interface BranchAddress {
154
+ line1?: string;
155
+ line2?: string;
156
+ city?: string;
157
+ state?: string;
158
+ postalCode?: string;
159
+ country?: string;
160
+ }
161
+ /**
162
+ * Branch (Store/Warehouse Location)
163
+ *
164
+ * Represents a physical location for inventory tracking and POS operations.
165
+ * Every deployment must have at least one branch (default branch).
166
+ *
167
+ * Branch Hierarchy:
168
+ * - One branch must be designated as head_office (typically the default branch)
169
+ * - All other branches are sub_branch by default
170
+ * - Stock flows: Suppliers -> Head Office -> Sub-branches
171
+ */
172
+ interface Branch {
173
+ _id: string;
174
+ /** URL-friendly slug (auto-generated from name) */
175
+ slug: string;
176
+ /** Unique branch code (e.g., "DHK-1", "CTG-MAIN") - uppercase, stable */
177
+ code: string;
178
+ /** Display name */
179
+ name: string;
180
+ /** Branch type (store, warehouse, outlet, franchise) */
181
+ type: BranchType;
182
+ /**
183
+ * Branch role in inventory hierarchy
184
+ * - head_office: Receives purchases, distributes to sub-branches
185
+ * - sub_branch: Receives stock from head office only
186
+ */
187
+ role: BranchRole;
188
+ /** Physical address */
189
+ address?: BranchAddress;
190
+ /** Contact phone */
191
+ phone?: string;
192
+ /** Contact email */
193
+ email?: string;
194
+ /** Operating hours (simple format, e.g., "10:00 AM - 10:00 PM") */
195
+ operatingHours?: string;
196
+ /** Whether this is the default branch (only one can be default) */
197
+ isDefault: boolean;
198
+ /** Whether this branch is active */
199
+ isActive: boolean;
200
+ /** Manager user ID reference */
201
+ manager?: string;
202
+ /** Admin notes (admin-only field) */
203
+ notes?: string;
204
+ createdAt: string;
205
+ updatedAt: string;
206
+ }
207
+ /**
208
+ * Create Branch Payload
209
+ */
210
+ interface CreateBranchPayload {
211
+ code: string;
212
+ name: string;
213
+ type?: BranchType;
214
+ /** Branch hierarchy role (defaults to 'sub_branch') */
215
+ role?: BranchRole;
216
+ address?: BranchAddress;
217
+ phone?: string;
218
+ email?: string;
219
+ operatingHours?: string;
220
+ isDefault?: boolean;
221
+ }
222
+ /**
223
+ * Update Branch Payload
224
+ */
225
+ interface UpdateBranchPayload extends Partial<CreateBranchPayload> {
226
+ isActive?: boolean;
227
+ notes?: string;
228
+ }
229
+ /**
230
+ * Branch Summary (for dropdowns, lists)
231
+ */
232
+ interface BranchSummary {
233
+ _id: string;
234
+ code: string;
235
+ name: string;
236
+ role: BranchRole;
237
+ isDefault: boolean;
238
+ }
239
+ /**
240
+ * Check if branch is head office
241
+ */
242
+ declare function isHeadOffice(branch: Branch | BranchSummary): boolean;
243
+ /**
244
+ * Check if branch is sub-branch
245
+ */
246
+ declare function isSubBranch(branch: Branch | BranchSummary): boolean;
247
+
248
+ /**
249
+ * User Types for Admin Management
250
+ *
251
+ * Simple types for CRUD operations on users.
252
+ * Frontend uses standard BaseApi methods with these types.
253
+ */
254
+ /** System-level roles (global permissions) */
255
+ type UserRoleType = 'user' | 'admin' | 'superadmin' | 'finance-admin' | 'finance-manager' | 'store-manager' | 'store-staff' | 'warehouse-admin' | 'warehouse-staff';
256
+ /** Branch-specific roles */
257
+ type BranchRoleType = 'branch_manager' | 'inventory_staff' | 'cashier' | 'stock_receiver' | 'stock_requester' | 'viewer';
258
+ /** User's branch assignment */
259
+ interface UserBranchAssignment {
260
+ branchId: string;
261
+ branchCode?: string;
262
+ branchName?: string;
263
+ branchRole?: 'head_office' | 'sub_branch';
264
+ roles: BranchRoleType[];
265
+ isPrimary: boolean;
266
+ }
267
+ /** User document */
268
+ interface User {
269
+ _id: string;
270
+ name: string;
271
+ email: string;
272
+ roles: UserRoleType[];
273
+ branches: UserBranchAssignment[];
274
+ isActive: boolean;
275
+ lastLoginAt?: string;
276
+ createdAt: string;
277
+ updatedAt: string;
278
+ }
279
+ /** Create user payload */
280
+ interface CreateUserPayload {
281
+ name: string;
282
+ email: string;
283
+ password: string;
284
+ roles?: UserRoleType[];
285
+ branches?: Array<{
286
+ branchId: string;
287
+ roles?: BranchRoleType[];
288
+ isPrimary?: boolean;
289
+ }>;
290
+ }
291
+ /** Update user payload - just patch what you need */
292
+ interface UpdateUserPayload {
293
+ name?: string;
294
+ email?: string;
295
+ roles?: UserRoleType[];
296
+ branches?: Array<{
297
+ branchId: string;
298
+ roles?: BranchRoleType[];
299
+ isPrimary?: boolean;
300
+ }>;
301
+ isActive?: boolean;
302
+ }
303
+ /** Query params for listing users */
304
+ interface UserListParams {
305
+ page?: number;
306
+ limit?: number;
307
+ sort?: string;
308
+ name?: string;
309
+ 'name[contains]'?: string;
310
+ email?: string;
311
+ roles?: UserRoleType;
312
+ 'roles[in]'?: string;
313
+ 'branches.branchId'?: string;
314
+ 'branches.roles'?: BranchRoleType;
315
+ isActive?: boolean;
316
+ }
317
+
318
+ /**
319
+ * Coupon Types
320
+ *
321
+ * Type definitions for discount coupons and promotional codes.
322
+ */
323
+
324
+ type DiscountType = 'percentage' | 'fixed';
325
+ /**
326
+ * Discount coupon/promo code
327
+ */
328
+ interface Coupon {
329
+ _id: string;
330
+ code: string;
331
+ discountType: DiscountType;
332
+ discountAmount: number;
333
+ minOrderAmount: number;
334
+ maxDiscountAmount?: number;
335
+ expiresAt: string;
336
+ usageLimit: number;
337
+ usedCount: number;
338
+ isActive: boolean;
339
+ createdAt: string;
340
+ updatedAt: string;
341
+ }
342
+ /**
343
+ * Coupon validation result
344
+ */
345
+ interface CouponValidationResult {
346
+ valid: boolean;
347
+ coupon?: Coupon;
348
+ discountAmount?: number;
349
+ error?: string;
350
+ details?: {
351
+ codeExists?: boolean;
352
+ isActive?: boolean;
353
+ notExpired?: boolean;
354
+ meetsMinPurchase?: boolean;
355
+ withinUsageLimit?: boolean;
356
+ };
357
+ }
358
+ /**
359
+ * Apply coupon request
360
+ */
361
+ interface ValidateCouponPayload {
362
+ orderAmount: number;
363
+ }
364
+ /**
365
+ * Create coupon request (admin)
366
+ */
367
+ interface CreateCouponPayload {
368
+ code: string;
369
+ discountType: DiscountType;
370
+ discountAmount: number;
371
+ minOrderAmount?: number;
372
+ maxDiscountAmount?: number;
373
+ expiresAt: string;
374
+ usageLimit?: number;
375
+ isActive?: boolean;
376
+ }
377
+ /**
378
+ * Update coupon request (admin)
379
+ */
380
+ type UpdateCouponPayload = Partial<CreateCouponPayload>;
381
+ type CouponListResponse = PaginatedResponse<Coupon>;
382
+ type CouponResponse = ApiResponse<Coupon>;
383
+ type CouponValidationResponse = ApiResponse<CouponValidationResult>;
384
+ /**
385
+ * Coupon usage record
386
+ */
387
+ interface CouponUsage {
388
+ /** Usage record ID */
389
+ _id: string;
390
+ /** Coupon ID */
391
+ couponId: string;
392
+ /** Coupon code */
393
+ couponCode: string;
394
+ /** User who used it */
395
+ userId: string;
396
+ /** Order ID */
397
+ orderId: string;
398
+ /** Discount amount applied */
399
+ discountAmount: number;
400
+ /** Used timestamp */
401
+ usedAt: string;
402
+ }
403
+
404
+ /**
405
+ * Platform Configuration API
406
+ *
407
+ * Singleton platform configuration - stores all platform-wide settings.
408
+ *
409
+ * Endpoints:
410
+ * - GET /api/v1/platform/config - Get platform config (supports field selection)
411
+ * - PATCH /api/v1/platform/config - Update platform config (admin only)
412
+ *
413
+ * Field Selection:
414
+ * - ?select=paymentMethods
415
+ * - ?select=checkout,vat
416
+ * - ?select=policies
417
+ */
418
+
419
+ declare class PlatformConfigApi {
420
+ readonly baseUrl = "/api/v1/platform";
421
+ /**
422
+ * Get platform configuration
423
+ *
424
+ * @param options.token - Optional access token (public without, authenticated with)
425
+ * @param options.select - Optional field selection (e.g., "paymentMethods", "checkout,vat")
426
+ * @returns Platform configuration (full or selected fields)
427
+ *
428
+ * @example
429
+ * // Full config (public)
430
+ * const config = await platformConfigApi.getConfig({});
431
+ *
432
+ * // Selected fields (public)
433
+ * const config = await platformConfigApi.getConfig({ select: "paymentMethods" });
434
+ *
435
+ * // Authenticated (admin sees more fields)
436
+ * const config = await platformConfigApi.getConfig({ token, select: "checkout,vat" });
437
+ */
438
+ getConfig({ token, select, }?: {
439
+ token?: string | null;
440
+ select?: string | null;
441
+ }): Promise<ApiResponse<PlatformConfig>>;
442
+ /**
443
+ * Update platform configuration
444
+ *
445
+ * @param options.token - Admin access token (required)
446
+ * @param options.data - Configuration data to update (partial update)
447
+ * @returns Updated platform configuration
448
+ *
449
+ * @example
450
+ * // Update payment methods
451
+ * await platformConfigApi.updateConfig({
452
+ * token,
453
+ * data: {
454
+ * paymentMethods: [
455
+ * { type: 'cash', name: 'Cash on Delivery', isActive: true },
456
+ * { type: 'mfs', provider: 'bkash', name: 'bKash', walletNumber: '01712345678' },
457
+ * ]
458
+ * }
459
+ * });
460
+ *
461
+ * // Update checkout settings
462
+ * await platformConfigApi.updateConfig({
463
+ * token,
464
+ * data: {
465
+ * checkout: {
466
+ * freeDeliveryThreshold: 2000,
467
+ * deliveryZones: [
468
+ * { name: 'Dhaka', region: 'dhaka', price: 60, estimatedDays: 2, isActive: true }
469
+ * ]
470
+ * }
471
+ * }
472
+ * });
473
+ */
474
+ updateConfig({ token, data, }: {
475
+ token: string;
476
+ data: UpdatePlatformConfigPayload;
477
+ }): Promise<ApiResponse<PlatformConfig>>;
478
+ /**
479
+ * Get payment methods only
480
+ * Convenience method for checkout/POS
481
+ *
482
+ * @param options.token - Optional access token
483
+ * @returns Platform config with only paymentMethods field
484
+ */
485
+ getPaymentMethods({ token, }?: {
486
+ token?: string | null;
487
+ }): Promise<ApiResponse<Pick<PlatformConfig, "paymentMethods">>>;
488
+ /**
489
+ * Get checkout settings only
490
+ * Convenience method for checkout flow
491
+ *
492
+ * @param options.token - Optional access token
493
+ * @returns Platform config with only checkout field
494
+ */
495
+ getCheckoutSettings({ token, }?: {
496
+ token?: string | null;
497
+ }): Promise<ApiResponse<Pick<PlatformConfig, "checkout">>>;
498
+ /**
499
+ * Get delivery zones
500
+ * Convenience method for delivery selection
501
+ *
502
+ * @param options.token - Optional access token
503
+ * @returns Platform config with checkout.deliveryZones
504
+ */
505
+ getDeliveryZones({ token, }?: {
506
+ token?: string | null;
507
+ }): Promise<ApiResponse<Pick<PlatformConfig, "checkout">>>;
508
+ /**
509
+ * Get VAT configuration
510
+ * Convenience method for invoice/tax calculations
511
+ *
512
+ * @param options.token - Optional access token
513
+ * @returns Platform config with only vat field
514
+ */
515
+ getVatConfig({ token, }?: {
516
+ token?: string | null;
517
+ }): Promise<ApiResponse<Pick<PlatformConfig, "vat">>>;
518
+ /**
519
+ * Get membership configuration
520
+ * Convenience method for loyalty programs
521
+ *
522
+ * @param options.token - Optional access token
523
+ * @returns Platform config with only membership field
524
+ */
525
+ getMembershipConfig({ token, }?: {
526
+ token?: string | null;
527
+ }): Promise<ApiResponse<Pick<PlatformConfig, "membership">>>;
528
+ }
529
+ declare const platformConfigApi: PlatformConfigApi;
530
+
531
+ declare const platformApi: PlatformConfigApi;
532
+ declare const businessApi: PlatformConfigApi;
533
+
534
+ /**
535
+ * Branch API - CRUD + Custom Endpoints
536
+ *
537
+ * Standard CRUD (inherited from BaseApi):
538
+ * - getAll({ token, params }) - list with filtering/pagination
539
+ * - getById({ token, id }) - get by ID
540
+ * - create({ token, data }) - create (admin only)
541
+ * - update({ token, id, data }) - update (admin only)
542
+ * - delete({ token, id }) - delete (admin only)
543
+ *
544
+ * Custom endpoints:
545
+ * - getByCode({ token, code }) - GET /branches/code/:code
546
+ * - getDefault({ token }) - GET /branches/default (auto-creates if none)
547
+ * - setDefault({ token, id }) - POST /branches/:id/set-default
548
+ *
549
+ * For active branches: getAll({ token, params: { isActive: true } })
550
+ */
551
+
552
+ type FetchOptions$1 = Omit<RequestOptions, 'token' | 'organizationId'>;
553
+ declare class BranchApi extends BaseApi<Branch, CreateBranchPayload, UpdateBranchPayload> {
554
+ constructor(config?: {});
555
+ /**
556
+ * Get branch by code
557
+ * GET /branches/code/:code
558
+ *
559
+ * @example
560
+ * branchApi.getByCode({ token, code: 'DHK-1' })
561
+ */
562
+ getByCode({ token, code, options, }: {
563
+ token: string;
564
+ code: string;
565
+ options?: FetchOptions$1;
566
+ }): Promise<ApiResponse<Branch>>;
567
+ /**
568
+ * Get default branch (auto-creates if none exists)
569
+ * GET /branches/default
570
+ *
571
+ * @example
572
+ * branchApi.getDefault({ token })
573
+ */
574
+ getDefault({ token, options, }: {
575
+ token: string;
576
+ options?: FetchOptions$1;
577
+ }): Promise<ApiResponse<Branch>>;
578
+ /**
579
+ * Set a branch as the default
580
+ * POST /branches/:id/set-default
581
+ *
582
+ * @example
583
+ * branchApi.setDefault({ token, id: '507f1f77bcf86cd799439011' })
584
+ */
585
+ setDefault({ token, id, options, }: {
586
+ token: string;
587
+ id: string;
588
+ options?: FetchOptions$1;
589
+ }): Promise<ApiResponse<Branch>>;
590
+ }
591
+ declare const branchApi: BranchApi;
592
+
593
+ /**
594
+ * User API - Admin User Management (CRUD)
595
+ *
596
+ * Standard CRUD (inherited from BaseApi):
597
+ * - getAll({ token, params }) - list users with filtering/pagination
598
+ * - getById({ token, id }) - get user by ID
599
+ * - create({ token, data }) - create user (admin only)
600
+ * - update({ token, id, data }) - update user (admin only)
601
+ * - delete({ token, id }) - delete user (admin only)
602
+ *
603
+ * Query examples:
604
+ * - List all users: getAll({ token, params: { page: 1, limit: 10 } })
605
+ * - Filter by role: getAll({ token, params: { roles: 'admin' } })
606
+ * - Search by name: getAll({ token, params: { 'name[contains]': 'john' } })
607
+ * - Filter by branch: getAll({ token, params: { 'branches.branchId': 'branch_123' } })
608
+ * - Active users only: getAll({ token, params: { isActive: true } })
609
+ */
610
+
611
+ declare class UserApi extends BaseApi<User, CreateUserPayload, UpdateUserPayload> {
612
+ constructor(config?: {});
613
+ }
614
+ declare const userApi: UserApi;
615
+
616
+ /**
617
+ * Coupon API - CRUD + validate
618
+ *
619
+ * Standard CRUD (inherited from BaseApi):
620
+ * - getAll({ token, params }) - list coupons with filtering/pagination
621
+ * - getById({ token, id }) - get coupon by ID
622
+ * - create({ token, data }) - create coupon (admin only)
623
+ * - update({ token, id, data }) - update coupon (admin only)
624
+ * - delete({ token, id }) - delete coupon (admin only)
625
+ *
626
+ * Custom endpoints:
627
+ * - validateCoupon({ code, data }) - POST /coupons/validate/:code
628
+ */
629
+
630
+ type FetchOptions = Omit<RequestOptions, "token" | "organizationId">;
631
+ declare class CouponApi extends BaseApi<Coupon, CreateCouponPayload, UpdateCouponPayload> {
632
+ constructor(config?: {});
633
+ /**
634
+ * Validate coupon by code with order amount
635
+ * POST /coupons/validate/:code
636
+ *
637
+ * @example
638
+ * const result = await couponApi.validateCoupon({
639
+ * code: 'SUMMER20',
640
+ * data: { orderAmount: 1500 }
641
+ * });
642
+ *
643
+ * if (result.data?.valid) {
644
+ * console.log('Discount:', result.data.discountAmount);
645
+ * }
646
+ */
647
+ validateCoupon({ code, data, options, }: {
648
+ code: string;
649
+ data: ValidateCouponPayload;
650
+ options?: FetchOptions;
651
+ }): Promise<ApiResponse<CouponValidationResult>>;
652
+ }
653
+ declare const couponApi: CouponApi;
654
+
655
+ export { type CheckoutPickupBranch as A, BranchApi as B, CouponApi as C, type DeliveryZone as D, type PlatformPolicies as E, type MembershipTierConfig as F, type MembershipRedemptionConfig as G, type MembershipConfig as H, type PlatformConfig as I, type UpdatePlatformConfigPayload as J, platformApi as K, type LogisticsSettings as L, type MembershipRoundingMode as M, businessApi as N, type DeliveryFeeSource as O, PlatformConfigApi as P, type CheckoutSettings as Q, type PlatformVatCategoryRate as R, type PlatformVatInvoiceConfig as S, type PlatformSupplementaryDutyConfig as T, UserApi as U, type ValidateCouponPayload as V, type PlatformVatConfig as W, type PaymentMethodConfig as X, type UserRoleType as Y, type User as Z, isSubBranch as a, branchApi as b, couponApi as c, type BranchType as d, type BranchRole as e, type BranchAddress as f, type Branch as g, type CreateBranchPayload as h, isHeadOffice as i, type UpdateBranchPayload as j, type BranchSummary as k, type BranchRoleType as l, type UserBranchAssignment as m, type CreateUserPayload as n, type UpdateUserPayload as o, platformConfigApi as p, type UserListParams as q, type Coupon as r, type CouponValidationResult as s, type CreateCouponPayload as t, userApi as u, type UpdateCouponPayload as v, type CouponListResponse as w, type CouponResponse as x, type CouponValidationResponse as y, type CouponUsage as z };