kcommons 18.17.1 → 18.17.2

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/build/index.d.ts CHANGED
@@ -170,6 +170,7 @@ export * from "./typings/kpis/company/item/itemSpecific/stockTrend.typings";
170
170
  export * from "./typings/kpis/company/item/mainDashboard/inventoryAndItemDetailsKpi.typings";
171
171
  export * from "./typings/kpis/company/item/mainDashboard/purchaseVSIssuanceKPI.typings";
172
172
  export * from "./typings/kpis/company/item/mainDashboard/mainItemDashboardSummaryKPI.typings";
173
+ export * from "./typings/kpis/store/storeKpis.typings";
173
174
  export * from "./typings/kpis/company/vendor/totalBusiness.typings";
174
175
  export * from "./typings/kpis/company/vendor/companyVendorPurchaseFlow.typings";
175
176
  export * from "./typings/kpis/company/vendor/topCompanyVendorItems.typings";
package/build/index.js CHANGED
@@ -200,6 +200,8 @@ __exportStar(require("./typings/kpis/company/item/itemSpecific/stockTrend.typing
200
200
  __exportStar(require("./typings/kpis/company/item/mainDashboard/inventoryAndItemDetailsKpi.typings"), exports);
201
201
  __exportStar(require("./typings/kpis/company/item/mainDashboard/purchaseVSIssuanceKPI.typings"), exports);
202
202
  __exportStar(require("./typings/kpis/company/item/mainDashboard/mainItemDashboardSummaryKPI.typings"), exports);
203
+ // Store Dashboard KPIs
204
+ __exportStar(require("./typings/kpis/store/storeKpis.typings"), exports);
203
205
  // Company Vendor Dashboard KPIs
204
206
  __exportStar(require("./typings/kpis/company/vendor/totalBusiness.typings"), exports);
205
207
  __exportStar(require("./typings/kpis/company/vendor/companyVendorPurchaseFlow.typings"), exports);
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Store Dashboard
3
+ *
4
+ * Group 1 - KPI cards (GET /c/kpis/store/kpis)
5
+ * 1. Total SKU count + stock units + inventory value
6
+ * 2. Procurement pipeline (PR -> RFQ -> Comparative -> PO)
7
+ * 3. Average issuance time (Indent raised -> Material issued)
8
+ * 4. Items in low stock
9
+ *
10
+ * Group 2 - Charts (GET /c/kpis/store/charts)
11
+ * 1. Active PRs by department / entity
12
+ * 2. Stock composition by category (+ item drill-down)
13
+ * 3. Inventory movement trend (issuance vs store transfers)
14
+ * 4. Store transfer distribution (routes)
15
+ * 5. Material issuance by department / entity
16
+ */
17
+ /** Scope filter for the KPI-cards endpoint. `store_location_id` is admin-only. */
18
+ export interface IStoreKPICommonFilters {
19
+ store_location_id: string | null;
20
+ }
21
+ /**
22
+ * Scope + time window for the charts endpoint. `store_location_id` is admin-only.
23
+ * `from` / `to` (ISO dates, `from` <= `to`) are required and bound the
24
+ * time-based charts (movement trend, transfer distribution, issuance by
25
+ * department); the point-in-time charts ignore them.
26
+ */
27
+ export interface IStoreChartsFilters {
28
+ store_location_id: string | null;
29
+ from: string;
30
+ to: string;
31
+ }
32
+ export declare enum STORE_PROCUREMENT_PIPELINE_STAGE {
33
+ PR = "PR",
34
+ RFQ = "RFQ",
35
+ COMPARATIVE = "COMPARATIVE",
36
+ PO = "PO"
37
+ }
38
+ export interface IStoreProcurementPipelineStageUnit {
39
+ stage: STORE_PROCUREMENT_PIPELINE_STAGE;
40
+ label: string;
41
+ document_count: number;
42
+ value: number | null;
43
+ }
44
+ export interface IStoreKpiCardsResponse {
45
+ /** Count of distinct items / SKUs stocked in the (scoped) store location. */
46
+ total_sku_count: number;
47
+ /** Sum of stock-in-hand (units) across the (scoped) inventory rows. */
48
+ total_stock_units: number;
49
+ procurement_pipeline: IStoreProcurementPipelineStageUnit[];
50
+ average_issuance_time_ms: number | null;
51
+ average_issuance_time_readable: string | null;
52
+ /** Number of Indent -> Issuance records that had both timestamps available. */
53
+ issuance_completed_records_count: number;
54
+ /**
55
+ * `false` when no inventory row has a reorder level configured, in which case
56
+ * the KPI should be hidden on the dashboard.
57
+ */
58
+ low_stock_data_available: boolean;
59
+ low_stock_item_count: number | null;
60
+ }
61
+ /** One bar in "Active PRs by Department / Entity". */
62
+ export interface IStoreActivePRsByDepartmentUnit {
63
+ department_id: string | null;
64
+ department_name: string;
65
+ pr_count: number;
66
+ }
67
+ /** One tile in the "Stock Composition" treemap. Uncategorized items -> `null`. */
68
+ export interface IStoreStockCompositionUnit {
69
+ category_id: string | null;
70
+ category_name: string;
71
+ stock_quantity: number;
72
+ stock_value: number | null;
73
+ item_count: number;
74
+ }
75
+ /** One point on the "Inventory Movement Trend" line chart. `bucket` is `yyyy-MM`. */
76
+ export interface IStoreInventoryMovementTrendPoint {
77
+ bucket: string;
78
+ material_issuance_quantity: number;
79
+ material_issuance_value: number | null;
80
+ store_transfer_quantity: number;
81
+ store_transfer_value: number | null;
82
+ }
83
+ /** One bar in "Store Transfer Distribution" - a source -> destination route. */
84
+ export interface IStoreTransferRouteUnit {
85
+ source_store_location_id: string;
86
+ source_store_location_name: string;
87
+ dest_store_location_id: string;
88
+ dest_store_location_name: string;
89
+ quantity: number;
90
+ value: number | null;
91
+ }
92
+ /** One bar in "Material Issuance by Department / Entity". */
93
+ export interface IStoreMaterialIssuanceByDepartmentUnit {
94
+ department_id: string | null;
95
+ department_name: string;
96
+ quantity: number;
97
+ value: number | null;
98
+ }
99
+ export interface IStoreChartsResponse {
100
+ active_prs_by_department: IStoreActivePRsByDepartmentUnit[];
101
+ stock_composition: IStoreStockCompositionUnit[];
102
+ inventory_movement_trend: IStoreInventoryMovementTrendPoint[];
103
+ store_transfer_distribution: IStoreTransferRouteUnit[];
104
+ material_issuance_by_department: IStoreMaterialIssuanceByDepartmentUnit[];
105
+ }
106
+ /** Filters for the stock-composition item drill-down. */
107
+ export interface IStoreStockCompositionItemsFilters {
108
+ store_location_id: string | null;
109
+ /** A category id, the literal `"uncategorized"`, or null for every item. */
110
+ category_id: string | null;
111
+ }
112
+ export interface IStoreStockCompositionItemUnit {
113
+ item_id: string;
114
+ item_name: string;
115
+ code_sku: string;
116
+ uom: string;
117
+ quantity: number;
118
+ reorder_level: number | null;
119
+ /** `quantity < reorder_level`; `null` when no reorder level is configured. */
120
+ is_low_stock: boolean | null;
121
+ value: number | null;
122
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Store Dashboard
4
+ *
5
+ * Group 1 - KPI cards (GET /c/kpis/store/kpis)
6
+ * 1. Total SKU count + stock units + inventory value
7
+ * 2. Procurement pipeline (PR -> RFQ -> Comparative -> PO)
8
+ * 3. Average issuance time (Indent raised -> Material issued)
9
+ * 4. Items in low stock
10
+ *
11
+ * Group 2 - Charts (GET /c/kpis/store/charts)
12
+ * 1. Active PRs by department / entity
13
+ * 2. Stock composition by category (+ item drill-down)
14
+ * 3. Inventory movement trend (issuance vs store transfers)
15
+ * 4. Store transfer distribution (routes)
16
+ * 5. Material issuance by department / entity
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.STORE_PROCUREMENT_PIPELINE_STAGE = void 0;
20
+ // Group 1 - KPI cards
21
+ var STORE_PROCUREMENT_PIPELINE_STAGE;
22
+ (function (STORE_PROCUREMENT_PIPELINE_STAGE) {
23
+ STORE_PROCUREMENT_PIPELINE_STAGE["PR"] = "PR";
24
+ STORE_PROCUREMENT_PIPELINE_STAGE["RFQ"] = "RFQ";
25
+ STORE_PROCUREMENT_PIPELINE_STAGE["COMPARATIVE"] = "COMPARATIVE";
26
+ STORE_PROCUREMENT_PIPELINE_STAGE["PO"] = "PO";
27
+ })(STORE_PROCUREMENT_PIPELINE_STAGE || (exports.STORE_PROCUREMENT_PIPELINE_STAGE = STORE_PROCUREMENT_PIPELINE_STAGE = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "18.17.1",
3
+ "version": "18.17.2",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",