@burgan-tech/morph-touch-runtime 0.0.6 → 0.0.8
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.8.tgz +0 -0
- package/morph-touch/Functions/get-absence-entry.1.0.0.json +1 -1
- package/morph-touch/Functions/get-advisor-stats.1.0.0.json +1 -1
- package/morph-touch/Functions/get-available-slots.1.0.0.json +1 -1
- package/morph-touch/Functions/get-rezervations.1.0.0.json +1 -1
- package/morph-touch/Functions/src/GetAbsenceEntryMapping.csx +18 -4
- package/morph-touch/Functions/src/GetAdvisorStatsMapping.csx +22 -8
- package/morph-touch/Functions/src/GetAvailableSlotsMapping.csx +22 -14
- package/morph-touch/Functions/src/GetRezervationsMapping.csx +46 -9
- package/morph-touch/Functions/src/SendCancelNotificationMapping.csx +27 -2
- package/morph-touch/Tasks/login-for-chat.1.0.0.json +27 -0
- package/morph-touch/Tasks/register-for-chat.1.0.0.json +27 -0
- package/morph-touch/Workflows/chat-room.json +273 -14
- package/morph-touch/Workflows/notification-sender.json +2 -2
- package/morph-touch/Workflows/rezervation-start.json +39 -2
- package/morph-touch/Workflows/rezervation-transfer.json +44 -7
- package/morph-touch/Workflows/rezervation-update.json +4 -4
- package/morph-touch/Workflows/rezervation.json +135 -45
- package/morph-touch/Workflows/src/CanStartRezervationTimerMapping.csx +18 -3
- package/morph-touch/Workflows/src/ChatRoomRemoveMapping.csx +10 -1
- package/morph-touch/Workflows/src/ChatRoomTransferInviteMapping.csx +10 -1
- package/morph-touch/Workflows/src/ChatRoomTransferRemoveMapping.csx +9 -1
- package/morph-touch/Workflows/src/ChatRoomUpdateMapping.csx +10 -1
- package/morph-touch/Workflows/src/CheckDuplicateRezervationMapping.csx +17 -3
- package/morph-touch/Workflows/src/CheckRandevuTimeMapping.csx +16 -2
- package/morph-touch/Workflows/src/CreateChatRoomForRezervationMapping.csx +12 -2
- package/morph-touch/Workflows/src/CreatePermanentChatRoomMapping.csx +11 -1
- package/morph-touch/Workflows/src/EnrichRezervationsForTransferMapping.csx +18 -4
- package/morph-touch/Workflows/src/FetchRoomMessagesForSummaryMapping.csx +10 -2
- package/morph-touch/Workflows/src/InviteAdvisorForRandevuUpdateMapping.csx +10 -1
- package/morph-touch/Workflows/src/InviteNewAdvisorToRezervationRoomMapping.csx +11 -2
- package/morph-touch/Workflows/src/InviteNewParticipantToRandevuRoomMapping.csx +10 -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 +4 -0
- package/morph-touch/Workflows/src/JoinMatrixRoomMapping.csx +11 -1
- package/morph-touch/Workflows/src/JoinUserToRoomMapping.csx +6 -0
- package/morph-touch/Workflows/src/LoginForAddParticipantChatMapping.csx +35 -6
- package/morph-touch/Workflows/src/LoginForChatRoomMapping.csx +121 -0
- package/morph-touch/Workflows/src/LoginForJoinUserToRoomMapping.csx +142 -0
- package/morph-touch/Workflows/src/LoginForRandevuStartChatMapping.csx +35 -10
- package/morph-touch/Workflows/src/LoginForTransferChatMapping.csx +153 -0
- package/morph-touch/Workflows/src/RegisterForAddParticipantChatMapping.csx +74 -0
- package/morph-touch/Workflows/src/RegisterForChatRoomMapping.csx +74 -0
- package/morph-touch/Workflows/src/RegisterForJoinUserToRoomMapping.csx +87 -0
- package/morph-touch/Workflows/src/RegisterForRandevuStartChatMapping.csx +80 -0
- package/morph-touch/Workflows/src/RegisterForTransferChatMapping.csx +113 -0
- package/morph-touch/Workflows/src/SendPushNotificationMapping.csx +25 -4
- package/morph-touch/Workflows/src/SendSmsNotificationMapping.csx +25 -4
- package/morph-touch/Workflows/src/SendSummaryToNewRoomMapping.csx +10 -2
- package/morph-touch/Workflows/src/SetRoomHistoryVisibilityMapping.csx +12 -4
- package/morph-touch/Workflows/src/ValidateDateForRezervationMapping.csx +16 -2
- package/morph-touch/Workflows/src/ValidateSlotForRandevuUpdateMapping.csx +22 -15
- package/morph-touch/Workflows/src/ValidateSlotForRezervationMapping.csx +23 -16
- package/morph-touch/Workflows/src/ValidateTransferMapping.csx +16 -2
- package/morph-touch/doc/morph-touch-domain.en.md +420 -6
- package/morph-touch/doc/morph-touch-domain.md +423 -6
- package/package.json +1 -1
- package/vnext.config.json +1 -1
- package/burgan-tech-morph-touch-runtime-0.0.6.tgz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Morph-touch domain — technical overview
|
|
2
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.
|
|
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
4
|
|
|
5
5
|
Turkish version: [morph-touch-domain.md](morph-touch-domain.md).
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ Turkish version: [morph-touch-domain.md](morph-touch-domain.md).
|
|
|
9
9
|
## 1. Overview and terminology
|
|
10
10
|
|
|
11
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}`.
|
|
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
13
|
- **Integrations:**
|
|
14
14
|
- **DAPR / application API:** `api/v{version}/{domain}/...` (paths such as `functions/state`, `functions/data` in mappings).
|
|
15
15
|
- **Matrix:** `MatrixBaseUrl` (secret); room creation, join, invite, kick, history visibility.
|
|
@@ -63,6 +63,8 @@ flowchart LR
|
|
|
63
63
|
|
|
64
64
|
Records are usually kept in `complete`; updated via `update`, moved to `cancelled` via `cancel`.
|
|
65
65
|
|
|
66
|
+
For detailed request bodies, key rules, and cURL examples, see **section 14**.
|
|
67
|
+
|
|
66
68
|
### Link to appointment transfer
|
|
67
69
|
|
|
68
70
|
- Transition **`start-transfer`** is evaluated only when `absenceType == "personal-leave"` (`CanStartTransferMapping` — [Workflows/src/CanStartTransferMapping.csx](../Workflows/src/CanStartTransferMapping.csx)).
|
|
@@ -276,13 +278,14 @@ See [Functions/get-room-messages.http](../Functions/get-room-messages.http) for
|
|
|
276
278
|
### Workflow API templates
|
|
277
279
|
|
|
278
280
|
- **Start instance:**
|
|
279
|
-
`POST {{baseUrl}}/
|
|
281
|
+
`POST {{baseUrl}}/morph-touch/workflows/{flowKey}/instances/start?sync=true`
|
|
280
282
|
Examples: `rezervation`, `absence-entry`, `rezervation-start`, `chat-room`, `start-chat`, `rezervation-transfer`, `notification-sender` (subflow).
|
|
281
283
|
- **Get instance:**
|
|
282
|
-
`GET
|
|
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-...`).
|
|
283
286
|
- **Transition:**
|
|
284
|
-
`PATCH
|
|
285
|
-
Body is usually `{ "attributes": { ... } }`.
|
|
287
|
+
`PATCH {{baseUrl}}/morph-touch/workflows/{flowKey}/instances/{{instanceIdOrKey}}/transitions/{transitionKey}?sync=true`
|
|
288
|
+
Same: **id** or **`key`**. Body is usually `{ "attributes": { ... } }`.
|
|
286
289
|
|
|
287
290
|
### Sample requests (collection folders)
|
|
288
291
|
|
|
@@ -325,4 +328,415 @@ Collection descriptions reference [vNext documentation](https://github.com/burga
|
|
|
325
328
|
|
|
326
329
|
---
|
|
327
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>`:** In many setups this header is **required**; whether it is mandatory can **vary by environment** (e.g. local dev may omit it per policy). The access token itself 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
|
+
|
|
328
742
|
*This document is derived from code and workflow definitions; runtime URLs and auth may vary by environment.*
|