shopoflex-types 1.0.236 → 1.0.239

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 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
@@ -3,3 +3,4 @@ export * from './productCart';
3
3
  export * from './filters';
4
4
  export * from './accounting';
5
5
  export * from './terminal';
6
+ export * from './interBranchRequest';
package/dist/index.js CHANGED
@@ -19,3 +19,4 @@ __exportStar(require("./productCart"), exports);
19
19
  __exportStar(require("./filters"), exports);
20
20
  __exportStar(require("./accounting"), exports);
21
21
  __exportStar(require("./terminal"), exports);
22
+ __exportStar(require("./interBranchRequest"), exports);
@@ -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
+ }
@@ -3,7 +3,9 @@ export type TerminalMainView = 'default' | 'tables';
3
3
  export type TerminalOrderType = 'dinein' | 'pickup' | 'delivery';
4
4
  export interface TerminalDuties {
5
5
  onlineOrders?: boolean;
6
+ onlineOrdersBranchIds?: string[];
6
7
  reservations?: boolean;
8
+ reservationsBranchIds?: string[];
7
9
  statusBoard?: boolean;
8
10
  }
9
11
  export interface Terminal {
@@ -18,6 +20,7 @@ export interface Terminal {
18
20
  role?: TerminalRole;
19
21
  mainView?: TerminalMainView;
20
22
  orderTypes?: TerminalOrderType[];
23
+ branchScope?: string[];
21
24
  reservationBranchIds?: string[];
22
25
  stations?: string[];
23
26
  duties?: TerminalDuties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopoflex-types",
3
- "version": "1.0.236",
3
+ "version": "1.0.239",
4
4
  "description": "Shared TypeScript types for Shopoflex applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",