-
Notifications
You must be signed in to change notification settings - Fork 5.5k
12462 trigger cliniko new appointment updated webhook #16185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vunguyenhung
merged 6 commits into
master
from
12462-trigger-cliniko---new-appointment-updated-webhook
Apr 8, 2025
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f2c851
[TRIGGER] Cliniko #12462
luancazarine 9233440
pnpm update
luancazarine 3f02ff9
pnpm update
luancazarine 94ba8a5
Merge branch 'master' into 12462-trigger-cliniko---new-appointment-up…
luancazarine 2a0d983
pnpm update
luancazarine c45b611
Update components/cliniko/sources/new-appointment-updated/new-appoint…
michelle0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
components/cliniko/sources/new-appointment-updated/new-appointment-updated.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import common from "../common/polling.mjs"; | ||
| import sampleEmit from "./test-event.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "cliniko-new-appointment-updated", | ||
| name: "New Appointment Updated", | ||
| description: "Emit new event when an appointment is updated in Cliniko.", | ||
| type: "source", | ||
| version: "0.0.2", | ||
| dedupe: "unique", | ||
| methods: { | ||
| ...common.methods, | ||
| getResourceName() { | ||
| return "appointments"; | ||
| }, | ||
| getResourcesFn() { | ||
| return this.app.listAppointments; | ||
| }, | ||
| generateMeta(resource) { | ||
| return { | ||
| id: `${resource.id}-${resource.updated_at}`, | ||
| summary: `Appointment updated: ${resource.id}`, | ||
| ts: Date.parse(resource.updated_at), | ||
| }; | ||
| }, | ||
| getSort() { | ||
| return "updated_at:desc"; | ||
| }, | ||
| }, | ||
| sampleEmit, | ||
| }; | ||
78 changes: 78 additions & 0 deletions
78
components/cliniko/sources/new-appointment-updated/test-event.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| export default { | ||
| "appointment_type": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/appointment_types/1" | ||
| } | ||
| }, | ||
| "archived_at": "2019-08-24T14:15:22Z", | ||
| "attendees": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/individual_appointments/1/attendees" | ||
| } | ||
| }, | ||
| "booking_ip_address": "10.0.0.43", | ||
| "business": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/businesses/1" | ||
| } | ||
| }, | ||
| "cancellation_note": "string", | ||
| "cancellation_reason": 0, | ||
| "cancellation_reason_description": "Feeling Better", | ||
| "cancelled_at": "2019-08-24T14:15:22Z", | ||
| "conflicts": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/individual_appointments/1/conflicts" | ||
| } | ||
| }, | ||
| "created_at": "2019-08-24T14:15:22Z", | ||
| "deleted_at": "2019-08-24T14:15:22Z", | ||
| "did_not_arrive": true, | ||
| "email_reminder_sent": true, | ||
| "ends_at": "2019-08-24T14:15:22Z", | ||
| "has_patient_appointment_notes": true, | ||
| "id": "string", | ||
| "invoice_status": 0, | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/individual_appointments/1" | ||
| }, | ||
| "notes": "string", | ||
| "online_booking_policy_accepted": true, | ||
| "patient": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/patients/1" | ||
| } | ||
| }, | ||
| "patient_arrived": true, | ||
| "patient_case": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/patient_cases/1" | ||
| } | ||
| }, | ||
| "patient_name": "string", | ||
| "practitioner": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/practitioners/1" | ||
| } | ||
| }, | ||
| "repeat_rule": { | ||
| "number_of_repeats": 0, | ||
| "repeat_type": "Daily", | ||
| "repeating_interval": 0 | ||
| }, | ||
| "repeated_from": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/individual_appointments/1" | ||
| } | ||
| }, | ||
| "repeats": { | ||
| "links": { | ||
| "self": "https://api.au1.cliniko.com/v1/individual_appointments?q[]=repeated_from_id:=1" | ||
| } | ||
| }, | ||
| "sms_reminder_sent": true, | ||
| "starts_at": "2019-08-24T14:15:22Z", | ||
| "telehealth_url": "http://example.com", | ||
| "treatment_note_status": 0, | ||
| "updated_at": "2019-08-24T14:15:22Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.