sinfactura-types 1.10.402 → 1.10.403

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/cjs/roles.js CHANGED
@@ -34,4 +34,14 @@ exports.USER_ROLES = void 0;
34
34
  * machine identity has to win attribution because it already wins the
35
35
  * authorization decision. Do not derive one from the other.
36
36
  */
37
- exports.USER_ROLES = ['USER', 'ADMIN', 'SUPERVISOR', 'MANAGER', 'PRINTER'];
37
+ /*
38
+ * ⚠️ **`ACCOUNTANT` is a RESTRICTED role, like `PRINTER` — not a rung on a ladder.**
39
+ * It is the tenant's accountant: a read-only fiscal login that reaches the
40
+ * fiscal-book report modes (`invoices`, `supplier-invoices`, `libro-iva-digital`,
41
+ * `iva-simple-apertura`) and the `GET /invoices` reads, and is refused
42
+ * everywhere else by default. Its presence on a claim outranks any operator role
43
+ * beside it. It does not occupy a `maxUsers` seat and is capped per store
44
+ * separately. Unrelated to the reserved `UserPermissions.accountant` capability
45
+ * key, which nothing reads.
46
+ */
47
+ exports.USER_ROLES = ['USER', 'ADMIN', 'SUPERVISOR', 'MANAGER', 'PRINTER', 'ACCOUNTANT'];
@@ -6,8 +6,9 @@
6
6
  // Naming follows `StorefrontEvent`'s convention: Title Case Object + Past-Tense Action for
7
7
  // event names, snake_case for properties.
8
8
  //
9
- // Distinct from `StorefrontEvent`: subject is internal staff (USER/ADMIN/SUPERVISOR/MANAGER) or
10
- // the PRINTER machine identity (a Cloud Print agent), never anonymous; retention is 90d hot +
9
+ // Distinct from `StorefrontEvent`: subject is internal staff (USER/ADMIN/SUPERVISOR/MANAGER, or the
10
+ // read-only ACCOUNTANT fiscal login) or the PRINTER machine identity (a Cloud Print agent), never
11
+ // anonymous; retention is 90d hot +
11
12
  // multi-year archive; append-only / anti-erasure per Ley 25.326 audit-trail exemption; ingest is
12
13
  // synchronous only (WS ingest disallowed).
13
14
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/roles.d.ts CHANGED
@@ -31,7 +31,7 @@
31
31
  * machine identity has to win attribution because it already wins the
32
32
  * authorization decision. Do not derive one from the other.
33
33
  */
34
- export declare const USER_ROLES: readonly ["USER", "ADMIN", "SUPERVISOR", "MANAGER", "PRINTER"];
34
+ export declare const USER_ROLES: readonly ["USER", "ADMIN", "SUPERVISOR", "MANAGER", "PRINTER", "ACCOUNTANT"];
35
35
  /** One assignable staff role token. See `USER_ROLES` for why this is not the shape of `User.roles`. */
36
36
  export type UserRole = (typeof USER_ROLES)[number];
37
37
  /**
package/dist/roles.js CHANGED
@@ -31,4 +31,14 @@
31
31
  * machine identity has to win attribution because it already wins the
32
32
  * authorization decision. Do not derive one from the other.
33
33
  */
34
- export const USER_ROLES = ['USER', 'ADMIN', 'SUPERVISOR', 'MANAGER', 'PRINTER'];
34
+ /*
35
+ * ⚠️ **`ACCOUNTANT` is a RESTRICTED role, like `PRINTER` — not a rung on a ladder.**
36
+ * It is the tenant's accountant: a read-only fiscal login that reaches the
37
+ * fiscal-book report modes (`invoices`, `supplier-invoices`, `libro-iva-digital`,
38
+ * `iva-simple-apertura`) and the `GET /invoices` reads, and is refused
39
+ * everywhere else by default. Its presence on a claim outranks any operator role
40
+ * beside it. It does not occupy a `maxUsers` seat and is capped per store
41
+ * separately. Unrelated to the reserved `UserPermissions.accountant` capability
42
+ * key, which nothing reads.
43
+ */
44
+ export const USER_ROLES = ['USER', 'ADMIN', 'SUPERVISOR', 'MANAGER', 'PRINTER', 'ACCOUNTANT'];
package/dist/user.d.ts CHANGED
@@ -249,6 +249,11 @@ declare global {
249
249
  customers?: boolean;
250
250
  products?: boolean;
251
251
  seller?: boolean;
252
+ /**
253
+ * Reserved, and read by nothing. NOT the `ACCOUNTANT` role in `roles` — that
254
+ * is a separate, restricted login (see `USER_ROLES`); setting this flag grants
255
+ * no fiscal access of any kind.
256
+ */
252
257
  accountant?: boolean;
253
258
  payments?: boolean;
254
259
  cash?: boolean;
@@ -28,7 +28,7 @@ declare global {
28
28
  * {@link CustomerActivityEventBase} instead.
29
29
  */
30
30
  interface UserActivityEventBase extends ActivityEventBase {
31
- actor_role: 'USER' | 'ADMIN' | 'SUPERVISOR' | 'MANAGER' | 'PRINTER';
31
+ actor_role: 'USER' | 'ADMIN' | 'SUPERVISOR' | 'MANAGER' | 'PRINTER' | 'ACCOUNTANT';
32
32
  }
33
33
  /**
34
34
  * A row written for an action the CUSTOMER took themselves, landing in the
@@ -5,8 +5,9 @@
5
5
  // Naming follows `StorefrontEvent`'s convention: Title Case Object + Past-Tense Action for
6
6
  // event names, snake_case for properties.
7
7
  //
8
- // Distinct from `StorefrontEvent`: subject is internal staff (USER/ADMIN/SUPERVISOR/MANAGER) or
9
- // the PRINTER machine identity (a Cloud Print agent), never anonymous; retention is 90d hot +
8
+ // Distinct from `StorefrontEvent`: subject is internal staff (USER/ADMIN/SUPERVISOR/MANAGER, or the
9
+ // read-only ACCOUNTANT fiscal login) or the PRINTER machine identity (a Cloud Print agent), never
10
+ // anonymous; retention is 90d hot +
10
11
  // multi-year archive; append-only / anti-erasure per Ley 25.326 audit-trail exemption; ingest is
11
12
  // synchronous only (WS ingest disallowed).
12
13
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.402",
3
+ "version": "1.10.403",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",