@candesk/contracts 6.37.0 → 6.38.0

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.
@@ -12,6 +12,8 @@ export declare const AUTH_EVENTS: {
12
12
  readonly STAFF_EMAIL_ASSIGNED: 'auth.staff-email.assigned';
13
13
  readonly STAFF_DEACTIVATED: 'auth.staff.deactivated';
14
14
  readonly STAFF_ACTIVATED: 'auth.staff.activated';
15
+ readonly PATIENT_BLOCKED: 'auth.patient.blocked';
16
+ readonly PATIENT_UNBLOCKED: 'auth.patient.unblocked';
15
17
  readonly TOTP_ENABLED: 'auth.totp.enabled';
16
18
  readonly TOTP_DISABLED: 'auth.totp.disabled';
17
19
  };
@@ -15,6 +15,8 @@ exports.AUTH_EVENTS = {
15
15
  STAFF_EMAIL_ASSIGNED: 'auth.staff-email.assigned',
16
16
  STAFF_DEACTIVATED: 'auth.staff.deactivated',
17
17
  STAFF_ACTIVATED: 'auth.staff.activated',
18
+ PATIENT_BLOCKED: 'auth.patient.blocked',
19
+ PATIENT_UNBLOCKED: 'auth.patient.unblocked',
18
20
  TOTP_ENABLED: 'auth.totp.enabled',
19
21
  TOTP_DISABLED: 'auth.totp.disabled'
20
22
  };
@@ -5,6 +5,8 @@ export * from './email-assigned.interface';
5
5
  export * from './email-change-requested.interface';
6
6
  export * from './email-changed.interface';
7
7
  export * from './otp-requested.interface';
8
+ export * from './patient-blocked.interface';
9
+ export * from './patient-unblocked.interface';
8
10
  export * from './staff-activated.interface';
9
11
  export * from './staff-deactivated.interface';
10
12
  export * from './staff-email-assigned.interface';
@@ -21,6 +21,8 @@ __exportStar(require("./email-assigned.interface"), exports);
21
21
  __exportStar(require("./email-change-requested.interface"), exports);
22
22
  __exportStar(require("./email-changed.interface"), exports);
23
23
  __exportStar(require("./otp-requested.interface"), exports);
24
+ __exportStar(require("./patient-blocked.interface"), exports);
25
+ __exportStar(require("./patient-unblocked.interface"), exports);
24
26
  __exportStar(require("./staff-activated.interface"), exports);
25
27
  __exportStar(require("./staff-deactivated.interface"), exports);
26
28
  __exportStar(require("./staff-email-assigned.interface"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PatientBlockedEvent {
2
+ email: string | null;
3
+ telegramId: string | null;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface PatientUnblockedEvent {
2
+ email: string | null;
3
+ telegramId: string | null;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,6 +11,7 @@ export declare enum Role {
11
11
  export declare enum PatientStatus {
12
12
  UNVERIFIED = 0,
13
13
  VERIFIED = 1,
14
+ BLOCKED = 2,
14
15
  UNRECOGNIZED = -1
15
16
  }
16
17
  export interface GetAccountRequest {
@@ -205,6 +206,19 @@ export interface ChangePatientEmailRequest {
205
206
  export interface ChangePatientEmailResponse {
206
207
  account: PatientAccount | undefined;
207
208
  }
209
+ export interface BlockPatientRequest {
210
+ id: string;
211
+ reason: string;
212
+ }
213
+ export interface BlockPatientResponse {
214
+ account: PatientAccount | undefined;
215
+ }
216
+ export interface UnblockPatientRequest {
217
+ id: string;
218
+ }
219
+ export interface UnblockPatientResponse {
220
+ account: PatientAccount | undefined;
221
+ }
208
222
  export interface StaffAccount {
209
223
  id: string;
210
224
  email: string;
@@ -224,6 +238,9 @@ export interface PatientAccount {
224
238
  createdAt: string;
225
239
  lastActiveAt?: string | undefined;
226
240
  isEmailVerified: boolean;
241
+ isIdentityVerified: boolean;
242
+ blockedAt?: string | undefined;
243
+ blockReason?: string | undefined;
227
244
  }
228
245
  export interface AccountService {
229
246
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
@@ -251,4 +268,6 @@ export interface AccountService {
251
268
  listPatientAccounts(request: ListPatientAccountsRequest): Promise<ListPatientAccountsResponse>;
252
269
  getPatientAccount(request: GetPatientAccountRequest): Promise<GetPatientAccountResponse>;
253
270
  changePatientEmail(request: ChangePatientEmailRequest): Promise<ChangePatientEmailResponse>;
271
+ blockPatient(request: BlockPatientRequest): Promise<BlockPatientResponse>;
272
+ unblockPatient(request: UnblockPatientRequest): Promise<UnblockPatientResponse>;
254
273
  }
@@ -22,5 +22,6 @@ var PatientStatus;
22
22
  (function (PatientStatus) {
23
23
  PatientStatus[PatientStatus["UNVERIFIED"] = 0] = "UNVERIFIED";
24
24
  PatientStatus[PatientStatus["VERIFIED"] = 1] = "VERIFIED";
25
+ PatientStatus[PatientStatus["BLOCKED"] = 2] = "BLOCKED";
25
26
  PatientStatus[PatientStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
27
  })(PatientStatus || (exports.PatientStatus = PatientStatus = {}));
@@ -12,6 +12,7 @@ export declare enum Role {
12
12
  export declare enum PatientStatus {
13
13
  UNVERIFIED = 0,
14
14
  VERIFIED = 1,
15
+ BLOCKED = 2,
15
16
  UNRECOGNIZED = -1
16
17
  }
17
18
  export interface GetAccountRequest {
@@ -206,6 +207,19 @@ export interface ChangePatientEmailRequest {
206
207
  export interface ChangePatientEmailResponse {
207
208
  account: PatientAccount | undefined;
208
209
  }
210
+ export interface BlockPatientRequest {
211
+ id: string;
212
+ reason: string;
213
+ }
214
+ export interface BlockPatientResponse {
215
+ account: PatientAccount | undefined;
216
+ }
217
+ export interface UnblockPatientRequest {
218
+ id: string;
219
+ }
220
+ export interface UnblockPatientResponse {
221
+ account: PatientAccount | undefined;
222
+ }
209
223
  export interface StaffAccount {
210
224
  id: string;
211
225
  email: string;
@@ -225,6 +239,9 @@ export interface PatientAccount {
225
239
  createdAt: string;
226
240
  lastActiveAt?: string | undefined;
227
241
  isEmailVerified: boolean;
242
+ isIdentityVerified: boolean;
243
+ blockedAt?: string | undefined;
244
+ blockReason?: string | undefined;
228
245
  }
229
246
  export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
230
247
  export interface AccountServiceClient {
@@ -253,6 +270,8 @@ export interface AccountServiceClient {
253
270
  listPatientAccounts(request: ListPatientAccountsRequest): Observable<ListPatientAccountsResponse>;
254
271
  getPatientAccount(request: GetPatientAccountRequest): Observable<GetPatientAccountResponse>;
255
272
  changePatientEmail(request: ChangePatientEmailRequest): Observable<ChangePatientEmailResponse>;
273
+ blockPatient(request: BlockPatientRequest): Observable<BlockPatientResponse>;
274
+ unblockPatient(request: UnblockPatientRequest): Observable<UnblockPatientResponse>;
256
275
  }
257
276
  export interface AccountServiceController {
258
277
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
@@ -280,6 +299,8 @@ export interface AccountServiceController {
280
299
  listPatientAccounts(request: ListPatientAccountsRequest): Promise<ListPatientAccountsResponse> | Observable<ListPatientAccountsResponse> | ListPatientAccountsResponse;
281
300
  getPatientAccount(request: GetPatientAccountRequest): Promise<GetPatientAccountResponse> | Observable<GetPatientAccountResponse> | GetPatientAccountResponse;
282
301
  changePatientEmail(request: ChangePatientEmailRequest): Promise<ChangePatientEmailResponse> | Observable<ChangePatientEmailResponse> | ChangePatientEmailResponse;
302
+ blockPatient(request: BlockPatientRequest): Promise<BlockPatientResponse> | Observable<BlockPatientResponse> | BlockPatientResponse;
303
+ unblockPatient(request: UnblockPatientRequest): Promise<UnblockPatientResponse> | Observable<UnblockPatientResponse> | UnblockPatientResponse;
283
304
  }
284
305
  export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
285
306
  export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -24,6 +24,7 @@ var PatientStatus;
24
24
  (function (PatientStatus) {
25
25
  PatientStatus[PatientStatus["UNVERIFIED"] = 0] = "UNVERIFIED";
26
26
  PatientStatus[PatientStatus["VERIFIED"] = 1] = "VERIFIED";
27
+ PatientStatus[PatientStatus["BLOCKED"] = 2] = "BLOCKED";
27
28
  PatientStatus[PatientStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
28
29
  })(PatientStatus || (exports.PatientStatus = PatientStatus = {}));
29
30
  exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
@@ -55,6 +56,8 @@ function AccountServiceControllerMethods() {
55
56
  "listPatientAccounts",
56
57
  "getPatientAccount",
57
58
  "changePatientEmail",
59
+ "blockPatient",
60
+ "unblockPatient",
58
61
  ];
59
62
  for (const method of grpcMethods) {
60
63
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.37.0",
3
+ "version": "6.38.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -35,6 +35,8 @@ service AccountService {
35
35
  rpc ListPatientAccounts(ListPatientAccountsRequest) returns (ListPatientAccountsResponse);
36
36
  rpc GetPatientAccount(GetPatientAccountRequest) returns (GetPatientAccountResponse);
37
37
  rpc ChangePatientEmail(ChangePatientEmailRequest) returns (ChangePatientEmailResponse);
38
+ rpc BlockPatient(BlockPatientRequest) returns (BlockPatientResponse);
39
+ rpc UnblockPatient(UnblockPatientRequest) returns (UnblockPatientResponse);
38
40
  }
39
41
 
40
42
  message GetAccountRequest {
@@ -272,6 +274,23 @@ message ChangePatientEmailResponse {
272
274
  PatientAccount account = 1;
273
275
  }
274
276
 
277
+ message BlockPatientRequest {
278
+ string id = 1;
279
+ string reason = 2;
280
+ }
281
+
282
+ message BlockPatientResponse {
283
+ PatientAccount account = 1;
284
+ }
285
+
286
+ message UnblockPatientRequest {
287
+ string id = 1;
288
+ }
289
+
290
+ message UnblockPatientResponse {
291
+ PatientAccount account = 1;
292
+ }
293
+
275
294
  message StaffAccount {
276
295
  string id = 1;
277
296
  string email = 2;
@@ -293,6 +312,9 @@ message PatientAccount {
293
312
  string created_at = 7;
294
313
  optional string last_active_at = 8;
295
314
  bool is_email_verified = 9;
315
+ bool is_identity_verified = 10;
316
+ optional string blocked_at = 11;
317
+ optional string block_reason = 12;
296
318
  }
297
319
 
298
320
  enum Role {
@@ -306,4 +328,5 @@ enum Role {
306
328
  enum PatientStatus {
307
329
  UNVERIFIED = 0;
308
330
  VERIFIED = 1;
331
+ BLOCKED = 2;
309
332
  }