@burgan-tech/morph-touch-runtime 0.0.7 → 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.
Files changed (60) hide show
  1. package/burgan-tech-morph-touch-runtime-0.0.8.tgz +0 -0
  2. package/morph-touch/Functions/get-absence-entry.1.0.0.json +1 -1
  3. package/morph-touch/Functions/get-advisor-stats.1.0.0.json +1 -1
  4. package/morph-touch/Functions/get-available-slots.1.0.0.json +1 -1
  5. package/morph-touch/Functions/get-rezervations.1.0.0.json +1 -1
  6. package/morph-touch/Functions/src/GetAbsenceEntryMapping.csx +18 -4
  7. package/morph-touch/Functions/src/GetAdvisorStatsMapping.csx +22 -8
  8. package/morph-touch/Functions/src/GetAvailableSlotsMapping.csx +22 -14
  9. package/morph-touch/Functions/src/GetRezervationsMapping.csx +19 -2
  10. package/morph-touch/Functions/src/SendCancelNotificationMapping.csx +27 -2
  11. package/morph-touch/Tasks/login-for-chat.1.0.0.json +27 -0
  12. package/morph-touch/Tasks/register-for-chat.1.0.0.json +27 -0
  13. package/morph-touch/Workflows/chat-room.json +273 -14
  14. package/morph-touch/Workflows/notification-sender.json +2 -2
  15. package/morph-touch/Workflows/rezervation-start.json +39 -2
  16. package/morph-touch/Workflows/rezervation-transfer.json +44 -7
  17. package/morph-touch/Workflows/rezervation-update.json +4 -4
  18. package/morph-touch/Workflows/rezervation.json +135 -45
  19. package/morph-touch/Workflows/src/CanStartRezervationTimerMapping.csx +18 -3
  20. package/morph-touch/Workflows/src/ChatRoomRemoveMapping.csx +10 -1
  21. package/morph-touch/Workflows/src/ChatRoomTransferInviteMapping.csx +10 -1
  22. package/morph-touch/Workflows/src/ChatRoomTransferRemoveMapping.csx +9 -1
  23. package/morph-touch/Workflows/src/ChatRoomUpdateMapping.csx +10 -1
  24. package/morph-touch/Workflows/src/CheckDuplicateRezervationMapping.csx +17 -3
  25. package/morph-touch/Workflows/src/CheckRandevuTimeMapping.csx +16 -2
  26. package/morph-touch/Workflows/src/CreateChatRoomForRezervationMapping.csx +12 -2
  27. package/morph-touch/Workflows/src/CreatePermanentChatRoomMapping.csx +11 -1
  28. package/morph-touch/Workflows/src/EnrichRezervationsForTransferMapping.csx +18 -4
  29. package/morph-touch/Workflows/src/FetchRoomMessagesForSummaryMapping.csx +10 -2
  30. package/morph-touch/Workflows/src/InviteAdvisorForRandevuUpdateMapping.csx +10 -1
  31. package/morph-touch/Workflows/src/InviteNewAdvisorToRezervationRoomMapping.csx +11 -2
  32. package/morph-touch/Workflows/src/InviteNewParticipantToRandevuRoomMapping.csx +10 -1
  33. package/morph-touch/Workflows/src/JoinChatRoomForAddParticipantMapping.csx +5 -1
  34. package/morph-touch/Workflows/src/JoinChatRoomForRandevuStartMapping.csx +5 -1
  35. package/morph-touch/Workflows/src/JoinChatRoomForRezervationMapping.csx +4 -0
  36. package/morph-touch/Workflows/src/JoinMatrixRoomMapping.csx +11 -1
  37. package/morph-touch/Workflows/src/JoinUserToRoomMapping.csx +6 -0
  38. package/morph-touch/Workflows/src/LoginForAddParticipantChatMapping.csx +35 -6
  39. package/morph-touch/Workflows/src/LoginForChatRoomMapping.csx +121 -0
  40. package/morph-touch/Workflows/src/LoginForJoinUserToRoomMapping.csx +142 -0
  41. package/morph-touch/Workflows/src/LoginForRandevuStartChatMapping.csx +35 -10
  42. package/morph-touch/Workflows/src/LoginForTransferChatMapping.csx +153 -0
  43. package/morph-touch/Workflows/src/RegisterForAddParticipantChatMapping.csx +74 -0
  44. package/morph-touch/Workflows/src/RegisterForChatRoomMapping.csx +74 -0
  45. package/morph-touch/Workflows/src/RegisterForJoinUserToRoomMapping.csx +87 -0
  46. package/morph-touch/Workflows/src/RegisterForRandevuStartChatMapping.csx +80 -0
  47. package/morph-touch/Workflows/src/RegisterForTransferChatMapping.csx +113 -0
  48. package/morph-touch/Workflows/src/SendPushNotificationMapping.csx +25 -4
  49. package/morph-touch/Workflows/src/SendSmsNotificationMapping.csx +25 -4
  50. package/morph-touch/Workflows/src/SendSummaryToNewRoomMapping.csx +10 -2
  51. package/morph-touch/Workflows/src/SetRoomHistoryVisibilityMapping.csx +12 -4
  52. package/morph-touch/Workflows/src/ValidateDateForRezervationMapping.csx +16 -2
  53. package/morph-touch/Workflows/src/ValidateSlotForRandevuUpdateMapping.csx +22 -15
  54. package/morph-touch/Workflows/src/ValidateSlotForRezervationMapping.csx +23 -16
  55. package/morph-touch/Workflows/src/ValidateTransferMapping.csx +16 -2
  56. package/morph-touch/doc/morph-touch-domain.en.md +1 -1
  57. package/morph-touch/doc/morph-touch-domain.md +1 -1
  58. package/package.json +1 -1
  59. package/vnext.config.json +1 -1
  60. package/burgan-tech-morph-touch-runtime-0.0.7.tgz +0 -0
@@ -22,7 +22,8 @@ public class SendCancelNotificationMapping : ScriptBase, IMapping
22
22
  var attrs = instance.Attributes;
23
23
  string user = attrs?.user?.ToString() ?? "";
24
24
  string advisor = attrs?.advisor?.ToString() ?? "";
25
- string startDateTime = attrs?.startDateTime?.ToString() ?? "";
25
+ string startDateTimeRaw = attrs?.startDateTime?.ToString() ?? "";
26
+ string startDateTime = FormatInBusinessTimeZone(startDateTimeRaw);
26
27
 
27
28
  if (string.IsNullOrEmpty(user))
28
29
  return Task.FromResult(new ScriptResponse());
@@ -44,7 +45,7 @@ public class SendCancelNotificationMapping : ScriptBase, IMapping
44
45
  {
45
46
  reservationKey = instanceKey,
46
47
  advisorId = advisor,
47
- originalDateTime = startDateTime
48
+ originalDateTime = startDateTimeRaw
48
49
  }
49
50
  });
50
51
 
@@ -60,4 +61,28 @@ public class SendCancelNotificationMapping : ScriptBase, IMapping
60
61
  Tags = new[] { "notification", "cancel" }
61
62
  });
62
63
  }
64
+
65
+ private string FormatInBusinessTimeZone(string dateStr)
66
+ {
67
+ if (string.IsNullOrEmpty(dateStr)) return dateStr;
68
+ if (!DateTimeOffset.TryParse(dateStr,
69
+ System.Globalization.CultureInfo.InvariantCulture,
70
+ System.Globalization.DateTimeStyles.None, out var dto))
71
+ return dateStr;
72
+
73
+ var tz = ResolveBusinessTimeZone();
74
+ var local = TimeZoneInfo.ConvertTimeFromUtc(dto.UtcDateTime, tz);
75
+ return local.ToString("dd.MM.yyyy HH:mm");
76
+ }
77
+
78
+ private TimeZoneInfo ResolveBusinessTimeZone()
79
+ {
80
+ var id = GetConfigValue("Appointments:TimeZone")
81
+ ?? GetConfigValue("APPOINTMENT_TIMEZONE");
82
+ if (string.IsNullOrWhiteSpace(id)) id = "Europe/Istanbul";
83
+ try { return TimeZoneInfo.FindSystemTimeZoneById(id.Trim()); } catch { }
84
+ try { return TimeZoneInfo.FindSystemTimeZoneById("Turkey Standard Time"); } catch { }
85
+ return TimeZoneInfo.CreateCustomTimeZone(
86
+ "TRT", TimeSpan.FromHours(3), "TRT (UTC+3)", "TRT (UTC+3)");
87
+ }
63
88
  }
@@ -0,0 +1,27 @@
1
+ {
2
+ "key": "login-for-chat",
3
+ "flow": "sys-tasks",
4
+ "domain": "morph-touch",
5
+ "version": "1.0.0",
6
+ "flowVersion": "1.0.0",
7
+ "tags": [
8
+ "chat",
9
+ "matrix",
10
+ "synapse",
11
+ "login",
12
+ "http"
13
+ ],
14
+ "attributes": {
15
+ "type": "6",
16
+ "config": {
17
+ "method": "POST",
18
+ "url": "/_matrix/client/v3/login",
19
+ "headers": {
20
+ "Content-Type": "application/json",
21
+ "Accept": "application/json"
22
+ },
23
+ "timeoutSeconds": 30,
24
+ "validateSsl": true
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "key": "register-for-chat",
3
+ "flow": "sys-tasks",
4
+ "domain": "morph-touch",
5
+ "version": "1.0.0",
6
+ "flowVersion": "1.0.0",
7
+ "tags": [
8
+ "chat",
9
+ "matrix",
10
+ "synapse",
11
+ "register",
12
+ "http"
13
+ ],
14
+ "attributes": {
15
+ "type": "6",
16
+ "config": {
17
+ "method": "POST",
18
+ "url": "/_matrix/client/v3/register",
19
+ "headers": {
20
+ "Content-Type": "application/json",
21
+ "Accept": "application/json"
22
+ },
23
+ "timeoutSeconds": 30,
24
+ "validateSsl": true
25
+ }
26
+ }
27
+ }