@candesk/contracts 7.1.2 → 7.1.4

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.
@@ -1,2 +1,3 @@
1
1
  export declare const TELEGRAM_SESSION_TTL_SECONDS: number;
2
2
  export declare const TELEGRAM_LINK_START_PREFIX = "link_";
3
+ export declare const TELEGRAM_STAFF_LINK_START_PREFIX = "staff_";
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TELEGRAM_LINK_START_PREFIX = exports.TELEGRAM_SESSION_TTL_SECONDS = void 0;
3
+ exports.TELEGRAM_STAFF_LINK_START_PREFIX = exports.TELEGRAM_LINK_START_PREFIX = exports.TELEGRAM_SESSION_TTL_SECONDS = void 0;
4
4
  exports.TELEGRAM_SESSION_TTL_SECONDS = 5 * 60; // 5 minutes
5
5
  exports.TELEGRAM_LINK_START_PREFIX = 'link_';
6
+ exports.TELEGRAM_STAFF_LINK_START_PREFIX = 'staff_';
@@ -1,4 +1,5 @@
1
1
  export * from './medication-wish-changed.interface';
2
+ export * from './requests-waiting.interface';
2
3
  export * from './treatment.events';
3
4
  export * from './treatment-request-approved.interface';
4
5
  export * from './treatment-request-expired.interface';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./medication-wish-changed.interface"), exports);
18
+ __exportStar(require("./requests-waiting.interface"), exports);
18
19
  __exportStar(require("./treatment.events"), exports);
19
20
  __exportStar(require("./treatment-request-approved.interface"), exports);
20
21
  __exportStar(require("./treatment-request-expired.interface"), exports);
@@ -0,0 +1,7 @@
1
+ export interface RequestsWaitingEvent {
2
+ doctorId: string;
3
+ email: string;
4
+ requests: number;
5
+ appointments: number;
6
+ isMorning: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,4 +7,5 @@ export declare const TREATMENT_EVENTS: {
7
7
  readonly REQUEST_REFUNDED: 'treatment.request.refunded';
8
8
  readonly REQUEST_APPROVED: 'treatment.request.approved';
9
9
  readonly REQUEST_REJECTED: 'treatment.request.rejected';
10
+ readonly REQUESTS_WAITING: 'treatment.requests.waiting';
10
11
  };
@@ -9,5 +9,6 @@ exports.TREATMENT_EVENTS = {
9
9
  WITHDRAWAL_REJECTED: 'treatment.withdrawal.rejected',
10
10
  REQUEST_REFUNDED: 'treatment.request.refunded',
11
11
  REQUEST_APPROVED: 'treatment.request.approved',
12
- REQUEST_REJECTED: 'treatment.request.rejected'
12
+ REQUEST_REJECTED: 'treatment.request.rejected',
13
+ REQUESTS_WAITING: 'treatment.requests.waiting'
13
14
  };
@@ -58,8 +58,41 @@ export interface DeleteNotificationsRequest {
58
58
  }
59
59
  export interface DeleteNotificationsResponse {
60
60
  }
61
+ export interface StaffNotificationSettingsResponse {
62
+ emailEnabled: boolean;
63
+ telegramEnabled: boolean;
64
+ isTelegramLinked: boolean;
65
+ }
66
+ export interface GetStaffNotificationSettingsRequest {
67
+ staffId: string;
68
+ }
69
+ export interface UpdateStaffNotificationSettingsRequest {
70
+ staffId: string;
71
+ emailEnabled: boolean;
72
+ telegramEnabled: boolean;
73
+ }
74
+ export interface CreateStaffTelegramLinkRequest {
75
+ staffId: string;
76
+ }
77
+ export interface CreateStaffTelegramLinkResponse {
78
+ url: string;
79
+ }
80
+ export interface CompleteStaffTelegramLinkRequest {
81
+ code: string;
82
+ chatId: string;
83
+ }
84
+ export interface CompleteStaffTelegramLinkResponse {
85
+ }
86
+ export interface UnlinkStaffTelegramRequest {
87
+ staffId: string;
88
+ }
61
89
  export interface NotificationService {
62
90
  listNotifications(request: ListNotificationsRequest): Promise<ListNotificationsResponse>;
63
91
  markNotificationsRead(request: MarkNotificationsReadRequest): Promise<MarkNotificationsReadResponse>;
64
92
  deleteNotifications(request: DeleteNotificationsRequest): Promise<DeleteNotificationsResponse>;
93
+ getStaffNotificationSettings(request: GetStaffNotificationSettingsRequest): Promise<StaffNotificationSettingsResponse>;
94
+ updateStaffNotificationSettings(request: UpdateStaffNotificationSettingsRequest): Promise<StaffNotificationSettingsResponse>;
95
+ createStaffTelegramLink(request: CreateStaffTelegramLinkRequest): Promise<CreateStaffTelegramLinkResponse>;
96
+ completeStaffTelegramLink(request: CompleteStaffTelegramLinkRequest): Promise<CompleteStaffTelegramLinkResponse>;
97
+ unlinkStaffTelegram(request: UnlinkStaffTelegramRequest): Promise<StaffNotificationSettingsResponse>;
65
98
  }
@@ -55,6 +55,7 @@ export interface Staff {
55
55
  email?: string | undefined;
56
56
  avatarKey?: string | undefined;
57
57
  absence?: StaffAbsence | undefined;
58
+ lastSeenAt?: string | undefined;
58
59
  }
59
60
  export interface StaffAddress {
60
61
  street: string;
@@ -67,6 +68,11 @@ export interface StaffAbsence {
67
68
  from: string;
68
69
  until: string;
69
70
  }
71
+ export interface TouchStaffPresenceRequest {
72
+ id: string;
73
+ }
74
+ export interface TouchStaffPresenceResponse {
75
+ }
70
76
  export interface StaffService {
71
77
  listStaff(request: ListStaffRequest): Promise<ListStaffResponse>;
72
78
  saveStaff(request: SaveStaffRequest): Promise<SaveStaffResponse>;
@@ -74,4 +80,5 @@ export interface StaffService {
74
80
  setStaffAvatar(request: SetStaffAvatarRequest): Promise<SetStaffAvatarResponse>;
75
81
  setStaffAbsence(request: SetStaffAbsenceRequest): Promise<SetStaffAbsenceResponse>;
76
82
  deleteStaff(request: DeleteStaffRequest): Promise<DeleteStaffResponse>;
83
+ touchStaffPresence(request: TouchStaffPresenceRequest): Promise<TouchStaffPresenceResponse>;
77
84
  }
@@ -59,16 +59,54 @@ export interface DeleteNotificationsRequest {
59
59
  }
60
60
  export interface DeleteNotificationsResponse {
61
61
  }
62
+ export interface StaffNotificationSettingsResponse {
63
+ emailEnabled: boolean;
64
+ telegramEnabled: boolean;
65
+ isTelegramLinked: boolean;
66
+ }
67
+ export interface GetStaffNotificationSettingsRequest {
68
+ staffId: string;
69
+ }
70
+ export interface UpdateStaffNotificationSettingsRequest {
71
+ staffId: string;
72
+ emailEnabled: boolean;
73
+ telegramEnabled: boolean;
74
+ }
75
+ export interface CreateStaffTelegramLinkRequest {
76
+ staffId: string;
77
+ }
78
+ export interface CreateStaffTelegramLinkResponse {
79
+ url: string;
80
+ }
81
+ export interface CompleteStaffTelegramLinkRequest {
82
+ code: string;
83
+ chatId: string;
84
+ }
85
+ export interface CompleteStaffTelegramLinkResponse {
86
+ }
87
+ export interface UnlinkStaffTelegramRequest {
88
+ staffId: string;
89
+ }
62
90
  export declare const NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
63
91
  export interface NotificationServiceClient {
64
92
  listNotifications(request: ListNotificationsRequest): Observable<ListNotificationsResponse>;
65
93
  markNotificationsRead(request: MarkNotificationsReadRequest): Observable<MarkNotificationsReadResponse>;
66
94
  deleteNotifications(request: DeleteNotificationsRequest): Observable<DeleteNotificationsResponse>;
95
+ getStaffNotificationSettings(request: GetStaffNotificationSettingsRequest): Observable<StaffNotificationSettingsResponse>;
96
+ updateStaffNotificationSettings(request: UpdateStaffNotificationSettingsRequest): Observable<StaffNotificationSettingsResponse>;
97
+ createStaffTelegramLink(request: CreateStaffTelegramLinkRequest): Observable<CreateStaffTelegramLinkResponse>;
98
+ completeStaffTelegramLink(request: CompleteStaffTelegramLinkRequest): Observable<CompleteStaffTelegramLinkResponse>;
99
+ unlinkStaffTelegram(request: UnlinkStaffTelegramRequest): Observable<StaffNotificationSettingsResponse>;
67
100
  }
68
101
  export interface NotificationServiceController {
69
102
  listNotifications(request: ListNotificationsRequest): Promise<ListNotificationsResponse> | Observable<ListNotificationsResponse> | ListNotificationsResponse;
70
103
  markNotificationsRead(request: MarkNotificationsReadRequest): Promise<MarkNotificationsReadResponse> | Observable<MarkNotificationsReadResponse> | MarkNotificationsReadResponse;
71
104
  deleteNotifications(request: DeleteNotificationsRequest): Promise<DeleteNotificationsResponse> | Observable<DeleteNotificationsResponse> | DeleteNotificationsResponse;
105
+ getStaffNotificationSettings(request: GetStaffNotificationSettingsRequest): Promise<StaffNotificationSettingsResponse> | Observable<StaffNotificationSettingsResponse> | StaffNotificationSettingsResponse;
106
+ updateStaffNotificationSettings(request: UpdateStaffNotificationSettingsRequest): Promise<StaffNotificationSettingsResponse> | Observable<StaffNotificationSettingsResponse> | StaffNotificationSettingsResponse;
107
+ createStaffTelegramLink(request: CreateStaffTelegramLinkRequest): Promise<CreateStaffTelegramLinkResponse> | Observable<CreateStaffTelegramLinkResponse> | CreateStaffTelegramLinkResponse;
108
+ completeStaffTelegramLink(request: CompleteStaffTelegramLinkRequest): Promise<CompleteStaffTelegramLinkResponse> | Observable<CompleteStaffTelegramLinkResponse> | CompleteStaffTelegramLinkResponse;
109
+ unlinkStaffTelegram(request: UnlinkStaffTelegramRequest): Promise<StaffNotificationSettingsResponse> | Observable<StaffNotificationSettingsResponse> | StaffNotificationSettingsResponse;
72
110
  }
73
111
  export declare function NotificationServiceControllerMethods(): (constructor: Function) => void;
74
112
  export declare const NOTIFICATION_SERVICE_NAME = "NotificationService";
@@ -39,7 +39,16 @@ var NotificationType;
39
39
  exports.NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
40
40
  function NotificationServiceControllerMethods() {
41
41
  return function (constructor) {
42
- const grpcMethods = ["listNotifications", "markNotificationsRead", "deleteNotifications"];
42
+ const grpcMethods = [
43
+ "listNotifications",
44
+ "markNotificationsRead",
45
+ "deleteNotifications",
46
+ "getStaffNotificationSettings",
47
+ "updateStaffNotificationSettings",
48
+ "createStaffTelegramLink",
49
+ "completeStaffTelegramLink",
50
+ "unlinkStaffTelegram",
51
+ ];
43
52
  for (const method of grpcMethods) {
44
53
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
45
54
  (0, microservices_1.GrpcMethod)("NotificationService", method)(constructor.prototype[method], method, descriptor);
@@ -56,6 +56,7 @@ export interface Staff {
56
56
  email?: string | undefined;
57
57
  avatarKey?: string | undefined;
58
58
  absence?: StaffAbsence | undefined;
59
+ lastSeenAt?: string | undefined;
59
60
  }
60
61
  export interface StaffAddress {
61
62
  street: string;
@@ -68,6 +69,11 @@ export interface StaffAbsence {
68
69
  from: string;
69
70
  until: string;
70
71
  }
72
+ export interface TouchStaffPresenceRequest {
73
+ id: string;
74
+ }
75
+ export interface TouchStaffPresenceResponse {
76
+ }
71
77
  export declare const STAFF_V1_PACKAGE_NAME = "staff.v1";
72
78
  export interface StaffServiceClient {
73
79
  listStaff(request: ListStaffRequest): Observable<ListStaffResponse>;
@@ -76,6 +82,7 @@ export interface StaffServiceClient {
76
82
  setStaffAvatar(request: SetStaffAvatarRequest): Observable<SetStaffAvatarResponse>;
77
83
  setStaffAbsence(request: SetStaffAbsenceRequest): Observable<SetStaffAbsenceResponse>;
78
84
  deleteStaff(request: DeleteStaffRequest): Observable<DeleteStaffResponse>;
85
+ touchStaffPresence(request: TouchStaffPresenceRequest): Observable<TouchStaffPresenceResponse>;
79
86
  }
80
87
  export interface StaffServiceController {
81
88
  listStaff(request: ListStaffRequest): Promise<ListStaffResponse> | Observable<ListStaffResponse> | ListStaffResponse;
@@ -84,6 +91,7 @@ export interface StaffServiceController {
84
91
  setStaffAvatar(request: SetStaffAvatarRequest): Promise<SetStaffAvatarResponse> | Observable<SetStaffAvatarResponse> | SetStaffAvatarResponse;
85
92
  setStaffAbsence(request: SetStaffAbsenceRequest): Promise<SetStaffAbsenceResponse> | Observable<SetStaffAbsenceResponse> | SetStaffAbsenceResponse;
86
93
  deleteStaff(request: DeleteStaffRequest): Promise<DeleteStaffResponse> | Observable<DeleteStaffResponse> | DeleteStaffResponse;
94
+ touchStaffPresence(request: TouchStaffPresenceRequest): Promise<TouchStaffPresenceResponse> | Observable<TouchStaffPresenceResponse> | TouchStaffPresenceResponse;
87
95
  }
88
96
  export declare function StaffServiceControllerMethods(): (constructor: Function) => void;
89
97
  export declare const STAFF_SERVICE_NAME = "StaffService";
@@ -21,6 +21,7 @@ function StaffServiceControllerMethods() {
21
21
  "setStaffAvatar",
22
22
  "setStaffAbsence",
23
23
  "deleteStaff",
24
+ "touchStaffPresence",
24
25
  ];
25
26
  for (const method of grpcMethods) {
26
27
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "7.1.2",
3
+ "version": "7.1.4",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -6,6 +6,11 @@ service NotificationService {
6
6
  rpc ListNotifications (ListNotificationsRequest) returns (ListNotificationsResponse);
7
7
  rpc MarkNotificationsRead (MarkNotificationsReadRequest) returns (MarkNotificationsReadResponse);
8
8
  rpc DeleteNotifications (DeleteNotificationsRequest) returns (DeleteNotificationsResponse);
9
+ rpc GetStaffNotificationSettings (GetStaffNotificationSettingsRequest) returns (StaffNotificationSettingsResponse);
10
+ rpc UpdateStaffNotificationSettings (UpdateStaffNotificationSettingsRequest) returns (StaffNotificationSettingsResponse);
11
+ rpc CreateStaffTelegramLink (CreateStaffTelegramLinkRequest) returns (CreateStaffTelegramLinkResponse);
12
+ rpc CompleteStaffTelegramLink (CompleteStaffTelegramLinkRequest) returns (CompleteStaffTelegramLinkResponse);
13
+ rpc UnlinkStaffTelegram (UnlinkStaffTelegramRequest) returns (StaffNotificationSettingsResponse);
9
14
  }
10
15
 
11
16
  enum NotificationType {
@@ -64,3 +69,38 @@ message DeleteNotificationsRequest {
64
69
  }
65
70
 
66
71
  message DeleteNotificationsResponse {}
72
+
73
+ message StaffNotificationSettingsResponse {
74
+ bool email_enabled = 1;
75
+ bool telegram_enabled = 2;
76
+ bool is_telegram_linked = 3;
77
+ }
78
+
79
+ message GetStaffNotificationSettingsRequest {
80
+ string staff_id = 1;
81
+ }
82
+
83
+ message UpdateStaffNotificationSettingsRequest {
84
+ string staff_id = 1;
85
+ bool email_enabled = 2;
86
+ bool telegram_enabled = 3;
87
+ }
88
+
89
+ message CreateStaffTelegramLinkRequest {
90
+ string staff_id = 1;
91
+ }
92
+
93
+ message CreateStaffTelegramLinkResponse {
94
+ string url = 1;
95
+ }
96
+
97
+ message CompleteStaffTelegramLinkRequest {
98
+ string code = 1;
99
+ string chat_id = 2;
100
+ }
101
+
102
+ message CompleteStaffTelegramLinkResponse {}
103
+
104
+ message UnlinkStaffTelegramRequest {
105
+ string staff_id = 1;
106
+ }
package/proto/staff.proto CHANGED
@@ -9,6 +9,7 @@ service StaffService {
9
9
  rpc SetStaffAvatar (SetStaffAvatarRequest) returns (SetStaffAvatarResponse);
10
10
  rpc SetStaffAbsence (SetStaffAbsenceRequest) returns (SetStaffAbsenceResponse);
11
11
  rpc DeleteStaff (DeleteStaffRequest) returns (DeleteStaffResponse);
12
+ rpc TouchStaffPresence (TouchStaffPresenceRequest) returns (TouchStaffPresenceResponse);
12
13
  }
13
14
 
14
15
  message ListStaffRequest {
@@ -78,6 +79,7 @@ message Staff {
78
79
  optional string email = 7;
79
80
  optional string avatar_key = 8;
80
81
  optional StaffAbsence absence = 9;
82
+ optional string last_seen_at = 10;
81
83
  }
82
84
 
83
85
  message StaffAddress {
@@ -92,3 +94,9 @@ message StaffAbsence {
92
94
  string from = 1;
93
95
  string until = 2;
94
96
  }
97
+
98
+ message TouchStaffPresenceRequest {
99
+ string id = 1;
100
+ }
101
+
102
+ message TouchStaffPresenceResponse {}