rez_core 5.0.270 → 5.0.272
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/enterprise/service/organization.service.d.ts +1 -1
- package/dist/module/enterprise/service/organization.service.js +2 -4
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/module/integration/service/integration.service.d.ts +1 -0
- package/dist/module/integration/service/integration.service.js +12 -1
- package/dist/module/integration/service/integration.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/service/organization.service.ts +6 -4
- package/src/module/integration/service/integration.service.ts +19 -1
package/package.json
CHANGED
|
@@ -114,11 +114,13 @@ export class OrganizationService {
|
|
|
114
114
|
async update(
|
|
115
115
|
id: number,
|
|
116
116
|
organizationDto: Partial<OrganizationData>,
|
|
117
|
-
manager?: EntityManager,
|
|
117
|
+
// manager?: EntityManager,
|
|
118
118
|
): Promise<OrganizationData | null> {
|
|
119
|
-
const repo = manager
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
// const repo = manager
|
|
120
|
+
// ? manager.getRepository(OrganizationData)
|
|
121
|
+
// : this.organizationRepository;
|
|
122
|
+
|
|
123
|
+
const repo = this.organizationRepository;
|
|
122
124
|
|
|
123
125
|
await repo.update(id, organizationDto);
|
|
124
126
|
return await repo.findOne({ where: { id } });
|
|
@@ -1253,15 +1253,33 @@ export class IntegrationService {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
|
|
1256
|
+
private formatDate(date: Date): string {
|
|
1257
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
1258
|
+
const month = date.toLocaleString('en-GB', { month: 'short' });
|
|
1259
|
+
const year = date.getFullYear();
|
|
1260
|
+
|
|
1261
|
+
return `${day}-${month},${year}`;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1256
1264
|
async scheduleMessage(
|
|
1257
1265
|
scheduledDto: any,
|
|
1258
1266
|
): Promise<{ scheduled: boolean; scheduleId?: string }> {
|
|
1259
1267
|
// For now, return a placeholder. In production, integrate with a job queue like Bull or Agenda
|
|
1268
|
+
|
|
1269
|
+
const formattedDate = this.formatDate(
|
|
1270
|
+
scheduledDto?.scheduleFor
|
|
1271
|
+
? new Date(scheduledDto.scheduleFor)
|
|
1272
|
+
: new Date(),
|
|
1273
|
+
);
|
|
1274
|
+
|
|
1260
1275
|
this.logger.log(`Message scheduled for ${scheduledDto.scheduleFor}`);
|
|
1261
1276
|
|
|
1262
1277
|
return {
|
|
1263
1278
|
scheduled: true,
|
|
1264
|
-
scheduleId: `sched_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`,
|
|
1279
|
+
// scheduleId: `sched_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`,
|
|
1280
|
+
scheduleId: `sched_${formattedDate}_${Math.random()
|
|
1281
|
+
.toString(36)
|
|
1282
|
+
.substring(2, 11)}`,
|
|
1265
1283
|
};
|
|
1266
1284
|
}
|
|
1267
1285
|
|