tychat-contracts 1.0.130 → 1.0.132

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,5 +1,5 @@
1
- export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, } from './notifications-kafka.payloads';
2
- export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, } from './notifications-kafka-topics';
1
+ export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationConversationChangeToHumanEventPayload, } from './notifications-kafka.payloads';
2
+ export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, } from './notifications-kafka-topics';
3
3
  export { AdminBroadcastPushDto } from './admin-broadcast-push.dto';
4
4
  export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, } from './register-push-token.dto';
5
5
  export { ListNotificationsQueryDto, NOTIFICATION_PROVIDER_FILTERS, NOTIFICATION_STATUS_FILTERS, type NotificationProviderFilterDto, type NotificationStatusFilterDto, } from './list-notifications-query.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,GACzC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,iDAAiD,GAClD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,EACxC,6CAA6C,GAC9C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC"}
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
3
+ exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
4
4
  var notifications_kafka_payloads_1 = require("./notifications-kafka.payloads");
5
5
  Object.defineProperty(exports, "NotificationUserCreatedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationUserCreatedEventPayload; } });
6
6
  Object.defineProperty(exports, "NotificationPasswordResetRequestedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationPasswordResetRequestedEventPayload; } });
7
+ Object.defineProperty(exports, "NotificationConversationChangeToHumanEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationConversationChangeToHumanEventPayload; } });
7
8
  var notifications_kafka_topics_1 = require("./notifications-kafka-topics");
8
9
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_FIND_ALL; } });
9
10
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
10
11
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UPDATE_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UPDATE_VIEWED; } });
11
12
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH; } });
13
+ Object.defineProperty(exports, "EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH; } });
12
14
  var admin_broadcast_push_dto_1 = require("./admin-broadcast-push.dto");
13
15
  Object.defineProperty(exports, "AdminBroadcastPushDto", { enumerable: true, get: function () { return admin_broadcast_push_dto_1.AdminBroadcastPushDto; } });
14
16
  var register_push_token_dto_1 = require("./register-push-token.dto");
@@ -5,4 +5,6 @@ export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.re
5
5
  export declare const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = "notifications.updateViewed";
6
6
  /** Kafka event: push FCM em massa (painel administrativo). */
7
7
  export declare const EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = "notifications.admin_broadcast_push";
8
+ /** Registo `notifications` / FCM quando a clínica recebe alerta de conversa para humano. */
9
+ export declare const EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = "notifications.conversation_change_to_human_push";
8
10
  //# sourceMappingURL=notifications-kafka-topics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC"}
1
+ {"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
3
+ exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
4
4
  /** Kafka request–reply: lista notificações persistidas no banco do tenant. */
5
5
  exports.TOPIC_NOTIFICATIONS_FIND_ALL = 'notifications.findAll';
6
6
  exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = 'notifications.registerPushToken';
@@ -8,3 +8,5 @@ exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = 'notifications.registerPushTok
8
8
  exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
9
9
  /** Kafka event: push FCM em massa (painel administrativo). */
10
10
  exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = 'notifications.admin_broadcast_push';
11
+ /** Registo `notifications` / FCM quando a clínica recebe alerta de conversa para humano. */
12
+ exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = 'notifications.conversation_change_to_human_push';
@@ -13,4 +13,17 @@ export declare class NotificationPasswordResetRequestedEventPayload {
13
13
  verifyToken: string;
14
14
  occurredAt: string;
15
15
  }
16
+ /** Evento Kafka `notifications.conversation-change-to-human` (IA ou clínica → fila humana). */
17
+ export declare class NotificationConversationChangeToHumanEventPayload {
18
+ eventId: string;
19
+ tenant: string;
20
+ patientId: string;
21
+ sessionUuid: string;
22
+ reason: string;
23
+ occurredAt: string;
24
+ patientName?: string;
25
+ unitId?: number;
26
+ isUrgent?: boolean;
27
+ handoffSource?: 'ai' | 'manual';
28
+ }
16
29
  //# sourceMappingURL=notifications-kafka.payloads.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka.payloads.ts"],"names":[],"mappings":"AAGA,qBAAa,mCAAmC;IAM9C,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,IAAI,EAAE,MAAM,CAAC;IASb,QAAQ,EAAE,MAAM,CAAC;IAOjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,8CAA8C;IAMzD,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,WAAW,EAAE,MAAM,CAAC;IAOpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"notifications-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka.payloads.ts"],"names":[],"mappings":"AAcA,qBAAa,mCAAmC;IAM9C,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,IAAI,EAAE,MAAM,CAAC;IASb,QAAQ,EAAE,MAAM,CAAC;IAOjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,8CAA8C;IAMzD,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,WAAW,EAAE,MAAM,CAAC;IAOpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,+FAA+F;AAC/F,qBAAa,iDAAiD;IAG5D,OAAO,EAAE,MAAM,CAAC;IAMhB,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAKlB,WAAW,EAAE,MAAM,CAAC;IAMpB,MAAM,EAAE,MAAM,CAAC;IAIf,UAAU,EAAE,MAAM,CAAC;IAMnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAOhB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,aAAa,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;CACjC"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
12
+ exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  class NotificationUserCreatedEventPayload {
@@ -129,3 +129,79 @@ __decorate([
129
129
  (0, class_validator_1.IsISO8601)(),
130
130
  __metadata("design:type", String)
131
131
  ], NotificationPasswordResetRequestedEventPayload.prototype, "occurredAt", void 0);
132
+ /** Evento Kafka `notifications.conversation-change-to-human` (IA ou clínica → fila humana). */
133
+ class NotificationConversationChangeToHumanEventPayload {
134
+ eventId;
135
+ tenant;
136
+ patientId;
137
+ sessionUuid;
138
+ reason;
139
+ occurredAt;
140
+ patientName;
141
+ unitId;
142
+ isUrgent;
143
+ handoffSource;
144
+ }
145
+ exports.NotificationConversationChangeToHumanEventPayload = NotificationConversationChangeToHumanEventPayload;
146
+ __decorate([
147
+ (0, swagger_1.ApiProperty)({ description: 'Idempotência' }),
148
+ (0, class_validator_1.IsUUID)(),
149
+ __metadata("design:type", String)
150
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "eventId", void 0);
151
+ __decorate([
152
+ (0, swagger_1.ApiProperty)(),
153
+ (0, class_validator_1.IsString)(),
154
+ (0, class_validator_1.MinLength)(1),
155
+ (0, class_validator_1.MaxLength)(255),
156
+ __metadata("design:type", String)
157
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "tenant", void 0);
158
+ __decorate([
159
+ (0, swagger_1.ApiProperty)(),
160
+ (0, class_validator_1.IsUUID)(),
161
+ __metadata("design:type", String)
162
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "patientId", void 0);
163
+ __decorate([
164
+ (0, swagger_1.ApiProperty)(),
165
+ (0, class_validator_1.IsString)(),
166
+ (0, class_validator_1.MinLength)(1),
167
+ __metadata("design:type", String)
168
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "sessionUuid", void 0);
169
+ __decorate([
170
+ (0, swagger_1.ApiProperty)(),
171
+ (0, class_validator_1.IsString)(),
172
+ (0, class_validator_1.MinLength)(1),
173
+ (0, class_validator_1.MaxLength)(500),
174
+ __metadata("design:type", String)
175
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "reason", void 0);
176
+ __decorate([
177
+ (0, swagger_1.ApiProperty)(),
178
+ (0, class_validator_1.IsISO8601)(),
179
+ __metadata("design:type", String)
180
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "occurredAt", void 0);
181
+ __decorate([
182
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Nome de exibição do paciente para a notificação push' }),
183
+ (0, class_validator_1.IsOptional)(),
184
+ (0, class_validator_1.IsString)(),
185
+ (0, class_validator_1.MaxLength)(255),
186
+ __metadata("design:type", String)
187
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "patientName", void 0);
188
+ __decorate([
189
+ (0, swagger_1.ApiPropertyOptional)(),
190
+ (0, class_validator_1.IsOptional)(),
191
+ (0, class_validator_1.IsNumber)(),
192
+ __metadata("design:type", Number)
193
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "unitId", void 0);
194
+ __decorate([
195
+ (0, swagger_1.ApiPropertyOptional)({
196
+ description: 'True quando o handoff é por possível urgência (ex.: intenção human_handoff)',
197
+ }),
198
+ (0, class_validator_1.IsOptional)(),
199
+ (0, class_validator_1.IsBoolean)(),
200
+ __metadata("design:type", Boolean)
201
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "isUrgent", void 0);
202
+ __decorate([
203
+ (0, swagger_1.ApiPropertyOptional)({ enum: ['ai', 'manual'] }),
204
+ (0, class_validator_1.IsOptional)(),
205
+ (0, class_validator_1.IsIn)(['ai', 'manual']),
206
+ __metadata("design:type", String)
207
+ ], NotificationConversationChangeToHumanEventPayload.prototype, "handoffSource", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.130",
3
+ "version": "1.0.132",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,12 +1,14 @@
1
1
  export {
2
2
  NotificationUserCreatedEventPayload,
3
3
  NotificationPasswordResetRequestedEventPayload,
4
+ NotificationConversationChangeToHumanEventPayload,
4
5
  } from './notifications-kafka.payloads';
5
6
  export {
6
7
  TOPIC_NOTIFICATIONS_FIND_ALL,
7
8
  TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
8
9
  TOPIC_NOTIFICATIONS_UPDATE_VIEWED,
9
10
  EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH,
11
+ EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH,
10
12
  } from './notifications-kafka-topics';
11
13
  export { AdminBroadcastPushDto } from './admin-broadcast-push.dto';
12
14
  export {
@@ -10,3 +10,7 @@ export const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
10
10
  /** Kafka event: push FCM em massa (painel administrativo). */
11
11
  export const EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH =
12
12
  'notifications.admin_broadcast_push';
13
+
14
+ /** Registo `notifications` / FCM quando a clínica recebe alerta de conversa para humano. */
15
+ export const EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH =
16
+ 'notifications.conversation_change_to_human_push';
@@ -1,5 +1,16 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsEmail, IsISO8601, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsBoolean,
4
+ IsEmail,
5
+ IsIn,
6
+ IsISO8601,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsString,
10
+ IsUUID,
11
+ MaxLength,
12
+ MinLength,
13
+ } from 'class-validator';
3
14
 
4
15
  export class NotificationUserCreatedEventPayload {
5
16
  @ApiProperty({
@@ -93,3 +104,58 @@ export class NotificationPasswordResetRequestedEventPayload {
93
104
  @IsISO8601()
94
105
  occurredAt: string;
95
106
  }
107
+
108
+ /** Evento Kafka `notifications.conversation-change-to-human` (IA ou clínica → fila humana). */
109
+ export class NotificationConversationChangeToHumanEventPayload {
110
+ @ApiProperty({ description: 'Idempotência' })
111
+ @IsUUID()
112
+ eventId: string;
113
+
114
+ @ApiProperty()
115
+ @IsString()
116
+ @MinLength(1)
117
+ @MaxLength(255)
118
+ tenant: string;
119
+
120
+ @ApiProperty()
121
+ @IsUUID()
122
+ patientId: string;
123
+
124
+ @ApiProperty()
125
+ @IsString()
126
+ @MinLength(1)
127
+ sessionUuid: string;
128
+
129
+ @ApiProperty()
130
+ @IsString()
131
+ @MinLength(1)
132
+ @MaxLength(500)
133
+ reason: string;
134
+
135
+ @ApiProperty()
136
+ @IsISO8601()
137
+ occurredAt: string;
138
+
139
+ @ApiPropertyOptional({ description: 'Nome de exibição do paciente para a notificação push' })
140
+ @IsOptional()
141
+ @IsString()
142
+ @MaxLength(255)
143
+ patientName?: string;
144
+
145
+ @ApiPropertyOptional()
146
+ @IsOptional()
147
+ @IsNumber()
148
+ unitId?: number;
149
+
150
+ @ApiPropertyOptional({
151
+ description: 'True quando o handoff é por possível urgência (ex.: intenção human_handoff)',
152
+ })
153
+ @IsOptional()
154
+ @IsBoolean()
155
+ isUrgent?: boolean;
156
+
157
+ @ApiPropertyOptional({ enum: ['ai', 'manual'] })
158
+ @IsOptional()
159
+ @IsIn(['ai', 'manual'])
160
+ handoffSource?: 'ai' | 'manual';
161
+ }