plenna_utilities 1.7.1 → 1.8.1
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.
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatIsoDateToSpanish = exports.getDifferenceInMinutes = exports.formatHour = exports.formatDate = void 0;
|
|
4
4
|
const formatDate = (isoDate) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const [year, month, day] = isoDate.split('-').map(Number);
|
|
6
|
+
const fecha = new Date(year, month - 1, day);
|
|
7
|
+
return fecha.toLocaleDateString('es-MX', {
|
|
7
8
|
day: 'numeric',
|
|
8
9
|
month: 'long',
|
|
9
10
|
year: 'numeric'
|
|
@@ -14,11 +15,15 @@ const formatHour = (time24) => {
|
|
|
14
15
|
const [hours, minutes, seconds] = time24.split(':').map(Number);
|
|
15
16
|
const date = new Date();
|
|
16
17
|
date.setHours(hours, minutes, seconds);
|
|
17
|
-
|
|
18
|
+
let formatted = date.toLocaleTimeString('es-MX', {
|
|
18
19
|
hour: 'numeric',
|
|
19
20
|
minute: '2-digit',
|
|
20
21
|
hour12: true
|
|
21
22
|
});
|
|
23
|
+
if (formatted.startsWith('0:')) {
|
|
24
|
+
formatted = formatted.replace('0:', '12:');
|
|
25
|
+
}
|
|
26
|
+
return formatted;
|
|
22
27
|
};
|
|
23
28
|
exports.formatHour = formatHour;
|
|
24
29
|
const getDifferenceInMinutes = (startTime, endTime) => {
|
|
@@ -34,10 +39,11 @@ const getDifferenceInMinutes = (startTime, endTime) => {
|
|
|
34
39
|
exports.getDifferenceInMinutes = getDifferenceInMinutes;
|
|
35
40
|
const formatIsoDateToSpanish = (isoString) => {
|
|
36
41
|
const date = new Date(isoString);
|
|
37
|
-
return date.toLocaleDateString('es-
|
|
42
|
+
return date.toLocaleDateString('es-MX', {
|
|
38
43
|
day: 'numeric',
|
|
39
44
|
month: 'long',
|
|
40
|
-
year: 'numeric'
|
|
45
|
+
year: 'numeric',
|
|
46
|
+
timeZone: 'America/Mexico_City'
|
|
41
47
|
});
|
|
42
48
|
};
|
|
43
49
|
exports.formatIsoDateToSpanish = formatIsoDateToSpanish;
|
|
@@ -30,3 +30,93 @@ templates:
|
|
|
30
30
|
elements:
|
|
31
31
|
- type: mrkdwn
|
|
32
32
|
text: 'Generado automáticamente por el sistema de validación de agendas.'
|
|
33
|
+
|
|
34
|
+
noAvailableDoctorsSchedule:
|
|
35
|
+
channel: 'C09E6K166KH'
|
|
36
|
+
text: '🚨 No hay disponibilidad en el calendario de doctores'
|
|
37
|
+
blocks:
|
|
38
|
+
- type: header
|
|
39
|
+
text:
|
|
40
|
+
type: plain_text
|
|
41
|
+
text: '🚫 La px no encontró disponibilidad en calendario'
|
|
42
|
+
emoji: true
|
|
43
|
+
- type: divider
|
|
44
|
+
- type: section
|
|
45
|
+
fields:
|
|
46
|
+
- type: mrkdwn
|
|
47
|
+
text: "*Servicio:*\n{serviceTitle}"
|
|
48
|
+
- type: mrkdwn
|
|
49
|
+
text: "*Modalidad:*\n{serviceModality}"
|
|
50
|
+
- type: mrkdwn
|
|
51
|
+
text: "*Especialidad:*\n{serviceSpecialty}"
|
|
52
|
+
- type: mrkdwn
|
|
53
|
+
text: "*Plenna Id:*\n{servicePlennaId}"
|
|
54
|
+
- type: divider
|
|
55
|
+
- type: section
|
|
56
|
+
fields:
|
|
57
|
+
- type: mrkdwn
|
|
58
|
+
text: "*Especialista:*\n{doctorName}"
|
|
59
|
+
- type: mrkdwn
|
|
60
|
+
text: "*Correo:*\n{doctorEmail}"
|
|
61
|
+
- type: mrkdwn
|
|
62
|
+
text: "*Clínica:*\n{clinicName}"
|
|
63
|
+
- type: mrkdwn
|
|
64
|
+
text: "*Última fecha de busqueda:*\n{lastDateSearch}"
|
|
65
|
+
- type: divider
|
|
66
|
+
- type: section
|
|
67
|
+
fields:
|
|
68
|
+
- type: mrkdwn
|
|
69
|
+
text: "*Paciente:*\n{patientName}"
|
|
70
|
+
- type: mrkdwn
|
|
71
|
+
text: "*Correo de px:*\n{patientEmail}"
|
|
72
|
+
- type: mrkdwn
|
|
73
|
+
text: "*Teléfono de paciente:*\n{patientPhone}"
|
|
74
|
+
- type: divider
|
|
75
|
+
- type: section
|
|
76
|
+
text:
|
|
77
|
+
type: plain_text
|
|
78
|
+
emoji: true
|
|
79
|
+
text: '🕵️ Verifica que hayan horarios configurados en Huli para esta doctora.'
|
|
80
|
+
|
|
81
|
+
patientNeedsACloserAppointment:
|
|
82
|
+
channel: 'C09ELN5A92S'
|
|
83
|
+
text: '🕒 La paciente busca una cita antes de la programada'
|
|
84
|
+
blocks:
|
|
85
|
+
- type: header
|
|
86
|
+
text:
|
|
87
|
+
type: plain_text
|
|
88
|
+
text: '🕒 La paciente busca una cita antes de la programada'
|
|
89
|
+
emoji: true
|
|
90
|
+
- type: divider
|
|
91
|
+
- type: section
|
|
92
|
+
fields:
|
|
93
|
+
- type: mrkdwn
|
|
94
|
+
text: "*Paciente:*\n{patientName}"
|
|
95
|
+
- type: mrkdwn
|
|
96
|
+
text: "*Correo de px:*\n{patientEmail}"
|
|
97
|
+
- type: mrkdwn
|
|
98
|
+
text: "*Teléfono de paciente:*\n{patientPhone}"
|
|
99
|
+
- type: divider
|
|
100
|
+
- type: section
|
|
101
|
+
fields:
|
|
102
|
+
- type: mrkdwn
|
|
103
|
+
text: "*Servicio:*\n{serviceTitle}"
|
|
104
|
+
- type: mrkdwn
|
|
105
|
+
text: "*Modalidad:*\n{serviceModality}"
|
|
106
|
+
- type: mrkdwn
|
|
107
|
+
text: "*Especialidad:*\n{serviceSpecialty}"
|
|
108
|
+
- type: mrkdwn
|
|
109
|
+
text: "*Plenna Id:*\n{servicePlennaId}"
|
|
110
|
+
- type: divider
|
|
111
|
+
- type: section
|
|
112
|
+
fields:
|
|
113
|
+
- type: mrkdwn
|
|
114
|
+
text: "*Especialista de la cita:*\n{doctorName}"
|
|
115
|
+
- type: mrkdwn
|
|
116
|
+
text: "*Correo de la especialista:*\n{doctorEmail}"
|
|
117
|
+
- type: mrkdwn
|
|
118
|
+
text: "*Clínica de la cita:*\n{clinicName}"
|
|
119
|
+
- type: mrkdwn
|
|
120
|
+
text: "*Fecha de la cita:*\n{dateAppointment}"
|
|
121
|
+
- type: mrkdwn
|
|
122
|
+
text: "*Hora de la cita:*\n{hourAppointment}"
|