@burgan-tech/morph-touch-runtime 0.0.5 → 0.0.7
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/burgan-tech-morph-touch-runtime-0.0.7.tgz +0 -0
- package/morph-touch/Functions/get-matrix-sync.1.0.0.json +1 -1
- package/morph-touch/Functions/get-room-messages.1.0.0.json +1 -1
- package/morph-touch/Functions/send-room-message.1.0.0.json +1 -1
- package/morph-touch/Functions/src/GetMatrixSyncMapping.csx +5 -1
- package/morph-touch/Functions/src/GetRezervationsMapping.csx +27 -7
- package/morph-touch/Functions/src/GetRoomMessagesMapping.csx +5 -1
- package/morph-touch/Functions/src/SendRoomMessageMapping.csx +5 -1
- package/morph-touch/Workflows/chat-room.json +9 -9
- package/morph-touch/Workflows/notification-sender.json +2 -2
- package/morph-touch/Workflows/rezervation-start.json +1 -1
- package/morph-touch/Workflows/rezervation-transfer.json +3 -3
- package/morph-touch/Workflows/rezervation.json +1 -1
- package/morph-touch/Workflows/src/ChatRoomRemoveMapping.csx +5 -1
- package/morph-touch/Workflows/src/ChatRoomTransferInviteMapping.csx +6 -2
- package/morph-touch/Workflows/src/ChatRoomTransferRemoveMapping.csx +5 -1
- package/morph-touch/Workflows/src/ChatRoomUpdateMapping.csx +6 -2
- package/morph-touch/Workflows/src/CreateChatRoomForRezervationMapping.csx +5 -1
- package/morph-touch/Workflows/src/CreatePermanentChatRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/FetchRoomMessagesForSummaryMapping.csx +5 -1
- package/morph-touch/Workflows/src/GetUserInfoForRezervationMapping.csx +5 -1
- package/morph-touch/Workflows/src/GetVideoCallUrlMapping.csx +5 -1
- package/morph-touch/Workflows/src/InviteAdvisorForRandevuUpdateMapping.csx +5 -1
- package/morph-touch/Workflows/src/InviteNewAdvisorToRezervationRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/InviteNewParticipantToRandevuRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/JoinChatRoomForAddParticipantMapping.csx +5 -1
- package/morph-touch/Workflows/src/JoinChatRoomForRandevuStartMapping.csx +5 -1
- package/morph-touch/Workflows/src/JoinChatRoomForRezervationMapping.csx +5 -1
- package/morph-touch/Workflows/src/JoinMatrixRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/JoinUserToRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/SendPushNotificationMapping.csx +5 -1
- package/morph-touch/Workflows/src/SendSmsNotificationMapping.csx +5 -1
- package/morph-touch/Workflows/src/SendSummaryToNewRoomMapping.csx +5 -1
- package/morph-touch/Workflows/src/SetRoomHistoryVisibilityMapping.csx +5 -1
- package/morph-touch/Workflows/src/SummarizeChatWithOpenAIMapping.csx +5 -1
- package/morph-touch/Workflows/start-video-call.json +1 -1
- package/morph-touch/doc/morph-touch-domain.en.md +742 -0
- package/morph-touch/doc/morph-touch-domain.md +745 -0
- package/package.json +1 -1
- package/vnext.config.json +1 -1
- package/burgan-tech-morph-touch-runtime-0.0.5.tgz +0 -0
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
# Morph-touch domain — technical overview
|
|
2
|
+
|
|
3
|
+
This document summarizes appointment (rezervation), absence, chat room, notification, and transfer flows in the `morph-touch` domain, based on workflow definitions and task mapping behaviour. HTTP examples use the **`{{BaseUrl}}/morph-touch/...`** template; the [postman_collection.json](../../postman_collection.json) collection may still use variables such as `api/v{{apiVersion}}` — align `baseUrl` and path prefixes with your gateway.
|
|
4
|
+
|
|
5
|
+
Turkish version: [morph-touch-domain.md](morph-touch-domain.md).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Overview and terminology
|
|
10
|
+
|
|
11
|
+
- **Domain:** `morph-touch`
|
|
12
|
+
- **Workflow instance:** vNext instance model with `key`, `flow` (`sys-flows`), `domain`, and `version`; started over HTTP at `.../workflows/{flowKey}/instances/...`, transitions at `.../transitions/{transitionKey}`. After `instances/`, the path may use the platform **instance id** (UUID) or the instance **`key`** from the `start` request.
|
|
13
|
+
- **Integrations:**
|
|
14
|
+
- **DAPR / application API:** `api/v{version}/{domain}/...` (paths such as `functions/state`, `functions/data` in mappings).
|
|
15
|
+
- **Matrix:** `MatrixBaseUrl` (secret); room creation, join, invite, kick, history visibility.
|
|
16
|
+
- **MessagingGateway:** SMS and push notifications ([notification-sender](../Workflows/notification-sender.json)).
|
|
17
|
+
|
|
18
|
+
### High-level relationships
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart LR
|
|
22
|
+
subgraph absence [absence-entry]
|
|
23
|
+
A1[complete]
|
|
24
|
+
A2[complete-with-transfer]
|
|
25
|
+
end
|
|
26
|
+
subgraph rez [rezervation]
|
|
27
|
+
R1[validating]
|
|
28
|
+
R2[appointment-form]
|
|
29
|
+
R3[active]
|
|
30
|
+
R4[in-meet]
|
|
31
|
+
end
|
|
32
|
+
subgraph transfer [rezervation-transfer]
|
|
33
|
+
T1[awaiting-assignment]
|
|
34
|
+
end
|
|
35
|
+
subgraph notify [notification-sender]
|
|
36
|
+
N1[pending to complete]
|
|
37
|
+
end
|
|
38
|
+
subgraph room [chat-room]
|
|
39
|
+
C1[permanent or reservation room]
|
|
40
|
+
end
|
|
41
|
+
R1 --> R2 --> R3
|
|
42
|
+
R3 --> N1
|
|
43
|
+
R3 --> absence
|
|
44
|
+
R3 --> R4
|
|
45
|
+
R4 --> room
|
|
46
|
+
A1 -->|start-transfer personal-leave| transfer
|
|
47
|
+
startChat[start-chat] --> room
|
|
48
|
+
resStart[rezervation-start] --> room
|
|
49
|
+
resStart --> R4
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 2. absence-entry
|
|
55
|
+
|
|
56
|
+
**File:** [Workflows/absence-entry.json](../Workflows/absence-entry.json)
|
|
57
|
+
|
|
58
|
+
### Purpose
|
|
59
|
+
|
|
60
|
+
- **Absence** records such as personal leave, customer meeting, etc.
|
|
61
|
+
- **Public holiday** (`public-holiday`).
|
|
62
|
+
- **Company working hours** and **advisor-specific working hours** (`working-hours-change` — with or without advisor for company-wide scope).
|
|
63
|
+
|
|
64
|
+
Records are usually kept in `complete`; updated via `update`, moved to `cancelled` via `cancel`.
|
|
65
|
+
|
|
66
|
+
For detailed request bodies, key rules, and cURL examples, see **section 14**.
|
|
67
|
+
|
|
68
|
+
### Link to appointment transfer
|
|
69
|
+
|
|
70
|
+
- Transition **`start-transfer`** is evaluated only when `absenceType == "personal-leave"` (`CanStartTransferMapping` — [Workflows/src/CanStartTransferMapping.csx](../Workflows/src/CanStartTransferMapping.csx)).
|
|
71
|
+
- When conditions hold, task `start-transfer-from-absence-entry` starts the **`rezervation-transfer`** subflow (`StartTransferFromAbsenceEntryMapping`).
|
|
72
|
+
- If **`endDateTime` is set**, transfer type is **annual leave** (`annual-leave`).
|
|
73
|
+
- If **`endDateTime` is empty**, type is **termination** (`termination`).
|
|
74
|
+
- Instance data must include **`advisor`**, **`advisorType`**, and **`startDateTime`**; otherwise the transfer task is skipped (`skipped` + reason).
|
|
75
|
+
|
|
76
|
+
Final state: `complete-with-transfer` (transfer started).
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 3. rezervation-transfer
|
|
81
|
+
|
|
82
|
+
**File:** [Workflows/rezervation-transfer.json](../Workflows/rezervation-transfer.json)
|
|
83
|
+
|
|
84
|
+
### Purpose
|
|
85
|
+
|
|
86
|
+
Move the source advisor’s appointments in a date range to suitable target advisors; run required Matrix operations on permanent chat rooms (per transfer vs update plan).
|
|
87
|
+
|
|
88
|
+
### Initial tasks (summary)
|
|
89
|
+
|
|
90
|
+
1. **Transfer type:** Without `endDate`, `termination` and a default far end date; with `endDate`, `annual-leave`.
|
|
91
|
+
2. **Source appointments:** `get-rezervations`-style query (`FetchRezervationsForTransferMapping`).
|
|
92
|
+
3. **Advisor list:** Active instances, workflow key resolution from `advisorType` / source id (`FetchAdvisorsForTransferMapping`).
|
|
93
|
+
4. **Absence records:** Completed `public-holiday`, `working-hours-change`, `personal-leave` (`FetchAbsenceEntriesForTransferMapping`).
|
|
94
|
+
5. **Enrichment:** All active appointments + slot validity (holiday, working hours, personal leave, conflicts) — `EnrichRezervationsForTransferMapping`.
|
|
95
|
+
|
|
96
|
+
### Key checks
|
|
97
|
+
|
|
98
|
+
- **`confirm-transfer`:** `validate-transfer-availability` — ensures the target advisor has no conflicting **active / in-meet** reservation in that slot; produces `validationResult.allValid` / `details`.
|
|
99
|
+
- **`transferPlan`:** Postman example: each row has `rezervationKey` + `targetAdvisor` ([postman_collection.json](../../postman_collection.json) — “Confirm Transfer”).
|
|
100
|
+
- Steps for permanent rooms using **`permanentRoomPlan`** (room `roomId` + `newAdvisorId`) are described in the collection notes.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 4. rezervation
|
|
105
|
+
|
|
106
|
+
**File:** [Workflows/rezervation.json](../Workflows/rezervation.json)
|
|
107
|
+
|
|
108
|
+
### State outline
|
|
109
|
+
|
|
110
|
+
`validating` → `appointment-form` or `slot-unavailable` → `active` → `in-meet` → `meet-completed`
|
|
111
|
+
Cancellations: `user-cancelled`, `advisor-cancelled`, `timeout`, etc.
|
|
112
|
+
|
|
113
|
+
### Controls
|
|
114
|
+
|
|
115
|
+
| Topic | Source | Description |
|
|
116
|
+
|------|--------|-------------|
|
|
117
|
+
| At most 2 reservations | `check-duplicate-rezervation` | For the same user, in certain confirmed states, at most **2** active reservations; **no overlapping** slots. |
|
|
118
|
+
| Slot validity | `validate-slot-for-rezervation` | If the chosen range is missing from `get-available-slots` output → `slot-unavailable`; **`appointment-form-retry`** resubmits new date/time for re-validation. |
|
|
119
|
+
| Date | `validate-date-for-rezervation` | Past or invalid dates are rejected. |
|
|
120
|
+
| User | `set-user-from-headers-for-rezervation` | Request **`sub`** header is written to the instance. |
|
|
121
|
+
| Confirm → active | `create-appointment` / confirmation chain | Order in workflow: previous advisor info, user info (`get-user-info-for-rezervation`), start **`notification-sender`**, create **`absence-entry`** (reservation record). |
|
|
122
|
+
|
|
123
|
+
### Notification (when appointment is created)
|
|
124
|
+
|
|
125
|
+
The `notification-sender` subflow starts during reservation confirmation. **Advisor** SMS/push body (summary):
|
|
126
|
+
|
|
127
|
+
`Sayın " + (advisorName ?? "Danisman") + ", " + formattedDate + " tarihli randevunuz olusturulmustur."`
|
|
128
|
+
|
|
129
|
+
**Customer** uses different copy (`SendSmsNotificationMapping` / `SendPushNotificationMapping` — [Workflows/src/SendSmsNotificationMapping.csx](../Workflows/src/SendSmsNotificationMapping.csx), [Workflows/src/SendPushNotificationMapping.csx](../Workflows/src/SendPushNotificationMapping.csx)). For channel selection and state transitions, see the **notification-sender** section (section 5 in this document).
|
|
130
|
+
|
|
131
|
+
### Shared transitions
|
|
132
|
+
|
|
133
|
+
- **`user-cancel` / `advisor-cancel` (active):** Triggers `cancel` on the related **`absence-entry`**; advisor cancel also sends a **cancellation notification**.
|
|
134
|
+
- **`add-invited-participant`**, **`video-call-url-update`:** Merge invited-user list and video URL list.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 5. notification-sender
|
|
139
|
+
|
|
140
|
+
**File:** [Workflows/notification-sender.json](../Workflows/notification-sender.json)
|
|
141
|
+
|
|
142
|
+
Subflow: started synchronously from reservation confirmation and other triggers. SMS (`/Messaging/sms/message/string`) and push (`/Messaging/push-notification/message`) calls are built in mappings against the `MessagingBaseUrl` secret.
|
|
143
|
+
|
|
144
|
+
### States and automatic transitions
|
|
145
|
+
|
|
146
|
+
| Source | Transition | Target | Condition (summary) |
|
|
147
|
+
|--------|------------|--------|----------------------|
|
|
148
|
+
| `pending` | `to-sms-sending` | `sms-sending` | `channels.sms == true` |
|
|
149
|
+
| `pending` | `to-push-sending-from-pending` | `push-sending` | SMS not requested, `channels.push == true`, `hasRegisteredDevice == true` |
|
|
150
|
+
| `pending` | `to-complete-from-pending` | `complete` | No applicable channel (push requested but no device, or no channel) |
|
|
151
|
+
| `sms-sending` | (onEntry) | — | `send-sms-notification` task; `recipient.phone` (countryCode, prefix, number) required |
|
|
152
|
+
| `sms-sending` | `to-push-sending-from-sms` | `push-sending` | `channels.push == true` and `hasRegisteredDevice == true` |
|
|
153
|
+
| `sms-sending` | `to-complete-from-sms` | `complete` | Push not requested or no registered device |
|
|
154
|
+
| `push-sending` | (onEntry) | — | `send-push-notification`; `recipient` uses `citizenshipNo` / `customerNo` |
|
|
155
|
+
| `push-sending` | `to-complete-from-push` | `complete` | Always after push |
|
|
156
|
+
|
|
157
|
+
**Copy:** `userType == "advisor"` uses advisor SMS/push text; `user` uses customer text (mapping summaries in the CSX files above).
|
|
158
|
+
|
|
159
|
+
Postman: folder **Notification Sender Subprocess** — SMS only, push only, no channel, no device scenarios.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 6. rezervation-start
|
|
164
|
+
|
|
165
|
+
**File:** [Workflows/rezervation-start.json](../Workflows/rezervation-start.json)
|
|
166
|
+
|
|
167
|
+
Both customer and advisor can start the meeting; the **first starter** takes the path that creates the reservation room; the other **joins**.
|
|
168
|
+
|
|
169
|
+
### Requirements / checks
|
|
170
|
+
|
|
171
|
+
- **`randevuKey`** required; state and data read via DAPR (`GetRezervationStateMapping`, `GetRezervationDataMapping`).
|
|
172
|
+
- **Invited:** If `participantType == "invited"` and `invitedUserId` is not in the reservation `invitedUser` list → **`not-allowed`**.
|
|
173
|
+
- If reservation state is not **`active`** or **`in-meet`** → **`meet-not-active`**.
|
|
174
|
+
- **Time window (`check-randevu-time`):** Start allowed at most **15 minutes** before appointment start (script compares with `UtcNow + 3`); otherwise an error like `MEET_NOT_STARTED`.
|
|
175
|
+
- **Invited and not yet in-meet:** `meet-not-started` branch.
|
|
176
|
+
|
|
177
|
+
### Room and in-meet
|
|
178
|
+
|
|
179
|
+
- If state is **`active`:** **`create-room-and-trigger`** — starts **`chat-room`** synchronously (`roomType: rezervation`), loads room data, fires **`to-in-meet`** on the main **`rezervation`**.
|
|
180
|
+
- If state is already **`in-meet`:** **`join-room`** — Matrix `join`, `x-matrix-user` by participant type (user / advisor / invited).
|
|
181
|
+
|
|
182
|
+
### End
|
|
183
|
+
|
|
184
|
+
In `end` state, **`start-video-call`** subflow runs (LiveKit, etc.).
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 7. chat-room
|
|
189
|
+
|
|
190
|
+
**File:** [Workflows/chat-room.json](../Workflows/chat-room.json)
|
|
191
|
+
|
|
192
|
+
### Purpose
|
|
193
|
+
|
|
194
|
+
- **Permanent room** (`roomType: permanent`): Matrix room keyed by user + advisor type + advisor.
|
|
195
|
+
- **Reservation room** (`roomType: rezervation`): Process room tied to reservation key.
|
|
196
|
+
|
|
197
|
+
### Behaviour summary
|
|
198
|
+
|
|
199
|
+
- Creation: Matrix `createRoom`, invite, `join-user-to-room`.
|
|
200
|
+
- **`activated`:** add member (`update`), remove member (`remove`), advisor **`transfer`** (kick + invite + join).
|
|
201
|
+
- **`deactivate` / `activate`** states.
|
|
202
|
+
- Second room creation blocked for same **user + advisorType + activated** on permanent rooms (`ALREADY_COMPLETED`).
|
|
203
|
+
|
|
204
|
+
### Domain functions (via workflow)
|
|
205
|
+
|
|
206
|
+
`get-chat-rooms`, `get-room-messages`, `send-room-message`, `get-matrix-sync` ([chat-room.json](../Workflows/chat-room.json) `attributes.functions`).
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 8. start-chat
|
|
211
|
+
|
|
212
|
+
**File:** [Workflows/start-chat.json](../Workflows/start-chat.json)
|
|
213
|
+
|
|
214
|
+
### Purpose
|
|
215
|
+
|
|
216
|
+
Open permanent advisor chat: create room if missing, otherwise go straight to chat.
|
|
217
|
+
|
|
218
|
+
### Flow
|
|
219
|
+
|
|
220
|
+
1. **`check-existing-permanent-chat-room`:** Whether the user already has a permanent room for the same `advisorType`; `advisorId` match kept in a separate flag.
|
|
221
|
+
2. **Existing room + same advisor** → **`in-chat`** (`open-existing-room`).
|
|
222
|
+
3. **Existing room + different advisor** → **`to-change-advisor`:** fire **`transfer`** on `chat-room`, then **`in-chat`**.
|
|
223
|
+
4. **No room** → **`start-permanent-chat-room`** starts **`chat-room`** synchronously, then **`in-chat`**.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 9. add-participant-to-rezervation
|
|
228
|
+
|
|
229
|
+
**File:** [Workflows/add-participant-to-rezervation.json](../Workflows/add-participant-to-rezervation.json)
|
|
230
|
+
|
|
231
|
+
### Prerequisite
|
|
232
|
+
|
|
233
|
+
Reservation state **`active`** or **`in-meet`**; otherwise **`state-not-valid`**.
|
|
234
|
+
|
|
235
|
+
### Branches
|
|
236
|
+
|
|
237
|
+
- **`in-meet`:** **update** on `chat-room` (new member) + **`add-invited-participant`** on `rezervation` + **`start-video-call`** subflow (invited customer path).
|
|
238
|
+
- **`active`:** **`update-invited`** → **`end`** (invited update only).
|
|
239
|
+
|
|
240
|
+
`newUserId` / `randevuKey` are required in task mappings.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 10. Domain functions (summary)
|
|
245
|
+
|
|
246
|
+
| Function | File | Purpose / notes |
|
|
247
|
+
|----------|------|------------------|
|
|
248
|
+
| `check-livekit-room-access` | [Functions/check-livekit-room-access.1.0.0.json](../Functions/check-livekit-room-access.1.0.0.json) | Query `access_token` (JWT or `prefix:roomName:participantName`). Participant validation on a single matching **active/in-meet** reservation; error on multiple matches. |
|
|
249
|
+
| `get-absence-entry` | [Functions/get-absence-entry.1.0.0.json](../Functions/get-absence-entry.1.0.0.json) | Required `absenceType`: `public-holiday`, `personal-leave`, `working-hours-change`, `rezervation`. Optional `advisor`, `startDate`, `endDate`, `pageSize`. |
|
|
250
|
+
| `get-advisor-stats` | [Functions/get-advisor-stats.1.0.0.json](../Functions/get-advisor-stats.1.0.0.json) | Advisor presence (Matrix: online, offline, busy, away). |
|
|
251
|
+
| `get-available-slots` | [Functions/get-available-slots.1.0.0.json](../Functions/get-available-slots.1.0.0.json) | `advisorId`, `date`, optional `duration` (minutes). |
|
|
252
|
+
| `get-chat-rooms` | [Functions/get-chat-rooms.1.0.0.json](../Functions/get-chat-rooms.1.0.0.json) | **`user` OR `advisor`** (mutually exclusive). |
|
|
253
|
+
| `get-customer-info` | [Functions/get-customer-info.1.0.0.json](../Functions/get-customer-info.1.0.0.json) | Customer profile. |
|
|
254
|
+
| `get-matrix-sync` | [Functions/get-matrix-sync.1.0.0.json](../Functions/get-matrix-sync.1.0.0.json) | Matrix sync payload. |
|
|
255
|
+
| `get-rezervations` | [Functions/get-rezervations.1.0.0.json](../Functions/get-rezervations.1.0.0.json) | Filtered reservation list. |
|
|
256
|
+
| `get-room-messages` | [Functions/get-room-messages.1.0.0.json](../Functions/get-room-messages.1.0.0.json) | Room messages. |
|
|
257
|
+
| `send-room-message` | [Functions/send-room-message.1.0.0.json](../Functions/send-room-message.1.0.0.json) | Send message to Matrix. |
|
|
258
|
+
|
|
259
|
+
See [Functions/get-room-messages.http](../Functions/get-room-messages.http) for detailed HTTP examples.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 11. Postman collection
|
|
264
|
+
|
|
265
|
+
**File:** [postman_collection.json](../../postman_collection.json) (workspace root)
|
|
266
|
+
**Collection name:** vNext Touch Domain
|
|
267
|
+
|
|
268
|
+
### Shared variables (defaults)
|
|
269
|
+
|
|
270
|
+
| Variable | Example value |
|
|
271
|
+
|----------|----------------|
|
|
272
|
+
| `baseUrl` | `http://localhost:4201` |
|
|
273
|
+
| `apiVersion` | `1` |
|
|
274
|
+
| `domain` | `morph-touch` |
|
|
275
|
+
| `instanceKey` / `user` | `core.user.user-001` |
|
|
276
|
+
| `advisor` / `advisorId` | `morph-touch.portfolio-manager.pm-001` |
|
|
277
|
+
|
|
278
|
+
### Workflow API templates
|
|
279
|
+
|
|
280
|
+
- **Start instance:**
|
|
281
|
+
`POST {{baseUrl}}/morph-touch/workflows/{flowKey}/instances/start?sync=true`
|
|
282
|
+
Examples: `rezervation`, `absence-entry`, `rezervation-start`, `chat-room`, `start-chat`, `rezervation-transfer`, `notification-sender` (subflow).
|
|
283
|
+
- **Get instance:**
|
|
284
|
+
`GET {{baseUrl}}/morph-touch/workflows/{flowKey}/instances/{{instanceIdOrKey}}`
|
|
285
|
+
Path segment: platform **instance `id`** (UUID) or the instance **`key`** from the `start` request (e.g. `working-hour`, `rez-...`).
|
|
286
|
+
- **Transition:**
|
|
287
|
+
`PATCH {{baseUrl}}/morph-touch/workflows/{flowKey}/instances/{{instanceIdOrKey}}/transitions/{transitionKey}?sync=true`
|
|
288
|
+
Same: **id** or **`key`**. Body is usually `{ "attributes": { ... } }`.
|
|
289
|
+
|
|
290
|
+
### Sample requests (collection folders)
|
|
291
|
+
|
|
292
|
+
| Folder / request | Method | Notes |
|
|
293
|
+
|------------------|--------|-------|
|
|
294
|
+
| **Reservation Workflow → Start Rezervation** | POST | `sub` header; body: `user`, `advisor`, `startDateTime`, `endDateTime`. |
|
|
295
|
+
| **Confirm Selection** | PATCH | `transitions/confirm-selection` — slot validation step. |
|
|
296
|
+
| **Appointment Form Retry** | PATCH | `appointment-form-retry` + new `startDateTime` / `endDateTime`. |
|
|
297
|
+
| **Create Appointment** | PATCH | `create-appointment` → `active`. |
|
|
298
|
+
| **Rezervation Start Workflow** | POST | `randevuKey`, `participantType` (advisor / customer / invited). |
|
|
299
|
+
| **Chat Room Workflow** | POST / PATCH | Permanent PM/IA start; `update`, `remove`, `transfer`. |
|
|
300
|
+
| **Start Chat Workflow** | POST | Creates permanent room if missing, else `in-chat`. |
|
|
301
|
+
| **Rezervation Transfer** | POST + PATCH | `startDate`/`endDate`; `confirm-transfer` with `transferPlan`. |
|
|
302
|
+
| **Get Absence Entry Function** | GET | `.../functions/get-absence-entry?absenceType=...` |
|
|
303
|
+
| **Get Available Slots** | GET | `advisorId`, `date`, `duration`. |
|
|
304
|
+
| **Get Chat Rooms** | GET | `user=...` or `advisor=...` |
|
|
305
|
+
| **Matrix Synapse API** | various | `http://localhost:9080/...` — presence, createRoom (manual test). |
|
|
306
|
+
| **Notification Sender Subprocess** | POST | `workflows/notification-sender/instances/start` — channel flags and recipient shape examples. |
|
|
307
|
+
|
|
308
|
+
Collection descriptions reference [vNext documentation](https://github.com/burgan-tech/vnext-runtime/tree/main/doc/en) for instance filtering and task types.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 12. Extra checks and edge cases
|
|
313
|
+
|
|
314
|
+
- **Reservation cancel:** Triggers `absence-entry` cancel; on older instances without `absenceEntryKey`, cancel may no-op.
|
|
315
|
+
- **Multiple invitees / video URLs:** List merge via `merge-invited-user`, `merge-video-call-urls`.
|
|
316
|
+
- **check-livekit-room-access:** Token format JWT or `room:participant`; multiple matches yield an unusable result.
|
|
317
|
+
- **notification-sender:** SMS requires phone structure; push uses `citizenshipNo` / `customerNo` and registered-device flag.
|
|
318
|
+
- **chat-room:** Matrix `M_ROOM_IN_USE`; history visibility limited to allowed values (`shared`, `invited`, `joined`, `world_readable`) in mappings.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 13. Related source files
|
|
323
|
+
|
|
324
|
+
- Workflow JSON: [Workflows/](../Workflows/)
|
|
325
|
+
- C# mappings: [Workflows/src/](../Workflows/src/)
|
|
326
|
+
- Function definitions: [Functions/](../Functions/)
|
|
327
|
+
- Project rules: [.cursorrules](../../.cursorrules)
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 14. API usage guide (cURL and field rules)
|
|
332
|
+
|
|
333
|
+
### 14.1 Prerequisite order
|
|
334
|
+
|
|
335
|
+
For appointments and **get-available-slots**, define **company working hours** first (`absenceType: working-hours-change`, instance `key: "working-hour"`, tags `working-hours-change` + `company`). Then use public holidays, advisor leave / custom hours, and the reservation flow.
|
|
336
|
+
|
|
337
|
+
### 14.2 `{{BaseUrl}}`, path template, and authentication
|
|
338
|
+
|
|
339
|
+
- In all examples, **`{{BaseUrl}}`** is your API gateway **root** (e.g. `https://<host>` or `https://<host>/ebanking` depending on deployment). Set it per APISIX / environment docs; avoid a trailing slash on the root or you may get **double slashes** (`//morph-touch`) when concatenating.
|
|
340
|
+
- Standard template: **`{{BaseUrl}}/morph-touch/workflows/...`** and **`{{BaseUrl}}/morph-touch/functions/...`** (e.g. `{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/start?sync=true`).
|
|
341
|
+
- This matches the role of Postman’s `{{baseUrl}}`; this doc uses the name **`{{BaseUrl}}`**.
|
|
342
|
+
- **`Authorization: Bearer <access_token>`:** The access token is **environment-specific** (dev, test, production). Obtain it from your identity provider or whatever process your environment documents (APISIX, API portal, security team). `<access_token>` in examples is only a placeholder; never commit real tokens to the repo or shared docs.
|
|
343
|
+
- In `.../workflows/{flowKey}/instances/<segment>/...`, `<segment>` is **`{{instanceIdOrKey}}`**: either the platform **instance id** or the instance **`key`**.
|
|
344
|
+
|
|
345
|
+
### 14.3 Company working hours — `absence-entry` start (once)
|
|
346
|
+
|
|
347
|
+
`key` must be **`working-hour`**. `absenceType` is **`working-hours-change`**. Under `customWorkingHours`, weekdays (`monday` … `sunday`) are arrays of `{ "start": "HH:mm", "end": "HH:mm" }`.
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/start?sync=true' \
|
|
351
|
+
--header 'Content-Type: application/json' \
|
|
352
|
+
--header 'Accept-Language: tr-TR' \
|
|
353
|
+
--header 'X-Request-Id: <uuid>' \
|
|
354
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
355
|
+
--data '{
|
|
356
|
+
"key": "working-hour",
|
|
357
|
+
"tags": ["working-hours-change", "company"],
|
|
358
|
+
"attributes": {
|
|
359
|
+
"absenceType": "working-hours-change",
|
|
360
|
+
"title": "Company working hours",
|
|
361
|
+
"customWorkingHours": {
|
|
362
|
+
"monday": [{"start": "09:00", "end": "12:00"}, {"start": "13:30", "end": "18:00"}],
|
|
363
|
+
"tuesday": [{"start": "09:00", "end": "12:00"}, {"start": "13:30", "end": "18:00"}],
|
|
364
|
+
"wednesday": [{"start": "09:00", "end": "12:00"}, {"start": "13:30", "end": "18:00"}],
|
|
365
|
+
"thursday": [{"start": "09:00", "end": "12:00"}, {"start": "13:30", "end": "18:00"}],
|
|
366
|
+
"friday": [{"start": "09:00", "end": "12:00"}, {"start": "13:30", "end": "17:00"}],
|
|
367
|
+
"saturday": [],
|
|
368
|
+
"sunday": []
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}'
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### 14.4 Company working hours — later updates (`update`)
|
|
375
|
+
|
|
376
|
+
Usually **one** `start` for company-wide record; afterwards use only **`PATCH .../transitions/update`**. In the URL, **`{{instanceIdOrKey}}`** may be the **platform instance id** (UUID) from the response or the fixed company **`key`** (`working-hour`).
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/{{instanceIdOrKey}}/transitions/update?sync=true' \
|
|
380
|
+
--header 'Content-Type: application/json' \
|
|
381
|
+
--header 'Accept-Language: tr-TR' \
|
|
382
|
+
--header 'X-Request-Id: <uuid>' \
|
|
383
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
384
|
+
--data '{
|
|
385
|
+
"attributes": {
|
|
386
|
+
"title": "Company working hours (updated)",
|
|
387
|
+
"customWorkingHours": {
|
|
388
|
+
"monday": [{"start": "08:30", "end": "12:00"}, {"start": "13:00", "end": "17:30"}],
|
|
389
|
+
"tuesday": [{"start": "08:30", "end": "12:00"}, {"start": "13:00", "end": "17:30"}],
|
|
390
|
+
"wednesday": [{"start": "08:30", "end": "12:00"}, {"start": "13:00", "end": "17:30"}],
|
|
391
|
+
"thursday": [{"start": "08:30", "end": "12:00"}, {"start": "13:00", "end": "17:30"}],
|
|
392
|
+
"friday": [{"start": "08:30", "end": "12:00"}, {"start": "13:00", "end": "16:30"}],
|
|
393
|
+
"saturday": [],
|
|
394
|
+
"sunday": []
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}'
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### 14.5 Public holiday (`public-holiday`)
|
|
401
|
+
|
|
402
|
+
Key pattern: `public-holiday-{date}`. `absenceType` **`public-holiday`**. Set `startDateTime` / `endDateTime` for full or half day.
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/start?sync=true' \
|
|
406
|
+
--header 'Content-Type: application/json' \
|
|
407
|
+
--header 'Accept-Language: tr-TR' \
|
|
408
|
+
--header 'X-Request-Id: <uuid>' \
|
|
409
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
410
|
+
--data '{
|
|
411
|
+
"key": "public-holiday-2026-04-23",
|
|
412
|
+
"tags": ["public-holiday"],
|
|
413
|
+
"attributes": {
|
|
414
|
+
"absenceType": "public-holiday",
|
|
415
|
+
"startDateTime": "2026-04-23T00:00:00",
|
|
416
|
+
"endDateTime": "2026-04-23T23:59:59",
|
|
417
|
+
"title": "National Sovereignty and Children's Day"
|
|
418
|
+
}
|
|
419
|
+
}'
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### 14.6 Personal leave (`personal-leave`)
|
|
423
|
+
|
|
424
|
+
Key pattern: `personal-leave-{advisorId}-{startDateTime}-{endDateTime}`. `absenceType` **`personal-leave`**. `advisor` is the advisor unique id (often employee id). `advisorType` may be short (**`PM` / `IA`**) or full workflow values (**`portfolio-manager` / `investment-advisor`**) per your contract.
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/start?sync=true' \
|
|
428
|
+
--header 'Content-Type: application/json' \
|
|
429
|
+
--header 'Accept-Language: tr-TR' \
|
|
430
|
+
--header 'X-Request-Id: <uuid>' \
|
|
431
|
+
--header 'sub: <user_sub>' \
|
|
432
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
433
|
+
--data '{
|
|
434
|
+
"key": "personal-leave-<advisorId>-2026-04-07T00:00:00-2026-04-07T12:59:59",
|
|
435
|
+
"tags": ["personal-leave"],
|
|
436
|
+
"attributes": {
|
|
437
|
+
"advisor": "<advisorId>",
|
|
438
|
+
"advisorType": "PM",
|
|
439
|
+
"absenceType": "personal-leave",
|
|
440
|
+
"startDateTime": "2026-04-07T00:00:00",
|
|
441
|
+
"endDateTime": "2026-04-07T12:59:59",
|
|
442
|
+
"title": "Customer meeting"
|
|
443
|
+
}
|
|
444
|
+
}'
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### 14.7 Advisor-specific working hours (`working-hours-change` + advisor)
|
|
448
|
+
|
|
449
|
+
Key pattern: `working-hour-{advisorId}`. Tags: `working-hours-change`, `advisor`. `advisor` required; `customWorkingHours` same shape as §14.3.
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/start?sync=true' \
|
|
453
|
+
--header 'Content-Type: application/json' \
|
|
454
|
+
--header 'Accept-Language: tr-TR' \
|
|
455
|
+
--header 'X-Request-Id: <uuid>' \
|
|
456
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
457
|
+
--data '{
|
|
458
|
+
"key": "working-hour-<advisorId>",
|
|
459
|
+
"tags": ["working-hours-change", "advisor"],
|
|
460
|
+
"attributes": {
|
|
461
|
+
"advisor": "<advisorId>",
|
|
462
|
+
"absenceType": "working-hours-change",
|
|
463
|
+
"title": "Advisor custom hours",
|
|
464
|
+
"customWorkingHours": {
|
|
465
|
+
"monday": [{"start": "10:00", "end": "12:00"}, {"start": "13:00", "end": "19:00"}],
|
|
466
|
+
"tuesday": [],
|
|
467
|
+
"wednesday": [],
|
|
468
|
+
"thursday": [],
|
|
469
|
+
"friday": [],
|
|
470
|
+
"saturday": [],
|
|
471
|
+
"sunday": []
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}'
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### 14.8 Cancel — `cancel` transition
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/{{instanceIdOrKey}}/transitions/cancel?sync=true' \
|
|
481
|
+
--header 'Content-Type: application/json' \
|
|
482
|
+
--header 'Accept-Language: tr-TR' \
|
|
483
|
+
--header 'X-Request-Id: <uuid>' \
|
|
484
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
485
|
+
--data '{"attributes": {}}'
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### 14.9 Absence update — `update` (example: leave times)
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/absence-entry/instances/{{instanceIdOrKey}}/transitions/update?sync=true' \
|
|
492
|
+
--header 'Content-Type: application/json' \
|
|
493
|
+
--header 'Accept-Language: tr-TR' \
|
|
494
|
+
--header 'X-Request-Id: <uuid>' \
|
|
495
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
496
|
+
--data '{
|
|
497
|
+
"attributes": {
|
|
498
|
+
"startDateTime": "2026-01-28T15:00:00",
|
|
499
|
+
"endDateTime": "2026-01-28T17:00:00",
|
|
500
|
+
"title": "Customer meeting (updated)"
|
|
501
|
+
}
|
|
502
|
+
}'
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### 14.10 `get-absence-entry` function
|
|
506
|
+
|
|
507
|
+
Required `absenceType`. Company-only: `working-hours-change` alone. Date range for public holidays; `advisor` for advisor working hours.
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-absence-entry?absenceType=working-hours-change' \
|
|
511
|
+
--header 'Accept: application/json' \
|
|
512
|
+
--header 'Accept-Language: tr-TR' \
|
|
513
|
+
--header 'X-Request-Id: <uuid>' \
|
|
514
|
+
--header 'Authorization: Bearer <access_token>'
|
|
515
|
+
|
|
516
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-absence-entry?absenceType=public-holiday&startDate=2026-04-01T00:00:00&endDate=2026-04-30T23:59:59' \
|
|
517
|
+
--header 'Accept: application/json' \
|
|
518
|
+
--header 'Accept-Language: tr-TR' \
|
|
519
|
+
--header 'X-Request-Id: <uuid>' \
|
|
520
|
+
--header 'Authorization: Bearer <access_token>'
|
|
521
|
+
|
|
522
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-absence-entry?absenceType=working-hours-change&advisor=<advisorId>' \
|
|
523
|
+
--header 'Accept: application/json' \
|
|
524
|
+
--header 'Accept-Language: tr-TR' \
|
|
525
|
+
--header 'X-Request-Id: <uuid>' \
|
|
526
|
+
--header 'Authorization: Bearer <access_token>'
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### 14.11 `get-available-slots`
|
|
530
|
+
|
|
531
|
+
Returns free slots for `advisorId` on `date`; optional `duration` (minutes).
|
|
532
|
+
|
|
533
|
+
```bash
|
|
534
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-available-slots?advisorId=<advisorId>&date=2026-03-17' \
|
|
535
|
+
--header 'Accept: application/json' \
|
|
536
|
+
--header 'Accept-Language: tr-TR' \
|
|
537
|
+
--header 'X-Request-Id: <uuid>' \
|
|
538
|
+
--header 'Authorization: Bearer <access_token>'
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Example body:
|
|
542
|
+
|
|
543
|
+
```json
|
|
544
|
+
{
|
|
545
|
+
"getAvailableSlots": {
|
|
546
|
+
"availableSlots": [
|
|
547
|
+
"09:00-09:30",
|
|
548
|
+
"09:30-10:00",
|
|
549
|
+
"10:00-10:30"
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### 14.12 Reservation flow (`rezervation`)
|
|
556
|
+
|
|
557
|
+
1. **`start`:** `key` must be unique per reservation; reuse as `randevuKey`. Align `startDateTime` / `endDateTime` with slots. Send **`sub`** (customer identity).
|
|
558
|
+
2. Past date or duplicate active reservation rules may reject creation (see §4 / §12).
|
|
559
|
+
3. If state is **`slot-unavailable`**, call **`appointment-form-retry`** with new times.
|
|
560
|
+
4. After **`appointment-form`**, **`confirm-selection`** confirms user input.
|
|
561
|
+
5. **`create-appointment`** moves to **`active`**; notifications and `get-user-info-for-rezervation` run; SMS to registered phone.
|
|
562
|
+
|
|
563
|
+
In the transition URLs below, use either the **platform instance id** or the reservation **`key`** from `start` (e.g. `rez-<unique-suffix>`) as `{{rezervationInstanceIdOrKey}}`.
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/rezervation/instances/start?sync=true' \
|
|
567
|
+
--header 'Content-Type: application/json' \
|
|
568
|
+
--header 'Accept-Language: tr-TR' \
|
|
569
|
+
--header 'X-Request-Id: <uuid>' \
|
|
570
|
+
--header 'sub: <customer_sub>' \
|
|
571
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
572
|
+
--data '{
|
|
573
|
+
"key": "rez-<unique-suffix>",
|
|
574
|
+
"tags": ["appointment", "randevu"],
|
|
575
|
+
"attributes": {
|
|
576
|
+
"user": "<userRef>",
|
|
577
|
+
"advisor": "<advisorRef>",
|
|
578
|
+
"startDateTime": "2026-04-17T10:30:00",
|
|
579
|
+
"endDateTime": "2026-04-17T11:00:00"
|
|
580
|
+
}
|
|
581
|
+
}'
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
```bash
|
|
585
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/rezervation/instances/{{rezervationInstanceIdOrKey}}/transitions/appointment-form-retry?sync=true' \
|
|
586
|
+
--header 'Content-Type: application/json' \
|
|
587
|
+
--header 'Accept-Language: tr-TR' \
|
|
588
|
+
--header 'X-Request-Id: <uuid>' \
|
|
589
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
590
|
+
--data '{
|
|
591
|
+
"attributes": {
|
|
592
|
+
"startDateTime": "2026-04-17T11:00:00",
|
|
593
|
+
"endDateTime": "2026-04-17T11:30:00"
|
|
594
|
+
}
|
|
595
|
+
}'
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
```bash
|
|
599
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/rezervation/instances/{{rezervationInstanceIdOrKey}}/transitions/confirm-selection?sync=true' \
|
|
600
|
+
--header 'Content-Type: application/json' \
|
|
601
|
+
--header 'Accept-Language: tr-TR' \
|
|
602
|
+
--header 'X-Request-Id: <uuid>' \
|
|
603
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
604
|
+
--data '{"attributes": {}}'
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
```bash
|
|
608
|
+
curl --location --request PATCH '{{BaseUrl}}/morph-touch/workflows/rezervation/instances/{{rezervationInstanceIdOrKey}}/transitions/create-appointment?sync=true' \
|
|
609
|
+
--header 'Content-Type: application/json' \
|
|
610
|
+
--header 'Accept-Language: tr-TR' \
|
|
611
|
+
--header 'X-Request-Id: <uuid>' \
|
|
612
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
613
|
+
--data '{"attributes": {}}'
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
### 14.13 Start meeting (`rezervation-start`)
|
|
617
|
+
|
|
618
|
+
Callable up to **15 minutes** before start; earlier yields **`meet-not-started`**. `randevuKey` is the reservation `key`. `participantType`: `customer`, `advisor`, or `invited`. For **`invited`**, send **`invitedUserId`** and add the user via **add-participant-to-rezervation** first. First participant creates the Matrix room and moves reservation to **`in-meet`**; second joins.
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/rezervation-start/instances/start?sync=true' \
|
|
622
|
+
--header 'Content-Type: application/json' \
|
|
623
|
+
--header 'Accept-Language: tr-TR' \
|
|
624
|
+
--header 'X-Request-Id: <uuid>' \
|
|
625
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
626
|
+
--data '{
|
|
627
|
+
"key": "randevu-<unique-suffix>",
|
|
628
|
+
"tags": ["randevu", "meeting"],
|
|
629
|
+
"attributes": {
|
|
630
|
+
"randevuKey": "rez-<unique-suffix>",
|
|
631
|
+
"participantType": "advisor"
|
|
632
|
+
}
|
|
633
|
+
}'
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
For invited: set `participantType: "invited"` and `invitedUserId: "<inviteeId>"`.
|
|
637
|
+
|
|
638
|
+
### 14.14 Add participant (`add-participant-to-rezervation`)
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/add-participant-to-rezervation/instances/start?sync=true' \
|
|
642
|
+
--header 'Content-Type: application/json' \
|
|
643
|
+
--header 'Accept-Language: tr-TR' \
|
|
644
|
+
--header 'X-Request-Id: <uuid>' \
|
|
645
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
646
|
+
--data '{
|
|
647
|
+
"key": "add-participant-<unique-suffix>",
|
|
648
|
+
"tags": ["rezervation", "add-participant"],
|
|
649
|
+
"attributes": {
|
|
650
|
+
"randevuKey": "rez-<unique-suffix>",
|
|
651
|
+
"newUserId": "<inviteeEmployeeId>"
|
|
652
|
+
}
|
|
653
|
+
}'
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
Suggested `key` pattern: `add-participant-{advisorId}-{randevuKey}`.
|
|
657
|
+
|
|
658
|
+
### 14.15 Active reservation update (`rezervation-update`)
|
|
659
|
+
|
|
660
|
+
`randevuKey` is the reservation `key`. Send `startDateTime`, `endDateTime`, and/or `advisor` as needed. With **`autoProcess: true`** the flow may auto-validate; with **`false`**, after `start` send updates via **`PATCH .../transitions/to-validate`** ([rezervation-update.json](../Workflows/rezervation-update.json)).
|
|
661
|
+
|
|
662
|
+
```bash
|
|
663
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/rezervation-update/instances/start?sync=true' \
|
|
664
|
+
--header 'Content-Type: application/json' \
|
|
665
|
+
--header 'Accept-Language: tr-TR' \
|
|
666
|
+
--header 'X-Request-Id: <uuid>' \
|
|
667
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
668
|
+
--data '{
|
|
669
|
+
"key": "rezervation-update-<unique-suffix>",
|
|
670
|
+
"tags": ["rezervation", "randevu", "update"],
|
|
671
|
+
"attributes": {
|
|
672
|
+
"randevuKey": "rez-<unique-suffix>",
|
|
673
|
+
"startDateTime": "2026-02-03T10:00:00",
|
|
674
|
+
"endDateTime": "2026-02-03T10:30:00",
|
|
675
|
+
"advisor": "<newAdvisorRef>",
|
|
676
|
+
"autoProcess": true
|
|
677
|
+
}
|
|
678
|
+
}'
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### 14.16 Permanent chat — `start-chat`
|
|
682
|
+
|
|
683
|
+
Creates room if missing; otherwise **`in-chat`**. `user` is the customer; `advisorType` **`PM`** or **`IA`**; `advisorId` unique advisor id.
|
|
684
|
+
|
|
685
|
+
```bash
|
|
686
|
+
curl --location '{{BaseUrl}}/morph-touch/workflows/start-chat/instances/start?sync=true' \
|
|
687
|
+
--header 'Content-Type: application/json' \
|
|
688
|
+
--header 'Accept-Language: tr-TR' \
|
|
689
|
+
--header 'X-Request-Id: <uuid>' \
|
|
690
|
+
--header 'Authorization: Bearer <access_token>' \
|
|
691
|
+
--data '{
|
|
692
|
+
"key": "start-chat-<unique-suffix>",
|
|
693
|
+
"tags": ["chat", "start-chat"],
|
|
694
|
+
"attributes": {
|
|
695
|
+
"user": "<userRef>",
|
|
696
|
+
"advisorType": "IA",
|
|
697
|
+
"advisorId": "<advisorId>"
|
|
698
|
+
}
|
|
699
|
+
}'
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### 14.17 Chat rooms and messages (domain functions)
|
|
703
|
+
|
|
704
|
+
Canonical paths: **`GET {{BaseUrl}}/morph-touch/functions/get-chat-rooms`** and **`GET .../functions/get-room-messages`**. Some gateways may use a different prefix.
|
|
705
|
+
|
|
706
|
+
**`get-chat-rooms`:** `user` **or** `advisor` (not both). Optional `roomType`: `permanent` or `rezervation`.
|
|
707
|
+
|
|
708
|
+
**Note:** [GetChatRoomsMapping](../Functions/src/GetChatRoomsMapping.csx) may query instances with a fixed internal `pageSize=100`; a query `pageSize` parameter may not always apply.
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-chat-rooms?user=<userRef>&roomType=permanent' \
|
|
712
|
+
--header 'Accept: application/json' \
|
|
713
|
+
--header 'Accept-Language: tr-TR' \
|
|
714
|
+
--header 'X-Request-Id: <uuid>' \
|
|
715
|
+
--header 'Authorization: Bearer <access_token>'
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
**`get-room-messages`:** Required `roomId`, `user`. Optional **`limit`** (default 50 in mapping); optional `from` for pagination.
|
|
719
|
+
|
|
720
|
+
```bash
|
|
721
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-room-messages?roomId=<encodedRoomId>&user=<userRef>&limit=20' \
|
|
722
|
+
--header 'Accept: application/json' \
|
|
723
|
+
--header 'Accept-Language: tr-TR' \
|
|
724
|
+
--header 'X-Request-Id: <uuid>' \
|
|
725
|
+
--header 'Authorization: Bearer <access_token>'
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
### 14.18 Reservation list — `get-rezervations`
|
|
729
|
+
|
|
730
|
+
Query: `advisorId`, `userId`, `startDate`, `endDate` — dates optional; filter a range when set.
|
|
731
|
+
|
|
732
|
+
```bash
|
|
733
|
+
curl --location '{{BaseUrl}}/morph-touch/functions/get-rezervations?advisorId=<advisorId>&startDate=2026-02-01&endDate=2026-02-28' \
|
|
734
|
+
--header 'Accept: application/json' \
|
|
735
|
+
--header 'Accept-Language: tr-TR' \
|
|
736
|
+
--header 'X-Request-Id: <uuid>' \
|
|
737
|
+
--header 'Authorization: Bearer <access_token>'
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
---
|
|
741
|
+
|
|
742
|
+
*This document is derived from code and workflow definitions; runtime URLs and auth may vary by environment.*
|