@classytic/commerce-sdk 0.1.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.

Potentially problematic release.


This version of @classytic/commerce-sdk might be problematic. Click here for more details.

Files changed (131) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +104 -0
  3. package/dist/adjustment-DTSLM7AN.js +5 -0
  4. package/dist/adjustment-DTSLM7AN.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 +479 -0
  14. package/dist/catalog/index.js +9 -0
  15. package/dist/catalog/index.js.map +1 -0
  16. package/dist/chunk-4ZQK3FFN.js +40 -0
  17. package/dist/chunk-4ZQK3FFN.js.map +1 -0
  18. package/dist/chunk-5L6EXDGH.js +465 -0
  19. package/dist/chunk-5L6EXDGH.js.map +1 -0
  20. package/dist/chunk-5ZFW3FEI.js +183 -0
  21. package/dist/chunk-5ZFW3FEI.js.map +1 -0
  22. package/dist/chunk-66OQAZSL.js +94 -0
  23. package/dist/chunk-66OQAZSL.js.map +1 -0
  24. package/dist/chunk-6RYGA6MF.js +123 -0
  25. package/dist/chunk-6RYGA6MF.js.map +1 -0
  26. package/dist/chunk-B6MPVOV7.js +328 -0
  27. package/dist/chunk-B6MPVOV7.js.map +1 -0
  28. package/dist/chunk-BDA2WSJA.js +148 -0
  29. package/dist/chunk-BDA2WSJA.js.map +1 -0
  30. package/dist/chunk-EIVYT3HM.js +126 -0
  31. package/dist/chunk-EIVYT3HM.js.map +1 -0
  32. package/dist/chunk-EPQN7ZKZ.js +27 -0
  33. package/dist/chunk-EPQN7ZKZ.js.map +1 -0
  34. package/dist/chunk-FA7QFJ2G.js +177 -0
  35. package/dist/chunk-FA7QFJ2G.js.map +1 -0
  36. package/dist/chunk-I5TIKUIQ.js +261 -0
  37. package/dist/chunk-I5TIKUIQ.js.map +1 -0
  38. package/dist/chunk-ILQUH444.js +135 -0
  39. package/dist/chunk-ILQUH444.js.map +1 -0
  40. package/dist/chunk-IXMWZJLV.js +616 -0
  41. package/dist/chunk-IXMWZJLV.js.map +1 -0
  42. package/dist/chunk-KZIGRIQG.js +75 -0
  43. package/dist/chunk-KZIGRIQG.js.map +1 -0
  44. package/dist/chunk-OF5M6R2S.js +769 -0
  45. package/dist/chunk-OF5M6R2S.js.map +1 -0
  46. package/dist/chunk-PYYLHUV6.js +3 -0
  47. package/dist/chunk-PYYLHUV6.js.map +1 -0
  48. package/dist/chunk-QO5AGZFP.js +159 -0
  49. package/dist/chunk-QO5AGZFP.js.map +1 -0
  50. package/dist/chunk-QUMTBLNE.js +76 -0
  51. package/dist/chunk-QUMTBLNE.js.map +1 -0
  52. package/dist/chunk-R5Z7NYLH.js +126 -0
  53. package/dist/chunk-R5Z7NYLH.js.map +1 -0
  54. package/dist/chunk-SZYWG5IB.js +75 -0
  55. package/dist/chunk-SZYWG5IB.js.map +1 -0
  56. package/dist/chunk-U3XT35GZ.js +202 -0
  57. package/dist/chunk-U3XT35GZ.js.map +1 -0
  58. package/dist/chunk-UGELTUIZ.js +830 -0
  59. package/dist/chunk-UGELTUIZ.js.map +1 -0
  60. package/dist/chunk-VR36QVX2.js +122 -0
  61. package/dist/chunk-VR36QVX2.js.map +1 -0
  62. package/dist/chunk-WUOQK7BO.js +13 -0
  63. package/dist/chunk-WUOQK7BO.js.map +1 -0
  64. package/dist/chunk-X6PV5MHG.js +582 -0
  65. package/dist/chunk-X6PV5MHG.js.map +1 -0
  66. package/dist/chunk-ZWLMFLLH.js +534 -0
  67. package/dist/chunk-ZWLMFLLH.js.map +1 -0
  68. package/dist/content/index.d.ts +309 -0
  69. package/dist/content/index.js +6 -0
  70. package/dist/content/index.js.map +1 -0
  71. package/dist/core/index.d.ts +107 -0
  72. package/dist/core/index.js +5 -0
  73. package/dist/core/index.js.map +1 -0
  74. package/dist/core/react.d.ts +107 -0
  75. package/dist/core/react.js +5 -0
  76. package/dist/core/react.js.map +1 -0
  77. package/dist/coupon-CHFcw7cd.d.ts +632 -0
  78. package/dist/coupon-zGkvO-Xx.d.ts +129 -0
  79. package/dist/crud.factory-DyKaPHcU.d.ts +181 -0
  80. package/dist/finance/index.d.ts +81 -0
  81. package/dist/finance/index.js +5 -0
  82. package/dist/finance/index.js.map +1 -0
  83. package/dist/finance-BJdfKRw0.d.ts +135 -0
  84. package/dist/index.d.ts +31 -0
  85. package/dist/index.js +29 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/inventory/index.d.ts +512 -0
  88. package/dist/inventory/index.js +16 -0
  89. package/dist/inventory/index.js.map +1 -0
  90. package/dist/inventory-DCiIZh8P.d.ts +742 -0
  91. package/dist/logistics/index.d.ts +226 -0
  92. package/dist/logistics/index.js +7 -0
  93. package/dist/logistics/index.js.map +1 -0
  94. package/dist/logistics-V8a9lUN3.d.ts +428 -0
  95. package/dist/media-CNLJK93J.d.ts +721 -0
  96. package/dist/movement-7MV3ADY5.js +5 -0
  97. package/dist/movement-7MV3ADY5.js.map +1 -0
  98. package/dist/payment-BRboLqvU.d.ts +127 -0
  99. package/dist/payments/index.d.ts +55 -0
  100. package/dist/payments/index.js +6 -0
  101. package/dist/payments/index.js.map +1 -0
  102. package/dist/platform/index.d.ts +645 -0
  103. package/dist/platform/index.js +8 -0
  104. package/dist/platform/index.js.map +1 -0
  105. package/dist/pos-D1jkkFl0.d.ts +885 -0
  106. package/dist/product-p09zXkXB.d.ts +260 -0
  107. package/dist/purchase-24BGT2HA.js +5 -0
  108. package/dist/purchase-24BGT2HA.js.map +1 -0
  109. package/dist/request-652PS6VR.js +5 -0
  110. package/dist/request-652PS6VR.js.map +1 -0
  111. package/dist/sales/index.d.ts +585 -0
  112. package/dist/sales/index.js +9 -0
  113. package/dist/sales/index.js.map +1 -0
  114. package/dist/server.d.ts +120 -0
  115. package/dist/server.js +27 -0
  116. package/dist/server.js.map +1 -0
  117. package/dist/size-guide-DgjzjM5P.d.ts +554 -0
  118. package/dist/stock-DEApGC-w.d.ts +632 -0
  119. package/dist/stock-OOUW57VQ.js +5 -0
  120. package/dist/stock-OOUW57VQ.js.map +1 -0
  121. package/dist/supplier-OC6JAWV6.js +5 -0
  122. package/dist/supplier-OC6JAWV6.js.map +1 -0
  123. package/dist/transaction/index.d.ts +104 -0
  124. package/dist/transaction/index.js +8 -0
  125. package/dist/transaction/index.js.map +1 -0
  126. package/dist/transaction-BTmoHpWh.d.ts +428 -0
  127. package/dist/transaction-u5oaNuav.d.ts +84 -0
  128. package/dist/transfer-7SYSH3RG.js +5 -0
  129. package/dist/transfer-7SYSH3RG.js.map +1 -0
  130. package/dist/user-data-DdLjAGwO.d.ts +132 -0
  131. package/package.json +146 -0
@@ -0,0 +1,632 @@
1
+ import { P as PaginatedResponse, A as ApiResponse, B as BaseApi, R as RequestOptions } from './api-factory-B_h4RKBm.js';
2
+ import { af as AdjustStockResult, ac as CreateAdjustmentPayload, ae as AdjustStockPayload, w as StockMovement, ai as MovementQueryParams, ag as LowStockItem, a8 as StockRequest, a9 as CreateStockRequestPayload, _ as Transfer, $ as CreateTransferPayload, a1 as UpdateTransferPayload, ah as TransferStats, a2 as DispatchTransferPayload, a3 as ReceiveTransferPayload, H as Purchase, I as CreatePurchasePayload, U as UpdatePurchasePayload, C as PurchaseActionType, v as StockEntry } from './inventory-DCiIZh8P.js';
3
+
4
+ /**
5
+ * Supplier (Vendor) Types
6
+ *
7
+ * Types for supplier management in the inventory module.
8
+ */
9
+
10
+ type SupplierType = "local" | "import" | "manufacturer" | "wholesaler";
11
+ type SupplierPaymentTerms = "cash" | "credit";
12
+ interface Supplier {
13
+ _id: string;
14
+ /** Supplier name (unique for active suppliers) */
15
+ name: string;
16
+ /** Auto-generated code (e.g., SUP-0001) */
17
+ code?: string;
18
+ /** Supplier type */
19
+ type?: SupplierType;
20
+ /** Primary contact person */
21
+ contactPerson?: string;
22
+ /** Phone number */
23
+ phone?: string;
24
+ /** Email address */
25
+ email?: string;
26
+ /** Address */
27
+ address?: string;
28
+ /** Tax ID or BIN */
29
+ taxId?: string;
30
+ /** Payment terms */
31
+ paymentTerms?: SupplierPaymentTerms;
32
+ /** Credit days (0 for cash) */
33
+ creditDays?: number;
34
+ /** Credit limit in BDT */
35
+ creditLimit?: number;
36
+ /** Opening payable balance */
37
+ openingBalance?: number;
38
+ /** Internal notes */
39
+ notes?: string;
40
+ /** Free-form tags */
41
+ tags?: string[];
42
+ /** Active/inactive status */
43
+ isActive?: boolean;
44
+ createdAt?: string;
45
+ updatedAt?: string;
46
+ }
47
+ interface SupplierCreatePayload {
48
+ name: string;
49
+ code?: string;
50
+ type?: SupplierType;
51
+ contactPerson?: string;
52
+ phone?: string;
53
+ email?: string;
54
+ address?: string;
55
+ taxId?: string;
56
+ paymentTerms?: SupplierPaymentTerms;
57
+ creditDays?: number;
58
+ creditLimit?: number;
59
+ openingBalance?: number;
60
+ notes?: string;
61
+ tags?: string[];
62
+ isActive?: boolean;
63
+ }
64
+ interface SupplierUpdatePayload {
65
+ name?: string;
66
+ code?: string;
67
+ type?: SupplierType;
68
+ contactPerson?: string;
69
+ phone?: string;
70
+ email?: string;
71
+ address?: string;
72
+ taxId?: string;
73
+ paymentTerms?: SupplierPaymentTerms;
74
+ creditDays?: number;
75
+ creditLimit?: number;
76
+ openingBalance?: number;
77
+ notes?: string;
78
+ tags?: string[];
79
+ isActive?: boolean;
80
+ }
81
+ interface SupplierQueryParams {
82
+ page?: number;
83
+ limit?: number;
84
+ after?: string;
85
+ sort?: string | Record<string, 1 | -1 | "asc" | "desc">;
86
+ search?: string;
87
+ name?: string;
88
+ type?: SupplierType;
89
+ paymentTerms?: SupplierPaymentTerms;
90
+ isActive?: boolean;
91
+ [key: string]: unknown;
92
+ }
93
+ type SupplierListResponse = PaginatedResponse<Supplier>;
94
+ type SupplierResponse = ApiResponse<Supplier>;
95
+
96
+ /**
97
+ * Supplier (Vendor) API
98
+ *
99
+ * Base path: /api/v1/inventory/suppliers
100
+ *
101
+ * Standard CRUD (inherited from BaseApi):
102
+ * - getAll({ token, params }) - list with filtering/search/pagination
103
+ * - getById({ token, id }) - get by ID
104
+ * - create({ token, data }) - create supplier
105
+ * - update({ token, id, data }) - update supplier
106
+ * - delete({ token, id }) - deactivate supplier (soft delete)
107
+ */
108
+
109
+ declare class SupplierApi extends BaseApi<Supplier, SupplierCreatePayload, SupplierUpdatePayload> {
110
+ constructor(config?: {});
111
+ }
112
+ declare const supplierApi: SupplierApi;
113
+
114
+ /**
115
+ * Adjustment API - Manual Stock Corrections
116
+ *
117
+ * Handles manual stock adjustments (add, remove, set).
118
+ * Creates adjustment movements and optionally expense transactions.
119
+ */
120
+
121
+ type FetchOptions$5 = Omit<RequestOptions, "token" | "organizationId">;
122
+ declare class AdjustmentApi extends BaseApi<AdjustStockResult, CreateAdjustmentPayload> {
123
+ constructor(config?: {});
124
+ /**
125
+ * Create a manual stock adjustment
126
+ * POST /inventory/adjustments
127
+ *
128
+ * @example Single item adjustment
129
+ * adjustmentApi.create({
130
+ * token,
131
+ * data: {
132
+ * productId: '...',
133
+ * variantSku: 'SKU-RED-M',
134
+ * quantity: 5,
135
+ * mode: 'remove',
136
+ * reason: 'damaged',
137
+ * lostAmount: 2500 // Creates expense transaction (opt-in)
138
+ * }
139
+ * })
140
+ *
141
+ * @example Bulk adjustment
142
+ * adjustmentApi.create({
143
+ * token,
144
+ * data: {
145
+ * adjustments: [
146
+ * { productId: '...', quantity: 5, mode: 'add' },
147
+ * { productId: '...', quantity: 3, mode: 'remove' }
148
+ * ],
149
+ * reason: 'inventory recount'
150
+ * }
151
+ * })
152
+ */
153
+ create({ token, data, options, }: {
154
+ token: string;
155
+ data: CreateAdjustmentPayload;
156
+ options?: FetchOptions$5;
157
+ }): Promise<ApiResponse<AdjustStockResult>>;
158
+ /**
159
+ * Adjust stock (single item, POS format)
160
+ * POST /inventory/adjustments
161
+ */
162
+ adjustStock({ token, data, options, }: {
163
+ token: string;
164
+ data: AdjustStockPayload;
165
+ options?: FetchOptions$5;
166
+ }): Promise<ApiResponse<AdjustStockResult>>;
167
+ /**
168
+ * Add stock to a product
169
+ */
170
+ addStock({ token, productId, variantSku, quantity, branchId, reason, options, }: {
171
+ token: string;
172
+ productId: string;
173
+ variantSku?: string;
174
+ quantity: number;
175
+ branchId?: string;
176
+ reason?: string;
177
+ options?: FetchOptions$5;
178
+ }): Promise<ApiResponse<AdjustStockResult>>;
179
+ /**
180
+ * Remove stock from a product
181
+ */
182
+ removeStock({ token, productId, variantSku, quantity, branchId, reason, lostAmount, options, }: {
183
+ token: string;
184
+ productId: string;
185
+ variantSku?: string;
186
+ quantity: number;
187
+ branchId?: string;
188
+ reason?: string;
189
+ lostAmount?: number;
190
+ options?: FetchOptions$5;
191
+ }): Promise<ApiResponse<AdjustStockResult>>;
192
+ /**
193
+ * Set stock to a specific quantity
194
+ */
195
+ setStock({ token, productId, variantSku, quantity, branchId, reason, options, }: {
196
+ token: string;
197
+ productId: string;
198
+ variantSku?: string;
199
+ quantity: number;
200
+ branchId?: string;
201
+ reason?: string;
202
+ options?: FetchOptions$5;
203
+ }): Promise<ApiResponse<AdjustStockResult>>;
204
+ }
205
+ declare const adjustmentApi: AdjustmentApi;
206
+
207
+ /**
208
+ * Movement API - Stock Audit Trail
209
+ *
210
+ * Every stock change creates an immutable StockMovement record.
211
+ * Types: purchase, sale, return, adjustment, transfer_in, transfer_out, initial, recount
212
+ */
213
+
214
+ type FetchOptions$4 = Omit<RequestOptions, "token" | "organizationId">;
215
+ declare class MovementApi extends BaseApi<StockMovement> {
216
+ constructor(config?: {});
217
+ /**
218
+ * Get stock movements (audit trail)
219
+ * GET /inventory/movements
220
+ *
221
+ * @param params - Filters (productId, branchId, type, startDate, endDate, page, limit, sort, after/cursor)
222
+ */
223
+ list({ token, params, options, }: {
224
+ token: string;
225
+ params?: MovementQueryParams;
226
+ options?: FetchOptions$4;
227
+ }): Promise<PaginatedResponse<StockMovement>>;
228
+ /**
229
+ * Get movements by type
230
+ * GET /inventory/movements?type=<type>
231
+ */
232
+ listByType({ token, type, params, options, }: {
233
+ token: string;
234
+ type: StockMovement["type"];
235
+ params?: Omit<MovementQueryParams, "type">;
236
+ options?: FetchOptions$4;
237
+ }): Promise<PaginatedResponse<StockMovement>>;
238
+ /**
239
+ * Get movements for a specific product
240
+ * GET /inventory/movements?productId=<id>
241
+ */
242
+ listByProduct({ token, productId, params, options, }: {
243
+ token: string;
244
+ productId: string;
245
+ params?: Omit<MovementQueryParams, "productId">;
246
+ options?: FetchOptions$4;
247
+ }): Promise<PaginatedResponse<StockMovement>>;
248
+ /**
249
+ * Get low stock items
250
+ * GET /inventory/low-stock
251
+ */
252
+ lowStock({ token, params, options, }: {
253
+ token: string;
254
+ params?: {
255
+ branchId?: string;
256
+ threshold?: number;
257
+ };
258
+ options?: FetchOptions$4;
259
+ }): Promise<ApiResponse<LowStockItem[]>>;
260
+ }
261
+ declare const movementApi: MovementApi;
262
+
263
+ /**
264
+ * Stock Request API - Sub-branch -> Head Office requests
265
+ *
266
+ * Handles stock requests from sub-branches following the Stripe action-based pattern.
267
+ * Status flow: pending -> approved -> fulfilled (or rejected/cancelled)
268
+ */
269
+
270
+ type FetchOptions$3 = Omit<RequestOptions, "token" | "organizationId">;
271
+ declare class RequestApi extends BaseApi<StockRequest, CreateStockRequestPayload> {
272
+ constructor(config?: {});
273
+ /**
274
+ * List stock requests
275
+ * GET /inventory/requests
276
+ */
277
+ list({ token, params, options, }: {
278
+ token: string;
279
+ params?: Record<string, unknown>;
280
+ options?: FetchOptions$3;
281
+ }): Promise<PaginatedResponse<StockRequest>>;
282
+ /**
283
+ * List pending stock requests
284
+ * GET /inventory/requests?status=pending
285
+ */
286
+ listPending({ token, options, }: {
287
+ token: string;
288
+ options?: FetchOptions$3;
289
+ }): Promise<PaginatedResponse<StockRequest>>;
290
+ /**
291
+ * Get stock request by ID
292
+ * GET /inventory/requests/:id
293
+ */
294
+ getById({ token, id, options, }: {
295
+ token: string;
296
+ id: string;
297
+ options?: FetchOptions$3;
298
+ }): Promise<ApiResponse<StockRequest>>;
299
+ /**
300
+ * Create a stock request
301
+ * POST /inventory/requests
302
+ */
303
+ create({ token, data, options, }: {
304
+ token: string;
305
+ data: CreateStockRequestPayload;
306
+ options?: FetchOptions$3;
307
+ }): Promise<ApiResponse<StockRequest>>;
308
+ /**
309
+ * Generic action endpoint
310
+ * POST /inventory/requests/:id/action
311
+ */
312
+ action({ token, id, action, data, options, }: {
313
+ token: string;
314
+ id: string;
315
+ action: "approve" | "reject" | "fulfill" | "cancel";
316
+ data?: Record<string, unknown>;
317
+ options?: FetchOptions$3;
318
+ }): Promise<ApiResponse<StockRequest>>;
319
+ /**
320
+ * Approve a stock request
321
+ */
322
+ approve({ token, id, items, reviewNotes, notes, options, }: {
323
+ token: string;
324
+ id: string;
325
+ items?: {
326
+ productId: string;
327
+ variantSku?: string;
328
+ quantityApproved: number;
329
+ }[];
330
+ reviewNotes?: string;
331
+ notes?: string;
332
+ options?: FetchOptions$3;
333
+ }): Promise<ApiResponse<StockRequest>>;
334
+ /**
335
+ * Reject a stock request
336
+ */
337
+ reject({ token, id, reason, options, }: {
338
+ token: string;
339
+ id: string;
340
+ reason: string;
341
+ options?: FetchOptions$3;
342
+ }): Promise<ApiResponse<StockRequest>>;
343
+ /**
344
+ * Fulfill a stock request (creates a transfer)
345
+ * Head office assigns carton numbers here for label printing
346
+ */
347
+ fulfill({ token, id, remarks, documentType, items, transport, options, }: {
348
+ token: string;
349
+ id: string;
350
+ remarks?: string;
351
+ documentType?: string;
352
+ items?: {
353
+ productId: string;
354
+ variantSku?: string;
355
+ quantity: number;
356
+ cartonNumber?: string;
357
+ }[];
358
+ transport?: {
359
+ vehicleNumber?: string;
360
+ driverName?: string;
361
+ driverPhone?: string;
362
+ };
363
+ options?: FetchOptions$3;
364
+ }): Promise<ApiResponse<StockRequest>>;
365
+ /**
366
+ * Cancel a stock request
367
+ */
368
+ cancel({ token, id, reason, options, }: {
369
+ token: string;
370
+ id: string;
371
+ reason?: string;
372
+ options?: FetchOptions$3;
373
+ }): Promise<ApiResponse<StockRequest>>;
374
+ }
375
+ declare const requestApi: RequestApi;
376
+
377
+ /**
378
+ * Transfer API - Inter-branch Stock Movement
379
+ *
380
+ * Handles challan/transfer documents following the Stripe action-based pattern.
381
+ * Status flow: draft -> approved -> dispatched -> in_transit -> received
382
+ */
383
+
384
+ type FetchOptions$2 = Omit<RequestOptions, "token" | "organizationId">;
385
+ declare class TransferApi extends BaseApi<Transfer, CreateTransferPayload, UpdateTransferPayload> {
386
+ constructor(config?: {});
387
+ /**
388
+ * List transfers with filtering
389
+ * GET /inventory/transfers
390
+ */
391
+ list({ token, params, options, }: {
392
+ token: string;
393
+ params?: Record<string, unknown>;
394
+ options?: FetchOptions$2;
395
+ }): Promise<PaginatedResponse<Transfer>>;
396
+ /**
397
+ * Get transfer by ID or challan number
398
+ * GET /inventory/transfers/:id
399
+ */
400
+ getById({ token, id, options, }: {
401
+ token: string;
402
+ id: string;
403
+ options?: FetchOptions$2;
404
+ }): Promise<ApiResponse<Transfer>>;
405
+ /**
406
+ * Create a new transfer (draft)
407
+ * POST /inventory/transfers
408
+ */
409
+ create({ token, data, options, }: {
410
+ token: string;
411
+ data: CreateTransferPayload;
412
+ options?: FetchOptions$2;
413
+ }): Promise<ApiResponse<Transfer>>;
414
+ /**
415
+ * Update a draft transfer
416
+ * PATCH /inventory/transfers/:id
417
+ */
418
+ update({ token, id, data, options, }: {
419
+ token: string;
420
+ id: string;
421
+ data: UpdateTransferPayload;
422
+ options?: FetchOptions$2;
423
+ }): Promise<ApiResponse<Transfer>>;
424
+ /**
425
+ * Get transfer statistics
426
+ * GET /inventory/transfers/stats
427
+ */
428
+ stats({ token, params, options, }: {
429
+ token: string;
430
+ params?: {
431
+ branchId?: string;
432
+ };
433
+ options?: FetchOptions$2;
434
+ }): Promise<ApiResponse<TransferStats>>;
435
+ /**
436
+ * Generic action endpoint
437
+ * POST /inventory/transfers/:id/action
438
+ */
439
+ action({ token, id, action, data, options, }: {
440
+ token: string;
441
+ id: string;
442
+ action: "approve" | "dispatch" | "in-transit" | "receive" | "cancel";
443
+ data?: Record<string, unknown>;
444
+ options?: FetchOptions$2;
445
+ }): Promise<ApiResponse<Transfer>>;
446
+ /**
447
+ * Approve a transfer (validates stock availability)
448
+ */
449
+ approve({ token, id, options, }: {
450
+ token: string;
451
+ id: string;
452
+ options?: FetchOptions$2;
453
+ }): Promise<ApiResponse<Transfer>>;
454
+ /**
455
+ * Dispatch a transfer (decrements sender stock)
456
+ */
457
+ dispatch({ token, id, data, options, }: {
458
+ token: string;
459
+ id: string;
460
+ data?: DispatchTransferPayload;
461
+ options?: FetchOptions$2;
462
+ }): Promise<ApiResponse<Transfer>>;
463
+ /**
464
+ * Mark transfer as in-transit
465
+ */
466
+ markInTransit({ token, id, options, }: {
467
+ token: string;
468
+ id: string;
469
+ options?: FetchOptions$2;
470
+ }): Promise<ApiResponse<Transfer>>;
471
+ /**
472
+ * Receive a transfer (increments receiver stock)
473
+ */
474
+ receive({ token, id, data, options, }: {
475
+ token: string;
476
+ id: string;
477
+ data?: ReceiveTransferPayload;
478
+ options?: FetchOptions$2;
479
+ }): Promise<ApiResponse<Transfer>>;
480
+ /**
481
+ * Cancel a transfer
482
+ */
483
+ cancel({ token, id, reason, options, }: {
484
+ token: string;
485
+ id: string;
486
+ reason?: string;
487
+ options?: FetchOptions$2;
488
+ }): Promise<ApiResponse<Transfer>>;
489
+ }
490
+ declare const transferApi: TransferApi;
491
+
492
+ /**
493
+ * Purchase API - Supplier Invoices & Stock Entry
494
+ *
495
+ * Base path: /api/v1/inventory/purchases
496
+ *
497
+ * Purchases are the only official way to bring new inventory into the system.
498
+ * They are Head Office only and drive COGS (weighted average cost).
499
+ *
500
+ * Standard CRUD:
501
+ * - create({ token, data }) - Create purchase invoice (draft)
502
+ * - getAll({ token, params }) - List purchases with filtering
503
+ * - getById({ token, id }) - Get purchase by ID
504
+ * - update({ token, id, data }) - Update draft purchase
505
+ *
506
+ * Actions (Stripe pattern):
507
+ * - receive({ token, id }) - Receive purchase (creates stock movements)
508
+ * - pay({ token, id, amount, method, reference }) - Record payment
509
+ * - cancel({ token, id, reason }) - Cancel draft/approved purchase
510
+ */
511
+
512
+ type FetchOptions$1 = Omit<RequestOptions, "token" | "organizationId">;
513
+ declare class PurchaseApi extends BaseApi<Purchase, CreatePurchasePayload, UpdatePurchasePayload> {
514
+ constructor(config?: {});
515
+ /**
516
+ * Perform a purchase action (receive/pay/cancel)
517
+ * POST /inventory/purchases/:id/action
518
+ */
519
+ action({ token, id, action, data, options, }: {
520
+ token: string;
521
+ id: string;
522
+ action: PurchaseActionType;
523
+ data?: Record<string, unknown>;
524
+ options?: FetchOptions$1;
525
+ }): Promise<ApiResponse<Purchase>>;
526
+ /**
527
+ * Receive a purchase (auto-approves draft and creates stock movements)
528
+ * POST /inventory/purchases/:id/action { action: 'receive' }
529
+ */
530
+ receive({ token, id, options, }: {
531
+ token: string;
532
+ id: string;
533
+ options?: FetchOptions$1;
534
+ }): Promise<ApiResponse<Purchase>>;
535
+ /**
536
+ * Record payment for a purchase
537
+ * POST /inventory/purchases/:id/action { action: 'pay', amount, method, reference }
538
+ */
539
+ pay({ token, id, amount, method, reference, accountNumber, walletNumber, bankName, accountName, proofUrl, transactionDate, notes, options, }: {
540
+ token: string;
541
+ id: string;
542
+ amount: number;
543
+ method: string;
544
+ reference?: string;
545
+ accountNumber?: string;
546
+ walletNumber?: string;
547
+ bankName?: string;
548
+ accountName?: string;
549
+ proofUrl?: string;
550
+ transactionDate?: string;
551
+ notes?: string;
552
+ options?: FetchOptions$1;
553
+ }): Promise<ApiResponse<Purchase>>;
554
+ /**
555
+ * Cancel a purchase (draft or approved only)
556
+ * POST /inventory/purchases/:id/action { action: 'cancel', reason }
557
+ */
558
+ cancel({ token, id, reason, options, }: {
559
+ token: string;
560
+ id: string;
561
+ reason?: string;
562
+ options?: FetchOptions$1;
563
+ }): Promise<ApiResponse<Purchase>>;
564
+ /**
565
+ * Record a stock purchase (legacy method)
566
+ * Creates and optionally auto-receives a purchase
567
+ *
568
+ * @deprecated Use create() with autoReceive: true instead
569
+ */
570
+ recordPurchase({ token, data, options, }: {
571
+ token: string;
572
+ data: CreatePurchasePayload;
573
+ options?: FetchOptions$1;
574
+ }): Promise<ApiResponse<{
575
+ stockEntries: StockEntry[];
576
+ movements: StockMovement[];
577
+ }>>;
578
+ }
579
+ declare const purchaseApi: PurchaseApi;
580
+
581
+ /**
582
+ * Stock API - Stock Entry Management
583
+ *
584
+ * Provides access to stock entry records.
585
+ * Stock entries track quantity per product/variant/branch combination.
586
+ */
587
+
588
+ type FetchOptions = Omit<RequestOptions, "token" | "organizationId">;
589
+ declare class StockApi extends BaseApi<StockEntry> {
590
+ constructor(config?: {});
591
+ /**
592
+ * List stock entries
593
+ * GET /inventory
594
+ */
595
+ list({ token, params, options, }: {
596
+ token: string;
597
+ params?: Record<string, unknown>;
598
+ options?: FetchOptions;
599
+ }): Promise<PaginatedResponse<StockEntry>>;
600
+ /**
601
+ * Get stock entry by ID
602
+ * GET /inventory/:id
603
+ */
604
+ getById({ token, id, options, }: {
605
+ token: string;
606
+ id: string;
607
+ options?: FetchOptions;
608
+ }): Promise<ApiResponse<StockEntry>>;
609
+ /**
610
+ * Get stock for a specific product
611
+ * GET /inventory?productId=<id>
612
+ */
613
+ getByProduct({ token, productId, branchId, options, }: {
614
+ token: string;
615
+ productId: string;
616
+ branchId?: string;
617
+ options?: FetchOptions;
618
+ }): Promise<PaginatedResponse<StockEntry>>;
619
+ /**
620
+ * Get stock for a specific branch
621
+ * GET /inventory?branchId=<id>
622
+ */
623
+ getByBranch({ token, branchId, params, options, }: {
624
+ token: string;
625
+ branchId: string;
626
+ params?: Record<string, unknown>;
627
+ options?: FetchOptions;
628
+ }): Promise<PaginatedResponse<StockEntry>>;
629
+ }
630
+ declare const stockApi: StockApi;
631
+
632
+ export { AdjustmentApi as A, MovementApi as M, PurchaseApi as P, RequestApi as R, StockApi as S, TransferApi as T, adjustmentApi as a, supplierApi as b, SupplierApi as c, type SupplierQueryParams as d, type SupplierType as e, type SupplierPaymentTerms as f, type Supplier as g, type SupplierCreatePayload as h, type SupplierUpdatePayload as i, type SupplierListResponse as j, type SupplierResponse as k, movementApi as m, purchaseApi as p, requestApi as r, stockApi as s, transferApi as t };
@@ -0,0 +1,5 @@
1
+ export { StockApi, stockApi } from './chunk-KZIGRIQG.js';
2
+ import './chunk-I5TIKUIQ.js';
3
+ import './chunk-VR36QVX2.js';
4
+ //# sourceMappingURL=stock-OOUW57VQ.js.map
5
+ //# sourceMappingURL=stock-OOUW57VQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"stock-OOUW57VQ.js"}
@@ -0,0 +1,5 @@
1
+ export { SupplierApi, supplierApi } from './chunk-WUOQK7BO.js';
2
+ import './chunk-I5TIKUIQ.js';
3
+ import './chunk-VR36QVX2.js';
4
+ //# sourceMappingURL=supplier-OC6JAWV6.js.map
5
+ //# sourceMappingURL=supplier-OC6JAWV6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"supplier-OC6JAWV6.js"}