@valentine-efagene/qshelter-common 2.0.154 → 2.0.156
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.
|
@@ -5,8 +5,8 @@ export interface InfrastructureConfig {
|
|
|
5
5
|
dbHost: string;
|
|
6
6
|
dbPort: number;
|
|
7
7
|
databaseSecretArn: string;
|
|
8
|
-
redisHost
|
|
9
|
-
redisPort
|
|
8
|
+
redisHost?: string;
|
|
9
|
+
redisPort?: number;
|
|
10
10
|
rolePoliciesTableName: string;
|
|
11
11
|
s3BucketName: string;
|
|
12
12
|
eventBridgeBusName: string;
|
|
@@ -110,6 +110,10 @@ export declare class ConfigService {
|
|
|
110
110
|
* Helper to extract parameter value from SSM response
|
|
111
111
|
*/
|
|
112
112
|
private getParamValue;
|
|
113
|
+
/**
|
|
114
|
+
* Helper to extract optional parameter value from SSM response
|
|
115
|
+
*/
|
|
116
|
+
private getOptionalParamValue;
|
|
113
117
|
/**
|
|
114
118
|
* Get value from cache if valid
|
|
115
119
|
*/
|
|
@@ -55,6 +55,8 @@ export class ConfigService {
|
|
|
55
55
|
}
|
|
56
56
|
nextToken = response.NextToken;
|
|
57
57
|
} while (nextToken);
|
|
58
|
+
const redisHost = this.getOptionalParamValue(params, `${pathPrefix}redis-host`);
|
|
59
|
+
const redisPortStr = this.getOptionalParamValue(params, `${pathPrefix}redis-port`);
|
|
58
60
|
const config = {
|
|
59
61
|
vpcId: this.getParamValue(params, `${pathPrefix}vpc-id`),
|
|
60
62
|
dbSecurityGroupId: this.getParamValue(params, `${pathPrefix}db-security-group-id`),
|
|
@@ -62,8 +64,8 @@ export class ConfigService {
|
|
|
62
64
|
dbHost: this.getParamValue(params, `${pathPrefix}db-host`),
|
|
63
65
|
dbPort: parseInt(this.getParamValue(params, `${pathPrefix}db-port`), 10),
|
|
64
66
|
databaseSecretArn: this.getParamValue(params, `${pathPrefix}database-secret-arn`),
|
|
65
|
-
redisHost:
|
|
66
|
-
redisPort: parseInt(
|
|
67
|
+
redisHost: redisHost || undefined,
|
|
68
|
+
redisPort: redisPortStr ? parseInt(redisPortStr, 10) : undefined,
|
|
67
69
|
rolePoliciesTableName: this.getParamValue(params, `${pathPrefix}role-policies-table-name`),
|
|
68
70
|
s3BucketName: this.getParamValue(params, `${pathPrefix}s3-bucket-name`),
|
|
69
71
|
eventBridgeBusName: this.getParamValue(params, `${pathPrefix}eventbridge-bus-name`),
|
|
@@ -252,6 +254,13 @@ export class ConfigService {
|
|
|
252
254
|
}
|
|
253
255
|
return param.Value || '';
|
|
254
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Helper to extract optional parameter value from SSM response
|
|
259
|
+
*/
|
|
260
|
+
getOptionalParamValue(params, name) {
|
|
261
|
+
const param = params.find(p => p.Name === name);
|
|
262
|
+
return param?.Value || null;
|
|
263
|
+
}
|
|
255
264
|
/**
|
|
256
265
|
* Get value from cache if valid
|
|
257
266
|
*/
|
|
@@ -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
package/prisma/schema.prisma
CHANGED
|
@@ -1136,17 +1136,17 @@ model Settings {
|
|
|
1136
1136
|
// =============================================================================
|
|
1137
1137
|
|
|
1138
1138
|
model Property {
|
|
1139
|
-
id
|
|
1140
|
-
tenantId
|
|
1141
|
-
tenant
|
|
1142
|
-
userId
|
|
1143
|
-
user
|
|
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?
|
|
1149
|
+
organization Organization? @relation(fields: [organizationId], references: [id], onDelete: SetNull)
|
|
1150
1150
|
|
|
1151
1151
|
title String
|
|
1152
1152
|
category String // SALE, RENT, LEASE
|