@valentine-efagene/qshelter-common 2.0.154 → 2.0.155

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.
@@ -33,9 +33,18 @@ export declare class EventPublisher {
33
33
  * Convenience method for publishing push notifications
34
34
  */
35
35
  publishPush<T>(type: NotificationType, payload: T, meta?: Partial<NotificationMeta>): Promise<string>;
36
+ /**
37
+ * Destroy the SNS client to allow process to exit cleanly (for tests)
38
+ */
39
+ destroy(): void;
36
40
  }
37
41
  /**
38
42
  * Get or create an EventPublisher for a service
39
43
  */
40
44
  export declare function getEventPublisher(serviceName: string, config?: EventPublisherConfig): EventPublisher;
45
+ /**
46
+ * Destroy all EventPublisher instances and their SNS clients.
47
+ * Call this in test teardown to allow Jest to exit cleanly.
48
+ */
49
+ export declare function destroyAllEventPublishers(): void;
41
50
  export {};
@@ -97,6 +97,12 @@ export class EventPublisher {
97
97
  async publishPush(type, payload, meta) {
98
98
  return this.publish(type, NotificationChannel.PUSH, payload, meta);
99
99
  }
100
+ /**
101
+ * Destroy the SNS client to allow process to exit cleanly (for tests)
102
+ */
103
+ destroy() {
104
+ this.snsClient.destroy();
105
+ }
100
106
  }
101
107
  // Singleton instances per service
102
108
  const publisherInstances = new Map();
@@ -109,3 +115,13 @@ export function getEventPublisher(serviceName, config) {
109
115
  }
110
116
  return publisherInstances.get(serviceName);
111
117
  }
118
+ /**
119
+ * Destroy all EventPublisher instances and their SNS clients.
120
+ * Call this in test teardown to allow Jest to exit cleanly.
121
+ */
122
+ export function destroyAllEventPublishers() {
123
+ for (const publisher of publisherInstances.values()) {
124
+ publisher.destroy();
125
+ }
126
+ publisherInstances.clear();
127
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valentine-efagene/qshelter-common",
3
- "version": "2.0.154",
3
+ "version": "2.0.155",
4
4
  "description": "Shared database schemas and utilities for QShelter services",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -1136,17 +1136,17 @@ model Settings {
1136
1136
  // =============================================================================
1137
1137
 
1138
1138
  model Property {
1139
- id String @id @default(cuid())
1140
- tenantId String
1141
- tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
1142
- userId String
1143
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1139
+ id String @id @default(cuid())
1140
+ tenantId String
1141
+ tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
1142
+ userId String
1143
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
1144
1144
 
1145
1145
  // Optional organization ownership
1146
1146
  // If set, any member of this organization with DEVELOPER role can manage the property
1147
1147
  // If null, only the userId owner can manage it (individual seller)
1148
1148
  organizationId String?
1149
- organization Organization? @relation(fields: [organizationId], references: [id], onDelete: SetNull)
1149
+ organization Organization? @relation(fields: [organizationId], references: [id], onDelete: SetNull)
1150
1150
 
1151
1151
  title String
1152
1152
  category String // SALE, RENT, LEASE