@codingfactory/inventory-locator-client 0.1.0 → 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.
@@ -0,0 +1,1803 @@
1
+ import { App } from 'vue';
2
+ import { AxiosInstance } from 'axios';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { ComponentProvideOptions } from 'vue';
5
+ import { ComputedRef } from 'vue';
6
+ import { DefineComponent } from 'vue';
7
+ import { PublicProps } from 'vue';
8
+ import { Ref } from 'vue';
9
+ import { StoreDefinition } from 'pinia';
10
+
11
+ declare type __VLS_Props = {
12
+ locationCode?: string;
13
+ locationId?: number;
14
+ };
15
+
16
+ declare type __VLS_Props_10 = {
17
+ location: Location_2;
18
+ show: boolean;
19
+ };
20
+
21
+ declare type __VLS_Props_11 = {
22
+ limit?: number;
23
+ };
24
+
25
+ declare type __VLS_Props_12 = {
26
+ locationId: number;
27
+ format?: LabelFormat;
28
+ };
29
+
30
+ declare type __VLS_Props_13 = {
31
+ limit?: number;
32
+ };
33
+
34
+ declare type __VLS_Props_2 = {
35
+ sessionId: number;
36
+ };
37
+
38
+ declare type __VLS_Props_3 = {
39
+ sessionId: number;
40
+ locationId?: number | null;
41
+ };
42
+
43
+ declare type __VLS_Props_4 = {
44
+ sessionId: number;
45
+ };
46
+
47
+ declare type __VLS_Props_5 = {
48
+ modelValue: string;
49
+ placeholder?: string;
50
+ autofocus?: boolean;
51
+ };
52
+
53
+ declare type __VLS_Props_6 = {
54
+ code: string;
55
+ truncate?: boolean;
56
+ maxSegments?: number;
57
+ };
58
+
59
+ declare type __VLS_Props_7 = {
60
+ type: LocationType;
61
+ size?: 'sm' | 'md' | 'lg';
62
+ };
63
+
64
+ declare type __VLS_Props_8 = {
65
+ path: PathSegment[];
66
+ };
67
+
68
+ declare type __VLS_Props_9 = {
69
+ productId: number | string;
70
+ };
71
+
72
+ export declare interface Column {
73
+ key: string;
74
+ label: string;
75
+ sortable?: boolean;
76
+ width?: string;
77
+ align?: 'left' | 'center' | 'right';
78
+ }
79
+
80
+ export declare function configureApiClient(options: {
81
+ axiosInstance?: AxiosInstance;
82
+ prefix?: string;
83
+ }): void;
84
+
85
+ export declare interface CountEntry {
86
+ id: number;
87
+ count_session_id: number;
88
+ location_id: number;
89
+ product_id: number | string;
90
+ product_type: string;
91
+ product_name: string;
92
+ expected_quantity: number | null;
93
+ counted_quantity: number | null;
94
+ discrepancy: number | null;
95
+ status: CountEntryStatus;
96
+ counted_by: number | null;
97
+ counted_at: string | null;
98
+ verified_by: number | null;
99
+ verified_at: string | null;
100
+ notes: string | null;
101
+ location?: Location_2;
102
+ }
103
+
104
+ export declare const CountEntryForm: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
105
+
106
+ export declare type CountEntryStatus = 'pending' | 'counted' | 'verified' | 'adjusted';
107
+
108
+ export declare interface CountProgress {
109
+ total: number;
110
+ counted: number;
111
+ verified: number;
112
+ discrepancies: number;
113
+ percent_complete: number;
114
+ }
115
+
116
+ export declare const CountReport: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
117
+
118
+ declare interface CountReport_2 {
119
+ session: {
120
+ id: number;
121
+ name: string;
122
+ status: CountStatus;
123
+ };
124
+ summary: {
125
+ total_entries: number;
126
+ counted: number;
127
+ verified: number;
128
+ pending: number;
129
+ with_discrepancies: number;
130
+ accuracy_percent: number;
131
+ total_expected: number;
132
+ total_counted: number;
133
+ net_discrepancy: number;
134
+ };
135
+ top_discrepancies: Array<{
136
+ location: string;
137
+ product: string;
138
+ expected: number;
139
+ counted: number;
140
+ discrepancy: number;
141
+ }>;
142
+ }
143
+
144
+ export declare interface CountSession {
145
+ id: number;
146
+ name: string;
147
+ scope_location_id: number | null;
148
+ status: CountStatus;
149
+ progress: CountProgress;
150
+ started_at: string | null;
151
+ completed_at: string | null;
152
+ started_by: number | null;
153
+ completed_by: number | null;
154
+ notes: string | null;
155
+ entries_count?: number;
156
+ created_at: string;
157
+ updated_at: string;
158
+ }
159
+
160
+ export declare const CountSessionDetail: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
161
+
162
+ export declare const CountSessionList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
163
+
164
+ export declare type CountStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled';
165
+
166
+ export declare interface CreateLocationData {
167
+ name: string;
168
+ type: LocationType;
169
+ parent_id?: number | null;
170
+ code?: string | null;
171
+ description?: string | null;
172
+ metadata?: Record<string, unknown> | null;
173
+ sort_order?: number;
174
+ }
175
+
176
+ export declare interface DashboardStats {
177
+ total_locations: number;
178
+ locations_by_type: Record<string, number>;
179
+ total_products_tracked: number;
180
+ locations_with_products: number;
181
+ empty_leaf_locations: number;
182
+ }
183
+
184
+ export declare const InventoryDashboard: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
185
+
186
+ declare interface InventoryLocatorOptions {
187
+ apiPrefix?: string;
188
+ }
189
+
190
+ export declare const InventoryLocatorPlugin: {
191
+ install(app: App, options?: InventoryLocatorOptions): void;
192
+ };
193
+
194
+ export declare const InventoryLocatorShell: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
195
+
196
+ export declare const LabelBatchPrint: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
197
+
198
+ export declare interface LabelData {
199
+ location: {
200
+ id: number;
201
+ name: string;
202
+ code: string;
203
+ full_code: string;
204
+ type: LocationType;
205
+ type_label: string;
206
+ };
207
+ path: string;
208
+ path_segments: PathSegment[];
209
+ qr_code_svg: string;
210
+ qr_code_url: string;
211
+ barcode_svg: string;
212
+ barcode_value: string;
213
+ format: LabelFormat;
214
+ size: {
215
+ width: string;
216
+ height: string;
217
+ };
218
+ }
219
+
220
+ export declare type LabelFormat = 'standard' | 'small' | 'pallet';
221
+
222
+ export declare const LabelPreview: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
223
+ print: () => any;
224
+ }, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{
225
+ onPrint?: (() => any) | undefined;
226
+ }>, {
227
+ format: LabelFormat;
228
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
229
+
230
+ declare interface Location_2 {
231
+ id: number;
232
+ parent_id: number | null;
233
+ type: LocationType;
234
+ type_label: string;
235
+ name: string;
236
+ code: string;
237
+ full_code: string;
238
+ description: string | null;
239
+ is_active: boolean;
240
+ is_mobile: boolean;
241
+ sort_order: number;
242
+ barcode: string | null;
243
+ metadata: Record<string, unknown> | null;
244
+ children_count?: number;
245
+ product_count?: number;
246
+ children?: Location_2[];
247
+ products?: LocationProduct[];
248
+ path?: PathSegment[];
249
+ created_at: string;
250
+ updated_at: string;
251
+ }
252
+ export { Location_2 as Location }
253
+
254
+ export declare const LocationBreadcrumb: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
255
+ navigate: (segment: PathSegment) => any;
256
+ }, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{
257
+ onNavigate?: ((segment: PathSegment) => any) | undefined;
258
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLElement>;
259
+
260
+ export declare const LocationCodeBadge: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {
261
+ truncate: boolean;
262
+ maxSegments: number;
263
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
264
+
265
+ export declare const LocationDetail: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
266
+ navigate: (location: Location_2) => any;
267
+ deleted: () => any;
268
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
269
+ onNavigate?: ((location: Location_2) => any) | undefined;
270
+ onDeleted?: (() => any) | undefined;
271
+ }>, {
272
+ locationId: number;
273
+ locationCode: string;
274
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
275
+
276
+ export declare interface LocationProduct {
277
+ id: number;
278
+ location_id: number;
279
+ product_id: number | string;
280
+ product_type: string;
281
+ product_name: string;
282
+ product_sku: string | null;
283
+ quantity: number;
284
+ is_primary: boolean;
285
+ notes: string | null;
286
+ placed_at: string | null;
287
+ placed_by: number | null;
288
+ location?: Location_2;
289
+ }
290
+
291
+ export declare const LocationSearchInput: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
292
+ select: (location: Location_2) => any;
293
+ "update:modelValue": (value: string) => any;
294
+ }, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{
295
+ onSelect?: ((location: Location_2) => any) | undefined;
296
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
297
+ }>, {
298
+ placeholder: string;
299
+ autofocus: boolean;
300
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
301
+ inputRef: HTMLInputElement;
302
+ listboxRef: HTMLUListElement;
303
+ }, HTMLDivElement>;
304
+
305
+ export declare const LocationTree: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
306
+ select: (location: Location_2) => any;
307
+ create: () => any;
308
+ }, string, PublicProps, Readonly<{}> & Readonly<{
309
+ onSelect?: ((location: Location_2) => any) | undefined;
310
+ onCreate?: (() => any) | undefined;
311
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
312
+
313
+ export declare type LocationType = 'site' | 'building' | 'container' | 'zone' | 'aisle' | 'rack' | 'shelf' | 'bin' | 'pallet';
314
+
315
+ export declare const LocationTypeIcon: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {
316
+ size: "sm" | "md" | "lg";
317
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, SVGSVGElement>;
318
+
319
+ export declare interface LocationTypeInfo {
320
+ value: LocationType;
321
+ label: string;
322
+ can_contain_products: boolean;
323
+ is_mobile: boolean;
324
+ }
325
+
326
+ export declare interface Movement {
327
+ id: number;
328
+ from_location: {
329
+ id: number;
330
+ name: string;
331
+ full_code: string;
332
+ } | null;
333
+ to_location: {
334
+ id: number;
335
+ name: string;
336
+ full_code: string;
337
+ } | null;
338
+ product_id: number | string;
339
+ product_type: string;
340
+ product_name: string;
341
+ quantity: number;
342
+ reason: MovementReason;
343
+ reason_label: string;
344
+ notes: string | null;
345
+ performed_by: number | null;
346
+ performer_name: string | null;
347
+ performed_at: string;
348
+ }
349
+
350
+ export declare type MovementReason = 'placed' | 'moved' | 'picked' | 'adjusted' | 'counted' | 'received' | 'returned';
351
+
352
+ export declare interface MoveProductData {
353
+ from_location_id: number;
354
+ to_location_id: number;
355
+ quantity?: number;
356
+ notes?: string;
357
+ }
358
+
359
+ export declare interface PathSegment {
360
+ id: number;
361
+ name: string;
362
+ code: string;
363
+ full_code: string;
364
+ type: LocationType;
365
+ }
366
+
367
+ declare interface PendingCount {
368
+ sessionId: number;
369
+ entryId: number;
370
+ countedQuantity: number;
371
+ notes?: string;
372
+ queuedAt: string;
373
+ }
374
+
375
+ export declare interface PlaceProductData {
376
+ product_id: number | string;
377
+ product_type?: string;
378
+ quantity?: number;
379
+ is_primary?: boolean;
380
+ notes?: string;
381
+ }
382
+
383
+ export declare const ProductLocationList: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
384
+ navigate: (location: Location_2) => any;
385
+ }, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{
386
+ onNavigate?: ((location: Location_2) => any) | undefined;
387
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
388
+
389
+ export declare const ScanHistory: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {
390
+ limit: number;
391
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
392
+
393
+ declare interface ScanHistoryEntry {
394
+ code: string;
395
+ locationName: string;
396
+ locationId: number;
397
+ scannedAt: string;
398
+ }
399
+
400
+ export declare const ScannerOverlay: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
401
+
402
+ export declare const ScanResult: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
403
+ close: () => any;
404
+ navigate: (location: Location_2) => any;
405
+ "scan-again": () => any;
406
+ }, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{
407
+ onClose?: (() => any) | undefined;
408
+ onNavigate?: ((location: Location_2) => any) | undefined;
409
+ "onScan-again"?: (() => any) | undefined;
410
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
411
+ sheetRef: HTMLDivElement;
412
+ }, any>;
413
+
414
+ export declare const UnlocatedProducts: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
415
+ locate: (product: {
416
+ id: number | string;
417
+ name: string;
418
+ }) => any;
419
+ }, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{
420
+ onLocate?: ((product: {
421
+ id: number | string;
422
+ name: string;
423
+ }) => any) | undefined;
424
+ }>, {
425
+ limit: number;
426
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
427
+
428
+ export declare interface UpdateLocationData {
429
+ name?: string;
430
+ code?: string;
431
+ description?: string | null;
432
+ is_active?: boolean;
433
+ metadata?: Record<string, unknown> | null;
434
+ sort_order?: number;
435
+ }
436
+
437
+ export declare function useCountSessions(): {
438
+ sessions: Ref< {
439
+ id: number;
440
+ name: string;
441
+ scope_location_id: number | null;
442
+ status: CountStatus;
443
+ progress: {
444
+ total: number;
445
+ counted: number;
446
+ verified: number;
447
+ discrepancies: number;
448
+ percent_complete: number;
449
+ };
450
+ started_at: string | null;
451
+ completed_at: string | null;
452
+ started_by: number | null;
453
+ completed_by: number | null;
454
+ notes: string | null;
455
+ entries_count?: number | undefined;
456
+ created_at: string;
457
+ updated_at: string;
458
+ }[], CountSession[] | {
459
+ id: number;
460
+ name: string;
461
+ scope_location_id: number | null;
462
+ status: CountStatus;
463
+ progress: {
464
+ total: number;
465
+ counted: number;
466
+ verified: number;
467
+ discrepancies: number;
468
+ percent_complete: number;
469
+ };
470
+ started_at: string | null;
471
+ completed_at: string | null;
472
+ started_by: number | null;
473
+ completed_by: number | null;
474
+ notes: string | null;
475
+ entries_count?: number | undefined;
476
+ created_at: string;
477
+ updated_at: string;
478
+ }[]>;
479
+ currentSession: Ref< {
480
+ id: number;
481
+ name: string;
482
+ scope_location_id: number | null;
483
+ status: CountStatus;
484
+ progress: {
485
+ total: number;
486
+ counted: number;
487
+ verified: number;
488
+ discrepancies: number;
489
+ percent_complete: number;
490
+ };
491
+ started_at: string | null;
492
+ completed_at: string | null;
493
+ started_by: number | null;
494
+ completed_by: number | null;
495
+ notes: string | null;
496
+ entries_count?: number | undefined;
497
+ created_at: string;
498
+ updated_at: string;
499
+ } | null, CountSession | {
500
+ id: number;
501
+ name: string;
502
+ scope_location_id: number | null;
503
+ status: CountStatus;
504
+ progress: {
505
+ total: number;
506
+ counted: number;
507
+ verified: number;
508
+ discrepancies: number;
509
+ percent_complete: number;
510
+ };
511
+ started_at: string | null;
512
+ completed_at: string | null;
513
+ started_by: number | null;
514
+ completed_by: number | null;
515
+ notes: string | null;
516
+ entries_count?: number | undefined;
517
+ created_at: string;
518
+ updated_at: string;
519
+ } | null>;
520
+ entries: Ref< {
521
+ id: number;
522
+ count_session_id: number;
523
+ location_id: number;
524
+ product_id: number | string;
525
+ product_type: string;
526
+ product_name: string;
527
+ expected_quantity: number | null;
528
+ counted_quantity: number | null;
529
+ discrepancy: number | null;
530
+ status: CountEntryStatus;
531
+ counted_by: number | null;
532
+ counted_at: string | null;
533
+ verified_by: number | null;
534
+ verified_at: string | null;
535
+ notes: string | null;
536
+ location?: {
537
+ id: number;
538
+ parent_id: number | null;
539
+ type: LocationType;
540
+ type_label: string;
541
+ name: string;
542
+ code: string;
543
+ full_code: string;
544
+ description: string | null;
545
+ is_active: boolean;
546
+ is_mobile: boolean;
547
+ sort_order: number;
548
+ barcode: string | null;
549
+ metadata: Record<string, unknown> | null;
550
+ children_count?: number | undefined;
551
+ product_count?: number | undefined;
552
+ children?: /*elided*/ any[] | undefined;
553
+ products?: {
554
+ id: number;
555
+ location_id: number;
556
+ product_id: number | string;
557
+ product_type: string;
558
+ product_name: string;
559
+ product_sku: string | null;
560
+ quantity: number;
561
+ is_primary: boolean;
562
+ notes: string | null;
563
+ placed_at: string | null;
564
+ placed_by: number | null;
565
+ location?: /*elided*/ any | undefined;
566
+ }[] | undefined;
567
+ path?: {
568
+ id: number;
569
+ name: string;
570
+ code: string;
571
+ full_code: string;
572
+ type: LocationType;
573
+ }[] | undefined;
574
+ created_at: string;
575
+ updated_at: string;
576
+ } | undefined;
577
+ }[], CountEntry[] | {
578
+ id: number;
579
+ count_session_id: number;
580
+ location_id: number;
581
+ product_id: number | string;
582
+ product_type: string;
583
+ product_name: string;
584
+ expected_quantity: number | null;
585
+ counted_quantity: number | null;
586
+ discrepancy: number | null;
587
+ status: CountEntryStatus;
588
+ counted_by: number | null;
589
+ counted_at: string | null;
590
+ verified_by: number | null;
591
+ verified_at: string | null;
592
+ notes: string | null;
593
+ location?: {
594
+ id: number;
595
+ parent_id: number | null;
596
+ type: LocationType;
597
+ type_label: string;
598
+ name: string;
599
+ code: string;
600
+ full_code: string;
601
+ description: string | null;
602
+ is_active: boolean;
603
+ is_mobile: boolean;
604
+ sort_order: number;
605
+ barcode: string | null;
606
+ metadata: Record<string, unknown> | null;
607
+ children_count?: number | undefined;
608
+ product_count?: number | undefined;
609
+ children?: /*elided*/ any[] | undefined;
610
+ products?: {
611
+ id: number;
612
+ location_id: number;
613
+ product_id: number | string;
614
+ product_type: string;
615
+ product_name: string;
616
+ product_sku: string | null;
617
+ quantity: number;
618
+ is_primary: boolean;
619
+ notes: string | null;
620
+ placed_at: string | null;
621
+ placed_by: number | null;
622
+ location?: /*elided*/ any | undefined;
623
+ }[] | undefined;
624
+ path?: {
625
+ id: number;
626
+ name: string;
627
+ code: string;
628
+ full_code: string;
629
+ type: LocationType;
630
+ }[] | undefined;
631
+ created_at: string;
632
+ updated_at: string;
633
+ } | undefined;
634
+ }[]>;
635
+ report: Ref< {
636
+ session: {
637
+ id: number;
638
+ name: string;
639
+ status: CountStatus;
640
+ };
641
+ summary: {
642
+ total_entries: number;
643
+ counted: number;
644
+ verified: number;
645
+ pending: number;
646
+ with_discrepancies: number;
647
+ accuracy_percent: number;
648
+ total_expected: number;
649
+ total_counted: number;
650
+ net_discrepancy: number;
651
+ };
652
+ top_discrepancies: {
653
+ location: string;
654
+ product: string;
655
+ expected: number;
656
+ counted: number;
657
+ discrepancy: number;
658
+ }[];
659
+ } | null, CountReport_2 | {
660
+ session: {
661
+ id: number;
662
+ name: string;
663
+ status: CountStatus;
664
+ };
665
+ summary: {
666
+ total_entries: number;
667
+ counted: number;
668
+ verified: number;
669
+ pending: number;
670
+ with_discrepancies: number;
671
+ accuracy_percent: number;
672
+ total_expected: number;
673
+ total_counted: number;
674
+ net_discrepancy: number;
675
+ };
676
+ top_discrepancies: {
677
+ location: string;
678
+ product: string;
679
+ expected: number;
680
+ counted: number;
681
+ discrepancy: number;
682
+ }[];
683
+ } | null>;
684
+ loading: Ref<boolean, boolean>;
685
+ error: Ref<string | null, string | null>;
686
+ fetchSessions: (status?: CountStatus) => Promise<void>;
687
+ createSession: (name: string, scopeLocationId?: number) => Promise<CountSession>;
688
+ fetchSession: (id: number) => Promise<CountSession>;
689
+ updateStatus: (id: number, status: "in_progress" | "cancelled") => Promise<void>;
690
+ generateEntries: (id: number) => Promise<{
691
+ entries_created: number;
692
+ }>;
693
+ fetchEntries: (sessionId: number, filters?: {
694
+ status?: string;
695
+ location_id?: number;
696
+ discrepancies_only?: boolean;
697
+ }) => Promise<void>;
698
+ submitCount: (sessionId: number, entryId: number, countedQuantity: number, notes?: string) => Promise<CountEntry>;
699
+ verifyEntry: (sessionId: number, entryId: number) => Promise<CountEntry>;
700
+ applySession: (id: number) => Promise<{
701
+ adjustments_made: number;
702
+ total_discrepancy: number;
703
+ }>;
704
+ fetchReport: (id: number) => Promise<CountReport_2>;
705
+ };
706
+
707
+ export declare const useCountStore: StoreDefinition<"inventoryCount", Pick<{
708
+ activeSessionId: Ref<number | null, number | null>;
709
+ currentLocationId: Ref<number | null, number | null>;
710
+ pendingSubmissions: Ref< {
711
+ sessionId: number;
712
+ entryId: number;
713
+ countedQuantity: number;
714
+ notes?: string | undefined;
715
+ queuedAt: string;
716
+ }[], PendingCount[] | {
717
+ sessionId: number;
718
+ entryId: number;
719
+ countedQuantity: number;
720
+ notes?: string | undefined;
721
+ queuedAt: string;
722
+ }[]>;
723
+ isOnline: Ref<boolean, boolean>;
724
+ hasPendingSubmissions: ComputedRef<boolean>;
725
+ isCountingMode: ComputedRef<boolean>;
726
+ startCounting: (sessionId: number) => void;
727
+ stopCounting: () => void;
728
+ setCurrentLocation: (locationId: number) => void;
729
+ queueCount: (count: Omit<PendingCount, "queuedAt">) => void;
730
+ removeFromQueue: (entryId: number) => void;
731
+ persistQueue: () => void;
732
+ loadQueue: () => void;
733
+ syncPendingCounts: (submitFn: (p: PendingCount) => Promise<void>) => Promise<void>;
734
+ }, "activeSessionId" | "currentLocationId" | "pendingSubmissions" | "isOnline">, Pick<{
735
+ activeSessionId: Ref<number | null, number | null>;
736
+ currentLocationId: Ref<number | null, number | null>;
737
+ pendingSubmissions: Ref< {
738
+ sessionId: number;
739
+ entryId: number;
740
+ countedQuantity: number;
741
+ notes?: string | undefined;
742
+ queuedAt: string;
743
+ }[], PendingCount[] | {
744
+ sessionId: number;
745
+ entryId: number;
746
+ countedQuantity: number;
747
+ notes?: string | undefined;
748
+ queuedAt: string;
749
+ }[]>;
750
+ isOnline: Ref<boolean, boolean>;
751
+ hasPendingSubmissions: ComputedRef<boolean>;
752
+ isCountingMode: ComputedRef<boolean>;
753
+ startCounting: (sessionId: number) => void;
754
+ stopCounting: () => void;
755
+ setCurrentLocation: (locationId: number) => void;
756
+ queueCount: (count: Omit<PendingCount, "queuedAt">) => void;
757
+ removeFromQueue: (entryId: number) => void;
758
+ persistQueue: () => void;
759
+ loadQueue: () => void;
760
+ syncPendingCounts: (submitFn: (p: PendingCount) => Promise<void>) => Promise<void>;
761
+ }, "hasPendingSubmissions" | "isCountingMode">, Pick<{
762
+ activeSessionId: Ref<number | null, number | null>;
763
+ currentLocationId: Ref<number | null, number | null>;
764
+ pendingSubmissions: Ref< {
765
+ sessionId: number;
766
+ entryId: number;
767
+ countedQuantity: number;
768
+ notes?: string | undefined;
769
+ queuedAt: string;
770
+ }[], PendingCount[] | {
771
+ sessionId: number;
772
+ entryId: number;
773
+ countedQuantity: number;
774
+ notes?: string | undefined;
775
+ queuedAt: string;
776
+ }[]>;
777
+ isOnline: Ref<boolean, boolean>;
778
+ hasPendingSubmissions: ComputedRef<boolean>;
779
+ isCountingMode: ComputedRef<boolean>;
780
+ startCounting: (sessionId: number) => void;
781
+ stopCounting: () => void;
782
+ setCurrentLocation: (locationId: number) => void;
783
+ queueCount: (count: Omit<PendingCount, "queuedAt">) => void;
784
+ removeFromQueue: (entryId: number) => void;
785
+ persistQueue: () => void;
786
+ loadQueue: () => void;
787
+ syncPendingCounts: (submitFn: (p: PendingCount) => Promise<void>) => Promise<void>;
788
+ }, "startCounting" | "stopCounting" | "setCurrentLocation" | "queueCount" | "removeFromQueue" | "persistQueue" | "loadQueue" | "syncPendingCounts">>;
789
+
790
+ export declare function useLabelPrinting(): {
791
+ labelData: Ref< {
792
+ location: {
793
+ id: number;
794
+ name: string;
795
+ code: string;
796
+ full_code: string;
797
+ type: LocationType;
798
+ type_label: string;
799
+ };
800
+ path: string;
801
+ path_segments: {
802
+ id: number;
803
+ name: string;
804
+ code: string;
805
+ full_code: string;
806
+ type: LocationType;
807
+ }[];
808
+ qr_code_svg: string;
809
+ qr_code_url: string;
810
+ barcode_svg: string;
811
+ barcode_value: string;
812
+ format: LabelFormat;
813
+ size: {
814
+ width: string;
815
+ height: string;
816
+ };
817
+ } | null, LabelData | {
818
+ location: {
819
+ id: number;
820
+ name: string;
821
+ code: string;
822
+ full_code: string;
823
+ type: LocationType;
824
+ type_label: string;
825
+ };
826
+ path: string;
827
+ path_segments: {
828
+ id: number;
829
+ name: string;
830
+ code: string;
831
+ full_code: string;
832
+ type: LocationType;
833
+ }[];
834
+ qr_code_svg: string;
835
+ qr_code_url: string;
836
+ barcode_svg: string;
837
+ barcode_value: string;
838
+ format: LabelFormat;
839
+ size: {
840
+ width: string;
841
+ height: string;
842
+ };
843
+ } | null>;
844
+ loading: Ref<boolean, boolean>;
845
+ error: Ref<string | null, string | null>;
846
+ fetchLabel: (locationId: number, format?: LabelFormat) => Promise<LabelData>;
847
+ printLabel: (locationId: number, format?: LabelFormat) => Promise<void>;
848
+ printBatch: (locationIds: number[], format?: LabelFormat) => Promise<void>;
849
+ };
850
+
851
+ export declare function useLocationBreadcrumbs(): {
852
+ breadcrumbs: Ref< {
853
+ id: number;
854
+ name: string;
855
+ code: string;
856
+ full_code: string;
857
+ type: LocationType;
858
+ }[], PathSegment[] | {
859
+ id: number;
860
+ name: string;
861
+ code: string;
862
+ full_code: string;
863
+ type: LocationType;
864
+ }[]>;
865
+ setBreadcrumbs: (path: PathSegment[]) => void;
866
+ navigateTo: (segment: PathSegment) => void;
867
+ };
868
+
869
+ export declare function useLocationProducts(): {
870
+ products: Ref< {
871
+ id: number;
872
+ location_id: number;
873
+ product_id: number | string;
874
+ product_type: string;
875
+ product_name: string;
876
+ product_sku: string | null;
877
+ quantity: number;
878
+ is_primary: boolean;
879
+ notes: string | null;
880
+ placed_at: string | null;
881
+ placed_by: number | null;
882
+ location?: {
883
+ id: number;
884
+ parent_id: number | null;
885
+ type: LocationType;
886
+ type_label: string;
887
+ name: string;
888
+ code: string;
889
+ full_code: string;
890
+ description: string | null;
891
+ is_active: boolean;
892
+ is_mobile: boolean;
893
+ sort_order: number;
894
+ barcode: string | null;
895
+ metadata: Record<string, unknown> | null;
896
+ children_count?: number | undefined;
897
+ product_count?: number | undefined;
898
+ children?: /*elided*/ any[] | undefined;
899
+ products?: /*elided*/ any[] | undefined;
900
+ path?: {
901
+ id: number;
902
+ name: string;
903
+ code: string;
904
+ full_code: string;
905
+ type: LocationType;
906
+ }[] | undefined;
907
+ created_at: string;
908
+ updated_at: string;
909
+ } | undefined;
910
+ }[], LocationProduct[] | {
911
+ id: number;
912
+ location_id: number;
913
+ product_id: number | string;
914
+ product_type: string;
915
+ product_name: string;
916
+ product_sku: string | null;
917
+ quantity: number;
918
+ is_primary: boolean;
919
+ notes: string | null;
920
+ placed_at: string | null;
921
+ placed_by: number | null;
922
+ location?: {
923
+ id: number;
924
+ parent_id: number | null;
925
+ type: LocationType;
926
+ type_label: string;
927
+ name: string;
928
+ code: string;
929
+ full_code: string;
930
+ description: string | null;
931
+ is_active: boolean;
932
+ is_mobile: boolean;
933
+ sort_order: number;
934
+ barcode: string | null;
935
+ metadata: Record<string, unknown> | null;
936
+ children_count?: number | undefined;
937
+ product_count?: number | undefined;
938
+ children?: /*elided*/ any[] | undefined;
939
+ products?: /*elided*/ any[] | undefined;
940
+ path?: {
941
+ id: number;
942
+ name: string;
943
+ code: string;
944
+ full_code: string;
945
+ type: LocationType;
946
+ }[] | undefined;
947
+ created_at: string;
948
+ updated_at: string;
949
+ } | undefined;
950
+ }[]>;
951
+ loading: Ref<boolean, boolean>;
952
+ error: Ref<string | null, string | null>;
953
+ fetchProducts: (locationId: number) => Promise<void>;
954
+ addProduct: (locationId: number, data: PlaceProductData) => Promise<LocationProduct>;
955
+ updateProduct: (locationId: number, productId: number | string, data: {
956
+ quantity?: number;
957
+ is_primary?: boolean;
958
+ notes?: string;
959
+ }) => Promise<LocationProduct>;
960
+ removeProduct: (locationId: number, productId: number | string, quantity?: number) => Promise<void>;
961
+ moveProduct: (productId: number | string, data: MoveProductData) => Promise<void>;
962
+ bulkAdd: (locationId: number, items: PlaceProductData[]) => Promise<void>;
963
+ fetchProductLocations: (productId: number | string) => Promise<LocationProduct[]>;
964
+ };
965
+
966
+ export declare function useLocations(): {
967
+ locations: Ref< {
968
+ id: number;
969
+ parent_id: number | null;
970
+ type: LocationType;
971
+ type_label: string;
972
+ name: string;
973
+ code: string;
974
+ full_code: string;
975
+ description: string | null;
976
+ is_active: boolean;
977
+ is_mobile: boolean;
978
+ sort_order: number;
979
+ barcode: string | null;
980
+ metadata: Record<string, unknown> | null;
981
+ children_count?: number | undefined;
982
+ product_count?: number | undefined;
983
+ children?: /*elided*/ any[] | undefined;
984
+ products?: {
985
+ id: number;
986
+ location_id: number;
987
+ product_id: number | string;
988
+ product_type: string;
989
+ product_name: string;
990
+ product_sku: string | null;
991
+ quantity: number;
992
+ is_primary: boolean;
993
+ notes: string | null;
994
+ placed_at: string | null;
995
+ placed_by: number | null;
996
+ location?: /*elided*/ any | undefined;
997
+ }[] | undefined;
998
+ path?: {
999
+ id: number;
1000
+ name: string;
1001
+ code: string;
1002
+ full_code: string;
1003
+ type: LocationType;
1004
+ }[] | undefined;
1005
+ created_at: string;
1006
+ updated_at: string;
1007
+ }[], Location_2[] | {
1008
+ id: number;
1009
+ parent_id: number | null;
1010
+ type: LocationType;
1011
+ type_label: string;
1012
+ name: string;
1013
+ code: string;
1014
+ full_code: string;
1015
+ description: string | null;
1016
+ is_active: boolean;
1017
+ is_mobile: boolean;
1018
+ sort_order: number;
1019
+ barcode: string | null;
1020
+ metadata: Record<string, unknown> | null;
1021
+ children_count?: number | undefined;
1022
+ product_count?: number | undefined;
1023
+ children?: /*elided*/ any[] | undefined;
1024
+ products?: {
1025
+ id: number;
1026
+ location_id: number;
1027
+ product_id: number | string;
1028
+ product_type: string;
1029
+ product_name: string;
1030
+ product_sku: string | null;
1031
+ quantity: number;
1032
+ is_primary: boolean;
1033
+ notes: string | null;
1034
+ placed_at: string | null;
1035
+ placed_by: number | null;
1036
+ location?: /*elided*/ any | undefined;
1037
+ }[] | undefined;
1038
+ path?: {
1039
+ id: number;
1040
+ name: string;
1041
+ code: string;
1042
+ full_code: string;
1043
+ type: LocationType;
1044
+ }[] | undefined;
1045
+ created_at: string;
1046
+ updated_at: string;
1047
+ }[]>;
1048
+ loading: Ref<boolean, boolean>;
1049
+ error: Ref<string | null, string | null>;
1050
+ fetchRoots: () => Promise<Location_2[]>;
1051
+ fetchLocation: (id: number) => Promise<Location_2>;
1052
+ fetchChildren: (locationId: number) => Promise<Location_2[]>;
1053
+ fetchTree: (locationId: number) => Promise<any>;
1054
+ create: (data: CreateLocationData) => Promise<Location_2>;
1055
+ update: (id: number, data: UpdateLocationData) => Promise<Location_2>;
1056
+ remove: (id: number) => Promise<void>;
1057
+ move: (id: number, parentId: number | null) => Promise<Location_2>;
1058
+ fetchTypes: () => Promise<LocationTypeInfo[]>;
1059
+ scanLookup: (code: string) => Promise<Location_2 | null>;
1060
+ };
1061
+
1062
+ export declare function useLocationSearch(): {
1063
+ results: Ref< {
1064
+ id: number;
1065
+ parent_id: number | null;
1066
+ type: LocationType;
1067
+ type_label: string;
1068
+ name: string;
1069
+ code: string;
1070
+ full_code: string;
1071
+ description: string | null;
1072
+ is_active: boolean;
1073
+ is_mobile: boolean;
1074
+ sort_order: number;
1075
+ barcode: string | null;
1076
+ metadata: Record<string, unknown> | null;
1077
+ children_count?: number | undefined;
1078
+ product_count?: number | undefined;
1079
+ children?: /*elided*/ any[] | undefined;
1080
+ products?: {
1081
+ id: number;
1082
+ location_id: number;
1083
+ product_id: number | string;
1084
+ product_type: string;
1085
+ product_name: string;
1086
+ product_sku: string | null;
1087
+ quantity: number;
1088
+ is_primary: boolean;
1089
+ notes: string | null;
1090
+ placed_at: string | null;
1091
+ placed_by: number | null;
1092
+ location?: /*elided*/ any | undefined;
1093
+ }[] | undefined;
1094
+ path?: {
1095
+ id: number;
1096
+ name: string;
1097
+ code: string;
1098
+ full_code: string;
1099
+ type: LocationType;
1100
+ }[] | undefined;
1101
+ created_at: string;
1102
+ updated_at: string;
1103
+ }[], Location_2[] | {
1104
+ id: number;
1105
+ parent_id: number | null;
1106
+ type: LocationType;
1107
+ type_label: string;
1108
+ name: string;
1109
+ code: string;
1110
+ full_code: string;
1111
+ description: string | null;
1112
+ is_active: boolean;
1113
+ is_mobile: boolean;
1114
+ sort_order: number;
1115
+ barcode: string | null;
1116
+ metadata: Record<string, unknown> | null;
1117
+ children_count?: number | undefined;
1118
+ product_count?: number | undefined;
1119
+ children?: /*elided*/ any[] | undefined;
1120
+ products?: {
1121
+ id: number;
1122
+ location_id: number;
1123
+ product_id: number | string;
1124
+ product_type: string;
1125
+ product_name: string;
1126
+ product_sku: string | null;
1127
+ quantity: number;
1128
+ is_primary: boolean;
1129
+ notes: string | null;
1130
+ placed_at: string | null;
1131
+ placed_by: number | null;
1132
+ location?: /*elided*/ any | undefined;
1133
+ }[] | undefined;
1134
+ path?: {
1135
+ id: number;
1136
+ name: string;
1137
+ code: string;
1138
+ full_code: string;
1139
+ type: LocationType;
1140
+ }[] | undefined;
1141
+ created_at: string;
1142
+ updated_at: string;
1143
+ }[]>;
1144
+ query: Ref<string, string>;
1145
+ loading: Ref<boolean, boolean>;
1146
+ error: Ref<string | null, string | null>;
1147
+ search: (q: string, filters?: {
1148
+ type?: LocationType;
1149
+ }) => void;
1150
+ clear: () => void;
1151
+ };
1152
+
1153
+ export declare const useLocationStore: StoreDefinition<"inventoryLocation", Pick<{
1154
+ roots: Ref< {
1155
+ id: number;
1156
+ parent_id: number | null;
1157
+ type: LocationType;
1158
+ type_label: string;
1159
+ name: string;
1160
+ code: string;
1161
+ full_code: string;
1162
+ description: string | null;
1163
+ is_active: boolean;
1164
+ is_mobile: boolean;
1165
+ sort_order: number;
1166
+ barcode: string | null;
1167
+ metadata: Record<string, unknown> | null;
1168
+ children_count?: number | undefined;
1169
+ product_count?: number | undefined;
1170
+ children?: /*elided*/ any[] | undefined;
1171
+ products?: {
1172
+ id: number;
1173
+ location_id: number;
1174
+ product_id: number | string;
1175
+ product_type: string;
1176
+ product_name: string;
1177
+ product_sku: string | null;
1178
+ quantity: number;
1179
+ is_primary: boolean;
1180
+ notes: string | null;
1181
+ placed_at: string | null;
1182
+ placed_by: number | null;
1183
+ location?: /*elided*/ any | undefined;
1184
+ }[] | undefined;
1185
+ path?: {
1186
+ id: number;
1187
+ name: string;
1188
+ code: string;
1189
+ full_code: string;
1190
+ type: LocationType;
1191
+ }[] | undefined;
1192
+ created_at: string;
1193
+ updated_at: string;
1194
+ }[], Location_2[] | {
1195
+ id: number;
1196
+ parent_id: number | null;
1197
+ type: LocationType;
1198
+ type_label: string;
1199
+ name: string;
1200
+ code: string;
1201
+ full_code: string;
1202
+ description: string | null;
1203
+ is_active: boolean;
1204
+ is_mobile: boolean;
1205
+ sort_order: number;
1206
+ barcode: string | null;
1207
+ metadata: Record<string, unknown> | null;
1208
+ children_count?: number | undefined;
1209
+ product_count?: number | undefined;
1210
+ children?: /*elided*/ any[] | undefined;
1211
+ products?: {
1212
+ id: number;
1213
+ location_id: number;
1214
+ product_id: number | string;
1215
+ product_type: string;
1216
+ product_name: string;
1217
+ product_sku: string | null;
1218
+ quantity: number;
1219
+ is_primary: boolean;
1220
+ notes: string | null;
1221
+ placed_at: string | null;
1222
+ placed_by: number | null;
1223
+ location?: /*elided*/ any | undefined;
1224
+ }[] | undefined;
1225
+ path?: {
1226
+ id: number;
1227
+ name: string;
1228
+ code: string;
1229
+ full_code: string;
1230
+ type: LocationType;
1231
+ }[] | undefined;
1232
+ created_at: string;
1233
+ updated_at: string;
1234
+ }[]>;
1235
+ selectedLocationId: Ref<number | null, number | null>;
1236
+ expandedNodeIds: Ref<Set<number> & Omit<Set<number>, keyof Set<any>>, Set<number> | (Set<number> & Omit<Set<number>, keyof Set<any>>)>;
1237
+ childrenCache: Ref<Map<number, {
1238
+ id: number;
1239
+ parent_id: number | null;
1240
+ type: LocationType;
1241
+ type_label: string;
1242
+ name: string;
1243
+ code: string;
1244
+ full_code: string;
1245
+ description: string | null;
1246
+ is_active: boolean;
1247
+ is_mobile: boolean;
1248
+ sort_order: number;
1249
+ barcode: string | null;
1250
+ metadata: Record<string, unknown> | null;
1251
+ children_count?: number | undefined;
1252
+ product_count?: number | undefined;
1253
+ children?: /*elided*/ any[] | undefined;
1254
+ products?: {
1255
+ id: number;
1256
+ location_id: number;
1257
+ product_id: number | string;
1258
+ product_type: string;
1259
+ product_name: string;
1260
+ product_sku: string | null;
1261
+ quantity: number;
1262
+ is_primary: boolean;
1263
+ notes: string | null;
1264
+ placed_at: string | null;
1265
+ placed_by: number | null;
1266
+ location?: /*elided*/ any | undefined;
1267
+ }[] | undefined;
1268
+ path?: {
1269
+ id: number;
1270
+ name: string;
1271
+ code: string;
1272
+ full_code: string;
1273
+ type: LocationType;
1274
+ }[] | undefined;
1275
+ created_at: string;
1276
+ updated_at: string;
1277
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>, Map<number, Location_2[]> | (Map<number, {
1278
+ id: number;
1279
+ parent_id: number | null;
1280
+ type: LocationType;
1281
+ type_label: string;
1282
+ name: string;
1283
+ code: string;
1284
+ full_code: string;
1285
+ description: string | null;
1286
+ is_active: boolean;
1287
+ is_mobile: boolean;
1288
+ sort_order: number;
1289
+ barcode: string | null;
1290
+ metadata: Record<string, unknown> | null;
1291
+ children_count?: number | undefined;
1292
+ product_count?: number | undefined;
1293
+ children?: /*elided*/ any[] | undefined;
1294
+ products?: {
1295
+ id: number;
1296
+ location_id: number;
1297
+ product_id: number | string;
1298
+ product_type: string;
1299
+ product_name: string;
1300
+ product_sku: string | null;
1301
+ quantity: number;
1302
+ is_primary: boolean;
1303
+ notes: string | null;
1304
+ placed_at: string | null;
1305
+ placed_by: number | null;
1306
+ location?: /*elided*/ any | undefined;
1307
+ }[] | undefined;
1308
+ path?: {
1309
+ id: number;
1310
+ name: string;
1311
+ code: string;
1312
+ full_code: string;
1313
+ type: LocationType;
1314
+ }[] | undefined;
1315
+ created_at: string;
1316
+ updated_at: string;
1317
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>)>;
1318
+ loading: Ref<boolean, boolean>;
1319
+ selectedLocation: ComputedRef<Location_2 | null>;
1320
+ isExpanded: ComputedRef<(id: number) => boolean>;
1321
+ setRoots: (locations: Location_2[]) => void;
1322
+ selectLocation: (id: number | null) => void;
1323
+ toggleExpand: (id: number) => void;
1324
+ cacheChildren: (parentId: number, children: Location_2[]) => void;
1325
+ updateLocationInTree: (updated: Location_2) => void;
1326
+ removeLocationFromTree: (id: number) => void;
1327
+ findInTree: (id: number) => Location_2 | null;
1328
+ reset: () => void;
1329
+ }, "roots" | "selectedLocationId" | "expandedNodeIds" | "childrenCache" | "loading">, Pick<{
1330
+ roots: Ref< {
1331
+ id: number;
1332
+ parent_id: number | null;
1333
+ type: LocationType;
1334
+ type_label: string;
1335
+ name: string;
1336
+ code: string;
1337
+ full_code: string;
1338
+ description: string | null;
1339
+ is_active: boolean;
1340
+ is_mobile: boolean;
1341
+ sort_order: number;
1342
+ barcode: string | null;
1343
+ metadata: Record<string, unknown> | null;
1344
+ children_count?: number | undefined;
1345
+ product_count?: number | undefined;
1346
+ children?: /*elided*/ any[] | undefined;
1347
+ products?: {
1348
+ id: number;
1349
+ location_id: number;
1350
+ product_id: number | string;
1351
+ product_type: string;
1352
+ product_name: string;
1353
+ product_sku: string | null;
1354
+ quantity: number;
1355
+ is_primary: boolean;
1356
+ notes: string | null;
1357
+ placed_at: string | null;
1358
+ placed_by: number | null;
1359
+ location?: /*elided*/ any | undefined;
1360
+ }[] | undefined;
1361
+ path?: {
1362
+ id: number;
1363
+ name: string;
1364
+ code: string;
1365
+ full_code: string;
1366
+ type: LocationType;
1367
+ }[] | undefined;
1368
+ created_at: string;
1369
+ updated_at: string;
1370
+ }[], Location_2[] | {
1371
+ id: number;
1372
+ parent_id: number | null;
1373
+ type: LocationType;
1374
+ type_label: string;
1375
+ name: string;
1376
+ code: string;
1377
+ full_code: string;
1378
+ description: string | null;
1379
+ is_active: boolean;
1380
+ is_mobile: boolean;
1381
+ sort_order: number;
1382
+ barcode: string | null;
1383
+ metadata: Record<string, unknown> | null;
1384
+ children_count?: number | undefined;
1385
+ product_count?: number | undefined;
1386
+ children?: /*elided*/ any[] | undefined;
1387
+ products?: {
1388
+ id: number;
1389
+ location_id: number;
1390
+ product_id: number | string;
1391
+ product_type: string;
1392
+ product_name: string;
1393
+ product_sku: string | null;
1394
+ quantity: number;
1395
+ is_primary: boolean;
1396
+ notes: string | null;
1397
+ placed_at: string | null;
1398
+ placed_by: number | null;
1399
+ location?: /*elided*/ any | undefined;
1400
+ }[] | undefined;
1401
+ path?: {
1402
+ id: number;
1403
+ name: string;
1404
+ code: string;
1405
+ full_code: string;
1406
+ type: LocationType;
1407
+ }[] | undefined;
1408
+ created_at: string;
1409
+ updated_at: string;
1410
+ }[]>;
1411
+ selectedLocationId: Ref<number | null, number | null>;
1412
+ expandedNodeIds: Ref<Set<number> & Omit<Set<number>, keyof Set<any>>, Set<number> | (Set<number> & Omit<Set<number>, keyof Set<any>>)>;
1413
+ childrenCache: Ref<Map<number, {
1414
+ id: number;
1415
+ parent_id: number | null;
1416
+ type: LocationType;
1417
+ type_label: string;
1418
+ name: string;
1419
+ code: string;
1420
+ full_code: string;
1421
+ description: string | null;
1422
+ is_active: boolean;
1423
+ is_mobile: boolean;
1424
+ sort_order: number;
1425
+ barcode: string | null;
1426
+ metadata: Record<string, unknown> | null;
1427
+ children_count?: number | undefined;
1428
+ product_count?: number | undefined;
1429
+ children?: /*elided*/ any[] | undefined;
1430
+ products?: {
1431
+ id: number;
1432
+ location_id: number;
1433
+ product_id: number | string;
1434
+ product_type: string;
1435
+ product_name: string;
1436
+ product_sku: string | null;
1437
+ quantity: number;
1438
+ is_primary: boolean;
1439
+ notes: string | null;
1440
+ placed_at: string | null;
1441
+ placed_by: number | null;
1442
+ location?: /*elided*/ any | undefined;
1443
+ }[] | undefined;
1444
+ path?: {
1445
+ id: number;
1446
+ name: string;
1447
+ code: string;
1448
+ full_code: string;
1449
+ type: LocationType;
1450
+ }[] | undefined;
1451
+ created_at: string;
1452
+ updated_at: string;
1453
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>, Map<number, Location_2[]> | (Map<number, {
1454
+ id: number;
1455
+ parent_id: number | null;
1456
+ type: LocationType;
1457
+ type_label: string;
1458
+ name: string;
1459
+ code: string;
1460
+ full_code: string;
1461
+ description: string | null;
1462
+ is_active: boolean;
1463
+ is_mobile: boolean;
1464
+ sort_order: number;
1465
+ barcode: string | null;
1466
+ metadata: Record<string, unknown> | null;
1467
+ children_count?: number | undefined;
1468
+ product_count?: number | undefined;
1469
+ children?: /*elided*/ any[] | undefined;
1470
+ products?: {
1471
+ id: number;
1472
+ location_id: number;
1473
+ product_id: number | string;
1474
+ product_type: string;
1475
+ product_name: string;
1476
+ product_sku: string | null;
1477
+ quantity: number;
1478
+ is_primary: boolean;
1479
+ notes: string | null;
1480
+ placed_at: string | null;
1481
+ placed_by: number | null;
1482
+ location?: /*elided*/ any | undefined;
1483
+ }[] | undefined;
1484
+ path?: {
1485
+ id: number;
1486
+ name: string;
1487
+ code: string;
1488
+ full_code: string;
1489
+ type: LocationType;
1490
+ }[] | undefined;
1491
+ created_at: string;
1492
+ updated_at: string;
1493
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>)>;
1494
+ loading: Ref<boolean, boolean>;
1495
+ selectedLocation: ComputedRef<Location_2 | null>;
1496
+ isExpanded: ComputedRef<(id: number) => boolean>;
1497
+ setRoots: (locations: Location_2[]) => void;
1498
+ selectLocation: (id: number | null) => void;
1499
+ toggleExpand: (id: number) => void;
1500
+ cacheChildren: (parentId: number, children: Location_2[]) => void;
1501
+ updateLocationInTree: (updated: Location_2) => void;
1502
+ removeLocationFromTree: (id: number) => void;
1503
+ findInTree: (id: number) => Location_2 | null;
1504
+ reset: () => void;
1505
+ }, "selectedLocation" | "isExpanded">, Pick<{
1506
+ roots: Ref< {
1507
+ id: number;
1508
+ parent_id: number | null;
1509
+ type: LocationType;
1510
+ type_label: string;
1511
+ name: string;
1512
+ code: string;
1513
+ full_code: string;
1514
+ description: string | null;
1515
+ is_active: boolean;
1516
+ is_mobile: boolean;
1517
+ sort_order: number;
1518
+ barcode: string | null;
1519
+ metadata: Record<string, unknown> | null;
1520
+ children_count?: number | undefined;
1521
+ product_count?: number | undefined;
1522
+ children?: /*elided*/ any[] | undefined;
1523
+ products?: {
1524
+ id: number;
1525
+ location_id: number;
1526
+ product_id: number | string;
1527
+ product_type: string;
1528
+ product_name: string;
1529
+ product_sku: string | null;
1530
+ quantity: number;
1531
+ is_primary: boolean;
1532
+ notes: string | null;
1533
+ placed_at: string | null;
1534
+ placed_by: number | null;
1535
+ location?: /*elided*/ any | undefined;
1536
+ }[] | undefined;
1537
+ path?: {
1538
+ id: number;
1539
+ name: string;
1540
+ code: string;
1541
+ full_code: string;
1542
+ type: LocationType;
1543
+ }[] | undefined;
1544
+ created_at: string;
1545
+ updated_at: string;
1546
+ }[], Location_2[] | {
1547
+ id: number;
1548
+ parent_id: number | null;
1549
+ type: LocationType;
1550
+ type_label: string;
1551
+ name: string;
1552
+ code: string;
1553
+ full_code: string;
1554
+ description: string | null;
1555
+ is_active: boolean;
1556
+ is_mobile: boolean;
1557
+ sort_order: number;
1558
+ barcode: string | null;
1559
+ metadata: Record<string, unknown> | null;
1560
+ children_count?: number | undefined;
1561
+ product_count?: number | undefined;
1562
+ children?: /*elided*/ any[] | undefined;
1563
+ products?: {
1564
+ id: number;
1565
+ location_id: number;
1566
+ product_id: number | string;
1567
+ product_type: string;
1568
+ product_name: string;
1569
+ product_sku: string | null;
1570
+ quantity: number;
1571
+ is_primary: boolean;
1572
+ notes: string | null;
1573
+ placed_at: string | null;
1574
+ placed_by: number | null;
1575
+ location?: /*elided*/ any | undefined;
1576
+ }[] | undefined;
1577
+ path?: {
1578
+ id: number;
1579
+ name: string;
1580
+ code: string;
1581
+ full_code: string;
1582
+ type: LocationType;
1583
+ }[] | undefined;
1584
+ created_at: string;
1585
+ updated_at: string;
1586
+ }[]>;
1587
+ selectedLocationId: Ref<number | null, number | null>;
1588
+ expandedNodeIds: Ref<Set<number> & Omit<Set<number>, keyof Set<any>>, Set<number> | (Set<number> & Omit<Set<number>, keyof Set<any>>)>;
1589
+ childrenCache: Ref<Map<number, {
1590
+ id: number;
1591
+ parent_id: number | null;
1592
+ type: LocationType;
1593
+ type_label: string;
1594
+ name: string;
1595
+ code: string;
1596
+ full_code: string;
1597
+ description: string | null;
1598
+ is_active: boolean;
1599
+ is_mobile: boolean;
1600
+ sort_order: number;
1601
+ barcode: string | null;
1602
+ metadata: Record<string, unknown> | null;
1603
+ children_count?: number | undefined;
1604
+ product_count?: number | undefined;
1605
+ children?: /*elided*/ any[] | undefined;
1606
+ products?: {
1607
+ id: number;
1608
+ location_id: number;
1609
+ product_id: number | string;
1610
+ product_type: string;
1611
+ product_name: string;
1612
+ product_sku: string | null;
1613
+ quantity: number;
1614
+ is_primary: boolean;
1615
+ notes: string | null;
1616
+ placed_at: string | null;
1617
+ placed_by: number | null;
1618
+ location?: /*elided*/ any | undefined;
1619
+ }[] | undefined;
1620
+ path?: {
1621
+ id: number;
1622
+ name: string;
1623
+ code: string;
1624
+ full_code: string;
1625
+ type: LocationType;
1626
+ }[] | undefined;
1627
+ created_at: string;
1628
+ updated_at: string;
1629
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>, Map<number, Location_2[]> | (Map<number, {
1630
+ id: number;
1631
+ parent_id: number | null;
1632
+ type: LocationType;
1633
+ type_label: string;
1634
+ name: string;
1635
+ code: string;
1636
+ full_code: string;
1637
+ description: string | null;
1638
+ is_active: boolean;
1639
+ is_mobile: boolean;
1640
+ sort_order: number;
1641
+ barcode: string | null;
1642
+ metadata: Record<string, unknown> | null;
1643
+ children_count?: number | undefined;
1644
+ product_count?: number | undefined;
1645
+ children?: /*elided*/ any[] | undefined;
1646
+ products?: {
1647
+ id: number;
1648
+ location_id: number;
1649
+ product_id: number | string;
1650
+ product_type: string;
1651
+ product_name: string;
1652
+ product_sku: string | null;
1653
+ quantity: number;
1654
+ is_primary: boolean;
1655
+ notes: string | null;
1656
+ placed_at: string | null;
1657
+ placed_by: number | null;
1658
+ location?: /*elided*/ any | undefined;
1659
+ }[] | undefined;
1660
+ path?: {
1661
+ id: number;
1662
+ name: string;
1663
+ code: string;
1664
+ full_code: string;
1665
+ type: LocationType;
1666
+ }[] | undefined;
1667
+ created_at: string;
1668
+ updated_at: string;
1669
+ }[]> & Omit<Map<number, Location_2[]>, keyof Map<any, any>>)>;
1670
+ loading: Ref<boolean, boolean>;
1671
+ selectedLocation: ComputedRef<Location_2 | null>;
1672
+ isExpanded: ComputedRef<(id: number) => boolean>;
1673
+ setRoots: (locations: Location_2[]) => void;
1674
+ selectLocation: (id: number | null) => void;
1675
+ toggleExpand: (id: number) => void;
1676
+ cacheChildren: (parentId: number, children: Location_2[]) => void;
1677
+ updateLocationInTree: (updated: Location_2) => void;
1678
+ removeLocationFromTree: (id: number) => void;
1679
+ findInTree: (id: number) => Location_2 | null;
1680
+ reset: () => void;
1681
+ }, "setRoots" | "selectLocation" | "toggleExpand" | "cacheChildren" | "updateLocationInTree" | "removeLocationFromTree" | "findInTree" | "reset">>;
1682
+
1683
+ export declare function useMovements(): {
1684
+ movements: Ref< {
1685
+ id: number;
1686
+ from_location: {
1687
+ id: number;
1688
+ name: string;
1689
+ full_code: string;
1690
+ } | null;
1691
+ to_location: {
1692
+ id: number;
1693
+ name: string;
1694
+ full_code: string;
1695
+ } | null;
1696
+ product_id: number | string;
1697
+ product_type: string;
1698
+ product_name: string;
1699
+ quantity: number;
1700
+ reason: MovementReason;
1701
+ reason_label: string;
1702
+ notes: string | null;
1703
+ performed_by: number | null;
1704
+ performer_name: string | null;
1705
+ performed_at: string;
1706
+ }[], Movement[] | {
1707
+ id: number;
1708
+ from_location: {
1709
+ id: number;
1710
+ name: string;
1711
+ full_code: string;
1712
+ } | null;
1713
+ to_location: {
1714
+ id: number;
1715
+ name: string;
1716
+ full_code: string;
1717
+ } | null;
1718
+ product_id: number | string;
1719
+ product_type: string;
1720
+ product_name: string;
1721
+ quantity: number;
1722
+ reason: MovementReason;
1723
+ reason_label: string;
1724
+ notes: string | null;
1725
+ performed_by: number | null;
1726
+ performer_name: string | null;
1727
+ performed_at: string;
1728
+ }[]>;
1729
+ loading: Ref<boolean, boolean>;
1730
+ error: Ref<string | null, string | null>;
1731
+ fetchAll: (filters?: {
1732
+ reason?: string;
1733
+ from_date?: string;
1734
+ to_date?: string;
1735
+ }) => Promise<void>;
1736
+ fetchByLocation: (locationId: number) => Promise<void>;
1737
+ fetchByProduct: (productId: number | string) => Promise<void>;
1738
+ fetchRecent: () => Promise<void>;
1739
+ };
1740
+
1741
+ export declare function useScanner(): {
1742
+ isScanning: Ref<boolean, boolean>;
1743
+ lastResult: Ref<string | null, string | null>;
1744
+ error: Ref<string | null, string | null>;
1745
+ isSupported: Ref<boolean, boolean>;
1746
+ hasFlash: Ref<boolean, boolean>;
1747
+ flashOn: Ref<boolean, boolean>;
1748
+ startScanning: (elementId: string, onResult: (code: string) => void) => Promise<void>;
1749
+ stopScanning: () => Promise<void>;
1750
+ toggleFlash: () => Promise<void>;
1751
+ };
1752
+
1753
+ export declare const useScannerStore: StoreDefinition<"inventoryScanner", Pick<{
1754
+ history: Ref< {
1755
+ code: string;
1756
+ locationName: string;
1757
+ locationId: number;
1758
+ scannedAt: string;
1759
+ }[], ScanHistoryEntry[] | {
1760
+ code: string;
1761
+ locationName: string;
1762
+ locationId: number;
1763
+ scannedAt: string;
1764
+ }[]>;
1765
+ lastScannedCode: Ref<string | null, string | null>;
1766
+ addToHistory: (entry: Omit<ScanHistoryEntry, "scannedAt">) => void;
1767
+ loadFromSession: () => void;
1768
+ clearHistory: () => void;
1769
+ }, "history" | "lastScannedCode">, Pick<{
1770
+ history: Ref< {
1771
+ code: string;
1772
+ locationName: string;
1773
+ locationId: number;
1774
+ scannedAt: string;
1775
+ }[], ScanHistoryEntry[] | {
1776
+ code: string;
1777
+ locationName: string;
1778
+ locationId: number;
1779
+ scannedAt: string;
1780
+ }[]>;
1781
+ lastScannedCode: Ref<string | null, string | null>;
1782
+ addToHistory: (entry: Omit<ScanHistoryEntry, "scannedAt">) => void;
1783
+ loadFromSession: () => void;
1784
+ clearHistory: () => void;
1785
+ }, never>, Pick<{
1786
+ history: Ref< {
1787
+ code: string;
1788
+ locationName: string;
1789
+ locationId: number;
1790
+ scannedAt: string;
1791
+ }[], ScanHistoryEntry[] | {
1792
+ code: string;
1793
+ locationName: string;
1794
+ locationId: number;
1795
+ scannedAt: string;
1796
+ }[]>;
1797
+ lastScannedCode: Ref<string | null, string | null>;
1798
+ addToHistory: (entry: Omit<ScanHistoryEntry, "scannedAt">) => void;
1799
+ loadFromSession: () => void;
1800
+ clearHistory: () => void;
1801
+ }, "addToHistory" | "loadFromSession" | "clearHistory">>;
1802
+
1803
+ export { }