@managemint-solutions/entities 1.1.31 → 1.1.33

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.
@@ -2,8 +2,4 @@ export type GetNotificationsDto = {
2
2
  search?: string | null;
3
3
  page: number;
4
4
  page_size: number;
5
- created_after?: string | null;
6
- created_before?: string | null;
7
- status_in?: string | null;
8
- type_in?: string | null;
9
5
  };
@@ -8,8 +8,4 @@ export declare enum NotificationChannel {
8
8
  EMAIL = "email"
9
9
  }
10
10
  export declare enum NotificationType {
11
- INVOICE_PAYMENT_FAILED = "invoice_payment_failed",
12
- CARD_EXPIRING_SOON = "card_expiring_soon",
13
- PAYMENT_RECOVERED = "payment_recovered",
14
- ORGANIZATION_PROVISIONED = "organization_provisioned"
15
11
  }
@@ -16,9 +16,5 @@ var NotificationChannel;
16
16
  ;
17
17
  var NotificationType;
18
18
  (function (NotificationType) {
19
- NotificationType["INVOICE_PAYMENT_FAILED"] = "invoice_payment_failed";
20
- NotificationType["CARD_EXPIRING_SOON"] = "card_expiring_soon";
21
- NotificationType["PAYMENT_RECOVERED"] = "payment_recovered";
22
- NotificationType["ORGANIZATION_PROVISIONED"] = "organization_provisioned";
23
19
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
24
20
  ;
@@ -2,39 +2,31 @@ import type { UUID } from 'crypto';
2
2
  import { UserIdentity } from '../users';
3
3
  import { NotificationChannel, NotificationStatus, NotificationType } from './enum';
4
4
  export * from './enum';
5
+ export type WelcomeEmailTemplateVariables = {
6
+ name: string;
7
+ surname: string;
8
+ email: string;
9
+ };
10
+ export type BillingEmailTemplateVariables = {
11
+ orgName: string;
12
+ invoice_number: string;
13
+ invoice_amount: string;
14
+ invoice_due_date: string;
15
+ };
5
16
  export interface NotificationSummary {
6
17
  mms_id: UUID;
7
18
  created_at: Date;
8
- recipient: UserIdentity | null;
9
- recipient_email: string;
10
19
  notification_type: NotificationType;
11
20
  channel: NotificationChannel;
12
- template_id: string;
13
21
  status: NotificationStatus;
14
- attempts: number;
15
- sent_at: Date | null;
16
- failed_at: Date | null;
17
- failure_reason: string | null;
18
- delivered_at: Date | null;
19
- delivery_delayed_at: Date | null;
20
- /** First-party: stamped when someone views the notification in the portal. */
21
- opened_at: Date | null;
22
- bounced_at: Date | null;
23
- complained_at: Date | null;
24
- delivery_failure_reason: string | null;
25
22
  }
26
- /** The rendered email as the provider sent it - variables already substituted. */
27
- export interface NotificationEmailContent {
28
- subject: string;
29
- html: string | null;
30
- text: string | null;
31
- }
32
- /**
33
- * The detail view behind one notification. Content blocks are per channel:
34
- * `email` is null when the channel is not email or the body could not be
35
- * fetched from the provider; future channels add their own nullable blocks.
36
- */
37
- export interface NotificationEntity extends NotificationSummary {
38
- template_variables: Record<string, string | number>;
39
- email: NotificationEmailContent | null;
23
+ export interface NotificationEntity {
24
+ mms_id: UUID;
25
+ created_at: Date;
26
+ notification_type: NotificationType;
27
+ channel: NotificationChannel;
28
+ status: NotificationStatus;
29
+ html: string;
30
+ template_variables: Record<string, string>;
31
+ created_by?: UserIdentity;
40
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {