@@ -65,23 +65,6 @@ export class ClinicAppointment {
6565 this . healthAnswers = options ?. healthAnswers || { }
6666 }
6767
68- /**
69- * Create a new clinic appointment, adding it to the context
70- *
71- * @param {object } appointment - an appointment to copy or an object with any subset of its properties
72- * @param {object } context - the context into which we'll add the new appointment
73- * @returns {ClinicAppointment } A new clinic booking, added to the context, and possibly with a new UUID
74- */
75- static createInContext ( appointment , context ) {
76- const createdAppointment = new ClinicAppointment ( appointment )
77-
78- // Update context
79- context . clinicAppointments = context . clinicAppointments || { }
80- context . clinicAppointments [ createdAppointment . uuid ] = createdAppointment
81-
82- return createdAppointment
83- }
84-
8568 /**
8669 * Get URI of the booking journey
8770 *
@@ -341,6 +324,23 @@ export class ClinicAppointment {
341324 }
342325 }
343326
327+ /**
328+ * Create a new clinic appointment, adding it to the context
329+ *
330+ * @param {object } appointment - an appointment to copy or an object with any subset of its properties
331+ * @param {object } context - the context into which we'll add the new appointment
332+ * @returns {ClinicAppointment } A new clinic booking, added to the context, and possibly with a new UUID
333+ */
334+ static create ( appointment , context ) {
335+ const createdAppointment = new ClinicAppointment ( appointment )
336+
337+ // Update context
338+ context . clinicAppointments = context . clinicAppointments || { }
339+ context . clinicAppointments [ createdAppointment . uuid ] = createdAppointment
340+
341+ return createdAppointment
342+ }
343+
344344 /**
345345 * Update
346346 *
0 commit comments