sinfactura-types 1.10.396 → 1.10.398

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.
@@ -8,7 +8,7 @@ exports.NotificationTypeEnum = void 0;
8
8
  // (stacks/helpers/notificationType.ts) and `app`
9
9
  // (src/domain/notificationType.ts) can drop their hand-mirrored copies
10
10
  // in follow-ups. DOLARBNA / ERROR / ML_FACTURADOR_COLLISION / ML_SELLER_SWITCHED /
11
- // ML_CONNECTION_BROKEN have no User-row read path — enum members only. AFIP_CERT_EXPIRY (the
11
+ // ML_CONNECTION_BROKEN / MENTION have no User-row read path — enum members only. AFIP_CERT_EXPIRY (the
12
12
  // cert-expiry alert type) was in that list and no longer belongs to it:
13
13
  // `createStore` seeds it on the founding user and `afipCertMonitor`
14
14
  // reads `getNotificationSubscribers` for it, so it is an ordinary opt-in
@@ -133,4 +133,18 @@ var NotificationTypeEnum;
133
133
  */
134
134
  NotificationTypeEnum["APPOINTMENT_CONFIRMED"] = "APPOINTMENT_CONFIRMED";
135
135
  NotificationTypeEnum["APPOINTMENT_CANCELLED"] = "APPOINTMENT_CANCELLED";
136
+ /**
137
+ * A colleague @mentioned you on an operator note about a customer.
138
+ *
139
+ * ⚠️ Additive, on the same grounds as `ABANDONED_CART`. No User-row read
140
+ * path: it is addressed to ONE user (`userId`), the one the write newly
141
+ * mentioned, never fanned out — the `ML_FACTURADOR_COLLISION` category, not
142
+ * the opt-in one (a new key is seeded nowhere).
143
+ *
144
+ * ⚠️ Carries `customerNoteRef` + `actor` and NEVER a top-level `customerId`
145
+ * (an audience — the row would reach that customer's storefront socket),
146
+ * never the note body and never the customer's name: NOTIF# rows live a
147
+ * month and customer anonymisation does not touch them.
148
+ */
149
+ NotificationTypeEnum["MENTION"] = "MENTION";
136
150
  })(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
@@ -4,6 +4,33 @@ declare global {
4
4
  userId: string;
5
5
  fullName: string;
6
6
  }
7
+ /**
8
+ * One colleague @mentioned on a note — a SNAPSHOT taken at write time, like
9
+ * `author`: a later rename does not rewrite it. Empty `fullName`, never
10
+ * absent, when the user row carried none.
11
+ */
12
+ type CustomerNoteMention = CustomerNoteActor;
13
+ /**
14
+ * `GET /customers/notes?mode=mention-candidates` — `data` is
15
+ * `CustomerNoteMention[]`: EXACTLY the colleagues a create or edit would keep
16
+ * in `mentions` (the rule is on {@link CustomerNote.mentions}), never the
17
+ * caller, and nothing else about them — `{ userId, fullName }` only. Same
18
+ * authorizer and capability as writing a note. `truncated: true` when the
19
+ * store's staff read stopped short, so a short list is never presented as
20
+ * complete.
21
+ */
22
+ type CustomerNoteMentionCandidates = CustomerNoteMention[];
23
+ /**
24
+ * A pointer to one note that is NOT an audience. The `MENTION` notification
25
+ * carries it instead of a top-level `customerId`, which the notification
26
+ * pipeline treats as a recipient (it would push the row to that customer's
27
+ * storefront socket). Ids only — resolve the note through the gated
28
+ * `GET /customers/notes?customerId=`.
29
+ */
30
+ interface CustomerNoteRef {
31
+ customerId: string;
32
+ noteId: string;
33
+ }
7
34
  /**
8
35
  * One note as it crosses the wire — an explicit allow-list of the stored row
9
36
  * (no `PK`/`SK`, no `storeId`).
@@ -23,6 +50,25 @@ declare global {
23
50
  createdAt: number;
24
51
  updatedAt?: number;
25
52
  lastEditedBy?: CustomerNoteActor;
53
+ /**
54
+ * Colleagues @mentioned on the note, in request order. Absent when none
55
+ * was ever kept.
56
+ *
57
+ * A create or edit sends `mentions?: string[]` (userIds, at most 20,
58
+ * each `USR…`; a malformed id or a longer list is 400 VALIDATION_FAILED).
59
+ * The server KEEPS only the ones that are active colleagues of the SAME
60
+ * store — not `disabled`, not anonymised, not a PRINTER identity, holding
61
+ * the `customers` capability (role-implied or flagged) — and never the
62
+ * author/editor themself; duplicates collapse. An ineligible or unknown
63
+ * id is DROPPED SILENTLY, not refused: the response's `mentions` is what
64
+ * stuck, so read it back rather than echoing the request.
65
+ *
66
+ * On an edit, an ABSENT `mentions` leaves the stored list untouched and
67
+ * `[]` clears it. Every user NEWLY kept by a write (not already on the
68
+ * note) receives one `MENTION` notification; a kept mention re-sent on a
69
+ * later edit does not re-notify.
70
+ */
71
+ mentions?: CustomerNoteMention[];
26
72
  }
27
73
  /**
28
74
  * `GET /customers/notes?customerId=` — one page, descending by `noteId` (the
@@ -107,9 +107,28 @@ export declare enum NotificationTypeEnum {
107
107
  * spine rather than merely unbuilt.
108
108
  */
109
109
  APPOINTMENT_CONFIRMED = "APPOINTMENT_CONFIRMED",
110
- APPOINTMENT_CANCELLED = "APPOINTMENT_CANCELLED"
110
+ APPOINTMENT_CANCELLED = "APPOINTMENT_CANCELLED",
111
+ /**
112
+ * A colleague @mentioned you on an operator note about a customer.
113
+ *
114
+ * ⚠️ Additive, on the same grounds as `ABANDONED_CART`. No User-row read
115
+ * path: it is addressed to ONE user (`userId`), the one the write newly
116
+ * mentioned, never fanned out — the `ML_FACTURADOR_COLLISION` category, not
117
+ * the opt-in one (a new key is seeded nowhere).
118
+ *
119
+ * ⚠️ Carries `customerNoteRef` + `actor` and NEVER a top-level `customerId`
120
+ * (an audience — the row would reach that customer's storefront socket),
121
+ * never the note body and never the customer's name: NOTIF# rows live a
122
+ * month and customer anonymisation does not touch them.
123
+ */
124
+ MENTION = "MENTION"
111
125
  }
112
126
  declare global {
127
+ /** Who caused a notification. Empty `fullName`, never absent, when unknown. */
128
+ interface NotificationActor {
129
+ userId: string;
130
+ fullName: string;
131
+ }
113
132
  interface NotificationInterface {
114
133
  storeId: string;
115
134
  notificationId: string;
@@ -139,6 +158,13 @@ declare global {
139
158
  */
140
159
  startTime?: string;
141
160
  ticketStoreId?: string;
161
+ /**
162
+ * `MENTION` only: which note to open. A POINTER, not an audience — unlike
163
+ * the top-level `customerId` below, nothing routes on it.
164
+ */
165
+ customerNoteRef?: CustomerNoteRef;
166
+ /** `MENTION` only: the colleague who wrote the mention (a snapshot). */
167
+ actor?: NotificationActor;
142
168
  userId?: string;
143
169
  customerId?: string;
144
170
  read?: boolean;
@@ -5,7 +5,7 @@
5
5
  // (stacks/helpers/notificationType.ts) and `app`
6
6
  // (src/domain/notificationType.ts) can drop their hand-mirrored copies
7
7
  // in follow-ups. DOLARBNA / ERROR / ML_FACTURADOR_COLLISION / ML_SELLER_SWITCHED /
8
- // ML_CONNECTION_BROKEN have no User-row read path — enum members only. AFIP_CERT_EXPIRY (the
8
+ // ML_CONNECTION_BROKEN / MENTION have no User-row read path — enum members only. AFIP_CERT_EXPIRY (the
9
9
  // cert-expiry alert type) was in that list and no longer belongs to it:
10
10
  // `createStore` seeds it on the founding user and `afipCertMonitor`
11
11
  // reads `getNotificationSubscribers` for it, so it is an ordinary opt-in
@@ -130,4 +130,18 @@ export var NotificationTypeEnum;
130
130
  */
131
131
  NotificationTypeEnum["APPOINTMENT_CONFIRMED"] = "APPOINTMENT_CONFIRMED";
132
132
  NotificationTypeEnum["APPOINTMENT_CANCELLED"] = "APPOINTMENT_CANCELLED";
133
+ /**
134
+ * A colleague @mentioned you on an operator note about a customer.
135
+ *
136
+ * ⚠️ Additive, on the same grounds as `ABANDONED_CART`. No User-row read
137
+ * path: it is addressed to ONE user (`userId`), the one the write newly
138
+ * mentioned, never fanned out — the `ML_FACTURADOR_COLLISION` category, not
139
+ * the opt-in one (a new key is seeded nowhere).
140
+ *
141
+ * ⚠️ Carries `customerNoteRef` + `actor` and NEVER a top-level `customerId`
142
+ * (an audience — the row would reach that customer's storefront socket),
143
+ * never the note body and never the customer's name: NOTIF# rows live a
144
+ * month and customer anonymisation does not touch them.
145
+ */
146
+ NotificationTypeEnum["MENTION"] = "MENTION";
133
147
  })(NotificationTypeEnum || (NotificationTypeEnum = {}));
package/dist/return.d.ts CHANGED
@@ -321,6 +321,13 @@ declare global {
321
321
  * NOT refund or unlink the provider payment.
322
322
  */
323
323
  acknowledgeNoProviderRefund?: boolean;
324
+ /**
325
+ * The depósito sellable lines go back to, on a store whose
326
+ * `stockAuthority` is `'depositos'`. Absent: each line's own recorded
327
+ * depósito. Ignored on a store that has not switched. Must name an
328
+ * active depósito (`WAREHOUSE_NOT_FOUND` / `WAREHOUSE_INACTIVE`).
329
+ */
330
+ warehouseId?: string;
324
331
  }
325
332
  interface CreateReturnRequestItem {
326
333
  /** Index into the originating `Order.items`. Duplicates are rejected. */
package/dist/stock.d.ts CHANGED
@@ -85,9 +85,10 @@ declare global {
85
85
  * the level moves in the same transaction and no `MOV#` row is written
86
86
  * for the same units (the api's ADR-0001).
87
87
  *
88
- * ⚠️ OPTIONAL PERMANENTLY. Nothing writes it yet, and rows written before
89
- * it never carry one — absent means "store-wide only", never "the
90
- * primary depósito".
88
+ * ⚠️ OPTIONAL PERMANENTLY. Written only when a level moved with the row
89
+ * (a store running `stockAuthority: 'depositos'`), and rows written
90
+ * before it never carry one — absent means "store-wide only", never
91
+ * "the primary depósito".
91
92
  */
92
93
  warehouseId?: string;
93
94
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.396",
3
+ "version": "1.10.398",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",