tychat-contracts 1.3.9 → 1.3.15

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 (45) hide show
  1. package/dist/analytics/event-analytic.enum.d.ts +1 -1
  2. package/dist/analytics/event-analytic.enum.d.ts.map +1 -1
  3. package/dist/analytics/event-analytic.enum.js +2 -0
  4. package/dist/conversations/followup-config-response.dto.d.ts +1 -0
  5. package/dist/conversations/followup-config-response.dto.d.ts.map +1 -1
  6. package/dist/conversations/followup-config-response.dto.js +10 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -0
  10. package/dist/legal-terms/index.d.ts +5 -0
  11. package/dist/legal-terms/index.d.ts.map +1 -0
  12. package/dist/legal-terms/index.js +20 -0
  13. package/dist/legal-terms/legal-term-preview.dto.d.ts +15 -0
  14. package/dist/legal-terms/legal-term-preview.dto.d.ts.map +1 -0
  15. package/dist/legal-terms/legal-term-preview.dto.js +100 -0
  16. package/dist/legal-terms/legal-term-rmq-patterns.d.ts +6 -0
  17. package/dist/legal-terms/legal-term-rmq-patterns.d.ts.map +1 -0
  18. package/dist/legal-terms/legal-term-rmq-patterns.js +8 -0
  19. package/dist/legal-terms/legal-term-signature-rpc.dto.d.ts +20 -0
  20. package/dist/legal-terms/legal-term-signature-rpc.dto.d.ts.map +1 -0
  21. package/dist/legal-terms/legal-term-signature-rpc.dto.js +116 -0
  22. package/dist/legal-terms/legal-term-template.dto.d.ts +10 -0
  23. package/dist/legal-terms/legal-term-template.dto.d.ts.map +1 -0
  24. package/dist/legal-terms/legal-term-template.dto.js +48 -0
  25. package/dist/notifications/index.d.ts +2 -1
  26. package/dist/notifications/index.d.ts.map +1 -1
  27. package/dist/notifications/index.js +5 -1
  28. package/dist/notifications/notifications-kafka-topics.d.ts +4 -0
  29. package/dist/notifications/notifications-kafka-topics.d.ts.map +1 -1
  30. package/dist/notifications/notifications-kafka-topics.js +5 -1
  31. package/dist/notifications/notifications-send-push-to-user.dto.d.ts +13 -0
  32. package/dist/notifications/notifications-send-push-to-user.dto.d.ts.map +1 -0
  33. package/dist/notifications/notifications-send-push-to-user.dto.js +76 -0
  34. package/package.json +1 -1
  35. package/src/analytics/event-analytic.enum.ts +3 -0
  36. package/src/conversations/followup-config-response.dto.ts +9 -0
  37. package/src/index.ts +1 -0
  38. package/src/legal-terms/index.ts +4 -0
  39. package/src/legal-terms/legal-term-preview.dto.ts +69 -0
  40. package/src/legal-terms/legal-term-rmq-patterns.ts +5 -0
  41. package/src/legal-terms/legal-term-signature-rpc.dto.ts +82 -0
  42. package/src/legal-terms/legal-term-template.dto.ts +24 -0
  43. package/src/notifications/index.ts +3 -0
  44. package/src/notifications/notifications-kafka-topics.ts +7 -0
  45. package/src/notifications/notifications-send-push-to-user.dto.ts +58 -0
@@ -2,6 +2,6 @@
2
2
  * Enum of all analytic event types emitted by microservices.
3
3
  * Each value follows the pattern: `domain.action`.
4
4
  */
5
- export declare const EVENT_ANALYTIC_TYPES: readonly ["patient.created", "patient.updated", "patient.deleted", "patient.status_changed", "appointment.created", "appointment.updated", "appointment.canceled", "appointment.rescheduled", "appointment.no_show", "appointment.finished", "appointment.procedure_finished", "checkin.effectued", "checkout.effectued", "message.sent", "message.received", "conversation.session_started", "conversation.session_ended", "conversation.transferred_to_human", "followup.abandonment.sent", "followup.appointment_confirmation.sent", "followup.satisfaction_booking.sent", "followup.satisfaction_finished.sent", "followup.no_show_reschedule.sent", "followup.wellness_check.sent", "followup.return_suggestion.sent", "followup.satisfaction_booking.response_received", "followup.satisfaction_finished.response_received", "followup.config_updated", "payment.created", "payment.payed", "payment.refunded", "payment.canceled", "payment.overdue", "payment_gateway.payment_created", "payment_gateway.payment_confirmed", "payment_gateway.payment_failed", "payment_gateway.payment_refunded", "payment_gateway.payment_canceled", "payment_gateway.payment_expired", "payment_gateway.webhook_received", "billing.invoice_created", "billing.invoice_paid", "ai.interaction", "ai.fallback", "auth.login", "auth.logout", "auth.password_reset", "user.created", "user.updated", "user.deleted", "notification.sent", "notification.failed", "whatsapp.connection_established", "whatsapp.connection_lost", "procedure.created", "procedure.updated", "procedure.deleted", "specialty.created", "specialty.updated", "specialty.deleted", "professional.created", "professional.updated", "professional.deleted", "configuration.updated", "storage.file_uploaded", "storage.file_deleted", "tenant.created", "tenant.updated"];
5
+ export declare const EVENT_ANALYTIC_TYPES: readonly ["patient.created", "patient.updated", "patient.deleted", "patient.status_changed", "appointment.created", "appointment.updated", "appointment.canceled", "appointment.rescheduled", "appointment.no_show", "appointment.finished", "appointment.procedure_finished", "checkin.effectued", "checkout.effectued", "message.sent", "message.received", "conversation.session_started", "conversation.session_ended", "conversation.transferred_to_human", "followup.abandonment.sent", "followup.appointment_confirmation.sent", "followup.satisfaction_booking.sent", "followup.satisfaction_finished.sent", "followup.no_show_reschedule.sent", "followup.wellness_check.sent", "followup.return_suggestion.sent", "followup.satisfaction_booking.response_received", "followup.satisfaction_finished.response_received", "followup.config_updated", "payment.created", "payment.payed", "payment.refunded", "payment.canceled", "payment.overdue", "payment_gateway.payment_created", "payment_gateway.payment_confirmed", "payment_gateway.payment_failed", "payment_gateway.payment_refunded", "payment_gateway.payment_canceled", "payment_gateway.payment_expired", "payment_gateway.webhook_received", "billing.invoice_created", "billing.invoice_paid", "ai.interaction", "ai.fallback", "auth.login", "auth.logout", "auth.password_reset", "user.created", "user.updated", "user.deleted", "notification.sent", "notification.failed", "whatsapp.connection_established", "whatsapp.connection_lost", "procedure.created", "procedure.updated", "procedure.deleted", "specialty.created", "specialty.updated", "specialty.deleted", "professional.created", "professional.updated", "professional.deleted", "configuration.updated", "legal_term.template.updated", "storage.file_uploaded", "storage.file_deleted", "tenant.created", "tenant.updated"];
6
6
  export type EventAnalyticType = (typeof EVENT_ANALYTIC_TYPES)[number];
7
7
  //# sourceMappingURL=event-analytic.enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-analytic.enum.d.ts","sourceRoot":"","sources":["../../src/analytics/event-analytic.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,8uDA6GvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"event-analytic.enum.d.ts","sourceRoot":"","sources":["../../src/analytics/event-analytic.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,6wDAgHvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -89,6 +89,8 @@ exports.EVENT_ANALYTIC_TYPES = [
89
89
  'professional.deleted',
90
90
  // ── Configuration events ────────────────────────────────────────
91
91
  'configuration.updated',
92
+ // ── Legal term (clinic template) ────────────────────────────────
93
+ 'legal_term.template.updated',
92
94
  // ── Storage events ──────────────────────────────────────────────
93
95
  'storage.file_uploaded',
94
96
  'storage.file_deleted',
@@ -36,6 +36,7 @@ export declare class FollowupConfigResponseDto {
36
36
  humanPatientIdleWarningDelayMinutes: number;
37
37
  humanPatientIdleFinalizeDelayMinutes: number;
38
38
  humanAttendantIdleRequeueDelayMinutes: number;
39
+ humanAttendantIdlePushWarningLeadMinutes: number;
39
40
  humanPatientIdleWarningMessage: string;
40
41
  humanPatientIdleFinalizeMessage: string;
41
42
  humanAttendantIdleRequeueMessage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,qBAAa,yBAAyB;IAIpC,EAAE,EAAE,MAAM,CAAC;IAMX,MAAM,CAAC,EAAE,MAAM,CAAC;IAYhB,2BAA2B,EAAE,MAAM,CAAC;IAKpC,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAS9B,yBAAyB,EAAE,MAAM,CAAC;IAIlC,mBAAmB,EAAE,OAAO,CAAC;IAS7B,+BAA+B,EAAE,MAAM,CAAC;IAIxC,0BAA0B,EAAE,OAAO,CAAC;IAKpC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,2BAA2B,EAAE,OAAO,CAAC;IASrC,kBAAkB,EAAE,MAAM,CAAC;IAI3B,aAAa,EAAE,OAAO,CAAC;IASvB,yBAAyB,EAAE,MAAM,CAAC;IAIlC,oBAAoB,EAAE,OAAO,CAAC;IAS9B,4BAA4B,EAAE,MAAM,CAAC;IAIrC,uBAAuB,EAAE,OAAO,CAAC;IAYjC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAQzC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAQrC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAQtC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAQlC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAQ/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAQlC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAQ7B,OAAO,EAAE,OAAO,CAAC;IASjB,mCAAmC,EAAE,MAAM,CAAC;IAS5C,oCAAoC,EAAE,MAAM,CAAC;IAS7C,qCAAqC,EAAE,MAAM,CAAC;IAS9C,8BAA8B,EAAE,MAAM,CAAC;IASvC,+BAA+B,EAAE,MAAM,CAAC;IASxC,gCAAgC,EAAE,MAAM,CAAC;IASzC,6BAA6B,EAAE,MAAM,CAAC;IAUtC,+BAA+B,EAAE,MAAM,CAAC;CACzC"}
1
+ {"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,qBAAa,yBAAyB;IAIpC,EAAE,EAAE,MAAM,CAAC;IAMX,MAAM,CAAC,EAAE,MAAM,CAAC;IAYhB,2BAA2B,EAAE,MAAM,CAAC;IAKpC,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAK9B,qBAAqB,EAAE,MAAM,CAAC;IAS9B,yBAAyB,EAAE,MAAM,CAAC;IAIlC,mBAAmB,EAAE,OAAO,CAAC;IAS7B,+BAA+B,EAAE,MAAM,CAAC;IAIxC,0BAA0B,EAAE,OAAO,CAAC;IAKpC,gCAAgC,EAAE,MAAM,CAAC;IAIzC,2BAA2B,EAAE,OAAO,CAAC;IASrC,kBAAkB,EAAE,MAAM,CAAC;IAI3B,aAAa,EAAE,OAAO,CAAC;IASvB,yBAAyB,EAAE,MAAM,CAAC;IAIlC,oBAAoB,EAAE,OAAO,CAAC;IAS9B,4BAA4B,EAAE,MAAM,CAAC;IAIrC,uBAAuB,EAAE,OAAO,CAAC;IAYjC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAQzC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAQrC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAQtC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAQlC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAQ/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAQlC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAQ7B,OAAO,EAAE,OAAO,CAAC;IASjB,mCAAmC,EAAE,MAAM,CAAC;IAS5C,oCAAoC,EAAE,MAAM,CAAC;IAS7C,qCAAqC,EAAE,MAAM,CAAC;IAS9C,wCAAwC,EAAE,MAAM,CAAC;IASjD,8BAA8B,EAAE,MAAM,CAAC;IASvC,+BAA+B,EAAE,MAAM,CAAC;IASxC,gCAAgC,EAAE,MAAM,CAAC;IASzC,6BAA6B,EAAE,MAAM,CAAC;IAUtC,+BAA+B,EAAE,MAAM,CAAC;CACzC"}
@@ -74,6 +74,7 @@ class FollowupConfigResponseDto {
74
74
  humanPatientIdleWarningDelayMinutes;
75
75
  humanPatientIdleFinalizeDelayMinutes;
76
76
  humanAttendantIdleRequeueDelayMinutes;
77
+ humanAttendantIdlePushWarningLeadMinutes;
77
78
  humanPatientIdleWarningMessage;
78
79
  humanPatientIdleFinalizeMessage;
79
80
  humanAttendantIdleRequeueMessage;
@@ -294,6 +295,15 @@ __decorate([
294
295
  (0, class_validator_1.Min)(1),
295
296
  __metadata("design:type", Number)
296
297
  ], FollowupConfigResponseDto.prototype, "humanAttendantIdleRequeueDelayMinutes", void 0);
298
+ __decorate([
299
+ (0, swagger_1.ApiProperty)({
300
+ description: 'Minutes before requeue to send a push to the responsible attendant (0 = disabled). Must be less than humanAttendantIdleRequeueDelayMinutes when > 0.',
301
+ example: 3,
302
+ }),
303
+ (0, class_validator_1.IsInt)(),
304
+ (0, class_validator_1.Min)(0),
305
+ __metadata("design:type", Number)
306
+ ], FollowupConfigResponseDto.prototype, "humanAttendantIdlePushWarningLeadMinutes", void 0);
297
307
  __decorate([
298
308
  (0, swagger_1.ApiProperty)({
299
309
  description: 'Message sent as warning when patient is idle during human attendance',
package/dist/index.d.ts CHANGED
@@ -19,4 +19,5 @@ export * from './analytics';
19
19
  export * from './cashback';
20
20
  export * from './filters';
21
21
  export * from './anamneses';
22
+ export * from './legal-terms';
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -35,3 +35,4 @@ __exportStar(require("./analytics"), exports);
35
35
  __exportStar(require("./cashback"), exports);
36
36
  __exportStar(require("./filters"), exports);
37
37
  __exportStar(require("./anamneses"), exports);
38
+ __exportStar(require("./legal-terms"), exports);
@@ -0,0 +1,5 @@
1
+ export * from './legal-term-template.dto';
2
+ export * from './legal-term-preview.dto';
3
+ export * from './legal-term-signature-rpc.dto';
4
+ export * from './legal-term-rmq-patterns';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legal-terms/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./legal-term-template.dto"), exports);
18
+ __exportStar(require("./legal-term-preview.dto"), exports);
19
+ __exportStar(require("./legal-term-signature-rpc.dto"), exports);
20
+ __exportStar(require("./legal-term-rmq-patterns"), exports);
@@ -0,0 +1,15 @@
1
+ /** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
2
+ export declare class LegalTermPreviewRequestDto {
3
+ body_html?: string;
4
+ nome_paciente?: string;
5
+ cpf_exemplo?: string;
6
+ procedimento_nomes?: string[];
7
+ data_hora_iso?: string;
8
+ }
9
+ export declare class LegalTermSendDto {
10
+ procedureIds: string[];
11
+ whatsappMessage: string;
12
+ signerEmail?: string;
13
+ instanceKey?: string;
14
+ }
15
+ //# sourceMappingURL=legal-term-preview.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAM9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAI3B,YAAY,EAAE,MAAM,EAAE,CAAC;IASvB,eAAe,EAAE,MAAM,CAAC;IAMxB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LegalTermSendDto = exports.LegalTermPreviewRequestDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
16
+ class LegalTermPreviewRequestDto {
17
+ body_html;
18
+ nome_paciente;
19
+ cpf_exemplo;
20
+ procedimento_nomes;
21
+ data_hora_iso;
22
+ }
23
+ exports.LegalTermPreviewRequestDto = LegalTermPreviewRequestDto;
24
+ __decorate([
25
+ (0, swagger_1.ApiPropertyOptional)({
26
+ description: 'HTML atual do editor (rascunho); se omitido, usa o modelo salvo no banco',
27
+ maxLength: 500_000,
28
+ }),
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.MaxLength)(500_000),
32
+ __metadata("design:type", String)
33
+ ], LegalTermPreviewRequestDto.prototype, "body_html", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Nome do paciente de exemplo' }),
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.MaxLength)(500),
39
+ __metadata("design:type", String)
40
+ ], LegalTermPreviewRequestDto.prototype, "nome_paciente", void 0);
41
+ __decorate([
42
+ (0, swagger_1.ApiPropertyOptional)({ description: 'CPF de exemplo (com ou sem máscara)' }),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.MaxLength)(20),
46
+ __metadata("design:type", String)
47
+ ], LegalTermPreviewRequestDto.prototype, "cpf_exemplo", void 0);
48
+ __decorate([
49
+ (0, swagger_1.ApiPropertyOptional)({ type: [String], description: 'Nomes de procedimentos na ordem' }),
50
+ (0, class_validator_1.IsOptional)(),
51
+ (0, class_validator_1.IsArray)(),
52
+ (0, class_validator_1.IsString)({ each: true }),
53
+ __metadata("design:type", Array)
54
+ ], LegalTermPreviewRequestDto.prototype, "procedimento_nomes", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Data/hora ISO 8601 para {{ data_hora }}' }),
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.IsString)(),
59
+ (0, class_validator_1.MaxLength)(40),
60
+ __metadata("design:type", String)
61
+ ], LegalTermPreviewRequestDto.prototype, "data_hora_iso", void 0);
62
+ class LegalTermSendDto {
63
+ procedureIds;
64
+ whatsappMessage;
65
+ signerEmail;
66
+ instanceKey;
67
+ }
68
+ exports.LegalTermSendDto = LegalTermSendDto;
69
+ __decorate([
70
+ (0, swagger_1.ApiProperty)({ type: [String], format: 'uuid' }),
71
+ (0, class_validator_1.IsArray)(),
72
+ (0, class_validator_1.IsUUID)('4', { each: true }),
73
+ __metadata("design:type", Array)
74
+ ], LegalTermSendDto.prototype, "procedureIds", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiProperty)({
77
+ description: 'Mensagem WhatsApp; deve conter exatamente {{ link_termo_juridico }}',
78
+ example: 'Olá, assine seu termo: {{ link_termo_juridico }}',
79
+ }),
80
+ (0, class_validator_1.IsString)(),
81
+ (0, class_validator_1.MinLength)(1),
82
+ (0, class_validator_1.MaxLength)(4000),
83
+ __metadata("design:type", String)
84
+ ], LegalTermSendDto.prototype, "whatsappMessage", void 0);
85
+ __decorate([
86
+ (0, swagger_1.ApiPropertyOptional)({ description: 'E-mail do signatário se o paciente não tiver e-mail cadastrado' }),
87
+ (0, class_validator_1.IsOptional)(),
88
+ (0, class_validator_1.IsString)(),
89
+ (0, class_validator_1.MaxLength)(320),
90
+ __metadata("design:type", String)
91
+ ], LegalTermSendDto.prototype, "signerEmail", void 0);
92
+ __decorate([
93
+ (0, swagger_1.ApiPropertyOptional)({
94
+ description: 'Instância Evolution (opcional). Se omitido, usa-se a da sessão ativa do paciente (igual a conversas).',
95
+ }),
96
+ (0, class_validator_1.IsOptional)(),
97
+ (0, class_validator_1.IsString)(),
98
+ (0, class_validator_1.MaxLength)(128),
99
+ __metadata("design:type", String)
100
+ ], LegalTermSendDto.prototype, "instanceKey", void 0);
@@ -0,0 +1,6 @@
1
+ export declare const LEGAL_TERM_TEMPLATE_GET = "legalTerm.template.get";
2
+ export declare const LEGAL_TERM_TEMPLATE_UPSERT = "legalTerm.template.upsert";
3
+ export declare const LEGAL_TERM_DISPATCH_CREATE = "legalTerm.dispatch.create";
4
+ export declare const LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = "legalTerm.dispatch.listByPatient";
5
+ export declare const SIGNATURE_LEGAL_ENVELOPE_CREATE = "signature.legalEnvelope.create";
6
+ //# sourceMappingURL=legal-term-rmq-patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-term-rmq-patterns.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-rmq-patterns.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AACtF,eAAO,MAAM,+BAA+B,mCAAmC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = exports.LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = exports.LEGAL_TERM_DISPATCH_CREATE = exports.LEGAL_TERM_TEMPLATE_UPSERT = exports.LEGAL_TERM_TEMPLATE_GET = void 0;
4
+ exports.LEGAL_TERM_TEMPLATE_GET = 'legalTerm.template.get';
5
+ exports.LEGAL_TERM_TEMPLATE_UPSERT = 'legalTerm.template.upsert';
6
+ exports.LEGAL_TERM_DISPATCH_CREATE = 'legalTerm.dispatch.create';
7
+ exports.LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = 'legalTerm.dispatch.listByPatient';
8
+ exports.SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
@@ -0,0 +1,20 @@
1
+ /** Payload RPC: tychat-api → tychat-signature-service (criar envelope Clicksign v3). */
2
+ export declare class CreateLegalSigningEnvelopeRpcDto {
3
+ tenant: string;
4
+ patientId: string;
5
+ legalTermDispatchId?: string;
6
+ signerName: string;
7
+ signerEmail: string;
8
+ pdfBase64?: string;
9
+ renderedHtml?: string;
10
+ documentFilename: string;
11
+ envelopeName?: string;
12
+ }
13
+ export declare class CreateLegalSigningEnvelopeRpcResultDto {
14
+ signatureDocumentId: string;
15
+ signingUrl: string;
16
+ clicksignEnvelopeId: string;
17
+ clicksignDocumentId: string;
18
+ clicksignSignerId?: string;
19
+ }
20
+ //# sourceMappingURL=legal-term-signature-rpc.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-term-signature-rpc.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-signature-rpc.dto.ts"],"names":[],"mappings":"AAWA,wFAAwF;AACxF,qBAAa,gCAAgC;IAK3C,MAAM,EAAE,MAAM,CAAC;IAIf,SAAS,EAAE,MAAM,CAAC;IAKlB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAM7B,UAAU,EAAE,MAAM,CAAC;IAKnB,WAAW,EAAE,MAAM,CAAC;IAMpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,gBAAgB,EAAE,MAAM,CAAC;IAMzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,sCAAsC;IAEjD,mBAAmB,EAAE,MAAM,CAAC;IAG5B,UAAU,EAAE,MAAM,CAAC;IAGnB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,mBAAmB,EAAE,MAAM,CAAC;IAG5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateLegalSigningEnvelopeRpcResultDto = exports.CreateLegalSigningEnvelopeRpcDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Payload RPC: tychat-api → tychat-signature-service (criar envelope Clicksign v3). */
16
+ class CreateLegalSigningEnvelopeRpcDto {
17
+ tenant;
18
+ patientId;
19
+ legalTermDispatchId;
20
+ signerName;
21
+ signerEmail;
22
+ pdfBase64;
23
+ renderedHtml;
24
+ documentFilename;
25
+ envelopeName;
26
+ }
27
+ exports.CreateLegalSigningEnvelopeRpcDto = CreateLegalSigningEnvelopeRpcDto;
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ description: 'Slug do tenant' }),
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.MinLength)(1),
32
+ (0, class_validator_1.MaxLength)(128),
33
+ __metadata("design:type", String)
34
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "tenant", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiProperty)({ format: 'uuid' }),
37
+ (0, class_validator_1.IsUUID)('4'),
38
+ __metadata("design:type", String)
39
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "patientId", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiPropertyOptional)({ format: 'uuid', description: 'ID do dispatch na clínica (preenchido após create se fluxo inverter)' }),
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsUUID)('4'),
44
+ __metadata("design:type", String)
45
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "legalTermDispatchId", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)(),
48
+ (0, class_validator_1.IsString)(),
49
+ (0, class_validator_1.MinLength)(1),
50
+ (0, class_validator_1.MaxLength)(500),
51
+ __metadata("design:type", String)
52
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "signerName", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiProperty)(),
55
+ (0, class_validator_1.IsEmail)(),
56
+ (0, class_validator_1.MaxLength)(320),
57
+ __metadata("design:type", String)
58
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "signerEmail", void 0);
59
+ __decorate([
60
+ (0, swagger_1.ApiPropertyOptional)({ description: 'PDF em base64 (sem prefixo data:); omitir se enviar renderedHtml' }),
61
+ (0, class_validator_1.ValidateIf)((o) => !o.renderedHtml?.trim()),
62
+ (0, class_validator_1.IsString)(),
63
+ (0, class_validator_1.MinLength)(1),
64
+ __metadata("design:type", String)
65
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "pdfBase64", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiPropertyOptional)({
68
+ description: 'HTML já renderizado do termo; convertido para PDF no signature-service se pdfBase64 ausente',
69
+ }),
70
+ (0, class_validator_1.ValidateIf)((o) => !o.pdfBase64?.trim()),
71
+ (0, class_validator_1.IsString)(),
72
+ (0, class_validator_1.MinLength)(1),
73
+ __metadata("design:type", String)
74
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "renderedHtml", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiProperty)({ example: 'termo-juridico.pdf' }),
77
+ (0, class_validator_1.IsString)(),
78
+ (0, class_validator_1.MinLength)(1),
79
+ (0, class_validator_1.MaxLength)(255),
80
+ __metadata("design:type", String)
81
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "documentFilename", void 0);
82
+ __decorate([
83
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Nome exibido do envelope na Clicksign' }),
84
+ (0, class_validator_1.IsOptional)(),
85
+ (0, class_validator_1.IsString)(),
86
+ (0, class_validator_1.MaxLength)(500),
87
+ __metadata("design:type", String)
88
+ ], CreateLegalSigningEnvelopeRpcDto.prototype, "envelopeName", void 0);
89
+ class CreateLegalSigningEnvelopeRpcResultDto {
90
+ signatureDocumentId;
91
+ signingUrl;
92
+ clicksignEnvelopeId;
93
+ clicksignDocumentId;
94
+ clicksignSignerId;
95
+ }
96
+ exports.CreateLegalSigningEnvelopeRpcResultDto = CreateLegalSigningEnvelopeRpcResultDto;
97
+ __decorate([
98
+ (0, swagger_1.ApiProperty)({ format: 'uuid' }),
99
+ __metadata("design:type", String)
100
+ ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "signatureDocumentId", void 0);
101
+ __decorate([
102
+ (0, swagger_1.ApiProperty)(),
103
+ __metadata("design:type", String)
104
+ ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "signingUrl", void 0);
105
+ __decorate([
106
+ (0, swagger_1.ApiProperty)(),
107
+ __metadata("design:type", String)
108
+ ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignEnvelopeId", void 0);
109
+ __decorate([
110
+ (0, swagger_1.ApiProperty)(),
111
+ __metadata("design:type", String)
112
+ ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignDocumentId", void 0);
113
+ __decorate([
114
+ (0, swagger_1.ApiPropertyOptional)(),
115
+ __metadata("design:type", String)
116
+ ], CreateLegalSigningEnvelopeRpcResultDto.prototype, "clicksignSignerId", void 0);
@@ -0,0 +1,10 @@
1
+ export declare class LegalTermTemplateDto {
2
+ id: string;
3
+ body_html: string;
4
+ createdAt: Date;
5
+ updatedAt: Date;
6
+ }
7
+ export declare class UpsertLegalTermTemplateDto {
8
+ body_html: string;
9
+ }
10
+ //# sourceMappingURL=legal-term-template.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legal-term-template.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-template.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,oBAAoB;IAE/B,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,qBAAa,0BAA0B;IAKrC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpsertLegalTermTemplateDto = exports.LegalTermTemplateDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class LegalTermTemplateDto {
16
+ id;
17
+ body_html;
18
+ createdAt;
19
+ updatedAt;
20
+ }
21
+ exports.LegalTermTemplateDto = LegalTermTemplateDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({ format: 'uuid' }),
24
+ __metadata("design:type", String)
25
+ ], LegalTermTemplateDto.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, swagger_1.ApiProperty)({ description: 'HTML do termo (editor rico)' }),
28
+ __metadata("design:type", String)
29
+ ], LegalTermTemplateDto.prototype, "body_html", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)(),
32
+ __metadata("design:type", Date)
33
+ ], LegalTermTemplateDto.prototype, "createdAt", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)(),
36
+ __metadata("design:type", Date)
37
+ ], LegalTermTemplateDto.prototype, "updatedAt", void 0);
38
+ class UpsertLegalTermTemplateDto {
39
+ body_html;
40
+ }
41
+ exports.UpsertLegalTermTemplateDto = UpsertLegalTermTemplateDto;
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({ description: 'HTML do termo (editor rico)', minLength: 1, maxLength: 500_000 }),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.MinLength)(1),
46
+ (0, class_validator_1.MaxLength)(500_000),
47
+ __metadata("design:type", String)
48
+ ], UpsertLegalTermTemplateDto.prototype, "body_html", void 0);
@@ -1,9 +1,10 @@
1
1
  export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationConversationChangeToHumanEventPayload, NotificationTenantAiTokensThresholdEventPayload, } 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, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
2
+ export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
3
3
  export { AdminBroadcastPushDto, ADMIN_NOTIFICATION_KINDS, type AdminNotificationKind, } 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';
6
6
  export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto';
7
7
  export { NotificationListItemDto } from './notification-list-item.dto';
8
8
  export { UpdateNotificationViewedDto, NotificationsUpdateViewedKafkaDto, } from './update-notification-viewed.dto';
9
+ export { NotificationsSendPushToUserKafkaDto } from './notifications-send-push-to-user.dto';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,EACxC,6CAA6C,EAC7C,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,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,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,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;AAC1C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC"}
@@ -1,6 +1,6 @@
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.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = 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.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
3
+ exports.NotificationsSendPushToUserKafkaDto = exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = 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; } });
@@ -10,8 +10,10 @@ var notifications_kafka_topics_1 = require("./notifications-kafka-topics");
10
10
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_FIND_ALL; } });
11
11
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
12
12
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UPDATE_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UPDATE_VIEWED; } });
13
+ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER; } });
13
14
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH; } });
14
15
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH; } });
16
+ Object.defineProperty(exports, "EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH; } });
15
17
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD; } });
16
18
  var admin_broadcast_push_dto_1 = require("./admin-broadcast-push.dto");
17
19
  Object.defineProperty(exports, "AdminBroadcastPushDto", { enumerable: true, get: function () { return admin_broadcast_push_dto_1.AdminBroadcastPushDto; } });
@@ -30,3 +32,5 @@ Object.defineProperty(exports, "NotificationListItemDto", { enumerable: true, ge
30
32
  var update_notification_viewed_dto_1 = require("./update-notification-viewed.dto");
31
33
  Object.defineProperty(exports, "UpdateNotificationViewedDto", { enumerable: true, get: function () { return update_notification_viewed_dto_1.UpdateNotificationViewedDto; } });
32
34
  Object.defineProperty(exports, "NotificationsUpdateViewedKafkaDto", { enumerable: true, get: function () { return update_notification_viewed_dto_1.NotificationsUpdateViewedKafkaDto; } });
35
+ var notifications_send_push_to_user_dto_1 = require("./notifications-send-push-to-user.dto");
36
+ Object.defineProperty(exports, "NotificationsSendPushToUserKafkaDto", { enumerable: true, get: function () { return notifications_send_push_to_user_dto_1.NotificationsSendPushToUserKafkaDto; } });
@@ -3,10 +3,14 @@ export declare const TOPIC_NOTIFICATIONS_FIND_ALL = "notifications.findAll";
3
3
  export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.registerPushToken";
4
4
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
5
5
  export declare const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = "notifications.updateViewed";
6
+ /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
7
+ export declare const TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = "notifications.sendPushToUser";
6
8
  /** Kafka event: push FCM em massa (painel administrativo). */
7
9
  export declare const EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = "notifications.admin_broadcast_push";
8
10
  /** Registo `notifications` / FCM quando a clínica recebe alerta de conversa para humano. */
9
11
  export declare const EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = "notifications.conversation_change_to_human_push";
12
+ /** Push ao atendente responsável: perto do timeout de inatividade (antes de ir à fila). */
13
+ export declare const EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = "notifications.human_attendant_idle_warning_push";
10
14
  /** Evento Kafka: alerta de cota mensal de tokens de IA para administradores do tenant. */
11
15
  export declare const EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = "notifications.tenant_ai_tokens_threshold";
12
16
  //# 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;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,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,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAEpF,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,2FAA2F;AAC3F,eAAO,MAAM,qDAAqD,oDACf,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,CAAC"}
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = 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;
3
+ exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 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';
7
7
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
8
8
  exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
9
+ /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
10
+ exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 'notifications.sendPushToUser';
9
11
  /** Kafka event: push FCM em massa (painel administrativo). */
10
12
  exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = 'notifications.admin_broadcast_push';
11
13
  /** Registo `notifications` / FCM quando a clínica recebe alerta de conversa para humano. */
12
14
  exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = 'notifications.conversation_change_to_human_push';
15
+ /** Push ao atendente responsável: perto do timeout de inatividade (antes de ir à fila). */
16
+ exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = 'notifications.human_attendant_idle_warning_push';
13
17
  /** Evento Kafka: alerta de cota mensal de tokens de IA para administradores do tenant. */
14
18
  exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = 'notifications.tenant_ai_tokens_threshold';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * RPC RabbitMQ `notifications.sendPushToUser` — envio FCM a um utilizador (microserviços internos).
3
+ */
4
+ export declare class NotificationsSendPushToUserKafkaDto {
5
+ tenant: string;
6
+ userId: string;
7
+ title: string;
8
+ body: string;
9
+ data?: Record<string, string>;
10
+ notificationEvent?: string;
11
+ notificationKind?: 'notification' | 'alert';
12
+ }
13
+ //# sourceMappingURL=notifications-send-push-to-user.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications-send-push-to-user.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-send-push-to-user.dto.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,qBAAa,mCAAmC;IAK9C,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,EAAE,MAAM,CAAC;IAMf,KAAK,EAAE,MAAM,CAAC;IAMd,IAAI,EAAE,MAAM,CAAC;IAOb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAQ9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAK3B,gBAAgB,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;CAC7C"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NotificationsSendPushToUserKafkaDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * RPC RabbitMQ `notifications.sendPushToUser` — envio FCM a um utilizador (microserviços internos).
17
+ */
18
+ class NotificationsSendPushToUserKafkaDto {
19
+ tenant;
20
+ userId;
21
+ title;
22
+ body;
23
+ data;
24
+ notificationEvent;
25
+ notificationKind;
26
+ }
27
+ exports.NotificationsSendPushToUserKafkaDto = NotificationsSendPushToUserKafkaDto;
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ example: 'default' }),
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.IsNotEmpty)(),
32
+ (0, class_validator_1.MaxLength)(255),
33
+ __metadata("design:type", String)
34
+ ], NotificationsSendPushToUserKafkaDto.prototype, "tenant", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiProperty)({ format: 'uuid', description: 'Destinatário (ex.: JWT sub do atendente)' }),
37
+ (0, class_validator_1.IsUUID)('4'),
38
+ __metadata("design:type", String)
39
+ ], NotificationsSendPushToUserKafkaDto.prototype, "userId", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({ example: 'Título curto' }),
42
+ (0, class_validator_1.IsString)(),
43
+ (0, class_validator_1.MinLength)(1),
44
+ (0, class_validator_1.MaxLength)(200),
45
+ __metadata("design:type", String)
46
+ ], NotificationsSendPushToUserKafkaDto.prototype, "title", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({ example: 'Corpo da notificação' }),
49
+ (0, class_validator_1.IsString)(),
50
+ (0, class_validator_1.MinLength)(1),
51
+ (0, class_validator_1.MaxLength)(2000),
52
+ __metadata("design:type", String)
53
+ ], NotificationsSendPushToUserKafkaDto.prototype, "body", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiPropertyOptional)({
56
+ description: 'Dados extras FCM (strings); ex.: sessionUuid, patientId',
57
+ }),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsObject)(),
60
+ __metadata("design:type", Object)
61
+ ], NotificationsSendPushToUserKafkaDto.prototype, "data", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiPropertyOptional)({
64
+ description: 'Valor gravado em notifications.notification_event (auditoria)',
65
+ }),
66
+ (0, class_validator_1.IsOptional)(),
67
+ (0, class_validator_1.IsString)(),
68
+ (0, class_validator_1.MaxLength)(120),
69
+ __metadata("design:type", String)
70
+ ], NotificationsSendPushToUserKafkaDto.prototype, "notificationEvent", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiPropertyOptional)({ enum: ['notification', 'alert'] }),
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_validator_1.IsIn)(['notification', 'alert']),
75
+ __metadata("design:type", String)
76
+ ], NotificationsSendPushToUserKafkaDto.prototype, "notificationKind", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.3.9",
3
+ "version": "1.3.15",
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",
@@ -104,6 +104,9 @@ export const EVENT_ANALYTIC_TYPES = [
104
104
  // ── Configuration events ────────────────────────────────────────
105
105
  'configuration.updated',
106
106
 
107
+ // ── Legal term (clinic template) ────────────────────────────────
108
+ 'legal_term.template.updated',
109
+
107
110
  // ── Storage events ──────────────────────────────────────────────
108
111
  'storage.file_uploaded',
109
112
  'storage.file_deleted',
@@ -233,6 +233,15 @@ export class FollowupConfigResponseDto {
233
233
  @Min(1)
234
234
  humanAttendantIdleRequeueDelayMinutes: number;
235
235
 
236
+ @ApiProperty({
237
+ description:
238
+ 'Minutes before requeue to send a push to the responsible attendant (0 = disabled). Must be less than humanAttendantIdleRequeueDelayMinutes when > 0.',
239
+ example: 3,
240
+ })
241
+ @IsInt()
242
+ @Min(0)
243
+ humanAttendantIdlePushWarningLeadMinutes: number;
244
+
236
245
  @ApiProperty({
237
246
  description: 'Message sent as warning when patient is idle during human attendance',
238
247
  example:
package/src/index.ts CHANGED
@@ -19,3 +19,4 @@ export * from './analytics';
19
19
  export * from './cashback';
20
20
  export * from './filters';
21
21
  export * from './anamneses';
22
+ export * from './legal-terms';
@@ -0,0 +1,4 @@
1
+ export * from './legal-term-template.dto';
2
+ export * from './legal-term-preview.dto';
3
+ export * from './legal-term-signature-rpc.dto';
4
+ export * from './legal-term-rmq-patterns';
@@ -0,0 +1,69 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsArray, IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
3
+
4
+ /** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
5
+ export class LegalTermPreviewRequestDto {
6
+ @ApiPropertyOptional({
7
+ description: 'HTML atual do editor (rascunho); se omitido, usa o modelo salvo no banco',
8
+ maxLength: 500_000,
9
+ })
10
+ @IsOptional()
11
+ @IsString()
12
+ @MaxLength(500_000)
13
+ body_html?: string;
14
+
15
+ @ApiPropertyOptional({ description: 'Nome do paciente de exemplo' })
16
+ @IsOptional()
17
+ @IsString()
18
+ @MaxLength(500)
19
+ nome_paciente?: string;
20
+
21
+ @ApiPropertyOptional({ description: 'CPF de exemplo (com ou sem máscara)' })
22
+ @IsOptional()
23
+ @IsString()
24
+ @MaxLength(20)
25
+ cpf_exemplo?: string;
26
+
27
+ @ApiPropertyOptional({ type: [String], description: 'Nomes de procedimentos na ordem' })
28
+ @IsOptional()
29
+ @IsArray()
30
+ @IsString({ each: true })
31
+ procedimento_nomes?: string[];
32
+
33
+ @ApiPropertyOptional({ description: 'Data/hora ISO 8601 para {{ data_hora }}' })
34
+ @IsOptional()
35
+ @IsString()
36
+ @MaxLength(40)
37
+ data_hora_iso?: string;
38
+ }
39
+
40
+ export class LegalTermSendDto {
41
+ @ApiProperty({ type: [String], format: 'uuid' })
42
+ @IsArray()
43
+ @IsUUID('4', { each: true })
44
+ procedureIds: string[];
45
+
46
+ @ApiProperty({
47
+ description: 'Mensagem WhatsApp; deve conter exatamente {{ link_termo_juridico }}',
48
+ example: 'Olá, assine seu termo: {{ link_termo_juridico }}',
49
+ })
50
+ @IsString()
51
+ @MinLength(1)
52
+ @MaxLength(4000)
53
+ whatsappMessage: string;
54
+
55
+ @ApiPropertyOptional({ description: 'E-mail do signatário se o paciente não tiver e-mail cadastrado' })
56
+ @IsOptional()
57
+ @IsString()
58
+ @MaxLength(320)
59
+ signerEmail?: string;
60
+
61
+ @ApiPropertyOptional({
62
+ description:
63
+ 'Instância Evolution (opcional). Se omitido, usa-se a da sessão ativa do paciente (igual a conversas).',
64
+ })
65
+ @IsOptional()
66
+ @IsString()
67
+ @MaxLength(128)
68
+ instanceKey?: string;
69
+ }
@@ -0,0 +1,5 @@
1
+ export const LEGAL_TERM_TEMPLATE_GET = 'legalTerm.template.get';
2
+ export const LEGAL_TERM_TEMPLATE_UPSERT = 'legalTerm.template.upsert';
3
+ export const LEGAL_TERM_DISPATCH_CREATE = 'legalTerm.dispatch.create';
4
+ export const LEGAL_TERM_DISPATCH_LIST_BY_PATIENT = 'legalTerm.dispatch.listByPatient';
5
+ export const SIGNATURE_LEGAL_ENVELOPE_CREATE = 'signature.legalEnvelope.create';
@@ -0,0 +1,82 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsEmail,
4
+ IsOptional,
5
+ IsString,
6
+ IsUUID,
7
+ MaxLength,
8
+ MinLength,
9
+ ValidateIf,
10
+ } from 'class-validator';
11
+
12
+ /** Payload RPC: tychat-api → tychat-signature-service (criar envelope Clicksign v3). */
13
+ export class CreateLegalSigningEnvelopeRpcDto {
14
+ @ApiProperty({ description: 'Slug do tenant' })
15
+ @IsString()
16
+ @MinLength(1)
17
+ @MaxLength(128)
18
+ tenant: string;
19
+
20
+ @ApiProperty({ format: 'uuid' })
21
+ @IsUUID('4')
22
+ patientId: string;
23
+
24
+ @ApiPropertyOptional({ format: 'uuid', description: 'ID do dispatch na clínica (preenchido após create se fluxo inverter)' })
25
+ @IsOptional()
26
+ @IsUUID('4')
27
+ legalTermDispatchId?: string;
28
+
29
+ @ApiProperty()
30
+ @IsString()
31
+ @MinLength(1)
32
+ @MaxLength(500)
33
+ signerName: string;
34
+
35
+ @ApiProperty()
36
+ @IsEmail()
37
+ @MaxLength(320)
38
+ signerEmail: string;
39
+
40
+ @ApiPropertyOptional({ description: 'PDF em base64 (sem prefixo data:); omitir se enviar renderedHtml' })
41
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => !o.renderedHtml?.trim())
42
+ @IsString()
43
+ @MinLength(1)
44
+ pdfBase64?: string;
45
+
46
+ @ApiPropertyOptional({
47
+ description: 'HTML já renderizado do termo; convertido para PDF no signature-service se pdfBase64 ausente',
48
+ })
49
+ @ValidateIf((o: CreateLegalSigningEnvelopeRpcDto) => !o.pdfBase64?.trim())
50
+ @IsString()
51
+ @MinLength(1)
52
+ renderedHtml?: string;
53
+
54
+ @ApiProperty({ example: 'termo-juridico.pdf' })
55
+ @IsString()
56
+ @MinLength(1)
57
+ @MaxLength(255)
58
+ documentFilename: string;
59
+
60
+ @ApiPropertyOptional({ description: 'Nome exibido do envelope na Clicksign' })
61
+ @IsOptional()
62
+ @IsString()
63
+ @MaxLength(500)
64
+ envelopeName?: string;
65
+ }
66
+
67
+ export class CreateLegalSigningEnvelopeRpcResultDto {
68
+ @ApiProperty({ format: 'uuid' })
69
+ signatureDocumentId: string;
70
+
71
+ @ApiProperty()
72
+ signingUrl: string;
73
+
74
+ @ApiProperty()
75
+ clicksignEnvelopeId: string;
76
+
77
+ @ApiProperty()
78
+ clicksignDocumentId: string;
79
+
80
+ @ApiPropertyOptional()
81
+ clicksignSignerId?: string;
82
+ }
@@ -0,0 +1,24 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsString, MaxLength, MinLength } from 'class-validator';
3
+
4
+ export class LegalTermTemplateDto {
5
+ @ApiProperty({ format: 'uuid' })
6
+ id: string;
7
+
8
+ @ApiProperty({ description: 'HTML do termo (editor rico)' })
9
+ body_html: string;
10
+
11
+ @ApiProperty()
12
+ createdAt: Date;
13
+
14
+ @ApiProperty()
15
+ updatedAt: Date;
16
+ }
17
+
18
+ export class UpsertLegalTermTemplateDto {
19
+ @ApiProperty({ description: 'HTML do termo (editor rico)', minLength: 1, maxLength: 500_000 })
20
+ @IsString()
21
+ @MinLength(1)
22
+ @MaxLength(500_000)
23
+ body_html: string;
24
+ }
@@ -8,8 +8,10 @@ export {
8
8
  TOPIC_NOTIFICATIONS_FIND_ALL,
9
9
  TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
10
10
  TOPIC_NOTIFICATIONS_UPDATE_VIEWED,
11
+ TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER,
11
12
  EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH,
12
13
  EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH,
14
+ EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH,
13
15
  EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD,
14
16
  } from './notifications-kafka-topics';
15
17
  export {
@@ -34,3 +36,4 @@ export {
34
36
  UpdateNotificationViewedDto,
35
37
  NotificationsUpdateViewedKafkaDto,
36
38
  } from './update-notification-viewed.dto';
39
+ export { NotificationsSendPushToUserKafkaDto } from './notifications-send-push-to-user.dto';
@@ -7,6 +7,9 @@ export const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN =
7
7
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
8
8
  export const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
9
9
 
10
+ /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
11
+ export const TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 'notifications.sendPushToUser';
12
+
10
13
  /** Kafka event: push FCM em massa (painel administrativo). */
11
14
  export const EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH =
12
15
  'notifications.admin_broadcast_push';
@@ -15,6 +18,10 @@ export const EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH =
15
18
  export const EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH =
16
19
  'notifications.conversation_change_to_human_push';
17
20
 
21
+ /** Push ao atendente responsável: perto do timeout de inatividade (antes de ir à fila). */
22
+ export const EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH =
23
+ 'notifications.human_attendant_idle_warning_push';
24
+
18
25
  /** Evento Kafka: alerta de cota mensal de tokens de IA para administradores do tenant. */
19
26
  export const EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD =
20
27
  'notifications.tenant_ai_tokens_threshold';
@@ -0,0 +1,58 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsIn,
4
+ IsNotEmpty,
5
+ IsObject,
6
+ IsOptional,
7
+ IsString,
8
+ IsUUID,
9
+ MaxLength,
10
+ MinLength,
11
+ } from 'class-validator';
12
+
13
+ /**
14
+ * RPC RabbitMQ `notifications.sendPushToUser` — envio FCM a um utilizador (microserviços internos).
15
+ */
16
+ export class NotificationsSendPushToUserKafkaDto {
17
+ @ApiProperty({ example: 'default' })
18
+ @IsString()
19
+ @IsNotEmpty()
20
+ @MaxLength(255)
21
+ tenant: string;
22
+
23
+ @ApiProperty({ format: 'uuid', description: 'Destinatário (ex.: JWT sub do atendente)' })
24
+ @IsUUID('4')
25
+ userId: string;
26
+
27
+ @ApiProperty({ example: 'Título curto' })
28
+ @IsString()
29
+ @MinLength(1)
30
+ @MaxLength(200)
31
+ title: string;
32
+
33
+ @ApiProperty({ example: 'Corpo da notificação' })
34
+ @IsString()
35
+ @MinLength(1)
36
+ @MaxLength(2000)
37
+ body: string;
38
+
39
+ @ApiPropertyOptional({
40
+ description: 'Dados extras FCM (strings); ex.: sessionUuid, patientId',
41
+ })
42
+ @IsOptional()
43
+ @IsObject()
44
+ data?: Record<string, string>;
45
+
46
+ @ApiPropertyOptional({
47
+ description: 'Valor gravado em notifications.notification_event (auditoria)',
48
+ })
49
+ @IsOptional()
50
+ @IsString()
51
+ @MaxLength(120)
52
+ notificationEvent?: string;
53
+
54
+ @ApiPropertyOptional({ enum: ['notification', 'alert'] })
55
+ @IsOptional()
56
+ @IsIn(['notification', 'alert'])
57
+ notificationKind?: 'notification' | 'alert';
58
+ }