@tolinax/ayoune-interfaces 2026.48.0 → 2026.50.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.
@@ -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";
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)
@@ -123,6 +123,159 @@ export interface ISupplierOrderPreview extends INotificationAttachmentBase {
123
123
  };
124
124
  expectedDelivery?: Date | string;
125
125
  }
126
+ export interface IDocumentPreview extends INotificationAttachmentBase {
127
+ title?: string;
128
+ filename?: string;
129
+ /** Mime type — used to choose the leading icon (pdf / image / audio / video / generic). */
130
+ contentType?: string;
131
+ /** Size in bytes — rendered as a human chip `2.3 MB`. */
132
+ size?: number;
133
+ /** Direct download URL (served by the media / uploads service). */
134
+ url?: string;
135
+ /** Author / uploader — rendered small. */
136
+ uploadedBy?: {
137
+ _id?: ObjectId;
138
+ name?: string;
139
+ };
140
+ }
141
+ export interface IConsumerPreview extends INotificationAttachmentBase {
142
+ /** Short reference label (sr-number in the legacy system). */
143
+ sr?: string;
144
+ /** Display name — individual OR company. */
145
+ name?: string;
146
+ /** Company-line (used when `name` is the person). */
147
+ company?: string;
148
+ email?: string;
149
+ phone?: string;
150
+ /** Optional avatar / logo URL — separate from the generic `image`
151
+ * base field which the card uses as a 40x40 thumbnail anyway. */
152
+ avatar?: string;
153
+ /** Lifecycle status — "lead", "customer", "archived", etc. */
154
+ status?: string;
155
+ /** Number of open items (tickets/tasks/deals) — rendered as a chip. */
156
+ openItemsCount?: number;
157
+ }
158
+ export interface IShippingPreview extends INotificationAttachmentBase {
159
+ /** Shipping identifier — internal and/or carrier tracking number. */
160
+ nbr?: string | number;
161
+ trackingNumber?: string;
162
+ /** Carrier slug or name — DHL, UPS, FedEx, etc. */
163
+ carrier?: string;
164
+ /** Lifecycle status — created / picked / in-transit / delivered / exception. */
165
+ status?: string;
166
+ destinationCity?: string;
167
+ destinationCountry?: string;
168
+ /** Expected / actual delivery timestamps. */
169
+ expectedDelivery?: Date | string;
170
+ deliveredAt?: Date | string;
171
+ /** Linked receiver (Consumer ref) — rendered as the recipient chip. */
172
+ receiver?: {
173
+ _id?: ObjectId;
174
+ name?: string;
175
+ };
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
+ }
126
279
  export type INotificationAttachment = {
127
280
  type: "calendarentry";
128
281
  preview: ICalendarEntryPreview;
@@ -138,6 +291,39 @@ export type INotificationAttachment = {
138
291
  } | {
139
292
  type: "supplierorder";
140
293
  preview: ISupplierOrderPreview;
294
+ } | {
295
+ type: "document";
296
+ preview: IDocumentPreview;
297
+ } | {
298
+ type: "consumer";
299
+ preview: IConsumerPreview;
300
+ } | {
301
+ type: "shipping";
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;
141
327
  };
142
328
  /** Producer-side shape — accepts either a bare reference (orchestrator will
143
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.48.0",
3
+ "version": "2026.50.0",
4
4
  "description": "Houses TypeScript interfaces for aYOUne",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",