@blackcode_sa/metaestetics-api 1.12.40 โ 1.12.42
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/admin/index.d.mts +12 -6
- package/dist/admin/index.d.ts +12 -6
- package/dist/backoffice/index.d.mts +182 -18
- package/dist/backoffice/index.d.ts +182 -18
- package/dist/backoffice/index.js +302 -14
- package/dist/backoffice/index.mjs +318 -27
- package/dist/index.d.mts +174 -10
- package/dist/index.d.ts +174 -10
- package/dist/index.js +329 -25
- package/dist/index.mjs +340 -33
- package/package.json +1 -1
- package/src/backoffice/services/migrate-products.ts +116 -0
- package/src/backoffice/services/product.service.ts +216 -18
- package/src/backoffice/services/technology.service.ts +169 -0
- package/src/backoffice/types/product.types.ts +116 -6
- package/src/services/appointment/appointment.service.ts +29 -5
|
@@ -412,20 +412,44 @@ export class AppointmentService extends BaseService {
|
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// AUTO-CLEANUP: Remove invalid recommendedProcedures with empty notes BEFORE validation
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
415
|
+
console.log(
|
|
416
|
+
'[APPOINTMENT_SERVICE] ๐ BEFORE CLEANUP - recommendedProcedures:',
|
|
417
|
+
JSON.stringify(data.metadata?.recommendedProcedures, null, 2),
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
if (
|
|
421
|
+
data.metadata?.recommendedProcedures &&
|
|
422
|
+
Array.isArray(data.metadata.recommendedProcedures)
|
|
423
|
+
) {
|
|
424
|
+
const validRecommendations = data.metadata.recommendedProcedures.filter((rec: any) => {
|
|
425
|
+
const isValid = rec.note && typeof rec.note === 'string' && rec.note.trim().length > 0;
|
|
426
|
+
if (!isValid) {
|
|
427
|
+
console.log('[APPOINTMENT_SERVICE] โ INVALID recommendation found:', rec);
|
|
428
|
+
}
|
|
429
|
+
return isValid;
|
|
430
|
+
});
|
|
431
|
+
|
|
419
432
|
if (validRecommendations.length !== data.metadata.recommendedProcedures.length) {
|
|
420
433
|
console.log(
|
|
421
|
-
`[APPOINTMENT_SERVICE] Removing ${
|
|
434
|
+
`[APPOINTMENT_SERVICE] ๐งน Removing ${
|
|
435
|
+
data.metadata.recommendedProcedures.length - validRecommendations.length
|
|
436
|
+
} invalid recommended procedures with empty notes`,
|
|
422
437
|
);
|
|
423
438
|
data.metadata.recommendedProcedures = validRecommendations;
|
|
439
|
+
} else {
|
|
440
|
+
console.log('[APPOINTMENT_SERVICE] โ
All recommendedProcedures are valid');
|
|
424
441
|
}
|
|
425
442
|
}
|
|
426
443
|
|
|
444
|
+
console.log(
|
|
445
|
+
'[APPOINTMENT_SERVICE] ๐ AFTER CLEANUP - recommendedProcedures:',
|
|
446
|
+
JSON.stringify(data.metadata?.recommendedProcedures, null, 2),
|
|
447
|
+
);
|
|
448
|
+
|
|
427
449
|
// Validate input data
|
|
450
|
+
console.log('[APPOINTMENT_SERVICE] ๐ Starting Zod validation...');
|
|
428
451
|
const validatedData = await updateAppointmentSchema.parseAsync(data);
|
|
452
|
+
console.log('[APPOINTMENT_SERVICE] โ
Zod validation passed!');
|
|
429
453
|
|
|
430
454
|
// Update the appointment using the utility function
|
|
431
455
|
const updatedAppointment = await updateAppointmentUtil(this.db, appointmentId, validatedData);
|