sinfactura-types 1.10.401 → 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.
@@ -32,6 +32,8 @@ exports.STOCK_MOVEMENT_TYPES = [
32
32
  * unions belong to two ledgers that run side by side permanently, so the mapping
33
33
  * is what anything showing both has to apply at read time; neither list is being
34
34
  * retired and no migration folds one into the other.
35
+ *
36
+ * ⚠️ The union's `cutover_seed` is missing here on purpose: it is server-only.
35
37
  */
36
38
  exports.STOCK_MOVEMENT_REASONS = [
37
39
  'count_correction',
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 });
@@ -17,6 +17,8 @@ export declare const STOCK_MOVEMENT_TYPES: readonly ["receipt", "sale", "sale_un
17
17
  * unions belong to two ledgers that run side by side permanently, so the mapping
18
18
  * is what anything showing both has to apply at read time; neither list is being
19
19
  * retired and no migration folds one into the other.
20
+ *
21
+ * ⚠️ The union's `cutover_seed` is missing here on purpose: it is server-only.
20
22
  */
21
23
  export declare const STOCK_MOVEMENT_REASONS: readonly ["count_correction", "shrinkage", "damage", "expiry", "theft", "admin_error", "other"];
22
24
  /** Every state an individual hold can hold. Runtime value for the api's Zod enum. */
@@ -636,8 +638,14 @@ declare global {
636
638
  * is included because the count-session entity emits adjustment rows on
637
639
  * finalise: without it, the platform's most common adjustment is the one
638
640
  * reason that cannot be stated, and every variance would land as `other`.
641
+ *
642
+ * ⚠️ `cutover_seed` is SERVER-ONLY and deliberately absent from
643
+ * `STOCK_MOVEMENT_REASONS`, the list a request may name: it marks the one-off
644
+ * `adjustment` the per-store cutover to depósito stock writes (the api's
645
+ * ADR-0001), so the seed stays identifiable in the ledger. It is not a loss
646
+ * and a loss report must not count it as one.
639
647
  */
640
- type StockMovementReason = 'count_correction' | 'shrinkage' | 'damage' | 'expiry' | 'theft' | 'admin_error' | 'other';
648
+ type StockMovementReason = 'count_correction' | 'shrinkage' | 'damage' | 'expiry' | 'theft' | 'admin_error' | 'other' | 'cutover_seed';
641
649
  /**
642
650
  * What happened to an individual hold.
643
651
  *
package/dist/inventory.js CHANGED
@@ -29,6 +29,8 @@ export const STOCK_MOVEMENT_TYPES = [
29
29
  * unions belong to two ledgers that run side by side permanently, so the mapping
30
30
  * is what anything showing both has to apply at read time; neither list is being
31
31
  * retired and no migration folds one into the other.
32
+ *
33
+ * ⚠️ The union's `cutover_seed` is missing here on purpose: it is server-only.
32
34
  */
33
35
  export const STOCK_MOVEMENT_REASONS = [
34
36
  'count_correction',
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/store.d.ts CHANGED
@@ -776,11 +776,11 @@ declare global {
776
776
  * moves the level in the same transaction as `Product.stock`, which
777
777
  * stays as the cached store total.
778
778
  *
779
- * ⚠️ Absent means `'store'`. Operator-owned: no request body sets it, and
780
- * nothing writes it yet — the cutover that flips it also seeds the store's
781
- * existing gap into its primary depósito. Rollback is flipping it back;
782
- * the store total is correct either way. The sale paths read it to decide
783
- * whether to record `OrderLine.warehouseId`.
779
+ * ⚠️ Absent means `'store'`. Operator-owned: no request body sets it. Its
780
+ * only writer is the operator-run cutover, which flips it and then seeds
781
+ * the store's existing gap into its primary depósito. Rollback is flipping
782
+ * it back; the store total is correct either way. The sale paths read it
783
+ * to decide whether to record `OrderLine.warehouseId`.
784
784
  */
785
785
  stockAuthority?: StockAuthority;
786
786
  afipCertAlert?: {
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.401",
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",