hvp-shared 7.1.0 → 7.2.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.
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/inventory-report/index.d.ts +8 -0
- package/dist/contracts/inventory-report/index.js +24 -0
- package/dist/contracts/inventory-report/requests.d.ts +27 -0
- package/dist/contracts/inventory-report/requests.js +10 -0
- package/dist/contracts/inventory-report/responses.d.ts +81 -0
- package/dist/contracts/inventory-report/responses.js +10 -0
- package/dist/contracts/inventory-report/types.d.ts +294 -0
- package/dist/contracts/inventory-report/types.js +57 -0
- package/package.json +1 -1
package/dist/contracts/index.js
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Report API Contracts
|
|
4
|
+
*
|
|
5
|
+
* Types, request and response definitions for inventory report endpoints.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
23
|
+
__exportStar(require("./requests"), exports);
|
|
24
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Report Requests
|
|
3
|
+
*
|
|
4
|
+
* Request types for inventory report generation.
|
|
5
|
+
*
|
|
6
|
+
* @example POST /api/inventory/reports/generate
|
|
7
|
+
* @example GET /api/inventory/reports/periods
|
|
8
|
+
*/
|
|
9
|
+
import { ReportPeriodType } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Generate Inventory Report Request
|
|
12
|
+
*
|
|
13
|
+
* Generates a complete inventory report for the specified period.
|
|
14
|
+
*
|
|
15
|
+
* @example POST /api/inventory/reports/generate
|
|
16
|
+
* { "periodType": "monthly", "year": 2026, "month": 3 }
|
|
17
|
+
*/
|
|
18
|
+
export interface GenerateInventoryReportRequest {
|
|
19
|
+
/** Period type */
|
|
20
|
+
periodType: ReportPeriodType;
|
|
21
|
+
/** Year */
|
|
22
|
+
year: number;
|
|
23
|
+
/** Month (1-12) — required for monthly, start month for quarterly */
|
|
24
|
+
month: number;
|
|
25
|
+
/** Branch filter (omit for global report) */
|
|
26
|
+
branch?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Report Requests
|
|
4
|
+
*
|
|
5
|
+
* Request types for inventory report generation.
|
|
6
|
+
*
|
|
7
|
+
* @example POST /api/inventory/reports/generate
|
|
8
|
+
* @example GET /api/inventory/reports/periods
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Report Responses
|
|
3
|
+
*
|
|
4
|
+
* Response types for inventory report endpoints.
|
|
5
|
+
*
|
|
6
|
+
* @example POST /api/inventory/reports/generate
|
|
7
|
+
* @example GET /api/inventory/reports/periods
|
|
8
|
+
*/
|
|
9
|
+
import { ReportSummary, FlowByCategory, TopShrinkageItem, PurchaseVsSaleItem, ConsumptionItem, CfAnomalyItem, PeriodComparisonRow } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Full Inventory Report Response
|
|
12
|
+
*
|
|
13
|
+
* Contains all 7 report sections.
|
|
14
|
+
*
|
|
15
|
+
* @example POST /api/inventory/reports/generate
|
|
16
|
+
*/
|
|
17
|
+
export interface InventoryReportResponse {
|
|
18
|
+
/** Section 1: Executive summary with key metrics */
|
|
19
|
+
summary: ReportSummary;
|
|
20
|
+
/** Section 2: Stock flow aggregated by usageType */
|
|
21
|
+
flowByCategory: FlowByCategory[];
|
|
22
|
+
/** Section 3: Products with highest real shrinkage (excludes consumption and CF artifacts) */
|
|
23
|
+
topShrinkage: TopShrinkageItem[];
|
|
24
|
+
/** Section 4: Purchase vs sale analysis for directSale items */
|
|
25
|
+
purchaseVsSale: PurchaseVsSaleItem[];
|
|
26
|
+
/** Section 5: Internal consumption analysis for internalUse items */
|
|
27
|
+
consumption: ConsumptionItem[];
|
|
28
|
+
/** Section 6: Items flagged as possible conversion factor anomalies */
|
|
29
|
+
cfAnomalies: CfAnomalyItem[];
|
|
30
|
+
/** Section 7: Period-over-period comparison metrics */
|
|
31
|
+
periodComparison: PeriodComparisonRow[];
|
|
32
|
+
/** Report generation metadata */
|
|
33
|
+
metadata: ReportMetadata;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Report generation metadata
|
|
37
|
+
*/
|
|
38
|
+
export interface ReportMetadata {
|
|
39
|
+
/** When the report was generated */
|
|
40
|
+
generatedAt: string;
|
|
41
|
+
/** Period date range */
|
|
42
|
+
period: {
|
|
43
|
+
from: string;
|
|
44
|
+
to: string;
|
|
45
|
+
};
|
|
46
|
+
/** Previous period date range (for comparison) */
|
|
47
|
+
previousPeriod?: {
|
|
48
|
+
from: string;
|
|
49
|
+
to: string;
|
|
50
|
+
};
|
|
51
|
+
/** Branch filter applied */
|
|
52
|
+
branch?: string;
|
|
53
|
+
/** Number of months in the period */
|
|
54
|
+
periodMonths: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Available Report Period
|
|
58
|
+
*
|
|
59
|
+
* Represents a period that can be generated (has snapshot data).
|
|
60
|
+
*/
|
|
61
|
+
export interface AvailableReportPeriod {
|
|
62
|
+
/** Year */
|
|
63
|
+
year: number;
|
|
64
|
+
/** Month (1-12) */
|
|
65
|
+
month: number;
|
|
66
|
+
/** Label for display (e.g., "Marzo 2026") */
|
|
67
|
+
label: string;
|
|
68
|
+
/** Snapshot date used for end of period */
|
|
69
|
+
snapshotDate: string;
|
|
70
|
+
/** Total items in snapshot */
|
|
71
|
+
totalItems: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Available Periods Response
|
|
75
|
+
*
|
|
76
|
+
* @example GET /api/inventory/reports/periods
|
|
77
|
+
*/
|
|
78
|
+
export interface AvailablePeriodsResponse {
|
|
79
|
+
/** Available monthly periods (sorted newest first) */
|
|
80
|
+
months: AvailableReportPeriod[];
|
|
81
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Report Responses
|
|
4
|
+
*
|
|
5
|
+
* Response types for inventory report endpoints.
|
|
6
|
+
*
|
|
7
|
+
* @example POST /api/inventory/reports/generate
|
|
8
|
+
* @example GET /api/inventory/reports/periods
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Report Types
|
|
3
|
+
*
|
|
4
|
+
* Domain types for periodic inventory reports (monthly, quarterly, annual).
|
|
5
|
+
* These reports aggregate stock flow data, detect anomalies, and compare periods.
|
|
6
|
+
*/
|
|
7
|
+
import { StockFlow } from '../stock-calculation/types';
|
|
8
|
+
/**
|
|
9
|
+
* Report period type
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ReportPeriodType {
|
|
12
|
+
monthly = "monthly",
|
|
13
|
+
quarterly = "quarterly",
|
|
14
|
+
annual = "annual"
|
|
15
|
+
}
|
|
16
|
+
export declare const REPORT_PERIOD_TYPE_LABELS: Record<ReportPeriodType, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Shrinkage flag — classifies the nature of each product's shrinkage
|
|
19
|
+
*/
|
|
20
|
+
export declare enum ShrinkageFlag {
|
|
21
|
+
/** Real unexplained loss */
|
|
22
|
+
realLoss = "real_loss",
|
|
23
|
+
/** Likely caused by conversion factor mismatch */
|
|
24
|
+
conversionArtifact = "conversion_artifact",
|
|
25
|
+
/** Expected consumption (internalUse items) */
|
|
26
|
+
expectedConsumption = "expected_consumption",
|
|
27
|
+
/** Surplus — more stock than expected */
|
|
28
|
+
surplus = "surplus",
|
|
29
|
+
/** Negligible (within tolerance) */
|
|
30
|
+
negligible = "negligible"
|
|
31
|
+
}
|
|
32
|
+
export declare const SHRINKAGE_FLAG_LABELS: Record<ShrinkageFlag, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Section 1: Executive Summary
|
|
35
|
+
*/
|
|
36
|
+
export interface ReportSummary {
|
|
37
|
+
/** Period date range */
|
|
38
|
+
period: {
|
|
39
|
+
from: string;
|
|
40
|
+
to: string;
|
|
41
|
+
};
|
|
42
|
+
/** Branch filter applied (undefined = all) */
|
|
43
|
+
branch?: string;
|
|
44
|
+
/** Stock value at period end (PVP) */
|
|
45
|
+
endStockValuePvp: number;
|
|
46
|
+
/** Stock value at period end (unit cost / PMPC) */
|
|
47
|
+
endStockValueCost: number;
|
|
48
|
+
/** Total products with movement in period */
|
|
49
|
+
productsWithMovement: number;
|
|
50
|
+
/** Total products in catalog */
|
|
51
|
+
totalCatalogProducts: number;
|
|
52
|
+
/** Aggregate purchase quantity */
|
|
53
|
+
totalPurchasesQty: number;
|
|
54
|
+
/** Aggregate purchase value (cost) */
|
|
55
|
+
totalPurchasesValue: number;
|
|
56
|
+
/** Aggregate sales quantity */
|
|
57
|
+
totalSalesQty: number;
|
|
58
|
+
/** Aggregate sales value (cost) */
|
|
59
|
+
totalSalesValue: number;
|
|
60
|
+
/** Total shrinkage units (directSale + autoDeduct only) */
|
|
61
|
+
totalShrinkageQty: number;
|
|
62
|
+
/** Total shrinkage value */
|
|
63
|
+
totalShrinkageValue: number;
|
|
64
|
+
/** Total internal consumption value */
|
|
65
|
+
totalConsumptionValue: number;
|
|
66
|
+
/** Number of items flagged as conversion artifacts */
|
|
67
|
+
conversionArtifactCount: number;
|
|
68
|
+
/** Comparison with previous period (same length) */
|
|
69
|
+
previousPeriod?: PeriodDelta;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Delta between current and previous period
|
|
73
|
+
*/
|
|
74
|
+
export interface PeriodDelta {
|
|
75
|
+
/** Previous period date range */
|
|
76
|
+
period: {
|
|
77
|
+
from: string;
|
|
78
|
+
to: string;
|
|
79
|
+
};
|
|
80
|
+
/** End stock value delta (%) */
|
|
81
|
+
stockValueDeltaPct: number;
|
|
82
|
+
/** Sales qty delta (%) */
|
|
83
|
+
salesDeltaPct: number;
|
|
84
|
+
/** Purchases qty delta (%) */
|
|
85
|
+
purchasesDeltaPct: number;
|
|
86
|
+
/** Shrinkage value delta (%) */
|
|
87
|
+
shrinkageDeltaPct: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Section 2: Flow by Category
|
|
91
|
+
*
|
|
92
|
+
* Aggregated stock flow grouped by usageType or section.
|
|
93
|
+
*/
|
|
94
|
+
export interface FlowByCategory {
|
|
95
|
+
/** Grouping key (usageType value or section name) */
|
|
96
|
+
category: string;
|
|
97
|
+
/** Display label */
|
|
98
|
+
label: string;
|
|
99
|
+
/** Number of products in this category */
|
|
100
|
+
productCount: number;
|
|
101
|
+
/** Aggregated flow */
|
|
102
|
+
flow: StockFlow;
|
|
103
|
+
/** Aggregated end stock value (cost) */
|
|
104
|
+
endStockValue: number;
|
|
105
|
+
/** Delta vs previous period (%) — undefined if no previous data */
|
|
106
|
+
endStockDeltaPct?: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Section 3: Top Shrinkage Items (real losses)
|
|
110
|
+
*/
|
|
111
|
+
export interface TopShrinkageItem {
|
|
112
|
+
qvetCode: number;
|
|
113
|
+
description: string;
|
|
114
|
+
section: string;
|
|
115
|
+
family: string;
|
|
116
|
+
usageType: string;
|
|
117
|
+
conversionFactor: number;
|
|
118
|
+
unitCost: number;
|
|
119
|
+
flow: StockFlow;
|
|
120
|
+
/** Classification of the shrinkage */
|
|
121
|
+
flag: ShrinkageFlag;
|
|
122
|
+
/** Shrinkage as % of available stock */
|
|
123
|
+
shrinkagePct: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Section 4: Purchase vs Sale Analysis
|
|
127
|
+
*/
|
|
128
|
+
export interface PurchaseVsSaleItem {
|
|
129
|
+
qvetCode: number;
|
|
130
|
+
description: string;
|
|
131
|
+
section: string;
|
|
132
|
+
family: string;
|
|
133
|
+
/** Total purchases (units, converted to sale units) */
|
|
134
|
+
purchasesQty: number;
|
|
135
|
+
/** Total purchase value (cost) */
|
|
136
|
+
purchasesValue: number;
|
|
137
|
+
/** Total sales (units) */
|
|
138
|
+
salesQty: number;
|
|
139
|
+
/** Total sales value (cost) */
|
|
140
|
+
salesValue: number;
|
|
141
|
+
/** Coverage ratio: purchases / sales. >1 = building stock, <1 = depleting */
|
|
142
|
+
coverageRatio: number | null;
|
|
143
|
+
/** Current end stock */
|
|
144
|
+
endStock: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Section 5: Internal Consumption Analysis
|
|
148
|
+
*/
|
|
149
|
+
export interface ConsumptionItem {
|
|
150
|
+
qvetCode: number;
|
|
151
|
+
description: string;
|
|
152
|
+
section: string;
|
|
153
|
+
family: string;
|
|
154
|
+
/** Consumed units = available - actualStock */
|
|
155
|
+
consumed: number;
|
|
156
|
+
/** Consumed value (cost) */
|
|
157
|
+
consumedValue: number;
|
|
158
|
+
/** Monthly consumption rate */
|
|
159
|
+
monthlyRate: number;
|
|
160
|
+
/** End stock */
|
|
161
|
+
endStock: number;
|
|
162
|
+
/** Days of stock remaining at current rate */
|
|
163
|
+
stockDaysRemaining: number | null;
|
|
164
|
+
/** Low stock flag (< 15 days remaining) */
|
|
165
|
+
isLowStock: boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Section 6: Conversion Factor Anomaly
|
|
169
|
+
*/
|
|
170
|
+
export interface CfAnomalyItem {
|
|
171
|
+
qvetCode: number;
|
|
172
|
+
description: string;
|
|
173
|
+
section: string;
|
|
174
|
+
conversionFactor: number;
|
|
175
|
+
/** Raw shrinkage (units) — may be unrealistic due to CF */
|
|
176
|
+
shrinkage: number;
|
|
177
|
+
/** Shrinkage value */
|
|
178
|
+
shrinkageValue: number;
|
|
179
|
+
/** Shrinkage as % of available */
|
|
180
|
+
shrinkagePct: number;
|
|
181
|
+
/** Initial stock */
|
|
182
|
+
initialStock: number;
|
|
183
|
+
/** End stock */
|
|
184
|
+
actualStock: number;
|
|
185
|
+
/** Purchases (converted) */
|
|
186
|
+
purchasesTotal: number;
|
|
187
|
+
/** Likely explanation */
|
|
188
|
+
likelyCause: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Section 7: Period Comparison (multi-metric)
|
|
192
|
+
*/
|
|
193
|
+
export interface PeriodComparisonRow {
|
|
194
|
+
/** Metric name */
|
|
195
|
+
metric: string;
|
|
196
|
+
/** Display label (Spanish) */
|
|
197
|
+
label: string;
|
|
198
|
+
/** Current period value */
|
|
199
|
+
current: number;
|
|
200
|
+
/** Previous period value */
|
|
201
|
+
previous: number;
|
|
202
|
+
/** Absolute delta */
|
|
203
|
+
delta: number;
|
|
204
|
+
/** Percentage delta */
|
|
205
|
+
deltaPct: number | null;
|
|
206
|
+
/** Unit for display (e.g., "units", "$", "%") */
|
|
207
|
+
unit: string;
|
|
208
|
+
}
|
|
209
|
+
/** Classification for a report line */
|
|
210
|
+
export type ReportLineClassification = 'consumption' | 'expired' | 'confirmed_loss' | 'unconfirmed_loss' | 'surplus' | 'negligible';
|
|
211
|
+
export declare const REPORT_LINE_CLASSIFICATION_LABELS: Record<ReportLineClassification, string>;
|
|
212
|
+
/** One product in one branch — the atomic unit of the V2 report */
|
|
213
|
+
export interface ReportLine {
|
|
214
|
+
qvetCode: number;
|
|
215
|
+
description: string;
|
|
216
|
+
section: string;
|
|
217
|
+
family: string;
|
|
218
|
+
usageType: string;
|
|
219
|
+
branch: string;
|
|
220
|
+
unitCost: number;
|
|
221
|
+
conversionFactor: number;
|
|
222
|
+
initialStock: number;
|
|
223
|
+
purchases: number;
|
|
224
|
+
transfersIn: number;
|
|
225
|
+
transfersOut: number;
|
|
226
|
+
sold: number;
|
|
227
|
+
actualStock: number;
|
|
228
|
+
available: number;
|
|
229
|
+
theoreticalStock: number;
|
|
230
|
+
shrinkage: number;
|
|
231
|
+
shrinkageValue: number;
|
|
232
|
+
expiredQty: number;
|
|
233
|
+
expiredValue: number;
|
|
234
|
+
classification: ReportLineClassification;
|
|
235
|
+
}
|
|
236
|
+
/** Per-product-per-branch override */
|
|
237
|
+
export interface ReportOverrideV2 {
|
|
238
|
+
qvetCode: number;
|
|
239
|
+
/** null = all branches */
|
|
240
|
+
branch: string | null;
|
|
241
|
+
action: 'ignore';
|
|
242
|
+
reason?: string;
|
|
243
|
+
reviewedBy?: string;
|
|
244
|
+
reviewedByName?: string;
|
|
245
|
+
reviewedAt?: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Waterfall V2 — same structure at every level (global, branch, section).
|
|
249
|
+
*
|
|
250
|
+
* Shows base (sin overrides, FIXED) and adjusted (con overrides).
|
|
251
|
+
* Equation: balance = consumption + expired + realLoss (ALWAYS holds)
|
|
252
|
+
*/
|
|
253
|
+
export interface WaterfallV2 {
|
|
254
|
+
baseFaltantes: number;
|
|
255
|
+
baseSobrantes: number;
|
|
256
|
+
baseBalance: number;
|
|
257
|
+
faltantes: number;
|
|
258
|
+
sobrantes: number;
|
|
259
|
+
balance: number;
|
|
260
|
+
consumption: number;
|
|
261
|
+
expired: number;
|
|
262
|
+
realLoss: number;
|
|
263
|
+
itemCount: number;
|
|
264
|
+
}
|
|
265
|
+
/** Waterfalls at all levels */
|
|
266
|
+
export interface ReportWaterfalls {
|
|
267
|
+
global: WaterfallV2;
|
|
268
|
+
branches: {
|
|
269
|
+
branch: string;
|
|
270
|
+
waterfall: WaterfallV2;
|
|
271
|
+
}[];
|
|
272
|
+
sections: {
|
|
273
|
+
section: string;
|
|
274
|
+
waterfall: WaterfallV2;
|
|
275
|
+
}[];
|
|
276
|
+
}
|
|
277
|
+
/** V2 persisted report document */
|
|
278
|
+
export interface InventoryReportDocumentV2 {
|
|
279
|
+
id: string;
|
|
280
|
+
periodType: ReportPeriodType;
|
|
281
|
+
year: number;
|
|
282
|
+
month: number;
|
|
283
|
+
status: 'draft' | 'closed';
|
|
284
|
+
schemaVersion: number;
|
|
285
|
+
lines: ReportLine[];
|
|
286
|
+
overrides: ReportOverrideV2[];
|
|
287
|
+
waterfall: ReportWaterfalls;
|
|
288
|
+
metadata: import('./responses').ReportMetadata;
|
|
289
|
+
createdByName?: string;
|
|
290
|
+
closedByName?: string;
|
|
291
|
+
closedAt?: string;
|
|
292
|
+
createdAt?: string;
|
|
293
|
+
updatedAt?: string;
|
|
294
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory Report Types
|
|
4
|
+
*
|
|
5
|
+
* Domain types for periodic inventory reports (monthly, quarterly, annual).
|
|
6
|
+
* These reports aggregate stock flow data, detect anomalies, and compare periods.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.REPORT_LINE_CLASSIFICATION_LABELS = exports.SHRINKAGE_FLAG_LABELS = exports.ShrinkageFlag = exports.REPORT_PERIOD_TYPE_LABELS = exports.ReportPeriodType = void 0;
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Enums
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Report period type
|
|
15
|
+
*/
|
|
16
|
+
var ReportPeriodType;
|
|
17
|
+
(function (ReportPeriodType) {
|
|
18
|
+
ReportPeriodType["monthly"] = "monthly";
|
|
19
|
+
ReportPeriodType["quarterly"] = "quarterly";
|
|
20
|
+
ReportPeriodType["annual"] = "annual";
|
|
21
|
+
})(ReportPeriodType || (exports.ReportPeriodType = ReportPeriodType = {}));
|
|
22
|
+
exports.REPORT_PERIOD_TYPE_LABELS = {
|
|
23
|
+
[ReportPeriodType.monthly]: 'Mensual',
|
|
24
|
+
[ReportPeriodType.quarterly]: 'Trimestral',
|
|
25
|
+
[ReportPeriodType.annual]: 'Anual',
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Shrinkage flag — classifies the nature of each product's shrinkage
|
|
29
|
+
*/
|
|
30
|
+
var ShrinkageFlag;
|
|
31
|
+
(function (ShrinkageFlag) {
|
|
32
|
+
/** Real unexplained loss */
|
|
33
|
+
ShrinkageFlag["realLoss"] = "real_loss";
|
|
34
|
+
/** Likely caused by conversion factor mismatch */
|
|
35
|
+
ShrinkageFlag["conversionArtifact"] = "conversion_artifact";
|
|
36
|
+
/** Expected consumption (internalUse items) */
|
|
37
|
+
ShrinkageFlag["expectedConsumption"] = "expected_consumption";
|
|
38
|
+
/** Surplus — more stock than expected */
|
|
39
|
+
ShrinkageFlag["surplus"] = "surplus";
|
|
40
|
+
/** Negligible (within tolerance) */
|
|
41
|
+
ShrinkageFlag["negligible"] = "negligible";
|
|
42
|
+
})(ShrinkageFlag || (exports.ShrinkageFlag = ShrinkageFlag = {}));
|
|
43
|
+
exports.SHRINKAGE_FLAG_LABELS = {
|
|
44
|
+
[ShrinkageFlag.realLoss]: 'Pérdida real',
|
|
45
|
+
[ShrinkageFlag.conversionArtifact]: 'Posible error de conversión',
|
|
46
|
+
[ShrinkageFlag.expectedConsumption]: 'Consumo esperado',
|
|
47
|
+
[ShrinkageFlag.surplus]: 'Sobrante',
|
|
48
|
+
[ShrinkageFlag.negligible]: 'Despreciable',
|
|
49
|
+
};
|
|
50
|
+
exports.REPORT_LINE_CLASSIFICATION_LABELS = {
|
|
51
|
+
consumption: 'Consumo interno',
|
|
52
|
+
expired: 'Caducidad',
|
|
53
|
+
confirmed_loss: 'Pérdida confirmada',
|
|
54
|
+
unconfirmed_loss: 'Sin confirmar',
|
|
55
|
+
surplus: 'Sobrante',
|
|
56
|
+
negligible: 'Despreciable',
|
|
57
|
+
};
|