@tolinax/ayoune-interfaces 2026.47.0 → 2026.49.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.
|
@@ -31,7 +31,49 @@ export interface INotification extends IDefaultFields {
|
|
|
31
31
|
attachments?: INotificationAttachment[];
|
|
32
32
|
/**
|
|
33
33
|
* Action buttons rendered under the notification (1-3 typical), and —
|
|
34
|
-
* where the OS supports it — as native Web-Push action buttons (first
|
|
34
|
+
* where the OS supports it — as native Web-Push action buttons (first
|
|
35
|
+
* three on modern Android Chrome / Edge / Samsung Internet).
|
|
35
36
|
*/
|
|
36
37
|
actions?: INotificationAction[];
|
|
38
|
+
/**
|
|
39
|
+
* Hero image shown in the expanded native push notification (Android).
|
|
40
|
+
* Rendered as a 16:9 banner above the body. Great for order thumbnails,
|
|
41
|
+
* product photos, meeting cover images, customer logos, illustrative
|
|
42
|
+
* GIFs (animated GIFs render as stills on most push stacks — keep
|
|
43
|
+
* static / use first-frame if animated).
|
|
44
|
+
*
|
|
45
|
+
* When absent, the adapter falls back to the first `attachments[*].preview.image`
|
|
46
|
+
* so entity-bearing notifications automatically get a thumbnail.
|
|
47
|
+
*/
|
|
48
|
+
image?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Monochrome status-bar badge (Android). 24x24 SVG or PNG. Customer-
|
|
51
|
+
* branding goes here — renders as the tiny icon next to the clock.
|
|
52
|
+
* Falls back to the platform-default badge when absent.
|
|
53
|
+
*/
|
|
54
|
+
badge?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Grouping / dedupe key. Two notifications with the same `tag` replace
|
|
57
|
+
* each other on the device instead of stacking. Used for live-update
|
|
58
|
+
* flows (order status, approval decisions, running job progress) where
|
|
59
|
+
* only the latest state should be visible.
|
|
60
|
+
*
|
|
61
|
+
* When absent, the adapter auto-derives `${entityType}:${entity._id || Date.now()}`
|
|
62
|
+
* so repeated notifications about the same entity naturally group.
|
|
63
|
+
*/
|
|
64
|
+
tag?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Re-alert (sound + vibration) when a notification with the same `tag`
|
|
67
|
+
* arrives. Default true — users expect "your order is now OUT FOR
|
|
68
|
+
* DELIVERY" to buzz even if the previous "being prepared" is still on
|
|
69
|
+
* screen. Set false for silent status updates (progress bars, typing
|
|
70
|
+
* indicators).
|
|
71
|
+
*/
|
|
72
|
+
renotify?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Keep the notification on screen until the user explicitly dismisses
|
|
75
|
+
* it (Android > 7). Use for approval requests, critical alerts, or
|
|
76
|
+
* anything that must not scroll out of awareness. Default false.
|
|
77
|
+
*/
|
|
78
|
+
requireInteraction?: boolean;
|
|
37
79
|
}
|
|
@@ -21,8 +21,12 @@
|
|
|
21
21
|
* shipping, productionorder, creditnote, internalorder, offer, assignment,
|
|
22
22
|
* question, snippet, media).
|
|
23
23
|
*/
|
|
24
|
-
export type NotificationAttachmentType = "calendarentry" | "task" | "invoice" | "permissionrequest" | "supplierorder";
|
|
25
|
-
/** Shared shape — all previews carry an optional deep-link override
|
|
24
|
+
export type NotificationAttachmentType = "calendarentry" | "task" | "invoice" | "permissionrequest" | "supplierorder" | "document" | "consumer" | "shipping";
|
|
25
|
+
/** Shared shape — all previews carry an optional deep-link override and
|
|
26
|
+
* an optional thumbnail image. The image is used both by the in-app
|
|
27
|
+
* preview card (rendered as a left-aligned thumbnail beside the metadata)
|
|
28
|
+
* and by the native push adapter (the first attachment with an image
|
|
29
|
+
* becomes the notification's hero banner on Android). */
|
|
26
30
|
interface INotificationAttachmentBase {
|
|
27
31
|
/** Reference to the source entity (the document `_id`). Required for
|
|
28
32
|
* enrichment and deep-linking. */
|
|
@@ -30,6 +34,10 @@ interface INotificationAttachmentBase {
|
|
|
30
34
|
/** Optional router path used when the user taps the preview card.
|
|
31
35
|
* When absent, the consumer falls back to `/{type}/{_id}`. */
|
|
32
36
|
href?: string;
|
|
37
|
+
/** Optional image URL — product thumbnail, supplier logo, meeting
|
|
38
|
+
* cover, customer branding. Absolute URL (served from media CDN or
|
|
39
|
+
* customer-meta). */
|
|
40
|
+
image?: string;
|
|
33
41
|
}
|
|
34
42
|
export interface ICalendarEntryPreview extends INotificationAttachmentBase {
|
|
35
43
|
summary?: string;
|
|
@@ -115,6 +123,57 @@ export interface ISupplierOrderPreview extends INotificationAttachmentBase {
|
|
|
115
123
|
};
|
|
116
124
|
expectedDelivery?: Date | string;
|
|
117
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
|
+
}
|
|
118
177
|
export type INotificationAttachment = {
|
|
119
178
|
type: "calendarentry";
|
|
120
179
|
preview: ICalendarEntryPreview;
|
|
@@ -130,6 +189,15 @@ export type INotificationAttachment = {
|
|
|
130
189
|
} | {
|
|
131
190
|
type: "supplierorder";
|
|
132
191
|
preview: ISupplierOrderPreview;
|
|
192
|
+
} | {
|
|
193
|
+
type: "document";
|
|
194
|
+
preview: IDocumentPreview;
|
|
195
|
+
} | {
|
|
196
|
+
type: "consumer";
|
|
197
|
+
preview: IConsumerPreview;
|
|
198
|
+
} | {
|
|
199
|
+
type: "shipping";
|
|
200
|
+
preview: IShippingPreview;
|
|
133
201
|
};
|
|
134
202
|
/** Producer-side shape — accepts either a bare reference (orchestrator will
|
|
135
203
|
* enrich) or a fully-populated attachment. */
|