shopoflex-types 1.0.237 → 1.0.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interBranchRequest.d.ts +50 -0
- package/dist/interBranchRequest.js +26 -0
- package/dist/productCart.d.ts +12 -0
- package/package.json +1 -1
package/dist/common.d.ts
CHANGED
|
@@ -482,6 +482,8 @@ export interface Vendor {
|
|
|
482
482
|
terminalId: string;
|
|
483
483
|
branchIds: string[];
|
|
484
484
|
}[];
|
|
485
|
+
/** POS-to-POS inter-branch item request settings (opt-in, off by default). */
|
|
486
|
+
posStockTransfer?: import('./interBranchRequest').PosStockTransferSettings;
|
|
485
487
|
getTaxConfig(country?: string): TaxSettings;
|
|
486
488
|
calculateTax(subtotal: number, country?: string): {
|
|
487
489
|
taxAmount: number;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type InterBranchRequestStatus = 'requested' | 'acknowledged' | 'sent' | 'received' | 'rejected' | 'cancelled';
|
|
2
|
+
export type InterBranchRequestMode = 'transfer' | 'info';
|
|
3
|
+
export interface InterBranchRequestItem {
|
|
4
|
+
productId: string;
|
|
5
|
+
variantId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
variantName?: string;
|
|
8
|
+
isStockTracked: boolean;
|
|
9
|
+
unitCost: number;
|
|
10
|
+
requestedQty: number;
|
|
11
|
+
sentQty?: number;
|
|
12
|
+
receivedQty?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PosStockTransferSettings {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
allowedModes: 'info' | 'transfer' | 'both';
|
|
17
|
+
senderBranchIds?: string[];
|
|
18
|
+
}
|
|
19
|
+
/** Branch ids a POS may request FROM, given the setting. A strict whitelist:
|
|
20
|
+
* EMPTY = no branch is selectable (the vendor must explicitly configure sources).
|
|
21
|
+
* Used by the POS to build the target dropdown and by the server to validate the
|
|
22
|
+
* request's toBranchId. */
|
|
23
|
+
export declare function allowedSenderBranchIds(settings: PosStockTransferSettings | null | undefined): string[];
|
|
24
|
+
/** The request modes a POS may create given the vendor setting. Empty = feature
|
|
25
|
+
* disabled → no requests at all. Used by both the POS (to gate the UI) and the
|
|
26
|
+
* server (to validate the create payload). */
|
|
27
|
+
export declare function allowedRequestModes(settings: PosStockTransferSettings | null | undefined): InterBranchRequestMode[];
|
|
28
|
+
export interface InterBranchRequest {
|
|
29
|
+
_id?: string;
|
|
30
|
+
vendorId: string;
|
|
31
|
+
fromBranchId: string;
|
|
32
|
+
toBranchId: string;
|
|
33
|
+
requestNumber?: string;
|
|
34
|
+
mode: InterBranchRequestMode;
|
|
35
|
+
items: InterBranchRequestItem[];
|
|
36
|
+
totalValue?: number;
|
|
37
|
+
status: InterBranchRequestStatus;
|
|
38
|
+
note?: string;
|
|
39
|
+
createdByTerminalId?: string;
|
|
40
|
+
createdByName?: string;
|
|
41
|
+
acknowledgedAt?: string;
|
|
42
|
+
acknowledgedByName?: string;
|
|
43
|
+
sentAt?: string;
|
|
44
|
+
receivedAt?: string;
|
|
45
|
+
receivedByName?: string;
|
|
46
|
+
stockTransferId?: string;
|
|
47
|
+
printCount?: number;
|
|
48
|
+
createdAt?: string;
|
|
49
|
+
updatedAt?: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Inter-branch item requests — shared shapes for the POS-to-POS cross-branch
|
|
3
|
+
// request feature (POS / dashboard / server). A terminal at the REQUESTER branch
|
|
4
|
+
// asks the FULFILLER branch to send items; goods flow fulfiller → requester.
|
|
5
|
+
// Completes the `in_transit`/`received` workflow the StockTransfer model reserved.
|
|
6
|
+
// IDs are strings (JSON), not ObjectIds.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.allowedSenderBranchIds = allowedSenderBranchIds;
|
|
9
|
+
exports.allowedRequestModes = allowedRequestModes;
|
|
10
|
+
/** Branch ids a POS may request FROM, given the setting. A strict whitelist:
|
|
11
|
+
* EMPTY = no branch is selectable (the vendor must explicitly configure sources).
|
|
12
|
+
* Used by the POS to build the target dropdown and by the server to validate the
|
|
13
|
+
* request's toBranchId. */
|
|
14
|
+
function allowedSenderBranchIds(settings) {
|
|
15
|
+
return (settings?.senderBranchIds || []).map(String);
|
|
16
|
+
}
|
|
17
|
+
/** The request modes a POS may create given the vendor setting. Empty = feature
|
|
18
|
+
* disabled → no requests at all. Used by both the POS (to gate the UI) and the
|
|
19
|
+
* server (to validate the create payload). */
|
|
20
|
+
function allowedRequestModes(settings) {
|
|
21
|
+
if (!settings?.enabled)
|
|
22
|
+
return [];
|
|
23
|
+
if (settings.allowedModes === 'both')
|
|
24
|
+
return ['transfer', 'info'];
|
|
25
|
+
return [settings.allowedModes];
|
|
26
|
+
}
|
package/dist/productCart.d.ts
CHANGED
|
@@ -120,6 +120,12 @@ export interface ProductType {
|
|
|
120
120
|
/** When true, cashiers may override this item's price at the POS even if the
|
|
121
121
|
* branch-wide custom pricing setting is off (additive with branch setting). */
|
|
122
122
|
allowCustomPricing?: boolean;
|
|
123
|
+
/** When true, a made-to-order line for this product accepts customer-supplied
|
|
124
|
+
* reference photo(s) + a text note (e.g. a custom cake). The options UI (POS
|
|
125
|
+
* and navori_app) shows an uploader + text box, stored on the cart line's
|
|
126
|
+
* `referenceImages` + `notes`, and printed per-line on the factory's color/A4
|
|
127
|
+
* printer. */
|
|
128
|
+
allowReferenceImages?: boolean;
|
|
123
129
|
specifications?: {
|
|
124
130
|
active: boolean;
|
|
125
131
|
values: any[];
|
|
@@ -185,6 +191,12 @@ export interface CartItem {
|
|
|
185
191
|
pluLocked?: boolean;
|
|
186
192
|
/** Copied from the product; lets the POS enable price editing per-item. */
|
|
187
193
|
allowCustomPricing?: boolean;
|
|
194
|
+
/** Customer-supplied reference photo(s) for a made-to-order line (e.g. a custom
|
|
195
|
+
* cake). imgix ids, resolved via getImageUrl. Populated by the POS cashier
|
|
196
|
+
* (QR handoff or file pick) OR by the customer in navori_app. A line carrying
|
|
197
|
+
* these never merges with another. Printed per-line on the factory color/A4
|
|
198
|
+
* printer; the accompanying text reuses `notes`. */
|
|
199
|
+
referenceImages?: string[];
|
|
188
200
|
}
|
|
189
201
|
export interface sModifier {
|
|
190
202
|
name: NameType;
|