feat(integrations): add mock integration (#3505)
This commit is contained in:
1 parent
350a531d32
commit
58d5b14c51
73 files changed
+1049
-156
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import type { Notification } from "../../interfaces/notifications/notification-types";
|
||||
import type { INotificationsIntegration } from "../../interfaces/notifications/notifications-integration";
|
||||
|
||||
export class NotificationsMockService implements INotificationsIntegration {
|
||||
public async getNotificationsAsync(): Promise<Notification[]> {
|
||||
return await Promise.resolve(
|
||||
Array.from({ length: 10 }, (_, index) => NotificationsMockService.createNotification(index)),
|
||||
);
|
||||
}
|
||||
|
||||
private static createNotification(index: number): Notification {
|
||||
return {
|
||||
id: index.toString(),
|
||||
time: new Date(Date.now() - Math.random() * 1000000), // Random time within the next 11 days
|
||||
title: `Notification ${index}`,
|
||||
body: `This is the body of notification ${index}.`,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user