@tolinax/ayoune-interfaces 2026.49.0 → 2026.51.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.
@@ -1,4 +1,6 @@
1
1
  import { IDefaultFields } from "./IDefaultFields";
2
+ import { INotificationAction } from "./INotificationAction";
3
+ import { INotificationAttachment } from "./INotificationAttachment";
2
4
  export interface IChatMessage extends IDefaultFields {
3
5
  _customerID: ObjectId;
4
6
  _clientID?: ObjectId[];
@@ -26,4 +28,31 @@ export interface IChatMessage extends IDefaultFields {
26
28
  viewParams?: object;
27
29
  viewTitle?: string;
28
30
  };
31
+ /**
32
+ * Typed rich-content attachments — reuses the same discriminated union
33
+ * that INotification carries. A task referenced in a chat message
34
+ * renders with the exact same card component as a task in a
35
+ * Tasks.assigned notification (see ChatViewComponent phase-4a
36
+ * integration). Producers can pass bare `{type, _id}` refs; the chat-
37
+ * api send route enriches them server-side (same helper the
38
+ * notification orchestrator uses).
39
+ */
40
+ attachments?: INotificationAttachment[];
41
+ /**
42
+ * Inline action buttons on the message (bot replies, quick-approvals,
43
+ * AI-copilot hand-offs). Same dispatch model as notification actions:
44
+ * link → router, api → /_action bridge, ai-copilot → Copilot panel.
45
+ */
46
+ actions?: INotificationAction[];
47
+ /**
48
+ * Avatar-carrying sender metadata for the bubble header. Mirrors
49
+ * INotificationSender — populated by the chat-api on send from
50
+ * req.user, or supplied explicitly for bot / system messages.
51
+ */
52
+ sender?: {
53
+ _userId?: ObjectId;
54
+ name?: string;
55
+ avatar?: string;
56
+ email?: string;
57
+ };
29
58
  }
@@ -21,7 +21,7 @@
21
21
  * shipping, productionorder, creditnote, internalorder, offer, assignment,
22
22
  * question, snippet, media).
23
23
  */
24
- export type NotificationAttachmentType = "calendarentry" | "task" | "invoice" | "permissionrequest" | "supplierorder" | "document" | "consumer" | "shipping";
24
+ export type NotificationAttachmentType = "calendarentry" | "task" | "invoice" | "permissionrequest" | "supplierorder" | "document" | "consumer" | "shipping" | "contract" | "productionorder" | "creditnote" | "internalorder" | "offer" | "assignment" | "question" | "snippet";
25
25
  /** Shared shape — all previews carry an optional deep-link override and
26
26
  * an optional thumbnail image. The image is used both by the in-app
27
27
  * preview card (rendered as a left-aligned thumbnail beside the metadata)
@@ -174,6 +174,108 @@ export interface IShippingPreview extends INotificationAttachmentBase {
174
174
  name?: string;
175
175
  };
176
176
  }
177
+ export interface IContractPreview extends INotificationAttachmentBase {
178
+ title?: string;
179
+ nbr?: string | number;
180
+ status?: string;
181
+ startDate?: Date | string;
182
+ endDate?: Date | string;
183
+ value?: number;
184
+ currency?: string;
185
+ partner?: {
186
+ _id?: ObjectId;
187
+ name?: string;
188
+ };
189
+ signed?: boolean;
190
+ }
191
+ export interface IProductionOrderPreview extends INotificationAttachmentBase {
192
+ nbr?: string | number;
193
+ title?: string;
194
+ status?: string;
195
+ /** 0-100 percent complete — rendered as a thin progress bar under the title. */
196
+ progress?: number;
197
+ product?: {
198
+ _id?: ObjectId;
199
+ name?: string;
200
+ };
201
+ quantity?: number;
202
+ workCenter?: string;
203
+ dueDate?: Date | string;
204
+ }
205
+ export interface ICreditNotePreview extends INotificationAttachmentBase {
206
+ nbr?: string | number;
207
+ referenceNumber?: string;
208
+ total?: number;
209
+ currency?: string;
210
+ reason?: string;
211
+ status?: string;
212
+ receiver?: {
213
+ _id?: ObjectId;
214
+ name?: string;
215
+ };
216
+ issuedAt?: Date | string;
217
+ }
218
+ export interface IInternalOrderPreview extends INotificationAttachmentBase {
219
+ nbr?: string | number;
220
+ title?: string;
221
+ status?: string;
222
+ requester?: {
223
+ _id?: ObjectId;
224
+ name?: string;
225
+ };
226
+ department?: string;
227
+ total?: number;
228
+ currency?: string;
229
+ urgent?: boolean;
230
+ }
231
+ export interface IOfferPreview extends INotificationAttachmentBase {
232
+ nbr?: string | number;
233
+ title?: string;
234
+ total?: number;
235
+ currency?: string;
236
+ status?: string;
237
+ validUntil?: Date | string;
238
+ receiver?: {
239
+ _id?: ObjectId;
240
+ name?: string;
241
+ };
242
+ sent?: boolean;
243
+ accepted?: boolean;
244
+ declined?: boolean;
245
+ }
246
+ export interface IAssignmentPreview extends INotificationAttachmentBase {
247
+ title?: string;
248
+ nbr?: string | number;
249
+ status?: string;
250
+ assignee?: {
251
+ _id?: ObjectId;
252
+ name?: string;
253
+ avatar?: string;
254
+ };
255
+ due?: Date | string;
256
+ priority?: string;
257
+ type?: string;
258
+ }
259
+ export interface IQuestionPreview extends INotificationAttachmentBase {
260
+ question?: string;
261
+ category?: string;
262
+ askedBy?: {
263
+ _id?: ObjectId;
264
+ name?: string;
265
+ avatar?: string;
266
+ };
267
+ answered?: boolean;
268
+ answerCount?: number;
269
+ askedAt?: Date | string;
270
+ }
271
+ export interface ISnippetPreview extends INotificationAttachmentBase {
272
+ title?: string;
273
+ /** Raw code string — truncated at render time to fit a 3-line preview. */
274
+ code?: string;
275
+ language?: string;
276
+ lineCount?: number;
277
+ fileName?: string;
278
+ }
177
279
  export type INotificationAttachment = {
178
280
  type: "calendarentry";
179
281
  preview: ICalendarEntryPreview;
@@ -198,6 +300,30 @@ export type INotificationAttachment = {
198
300
  } | {
199
301
  type: "shipping";
200
302
  preview: IShippingPreview;
303
+ } | {
304
+ type: "contract";
305
+ preview: IContractPreview;
306
+ } | {
307
+ type: "productionorder";
308
+ preview: IProductionOrderPreview;
309
+ } | {
310
+ type: "creditnote";
311
+ preview: ICreditNotePreview;
312
+ } | {
313
+ type: "internalorder";
314
+ preview: IInternalOrderPreview;
315
+ } | {
316
+ type: "offer";
317
+ preview: IOfferPreview;
318
+ } | {
319
+ type: "assignment";
320
+ preview: IAssignmentPreview;
321
+ } | {
322
+ type: "question";
323
+ preview: IQuestionPreview;
324
+ } | {
325
+ type: "snippet";
326
+ preview: ISnippetPreview;
201
327
  };
202
328
  /** Producer-side shape — accepts either a bare reference (orchestrator will
203
329
  * enrich) or a fully-populated attachment. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolinax/ayoune-interfaces",
3
- "version": "2026.49.0",
3
+ "version": "2026.51.0",
4
4
  "description": "Houses TypeScript interfaces for aYOUne",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -98,7 +98,9 @@
98
98
  }
99
99
  }
100
100
  },
101
- "dependencies": {},
101
+ "dependencies": {
102
+ "@tolinax/ayoune-interfaces": "^2026.50.0"
103
+ },
102
104
  "devDependencies": {
103
105
  "@release-it/conventional-changelog": "^5.0.0",
104
106
  "cpx": "^1.5.0",