@iveri/contracts 0.92.0 → 0.93.0

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.
@@ -0,0 +1,44 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ import type { Paginated } from '../../type/paginated.type.js';
4
+ import type { UUID } from '../../type/uuid.type.js';
5
+ /**
6
+ * One number a product reports about a company, or about all of them. `key` is a stable, lower-case word the
7
+ * product's backoffice turns into a label (`people`, `bookings`, `orders`), so a product adds a figure without a
8
+ * contracts release.
9
+ */
10
+ export interface BackofficeMetric {
11
+ key: string;
12
+ value: number;
13
+ }
14
+ /** A product's totals across every company that uses it. */
15
+ export interface BackofficeOverview {
16
+ tenantCount: number;
17
+ metrics: BackofficeMetric[];
18
+ }
19
+ /** One company as a product sees it: its figures and when it last did anything. Names come from identity. */
20
+ export interface BackofficeTenantSummary {
21
+ tenantId: UUID;
22
+ metrics: BackofficeMetric[];
23
+ lastActivityAt: Nullable<IsoDateTime>;
24
+ }
25
+ export type BackofficeTenantsPage = Paginated<BackofficeTenantSummary>;
26
+ /**
27
+ * A record support may need to see, read-only: an order, a booking, a ride, an employee. `kind` and `status` are
28
+ * stable words the backoffice labels; `title` is the company's own text (a name, a number) and is shown as written.
29
+ * Never pay, identity numbers, health records or the words of a message.
30
+ */
31
+ export interface BackofficeRecord {
32
+ id: UUID;
33
+ kind: string;
34
+ title: string;
35
+ status: Nullable<string>;
36
+ at: IsoDateTime;
37
+ }
38
+ export interface BackofficeTenantDetail {
39
+ tenantId: UUID;
40
+ metrics: BackofficeMetric[];
41
+ lastActivityAt: Nullable<IsoDateTime>;
42
+ /** The newest records, at most 50. */
43
+ recent: BackofficeRecord[];
44
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './backoffice.type.js';
1
2
  export * from './iveri-product.enum.js';
2
3
  export * from './licence-kind.enum.js';
3
4
  export * from './licence-status.enum.js';
@@ -1,3 +1,4 @@
1
+ export * from './backoffice.type.js';
1
2
  export * from './iveri-product.enum.js';
2
3
  export * from './licence-kind.enum.js';
3
4
  export * from './licence-status.enum.js';
@@ -626,7 +626,12 @@ export declare enum UserPermission {
626
626
  * Ask whether a company's licence for one product is live. Held by the products' own service credentials, so a
627
627
  * product can refuse a company whose licence has ended without reading anything else about it.
628
628
  */
629
- PLATFORM_LICENCE_CHECK = "platform:licence:check"
629
+ PLATFORM_LICENCE_CHECK = "platform:licence:check",
630
+ /**
631
+ * Read one product's view across every company: who uses it, how much, and the records support needs to answer a
632
+ * question. Never pay, identity numbers, health records or messages. Each product's backoffice routes need it.
633
+ */
634
+ PLATFORM_BACKOFFICE_READ = "platform:backoffice:read"
630
635
  }
631
636
  /**
632
637
  * The permissions that act across companies. They are granted only inside Iveri's own operator workspace, which each
@@ -694,6 +694,11 @@ export var UserPermission;
694
694
  * product can refuse a company whose licence has ended without reading anything else about it.
695
695
  */
696
696
  UserPermission["PLATFORM_LICENCE_CHECK"] = "platform:licence:check";
697
+ /**
698
+ * Read one product's view across every company: who uses it, how much, and the records support needs to answer a
699
+ * question. Never pay, identity numbers, health records or messages. Each product's backoffice routes need it.
700
+ */
701
+ UserPermission["PLATFORM_BACKOFFICE_READ"] = "platform:backoffice:read";
697
702
  })(UserPermission || (UserPermission = {}));
698
703
  /**
699
704
  * The permissions that act across companies. They are granted only inside Iveri's own operator workspace, which each
@@ -706,6 +711,7 @@ export const PLATFORM_PERMISSIONS = Object.freeze([
706
711
  UserPermission.PLATFORM_LICENCE_READ,
707
712
  UserPermission.PLATFORM_LICENCE_MANAGE,
708
713
  UserPermission.PLATFORM_LICENCE_CHECK,
714
+ UserPermission.PLATFORM_BACKOFFICE_READ,
709
715
  ]);
710
716
  /** Whether a permission acts across companies, and so may only be held in Iveri's operator workspace. */
711
717
  export function isPlatformPermission(permission) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.92.0",
3
+ "version": "0.93.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {