@managesome/eposmatic-toolkit 0.4.1 → 0.4.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.
@@ -15,6 +15,7 @@ export * from './internal-leads';
15
15
  export * from './inventory-catalog';
16
16
  export * from './kpra-generate-invoice';
17
17
  export * from './marketing';
18
+ export * from './materialized-reports-apis';
18
19
  export * from './order-engine';
19
20
  export * from './pra-generate-invoice';
20
21
  export * from './report-webview';
@@ -0,0 +1 @@
1
+ export {};
@@ -15,6 +15,7 @@ export * from './internal-leads';
15
15
  export * from './inventory-catalog';
16
16
  export * from './kpra-generate-invoice';
17
17
  export * from './marketing';
18
+ export * from './materialized-reports-apis';
18
19
  export * from './order-engine';
19
20
  export * from './pra-generate-invoice';
20
21
  export * from './report-webview';
@@ -31,6 +31,7 @@ __exportStar(require("./internal-leads"), exports);
31
31
  __exportStar(require("./inventory-catalog"), exports);
32
32
  __exportStar(require("./kpra-generate-invoice"), exports);
33
33
  __exportStar(require("./marketing"), exports);
34
+ __exportStar(require("./materialized-reports-apis"), exports);
34
35
  __exportStar(require("./order-engine"), exports);
35
36
  __exportStar(require("./pra-generate-invoice"), exports);
36
37
  __exportStar(require("./report-webview"), exports);
@@ -0,0 +1,65 @@
1
+ import { MATERIALIZED_REPORT_SCOPE_ENUM, MATERIALIZED_REPORT_TYPE_ENUM } from '../../constants';
2
+ /**
3
+ * Request body contracts for the materialized reports READ APIs
4
+ * (operations-service, mounted at `/materialized-reports`) — shared between
5
+ * the backend service and the reports frontend so both sides agree on the
6
+ * wire shape.
7
+ *
8
+ * Every endpoint takes the tenant scope as an ARRAY (`tenants`, minimum
9
+ * length 1) so a single call can serve one tenant or many (brand-level
10
+ * reports). Responses are the persisted documents themselves (see
11
+ * `IMaterializedTenantSalesOverviewReport` /
12
+ * `IMaterializedTenantReportIteration`) — amounts are INTEGER CENTS.
13
+ */
14
+ /**
15
+ * Body of `POST /materialized-reports/overview` — materialized sales overview
16
+ * documents (`materialized_tenant_sales_overview_reports`).
17
+ *
18
+ * The scope query is either the exact `scope_field`, or the inclusive
19
+ * lexicographic range `from`..`to` (all scope_field formats are fixed-width,
20
+ * so lexicographic order equals chronological order).
21
+ */
22
+ export interface IGetMaterializedTenantSalesOverviewReportsBody {
23
+ /** One or more tenant ids to read (minimum length 1). */
24
+ tenants: string[];
25
+ /**
26
+ * Scope granularity — one of `MATERIALIZED_REPORT_SCOPE_ENUM`. Optional;
27
+ * the backend defaults to `LOCAL_DATE`.
28
+ */
29
+ scope_context?: MATERIALIZED_REPORT_SCOPE_ENUM;
30
+ /** Exact scope value (e.g. '2026-09-30' or '2026-09-30 18'). */
31
+ scope_field?: string;
32
+ /**
33
+ * Inclusive lower bound on `scope_field` — required together with `to` when
34
+ * `scope_field` is absent.
35
+ */
36
+ from?: string;
37
+ /**
38
+ * Inclusive upper bound on `scope_field` — required together with `from`
39
+ * when `scope_field` is absent.
40
+ */
41
+ to?: string;
42
+ }
43
+ /**
44
+ * Body of `POST /materialized-reports/iterations` — the latest stored versions
45
+ * of ONE report document from `materialized_tenant_reports_iterations` (the
46
+ * shared version history of every materialized report collection). Rows
47
+ * return newest-first, each carrying the full post-write `snapshot`.
48
+ */
49
+ export interface IGetMaterializedReportIterationsBody {
50
+ /**
51
+ * One or more tenant ids — every returned row is guarded by the snapshot's
52
+ * `tenant_id` (the report itself is addressed by `report_id` alone).
53
+ */
54
+ tenants: string[];
55
+ /** `_id` of the report document (the `report_id` of the history rows). */
56
+ report_id: string;
57
+ /**
58
+ * Which report collection `report_id` belongs to
59
+ * (`MATERIALIZED_REPORT_TYPE_ENUM`). Optional; defaults to
60
+ * `TENANT_SALES_OVERVIEW`.
61
+ */
62
+ report_type?: MATERIALIZED_REPORT_TYPE_ENUM;
63
+ /** Latest N iterations, newest-first. Optional; default 5, capped at 50. */
64
+ limit?: number;
65
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",