@blackcode_sa/metaestetics-api 1.14.63 → 1.14.65
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.js +144 -220
- package/dist/admin/index.mjs +144 -220
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
- package/src/admin/mailing/appointment/appointment.mailing.service.ts +144 -220
- package/src/services/appointment/appointment.service.ts +14 -2
|
@@ -17,195 +17,139 @@ const patientAppointmentConfirmedTemplate = `
|
|
|
17
17
|
<meta charset="UTF-8">
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
19
19
|
<title>Appointment Confirmed</title>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
max-width: 600px;
|
|
30
|
-
margin: 0 auto;
|
|
31
|
-
background: #ffffff;
|
|
32
|
-
border-radius: 20px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
|
35
|
-
margin-top: 40px;
|
|
36
|
-
margin-bottom: 40px;
|
|
37
|
-
}
|
|
38
|
-
.header {
|
|
39
|
-
background: linear-gradient(135deg, #a48a76 0%, #67574A 100%);
|
|
40
|
-
padding: 40px 30px;
|
|
41
|
-
text-align: center;
|
|
42
|
-
color: white;
|
|
43
|
-
}
|
|
44
|
-
.header h1 {
|
|
45
|
-
margin: 0;
|
|
46
|
-
font-size: 28px;
|
|
47
|
-
font-weight: 300;
|
|
48
|
-
letter-spacing: 1px;
|
|
49
|
-
}
|
|
50
|
-
.header .subtitle {
|
|
51
|
-
margin: 10px 0 0 0;
|
|
52
|
-
font-size: 16px;
|
|
53
|
-
opacity: 0.9;
|
|
54
|
-
font-weight: 300;
|
|
55
|
-
}
|
|
56
|
-
.content {
|
|
57
|
-
padding: 40px 30px;
|
|
58
|
-
}
|
|
59
|
-
.greeting {
|
|
60
|
-
font-size: 18px;
|
|
61
|
-
color: #333;
|
|
62
|
-
margin-bottom: 25px;
|
|
63
|
-
font-weight: 400;
|
|
64
|
-
}
|
|
65
|
-
.appointment-card {
|
|
66
|
-
background: linear-gradient(135deg, #f8f6f5 0%, #f5f3f2 100%);
|
|
67
|
-
border-radius: 15px;
|
|
68
|
-
padding: 30px;
|
|
69
|
-
margin: 25px 0;
|
|
70
|
-
border-left: 5px solid #a48a76;
|
|
71
|
-
}
|
|
72
|
-
.appointment-title {
|
|
73
|
-
font-size: 20px;
|
|
74
|
-
color: #a48a76;
|
|
75
|
-
margin-bottom: 20px;
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
}
|
|
78
|
-
.appointment-details {
|
|
79
|
-
display: grid;
|
|
80
|
-
gap: 15px;
|
|
81
|
-
}
|
|
82
|
-
.detail-row {
|
|
83
|
-
display: flex;
|
|
84
|
-
align-items: center;
|
|
85
|
-
padding: 8px 0;
|
|
86
|
-
}
|
|
87
|
-
.detail-label {
|
|
88
|
-
font-weight: 600;
|
|
89
|
-
color: #555;
|
|
90
|
-
min-width: 120px;
|
|
91
|
-
font-size: 14px;
|
|
92
|
-
}
|
|
93
|
-
.detail-value {
|
|
94
|
-
color: #333;
|
|
95
|
-
font-size: 16px;
|
|
96
|
-
font-weight: 500;
|
|
97
|
-
}
|
|
98
|
-
.procedure-name {
|
|
99
|
-
color: #67574A;
|
|
100
|
-
font-weight: 600;
|
|
101
|
-
}
|
|
102
|
-
.clinic-name {
|
|
103
|
-
color: #a48a76;
|
|
104
|
-
font-weight: 600;
|
|
105
|
-
}
|
|
106
|
-
.success-icon {
|
|
107
|
-
text-align: center;
|
|
108
|
-
margin: 20px 0;
|
|
109
|
-
font-size: 48px;
|
|
110
|
-
}
|
|
111
|
-
.footer {
|
|
112
|
-
background: #f8f9fa;
|
|
113
|
-
padding: 25px 30px;
|
|
114
|
-
text-align: center;
|
|
115
|
-
color: #666;
|
|
116
|
-
font-size: 14px;
|
|
117
|
-
border-top: 1px solid #eee;
|
|
118
|
-
}
|
|
119
|
-
.logo {
|
|
120
|
-
font-size: 24px;
|
|
121
|
-
font-weight: 700;
|
|
122
|
-
color: white;
|
|
123
|
-
margin-bottom: 5px;
|
|
124
|
-
}
|
|
125
|
-
.divider {
|
|
126
|
-
height: 2px;
|
|
127
|
-
background: linear-gradient(90deg, #a48a76, #67574A);
|
|
128
|
-
margin: 25px 0;
|
|
129
|
-
border-radius: 1px;
|
|
130
|
-
}
|
|
131
|
-
.thank-you {
|
|
132
|
-
background: linear-gradient(135deg, #f0ede8 0%, #ebe6e0 100%);
|
|
133
|
-
border-radius: 15px;
|
|
134
|
-
padding: 25px;
|
|
135
|
-
margin: 25px 0;
|
|
136
|
-
text-align: center;
|
|
137
|
-
border-left: 5px solid #4CAF50;
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
20
|
+
<!--[if mso]>
|
|
21
|
+
<noscript>
|
|
22
|
+
<xml>
|
|
23
|
+
<o:OfficeDocumentSettings>
|
|
24
|
+
<o:PixelsPerInch>96</o:PixelsPerInch>
|
|
25
|
+
</o:OfficeDocumentSettings>
|
|
26
|
+
</xml>
|
|
27
|
+
</noscript>
|
|
28
|
+
<![endif]-->
|
|
140
29
|
</head>
|
|
141
|
-
<body>
|
|
142
|
-
<
|
|
143
|
-
<
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
30
|
+
<body style="margin: 0; padding: 0; background-color: #f8f6f5; font-family: Georgia, 'Times New Roman', serif;">
|
|
31
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #f8f6f5;">
|
|
32
|
+
<tr>
|
|
33
|
+
<td align="center" style="padding: 40px 20px;">
|
|
34
|
+
<table role="presentation" width="600" cellspacing="0" cellpadding="0" border="0" style="max-width: 600px; background-color: #ffffff; border-radius: 2px; box-shadow: 0 1px 3px rgba(103, 87, 74, 0.08);">
|
|
35
|
+
|
|
36
|
+
<!-- Header -->
|
|
37
|
+
<tr>
|
|
38
|
+
<td style="padding: 48px 48px 32px 48px; border-bottom: 1px solid #f0ebe6;">
|
|
39
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
|
|
40
|
+
<tr>
|
|
41
|
+
<td>
|
|
42
|
+
<h1 style="margin: 0; font-size: 24px; font-weight: 400; color: #67574A; letter-spacing: 2px; text-transform: uppercase; font-family: Georgia, 'Times New Roman', serif;">MetaEstetics</h1>
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
45
|
+
</table>
|
|
46
|
+
</td>
|
|
47
|
+
</tr>
|
|
48
|
+
|
|
49
|
+
<!-- Confirmed Banner -->
|
|
50
|
+
<tr>
|
|
51
|
+
<td style="padding: 0;">
|
|
52
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="background-color: #00BB38;">
|
|
53
|
+
<tr>
|
|
54
|
+
<td style="padding: 20px 48px;">
|
|
55
|
+
<p style="margin: 0; font-size: 13px; font-weight: 600; color: #ffffff; letter-spacing: 1.5px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Appointment Confirmed</p>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</table>
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
|
|
62
|
+
<!-- Main Content -->
|
|
63
|
+
<tr>
|
|
64
|
+
<td style="padding: 40px 48px;">
|
|
65
|
+
|
|
66
|
+
<!-- Greeting -->
|
|
67
|
+
<p style="margin: 0 0 24px 0; font-size: 17px; color: #333333; line-height: 1.6; font-family: Georgia, 'Times New Roman', serif;">
|
|
68
|
+
Dear {{patientName}},
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
<p style="margin: 0 0 32px 0; font-size: 16px; color: #555555; line-height: 1.7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
72
|
+
Your appointment has been confirmed. We look forward to seeing you.
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
<!-- Appointment Details Card -->
|
|
76
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px; background-color: #faf9f7; border-left: 3px solid #00BB38;">
|
|
77
|
+
<tr>
|
|
78
|
+
<td style="padding: 24px;">
|
|
79
|
+
<p style="margin: 0 0 4px 0; font-size: 11px; font-weight: 600; color: #868686; letter-spacing: 1px; text-transform: uppercase; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Procedure</p>
|
|
80
|
+
<p style="margin: 0 0 20px 0; font-size: 18px; color: #67574A; font-weight: 500; font-family: Georgia, 'Times New Roman', serif;">{{procedureName}}</p>
|
|
81
|
+
|
|
82
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
|
|
83
|
+
<tr>
|
|
84
|
+
<td style="padding-bottom: 16px;">
|
|
85
|
+
<p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Date & Time</p>
|
|
86
|
+
<p style="margin: 0; font-size: 15px; color: #333333; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{appointmentDate}}</p>
|
|
87
|
+
<p style="margin: 4px 0 0 0; font-size: 14px; color: #67574A; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{appointmentTime}}</p>
|
|
88
|
+
</td>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td style="padding-bottom: 16px;">
|
|
92
|
+
<p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Practitioner</p>
|
|
93
|
+
<p style="margin: 0; font-size: 15px; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{practitionerName}}</p>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td>
|
|
98
|
+
<p style="margin: 0 0 2px 0; font-size: 11px; color: #868686; text-transform: uppercase; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Location</p>
|
|
99
|
+
<p style="margin: 0; font-size: 15px; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">{{clinicName}}</p>
|
|
100
|
+
</td>
|
|
101
|
+
</tr>
|
|
102
|
+
</table>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
|
|
107
|
+
<!-- Divider -->
|
|
108
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px;">
|
|
109
|
+
<tr>
|
|
110
|
+
<td style="height: 1px; background-color: #e8e4df;"></td>
|
|
111
|
+
</tr>
|
|
112
|
+
</table>
|
|
113
|
+
|
|
114
|
+
<!-- Important Notice -->
|
|
115
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 24px;">
|
|
116
|
+
<tr>
|
|
117
|
+
<td style="padding: 20px 24px; background-color: #faf9f7; border-left: 3px solid #a48a76;">
|
|
118
|
+
<p style="margin: 0 0 8px 0; font-size: 13px; font-weight: 600; color: #67574A; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Before Your Visit</p>
|
|
119
|
+
<p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
120
|
+
Please arrive 15 minutes early. If you need to reschedule or cancel, contact us through the MetaEstetics app.
|
|
121
|
+
</p>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
</table>
|
|
125
|
+
|
|
126
|
+
<!-- Thank You -->
|
|
127
|
+
<p style="margin: 0; font-size: 14px; color: #868686; line-height: 1.7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
128
|
+
Thank you for choosing {{clinicName}}. We look forward to providing you with exceptional care.
|
|
129
|
+
</p>
|
|
130
|
+
|
|
131
|
+
</td>
|
|
132
|
+
</tr>
|
|
133
|
+
|
|
134
|
+
<!-- Footer -->
|
|
135
|
+
<tr>
|
|
136
|
+
<td style="padding: 32px 48px; background-color: #faf9f7; border-top: 1px solid #f0ebe6;">
|
|
137
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
|
|
138
|
+
<tr>
|
|
139
|
+
<td>
|
|
140
|
+
<p style="margin: 0 0 8px 0; font-size: 14px; font-weight: 500; color: #67574A; font-family: Georgia, 'Times New Roman', serif;">{{clinicName}}</p>
|
|
141
|
+
<p style="margin: 0 0 16px 0; font-size: 13px; color: #868686; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Premium Aesthetic Services</p>
|
|
142
|
+
<p style="margin: 0; font-size: 11px; color: #aaaaaa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">This is an automated message from MetaEstetics. Please do not reply directly to this email.</p>
|
|
143
|
+
</td>
|
|
144
|
+
</tr>
|
|
145
|
+
</table>
|
|
146
|
+
</td>
|
|
147
|
+
</tr>
|
|
148
|
+
|
|
149
|
+
</table>
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
</table>
|
|
209
153
|
</body>
|
|
210
154
|
</html>
|
|
211
155
|
`;
|
|
@@ -539,27 +483,20 @@ const appointmentCancelledTemplate = `
|
|
|
539
483
|
</table>
|
|
540
484
|
|
|
541
485
|
<!-- Rebook Section -->
|
|
542
|
-
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom:
|
|
486
|
+
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 24px; background-color: #f0faf4; border-left: 3px solid #00BB38;">
|
|
543
487
|
<tr>
|
|
544
|
-
<td style="padding:
|
|
545
|
-
<p style="margin: 0 0
|
|
546
|
-
<p style="margin: 0
|
|
547
|
-
We'd love to see you. Open the MetaEstetics app to browse available times and book a new appointment.
|
|
488
|
+
<td style="padding: 24px;">
|
|
489
|
+
<p style="margin: 0 0 8px 0; font-size: 14px; font-weight: 600; color: #00BB38; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Book a New Appointment</p>
|
|
490
|
+
<p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
491
|
+
We'd love to see you again. Open the MetaEstetics app to browse available times and book a new appointment.
|
|
548
492
|
</p>
|
|
549
|
-
<table role="presentation" cellspacing="0" cellpadding="0" border="0">
|
|
550
|
-
<tr>
|
|
551
|
-
<td style="background-color: #67574A; border-radius: 2px;">
|
|
552
|
-
<a href="#" style="display: inline-block; padding: 14px 32px; font-size: 13px; font-weight: 600; color: #ffffff; text-decoration: none; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Book New Appointment</a>
|
|
553
|
-
</td>
|
|
554
|
-
</tr>
|
|
555
|
-
</table>
|
|
556
493
|
</td>
|
|
557
494
|
</tr>
|
|
558
495
|
</table>
|
|
559
496
|
|
|
560
497
|
<!-- Support Info -->
|
|
561
498
|
<p style="margin: 0; font-size: 13px; color: #868686; line-height: 1.7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
562
|
-
If you have any questions about this cancellation, please contact {{clinicName}}
|
|
499
|
+
If you have any questions about this cancellation, please contact {{clinicName}} through the MetaEstetics app.
|
|
563
500
|
</p>
|
|
564
501
|
|
|
565
502
|
</td>
|
|
@@ -700,31 +637,18 @@ const appointmentRescheduledProposalTemplate = `
|
|
|
700
637
|
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-bottom: 32px; background-color: #faf9f7;">
|
|
701
638
|
<tr>
|
|
702
639
|
<td style="padding: 28px;">
|
|
703
|
-
<p style="margin: 0 0
|
|
704
|
-
<p style="margin: 0
|
|
640
|
+
<p style="margin: 0 0 8px 0; font-size: 14px; font-weight: 600; color: #67574A; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">How to Respond</p>
|
|
641
|
+
<p style="margin: 0; font-size: 14px; color: #555555; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
705
642
|
Open the MetaEstetics app to accept or decline this reschedule request. Your appointment will remain pending until you respond.
|
|
706
643
|
</p>
|
|
707
|
-
<table role="presentation" cellspacing="0" cellpadding="0" border="0">
|
|
708
|
-
<tr>
|
|
709
|
-
<td style="background-color: #67574A; border-radius: 2px;">
|
|
710
|
-
<a href="#" style="display: inline-block; padding: 14px 32px; font-size: 13px; font-weight: 600; color: #ffffff; text-decoration: none; letter-spacing: 0.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">Open App</a>
|
|
711
|
-
</td>
|
|
712
|
-
</tr>
|
|
713
|
-
</table>
|
|
714
644
|
</td>
|
|
715
645
|
</tr>
|
|
716
646
|
</table>
|
|
717
647
|
|
|
718
|
-
<!--
|
|
719
|
-
<
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
<p style="margin: 0; font-size: 13px; color: #a48a76; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
723
|
-
<strong>Status:</strong> Pending your response. Please respond as soon as possible so we can confirm your appointment.
|
|
724
|
-
</p>
|
|
725
|
-
</td>
|
|
726
|
-
</tr>
|
|
727
|
-
</table>
|
|
648
|
+
<!-- Response Notice -->
|
|
649
|
+
<p style="margin: 0; font-size: 13px; color: #868686; line-height: 1.6; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;">
|
|
650
|
+
Please respond at your earliest convenience so we can finalize your appointment. If you have questions, contact {{clinicName}} through the app.
|
|
651
|
+
</p>
|
|
728
652
|
|
|
729
653
|
</td>
|
|
730
654
|
</tr>
|
|
@@ -680,11 +680,23 @@ export class AppointmentService extends BaseService {
|
|
|
680
680
|
|
|
681
681
|
/**
|
|
682
682
|
* Cancels an appointment by an Admin/Clinic.
|
|
683
|
+
* @param appointmentId - The appointment ID to cancel
|
|
684
|
+
* @param reasonOrClinicId - Either a cancellation reason string, or clinicId (legacy parameter - will be ignored)
|
|
683
685
|
*/
|
|
684
|
-
async cancelAppointmentAdmin(appointmentId: string,
|
|
686
|
+
async cancelAppointmentAdmin(appointmentId: string, reasonOrClinicId?: string): Promise<Appointment> {
|
|
685
687
|
console.log(`[APPOINTMENT_SERVICE] Admin canceling appointment: ${appointmentId}`);
|
|
688
|
+
|
|
689
|
+
// Detect if the second parameter looks like an ID rather than a reason
|
|
690
|
+
// IDs typically have no spaces and contain alphanumeric/dash/underscore patterns
|
|
691
|
+
const isLikelyId = reasonOrClinicId &&
|
|
692
|
+
!reasonOrClinicId.includes(' ') &&
|
|
693
|
+
/^[a-zA-Z0-9_-]+$/.test(reasonOrClinicId) &&
|
|
694
|
+
reasonOrClinicId.length > 15;
|
|
695
|
+
|
|
696
|
+
const cancellationReason = isLikelyId ? undefined : (reasonOrClinicId || undefined);
|
|
697
|
+
|
|
686
698
|
return this.updateAppointmentStatus(appointmentId, AppointmentStatus.CANCELED_CLINIC, {
|
|
687
|
-
cancellationReason
|
|
699
|
+
cancellationReason,
|
|
688
700
|
canceledBy: 'clinic',
|
|
689
701
|
});
|
|
690
702
|
}
|