rez_core 3.1.131 → 3.1.133
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.
- package/dist/module/integration/service/wrapper.service.js +11 -9
- package/dist/module/integration/service/wrapper.service.js.map +1 -1
- package/dist/module/meta/repository/entity-master.repository.js +1 -1
- package/dist/module/meta/repository/entity-master.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/integration/service/wrapper.service.ts +14 -9
- package/src/module/meta/repository/entity-master.repository.ts +1 -1
package/package.json
CHANGED
|
@@ -148,7 +148,7 @@ export class WrapperService {
|
|
|
148
148
|
async sendCommunicationWrapperService(entity: any, loggedInUser: any) {
|
|
149
149
|
try {
|
|
150
150
|
this.logger.log(
|
|
151
|
-
`
|
|
151
|
+
`sendCommunicationWrapper called. User: ${JSON.stringify(loggedInUser)}, Payload: ${JSON.stringify(entity)}`,
|
|
152
152
|
);
|
|
153
153
|
|
|
154
154
|
const { level_id, level_type, appcode } = loggedInUser;
|
|
@@ -162,7 +162,7 @@ export class WrapperService {
|
|
|
162
162
|
level_id,
|
|
163
163
|
level_type,
|
|
164
164
|
appcode,
|
|
165
|
-
'EMAIL',
|
|
165
|
+
entity.type || 'EMAIL',
|
|
166
166
|
);
|
|
167
167
|
|
|
168
168
|
let effectiveLevelId = level_id;
|
|
@@ -171,22 +171,22 @@ export class WrapperService {
|
|
|
171
171
|
// Step 2: If no configs exist, fall back to ORG-level (1, 'ORG')
|
|
172
172
|
if (!configs || configs.length === 0) {
|
|
173
173
|
this.logger.warn(
|
|
174
|
-
`No
|
|
174
|
+
`No active configs found for ${level_type}:${level_id}, falling back to ORG-level`,
|
|
175
175
|
);
|
|
176
176
|
|
|
177
177
|
configs = await this.integrationService.getActiveConfigs(
|
|
178
178
|
1,
|
|
179
179
|
'ORG',
|
|
180
180
|
appcode,
|
|
181
|
-
'EMAIL',
|
|
181
|
+
entity.type || 'EMAIL',
|
|
182
182
|
);
|
|
183
183
|
effectiveLevelId = 1;
|
|
184
184
|
effectiveLevelType = 'ORG';
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
if (!configs || configs.length === 0) {
|
|
188
|
-
this.logger.error('No active
|
|
189
|
-
throw new Error('No active
|
|
188
|
+
this.logger.error('No active configurations found at any level.');
|
|
189
|
+
throw new Error('No active configurations found.');
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// Step 3: Prepare payload for Integration Service
|
|
@@ -203,8 +203,10 @@ export class WrapperService {
|
|
|
203
203
|
levelType: effectiveLevelType,
|
|
204
204
|
app_code: appcode,
|
|
205
205
|
user_id: loggedInUser.id,
|
|
206
|
-
entity_type:
|
|
206
|
+
entity_type: entity.mapped_entity_type,
|
|
207
207
|
entity_id: entity.mapped_entity_id,
|
|
208
|
+
attachments: entity.attachments,
|
|
209
|
+
mediaUrl: entity.mediaUrl,
|
|
208
210
|
} as any;
|
|
209
211
|
|
|
210
212
|
this.logger.debug(
|
|
@@ -216,7 +218,7 @@ export class WrapperService {
|
|
|
216
218
|
await this.integrationService.sendGenericMessage(mailPayload);
|
|
217
219
|
|
|
218
220
|
this.logger.log(
|
|
219
|
-
`
|
|
221
|
+
`sendCommunicationWrapper SUCCESS. Result: ${JSON.stringify(result)}`,
|
|
220
222
|
);
|
|
221
223
|
|
|
222
224
|
return {
|
|
@@ -224,7 +226,10 @@ export class WrapperService {
|
|
|
224
226
|
data: result,
|
|
225
227
|
};
|
|
226
228
|
} catch (error: any) {
|
|
227
|
-
this.logger.error(
|
|
229
|
+
this.logger.error(
|
|
230
|
+
`sendCommunicationWrapper ERROR: ${error.message}`,
|
|
231
|
+
error.stack,
|
|
232
|
+
);
|
|
228
233
|
return {
|
|
229
234
|
success: false,
|
|
230
235
|
error: error.message,
|
|
@@ -18,7 +18,7 @@ export class EntityMasterRepository {
|
|
|
18
18
|
let data = await this.entityMasterRepository.findOne({ where: { id } });
|
|
19
19
|
if(data){
|
|
20
20
|
let listMasterData = await this.entityMasterRepository.query(`SELECT * FROM cr_list_master_items where id = ?`, [data?.status]);
|
|
21
|
-
data.status=listMasterData?.[0];
|
|
21
|
+
data.status=listMasterData?.[0].name;
|
|
22
22
|
}
|
|
23
23
|
return data;
|
|
24
24
|
}
|