tychat-contracts 1.0.74 → 1.0.76

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 (44) hide show
  1. package/dist/connections/index.d.ts +1 -0
  2. package/dist/connections/index.d.ts.map +1 -1
  3. package/dist/connections/index.js +1 -0
  4. package/dist/connections/whatsapp-official.dto.d.ts +31 -0
  5. package/dist/connections/whatsapp-official.dto.d.ts.map +1 -0
  6. package/dist/connections/whatsapp-official.dto.js +149 -0
  7. package/dist/conversations/followup-config-response.dto.d.ts +7 -1
  8. package/dist/conversations/followup-config-response.dto.d.ts.map +1 -1
  9. package/dist/conversations/followup-config-response.dto.js +73 -7
  10. package/dist/conversations/followup-events.dto.d.ts +30 -0
  11. package/dist/conversations/followup-events.dto.d.ts.map +1 -0
  12. package/dist/conversations/followup-events.dto.js +162 -0
  13. package/dist/conversations/followup-log-response.dto.d.ts +0 -1
  14. package/dist/conversations/followup-log-response.dto.d.ts.map +1 -1
  15. package/dist/conversations/followup-log-response.dto.js +0 -7
  16. package/dist/conversations/index.d.ts +2 -0
  17. package/dist/conversations/index.d.ts.map +1 -1
  18. package/dist/conversations/index.js +2 -0
  19. package/dist/conversations/satisfaction-response.dto.d.ts +36 -0
  20. package/dist/conversations/satisfaction-response.dto.d.ts.map +1 -0
  21. package/dist/conversations/satisfaction-response.dto.js +149 -0
  22. package/dist/tenants/index.d.ts +2 -0
  23. package/dist/tenants/index.d.ts.map +1 -1
  24. package/dist/tenants/index.js +2 -0
  25. package/dist/tenants/tenant-slug.util.d.ts +46 -0
  26. package/dist/tenants/tenant-slug.util.d.ts.map +1 -0
  27. package/dist/tenants/tenant-slug.util.js +59 -0
  28. package/dist/tenants/tenant-slug.util.spec.d.ts +2 -0
  29. package/dist/tenants/tenant-slug.util.spec.d.ts.map +1 -0
  30. package/dist/tenants/tenant-slug.util.spec.js +102 -0
  31. package/dist/tenants/whatsapp-provider-kind.dto.d.ts +9 -0
  32. package/dist/tenants/whatsapp-provider-kind.dto.d.ts.map +1 -0
  33. package/dist/tenants/whatsapp-provider-kind.dto.js +13 -0
  34. package/package.json +2 -1
  35. package/src/connections/index.ts +1 -0
  36. package/src/connections/whatsapp-official.dto.ts +113 -0
  37. package/src/conversations/followup-config-response.dto.ts +60 -5
  38. package/src/conversations/followup-events.dto.ts +111 -0
  39. package/src/conversations/followup-log-response.dto.ts +0 -5
  40. package/src/conversations/index.ts +2 -0
  41. package/src/conversations/satisfaction-response.dto.ts +116 -0
  42. package/src/tenants/index.ts +2 -0
  43. package/src/tenants/tenant-slug.util.ts +56 -0
  44. package/src/tenants/whatsapp-provider-kind.dto.ts +12 -0
@@ -1,2 +1,3 @@
1
1
  export * from './connections.dto';
2
+ export * from './whatsapp-official.dto';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./connections.dto"), exports);
18
+ __exportStar(require("./whatsapp-official.dto"), exports);
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Payload to register a WhatsApp Official (Meta Cloud API) instance for a tenant.
3
+ * Requires the access token, phone number ID, and WhatsApp Business Account ID
4
+ * obtained from the Meta developer portal.
5
+ */
6
+ export declare class CreateWhatsAppOfficialInstanceDto {
7
+ accessToken: string;
8
+ phoneNumberId: string;
9
+ wabaId: string;
10
+ webhookVerifyToken?: string;
11
+ }
12
+ /**
13
+ * Payload to send a pre-approved template message via WhatsApp Official (Meta Cloud API).
14
+ * Templates must be created and approved in the Meta Business Manager before use.
15
+ */
16
+ export declare class SendWhatsAppOfficialTemplateDto {
17
+ to: string;
18
+ templateName: string;
19
+ languageCode: string;
20
+ bodyParameters?: string[];
21
+ headerParameters?: string[];
22
+ }
23
+ /**
24
+ * Payload to send a free-form text message via WhatsApp Official (Meta Cloud API).
25
+ * Only works within the 24-hour customer service window.
26
+ */
27
+ export declare class SendWhatsAppOfficialTextDto {
28
+ to: string;
29
+ text: string;
30
+ }
31
+ //# sourceMappingURL=whatsapp-official.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whatsapp-official.dto.d.ts","sourceRoot":"","sources":["../../src/connections/whatsapp-official.dto.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,qBAAa,iCAAiC;IAO5C,WAAW,EAAE,MAAM,CAAC;IAQpB,aAAa,EAAE,MAAM,CAAC;IAQtB,MAAM,EAAE,MAAM,CAAC;IAQf,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,+BAA+B;IAO1C,EAAE,EAAE,MAAM,CAAC;IAQX,YAAY,EAAE,MAAM,CAAC;IAQrB,YAAY,EAAE,MAAM,CAAC;IAWrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAS1B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,2BAA2B;IAOtC,EAAE,EAAE,MAAM,CAAC;IAQX,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,149 @@
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.SendWhatsAppOfficialTextDto = exports.SendWhatsAppOfficialTemplateDto = exports.CreateWhatsAppOfficialInstanceDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Payload to register a WhatsApp Official (Meta Cloud API) instance for a tenant.
17
+ * Requires the access token, phone number ID, and WhatsApp Business Account ID
18
+ * obtained from the Meta developer portal.
19
+ */
20
+ class CreateWhatsAppOfficialInstanceDto {
21
+ accessToken;
22
+ phoneNumberId;
23
+ wabaId;
24
+ webhookVerifyToken;
25
+ }
26
+ exports.CreateWhatsAppOfficialInstanceDto = CreateWhatsAppOfficialInstanceDto;
27
+ __decorate([
28
+ (0, swagger_1.ApiProperty)({
29
+ description: 'Meta Cloud API permanent access token',
30
+ example: 'EAABs...',
31
+ }),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], CreateWhatsAppOfficialInstanceDto.prototype, "accessToken", void 0);
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({
38
+ description: 'Phone Number ID from Meta Business Manager',
39
+ example: '106540352242922',
40
+ }),
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.IsNotEmpty)(),
43
+ __metadata("design:type", String)
44
+ ], CreateWhatsAppOfficialInstanceDto.prototype, "phoneNumberId", void 0);
45
+ __decorate([
46
+ (0, swagger_1.ApiProperty)({
47
+ description: 'WhatsApp Business Account ID (WABA ID)',
48
+ example: '102291529438901',
49
+ }),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.IsNotEmpty)(),
52
+ __metadata("design:type", String)
53
+ ], CreateWhatsAppOfficialInstanceDto.prototype, "wabaId", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiPropertyOptional)({
56
+ description: 'Webhook verify token used to validate Meta webhook registration',
57
+ example: 'my-verify-token',
58
+ }),
59
+ (0, class_validator_1.IsOptional)(),
60
+ (0, class_validator_1.IsString)(),
61
+ __metadata("design:type", String)
62
+ ], CreateWhatsAppOfficialInstanceDto.prototype, "webhookVerifyToken", void 0);
63
+ /**
64
+ * Payload to send a pre-approved template message via WhatsApp Official (Meta Cloud API).
65
+ * Templates must be created and approved in the Meta Business Manager before use.
66
+ */
67
+ class SendWhatsAppOfficialTemplateDto {
68
+ to;
69
+ templateName;
70
+ languageCode;
71
+ bodyParameters;
72
+ headerParameters;
73
+ }
74
+ exports.SendWhatsAppOfficialTemplateDto = SendWhatsAppOfficialTemplateDto;
75
+ __decorate([
76
+ (0, swagger_1.ApiProperty)({
77
+ description: 'Recipient phone number with country code (digits only)',
78
+ example: '5511999999999',
79
+ }),
80
+ (0, class_validator_1.IsString)(),
81
+ (0, class_validator_1.IsNotEmpty)(),
82
+ __metadata("design:type", String)
83
+ ], SendWhatsAppOfficialTemplateDto.prototype, "to", void 0);
84
+ __decorate([
85
+ (0, swagger_1.ApiProperty)({
86
+ description: 'Approved template name in Meta Business Manager',
87
+ example: 'appointment_confirmation',
88
+ }),
89
+ (0, class_validator_1.IsString)(),
90
+ (0, class_validator_1.IsNotEmpty)(),
91
+ __metadata("design:type", String)
92
+ ], SendWhatsAppOfficialTemplateDto.prototype, "templateName", void 0);
93
+ __decorate([
94
+ (0, swagger_1.ApiProperty)({
95
+ description: 'Template language code (BCP 47)',
96
+ example: 'pt_BR',
97
+ }),
98
+ (0, class_validator_1.IsString)(),
99
+ (0, class_validator_1.IsNotEmpty)(),
100
+ __metadata("design:type", String)
101
+ ], SendWhatsAppOfficialTemplateDto.prototype, "languageCode", void 0);
102
+ __decorate([
103
+ (0, swagger_1.ApiPropertyOptional)({
104
+ description: 'Template body variable components (positional parameters). ' +
105
+ 'Each element replaces {{1}}, {{2}}, etc. in the template body.',
106
+ example: ['João', '15/04/2026 às 10:00'],
107
+ type: [String],
108
+ }),
109
+ (0, class_validator_1.IsOptional)(),
110
+ (0, class_validator_1.IsString)({ each: true }),
111
+ __metadata("design:type", Array)
112
+ ], SendWhatsAppOfficialTemplateDto.prototype, "bodyParameters", void 0);
113
+ __decorate([
114
+ (0, swagger_1.ApiPropertyOptional)({
115
+ description: 'Template header variable components (positional parameters)',
116
+ example: ['Clínica Saúde'],
117
+ type: [String],
118
+ }),
119
+ (0, class_validator_1.IsOptional)(),
120
+ (0, class_validator_1.IsString)({ each: true }),
121
+ __metadata("design:type", Array)
122
+ ], SendWhatsAppOfficialTemplateDto.prototype, "headerParameters", void 0);
123
+ /**
124
+ * Payload to send a free-form text message via WhatsApp Official (Meta Cloud API).
125
+ * Only works within the 24-hour customer service window.
126
+ */
127
+ class SendWhatsAppOfficialTextDto {
128
+ to;
129
+ text;
130
+ }
131
+ exports.SendWhatsAppOfficialTextDto = SendWhatsAppOfficialTextDto;
132
+ __decorate([
133
+ (0, swagger_1.ApiProperty)({
134
+ description: 'Recipient phone number with country code (digits only)',
135
+ example: '5511999999999',
136
+ }),
137
+ (0, class_validator_1.IsString)(),
138
+ (0, class_validator_1.IsNotEmpty)(),
139
+ __metadata("design:type", String)
140
+ ], SendWhatsAppOfficialTextDto.prototype, "to", void 0);
141
+ __decorate([
142
+ (0, swagger_1.ApiProperty)({
143
+ description: 'Plain text message body',
144
+ example: 'Olá! Tudo bem?',
145
+ }),
146
+ (0, class_validator_1.IsString)(),
147
+ (0, class_validator_1.IsNotEmpty)(),
148
+ __metadata("design:type", String)
149
+ ], SendWhatsAppOfficialTextDto.prototype, "text", void 0);
@@ -6,7 +6,6 @@
6
6
  */
7
7
  export declare class FollowupConfigResponseDto {
8
8
  id: string;
9
- tenant: string;
10
9
  unitId?: number;
11
10
  abandonmentThresholdMinutes: number;
12
11
  followup1DelayMinutes: number;
@@ -26,6 +25,13 @@ export declare class FollowupConfigResponseDto {
26
25
  wellnessCheckEnabled: boolean;
27
26
  returnSuggestionDelayMinutes: number;
28
27
  returnSuggestionEnabled: boolean;
28
+ templateAppointmentConfirmation?: string;
29
+ templateSatisfactionBooking?: string;
30
+ templateSatisfactionFinished?: string;
31
+ templateNoShowReschedule?: string;
32
+ templateWellnessCheck?: string;
33
+ templateReturnSuggestion?: string;
34
+ templateAbandonment?: string;
29
35
  enabled: boolean;
30
36
  }
31
37
  //# sourceMappingURL=followup-config-response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,qBAAa,yBAAyB;IAIpC,EAAE,EAAE,MAAM,CAAC;IAKX,MAAM,EAAE,MAAM,CAAC;IAMf,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;IAQjC,OAAO,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAGA;;;;;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;CAClB"}
@@ -20,7 +20,6 @@ const class_validator_1 = require("class-validator");
20
20
  */
21
21
  class FollowupConfigResponseDto {
22
22
  id;
23
- tenant;
24
23
  unitId;
25
24
  // ---------------------------------------------------------------------------
26
25
  // Abandonment follow-up settings
@@ -59,6 +58,16 @@ class FollowupConfigResponseDto {
59
58
  returnSuggestionDelayMinutes;
60
59
  returnSuggestionEnabled;
61
60
  // ---------------------------------------------------------------------------
61
+ // WhatsApp Official template IDs (per follow-up type)
62
+ // ---------------------------------------------------------------------------
63
+ templateAppointmentConfirmation;
64
+ templateSatisfactionBooking;
65
+ templateSatisfactionFinished;
66
+ templateNoShowReschedule;
67
+ templateWellnessCheck;
68
+ templateReturnSuggestion;
69
+ templateAbandonment;
70
+ // ---------------------------------------------------------------------------
62
71
  // Global setting
63
72
  // ---------------------------------------------------------------------------
64
73
  enabled;
@@ -70,12 +79,6 @@ __decorate([
70
79
  (0, class_validator_1.IsNotEmpty)(),
71
80
  __metadata("design:type", String)
72
81
  ], FollowupConfigResponseDto.prototype, "id", void 0);
73
- __decorate([
74
- (0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
75
- (0, class_validator_1.IsString)(),
76
- (0, class_validator_1.IsNotEmpty)(),
77
- __metadata("design:type", String)
78
- ], FollowupConfigResponseDto.prototype, "tenant", void 0);
79
82
  __decorate([
80
83
  (0, swagger_1.ApiPropertyOptional)({ description: 'Tenant unit id', example: 1 }),
81
84
  (0, class_validator_1.IsOptional)(),
@@ -188,6 +191,69 @@ __decorate([
188
191
  (0, class_validator_1.IsBoolean)(),
189
192
  __metadata("design:type", Boolean)
190
193
  ], FollowupConfigResponseDto.prototype, "returnSuggestionEnabled", void 0);
194
+ __decorate([
195
+ (0, swagger_1.ApiPropertyOptional)({
196
+ description: 'WhatsApp Official template name for appointment confirmation follow-ups',
197
+ example: 'appointment_confirmation',
198
+ }),
199
+ (0, class_validator_1.IsOptional)(),
200
+ (0, class_validator_1.IsString)(),
201
+ __metadata("design:type", String)
202
+ ], FollowupConfigResponseDto.prototype, "templateAppointmentConfirmation", void 0);
203
+ __decorate([
204
+ (0, swagger_1.ApiPropertyOptional)({
205
+ description: 'WhatsApp Official template name for satisfaction booking follow-ups',
206
+ example: 'satisfaction_booking',
207
+ }),
208
+ (0, class_validator_1.IsOptional)(),
209
+ (0, class_validator_1.IsString)(),
210
+ __metadata("design:type", String)
211
+ ], FollowupConfigResponseDto.prototype, "templateSatisfactionBooking", void 0);
212
+ __decorate([
213
+ (0, swagger_1.ApiPropertyOptional)({
214
+ description: 'WhatsApp Official template name for satisfaction finished follow-ups',
215
+ example: 'satisfaction_finished',
216
+ }),
217
+ (0, class_validator_1.IsOptional)(),
218
+ (0, class_validator_1.IsString)(),
219
+ __metadata("design:type", String)
220
+ ], FollowupConfigResponseDto.prototype, "templateSatisfactionFinished", void 0);
221
+ __decorate([
222
+ (0, swagger_1.ApiPropertyOptional)({
223
+ description: 'WhatsApp Official template name for no-show reschedule follow-ups',
224
+ example: 'no_show_reschedule',
225
+ }),
226
+ (0, class_validator_1.IsOptional)(),
227
+ (0, class_validator_1.IsString)(),
228
+ __metadata("design:type", String)
229
+ ], FollowupConfigResponseDto.prototype, "templateNoShowReschedule", void 0);
230
+ __decorate([
231
+ (0, swagger_1.ApiPropertyOptional)({
232
+ description: 'WhatsApp Official template name for wellness check follow-ups',
233
+ example: 'wellness_check',
234
+ }),
235
+ (0, class_validator_1.IsOptional)(),
236
+ (0, class_validator_1.IsString)(),
237
+ __metadata("design:type", String)
238
+ ], FollowupConfigResponseDto.prototype, "templateWellnessCheck", void 0);
239
+ __decorate([
240
+ (0, swagger_1.ApiPropertyOptional)({
241
+ description: 'WhatsApp Official template name for return suggestion follow-ups',
242
+ example: 'return_suggestion',
243
+ }),
244
+ (0, class_validator_1.IsOptional)(),
245
+ (0, class_validator_1.IsString)(),
246
+ __metadata("design:type", String)
247
+ ], FollowupConfigResponseDto.prototype, "templateReturnSuggestion", void 0);
248
+ __decorate([
249
+ (0, swagger_1.ApiPropertyOptional)({
250
+ description: 'WhatsApp Official template name for abandonment follow-ups',
251
+ example: 'abandonment_followup',
252
+ }),
253
+ (0, class_validator_1.IsOptional)(),
254
+ (0, class_validator_1.IsString)(),
255
+ __metadata("design:type", String)
256
+ ], FollowupConfigResponseDto.prototype, "templateAbandonment", void 0);
191
257
  __decorate([
192
258
  (0, swagger_1.ApiProperty)({ description: 'Whether abandonment follow-up is enabled for this tenant' }),
193
259
  (0, class_validator_1.IsBoolean)(),
@@ -0,0 +1,30 @@
1
+ export declare const TOPIC_MESSAGE_SENT = "MESSAGE_SENT";
2
+ export declare const TOPIC_MESSAGE_RECEIVED = "MESSAGE_RECEIVED";
3
+ export declare const TOPIC_FOLLOWUP_CONFIG_UPDATED = "FOLLOWUP_CONFIG_UPDATED";
4
+ export declare const TOPIC_APPOINTMENT_CHANGED = "APPOINTMENT_CHANGED";
5
+ export declare class FollowupConversationEventPayload {
6
+ tenant: string;
7
+ patientId: string;
8
+ sessionUuid: string;
9
+ unitId?: number;
10
+ messageType: 'ia' | 'human' | 'patient';
11
+ isFollowup?: boolean;
12
+ occurredAt: string;
13
+ }
14
+ export declare class FollowupConfigUpdatedEventPayload {
15
+ tenant: string;
16
+ unitId?: number;
17
+ config: Record<string, unknown>;
18
+ occurredAt: string;
19
+ }
20
+ export declare class AppointmentChangedEventPayload {
21
+ tenant: string;
22
+ appointmentId: string;
23
+ patientId: string;
24
+ status: string;
25
+ previousStatus?: string;
26
+ date?: string;
27
+ exitTime?: string;
28
+ occurredAt: string;
29
+ }
30
+ //# sourceMappingURL=followup-events.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"followup-events.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-events.dto.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAE/D,qBAAa,gCAAgC;IAK3C,MAAM,EAAE,MAAM,CAAC;IAMf,SAAS,EAAE,MAAM,CAAC;IAIlB,WAAW,EAAE,MAAM,CAAC;IAIpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,WAAW,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IAKxC,UAAU,CAAC,EAAE,OAAO,CAAC;IAIrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iCAAiC;IAK5C,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAIhC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,8BAA8B;IAKzC,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,MAAM,CAAC;IAMtB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,MAAM,CAAC;IAMf,cAAc,CAAC,EAAE,MAAM,CAAC;IAKxB,IAAI,CAAC,EAAE,MAAM,CAAC;IAKd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,162 @@
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.AppointmentChangedEventPayload = exports.FollowupConfigUpdatedEventPayload = exports.FollowupConversationEventPayload = exports.TOPIC_APPOINTMENT_CHANGED = exports.TOPIC_FOLLOWUP_CONFIG_UPDATED = exports.TOPIC_MESSAGE_RECEIVED = exports.TOPIC_MESSAGE_SENT = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ exports.TOPIC_MESSAGE_SENT = 'MESSAGE_SENT';
16
+ exports.TOPIC_MESSAGE_RECEIVED = 'MESSAGE_RECEIVED';
17
+ exports.TOPIC_FOLLOWUP_CONFIG_UPDATED = 'FOLLOWUP_CONFIG_UPDATED';
18
+ exports.TOPIC_APPOINTMENT_CHANGED = 'APPOINTMENT_CHANGED';
19
+ class FollowupConversationEventPayload {
20
+ tenant;
21
+ patientId;
22
+ sessionUuid;
23
+ unitId;
24
+ messageType;
25
+ isFollowup;
26
+ occurredAt;
27
+ }
28
+ exports.FollowupConversationEventPayload = FollowupConversationEventPayload;
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({ example: 'homolog' }),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.MinLength)(1),
33
+ (0, class_validator_1.MaxLength)(255),
34
+ __metadata("design:type", String)
35
+ ], FollowupConversationEventPayload.prototype, "tenant", void 0);
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({ example: '3c593727-4505-495a-a054-c052acb4cf19' }),
38
+ (0, class_validator_1.IsString)(),
39
+ (0, class_validator_1.MinLength)(1),
40
+ (0, class_validator_1.MaxLength)(255),
41
+ __metadata("design:type", String)
42
+ ], FollowupConversationEventPayload.prototype, "patientId", void 0);
43
+ __decorate([
44
+ (0, swagger_1.ApiProperty)({ example: 'f3f50ecb-fb71-4d4b-a0dd-910ef6e3fd0a' }),
45
+ (0, class_validator_1.IsUUID)(),
46
+ __metadata("design:type", String)
47
+ ], FollowupConversationEventPayload.prototype, "sessionUuid", void 0);
48
+ __decorate([
49
+ (0, swagger_1.ApiProperty)({ required: false, example: 1 }),
50
+ (0, class_validator_1.IsOptional)(),
51
+ __metadata("design:type", Number)
52
+ ], FollowupConversationEventPayload.prototype, "unitId", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiProperty)({ example: 'ia' }),
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.MinLength)(1),
57
+ (0, class_validator_1.MaxLength)(50),
58
+ __metadata("design:type", String)
59
+ ], FollowupConversationEventPayload.prototype, "messageType", void 0);
60
+ __decorate([
61
+ (0, swagger_1.ApiProperty)({ required: false, example: false }),
62
+ (0, class_validator_1.IsOptional)(),
63
+ (0, class_validator_1.IsBoolean)(),
64
+ __metadata("design:type", Boolean)
65
+ ], FollowupConversationEventPayload.prototype, "isFollowup", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiProperty)({ example: '2026-03-30T12:03:14.000Z' }),
68
+ (0, class_validator_1.IsISO8601)(),
69
+ __metadata("design:type", String)
70
+ ], FollowupConversationEventPayload.prototype, "occurredAt", void 0);
71
+ class FollowupConfigUpdatedEventPayload {
72
+ tenant;
73
+ unitId;
74
+ config;
75
+ occurredAt;
76
+ }
77
+ exports.FollowupConfigUpdatedEventPayload = FollowupConfigUpdatedEventPayload;
78
+ __decorate([
79
+ (0, swagger_1.ApiProperty)({ example: 'homolog' }),
80
+ (0, class_validator_1.IsString)(),
81
+ (0, class_validator_1.MinLength)(1),
82
+ (0, class_validator_1.MaxLength)(255),
83
+ __metadata("design:type", String)
84
+ ], FollowupConfigUpdatedEventPayload.prototype, "tenant", void 0);
85
+ __decorate([
86
+ (0, swagger_1.ApiProperty)({ required: false, example: 1 }),
87
+ (0, class_validator_1.IsOptional)(),
88
+ __metadata("design:type", Number)
89
+ ], FollowupConfigUpdatedEventPayload.prototype, "unitId", void 0);
90
+ __decorate([
91
+ (0, swagger_1.ApiProperty)({
92
+ description: 'Serialized follow-up configuration snapshot stored in cache.',
93
+ type: Object,
94
+ }),
95
+ __metadata("design:type", Object)
96
+ ], FollowupConfigUpdatedEventPayload.prototype, "config", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiProperty)({ example: '2026-03-30T12:03:14.000Z' }),
99
+ (0, class_validator_1.IsISO8601)(),
100
+ __metadata("design:type", String)
101
+ ], FollowupConfigUpdatedEventPayload.prototype, "occurredAt", void 0);
102
+ class AppointmentChangedEventPayload {
103
+ tenant;
104
+ appointmentId;
105
+ patientId;
106
+ status;
107
+ previousStatus;
108
+ date;
109
+ exitTime;
110
+ occurredAt;
111
+ }
112
+ exports.AppointmentChangedEventPayload = AppointmentChangedEventPayload;
113
+ __decorate([
114
+ (0, swagger_1.ApiProperty)({ example: 'homolog' }),
115
+ (0, class_validator_1.IsString)(),
116
+ (0, class_validator_1.MinLength)(1),
117
+ (0, class_validator_1.MaxLength)(255),
118
+ __metadata("design:type", String)
119
+ ], AppointmentChangedEventPayload.prototype, "tenant", void 0);
120
+ __decorate([
121
+ (0, swagger_1.ApiProperty)({ example: 'f3f50ecb-fb71-4d4b-a0dd-910ef6e3fd0a' }),
122
+ (0, class_validator_1.IsUUID)(),
123
+ __metadata("design:type", String)
124
+ ], AppointmentChangedEventPayload.prototype, "appointmentId", void 0);
125
+ __decorate([
126
+ (0, swagger_1.ApiProperty)({ example: '3c593727-4505-495a-a054-c052acb4cf19' }),
127
+ (0, class_validator_1.IsString)(),
128
+ (0, class_validator_1.MinLength)(1),
129
+ (0, class_validator_1.MaxLength)(255),
130
+ __metadata("design:type", String)
131
+ ], AppointmentChangedEventPayload.prototype, "patientId", void 0);
132
+ __decorate([
133
+ (0, swagger_1.ApiProperty)({ example: 'sended' }),
134
+ (0, class_validator_1.IsString)(),
135
+ (0, class_validator_1.MinLength)(1),
136
+ (0, class_validator_1.MaxLength)(50),
137
+ __metadata("design:type", String)
138
+ ], AppointmentChangedEventPayload.prototype, "status", void 0);
139
+ __decorate([
140
+ (0, swagger_1.ApiProperty)({ required: false, example: 'pending' }),
141
+ (0, class_validator_1.IsOptional)(),
142
+ (0, class_validator_1.IsString)(),
143
+ (0, class_validator_1.MaxLength)(50),
144
+ __metadata("design:type", String)
145
+ ], AppointmentChangedEventPayload.prototype, "previousStatus", void 0);
146
+ __decorate([
147
+ (0, swagger_1.ApiProperty)({ required: false, example: '2026-03-30T15:00:00.000Z' }),
148
+ (0, class_validator_1.IsOptional)(),
149
+ (0, class_validator_1.IsISO8601)(),
150
+ __metadata("design:type", String)
151
+ ], AppointmentChangedEventPayload.prototype, "date", void 0);
152
+ __decorate([
153
+ (0, swagger_1.ApiProperty)({ required: false, example: '2026-03-30T16:00:00.000Z' }),
154
+ (0, class_validator_1.IsOptional)(),
155
+ (0, class_validator_1.IsISO8601)(),
156
+ __metadata("design:type", String)
157
+ ], AppointmentChangedEventPayload.prototype, "exitTime", void 0);
158
+ __decorate([
159
+ (0, swagger_1.ApiProperty)({ example: '2026-03-30T12:03:14.000Z' }),
160
+ (0, class_validator_1.IsISO8601)(),
161
+ __metadata("design:type", String)
162
+ ], AppointmentChangedEventPayload.prototype, "occurredAt", void 0);
@@ -5,7 +5,6 @@ import { FollowupTypeDto } from './followup-type.dto';
5
5
  */
6
6
  export declare class FollowupLogResponseDto {
7
7
  id: string;
8
- tenant: string;
9
8
  sessionUuid?: string | null;
10
9
  patientId: string;
11
10
  attempt: number;
@@ -1 +1 @@
1
- {"version":3,"file":"followup-log-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-log-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;GAGG;AACH,qBAAa,sBAAsB;IAIjC,EAAE,EAAE,MAAM,CAAC;IAKX,MAAM,EAAE,MAAM,CAAC;IAKf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,SAAS,EAAE,MAAM,CAAC;IAMlB,OAAO,EAAE,MAAM,CAAC;IAKhB,OAAO,EAAE,MAAM,CAAC;IAKhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,YAAY,EAAE,eAAe,CAAC;IAK9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK9B,MAAM,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"followup-log-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-log-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;GAGG;AACH,qBAAa,sBAAsB;IAIjC,EAAE,EAAE,MAAM,CAAC;IAKX,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,SAAS,EAAE,MAAM,CAAC;IAMlB,OAAO,EAAE,MAAM,CAAC;IAKhB,OAAO,EAAE,MAAM,CAAC;IAKhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,YAAY,EAAE,eAAe,CAAC;IAK9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK9B,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -19,7 +19,6 @@ const followup_type_dto_1 = require("./followup-type.dto");
19
19
  */
20
20
  class FollowupLogResponseDto {
21
21
  id;
22
- tenant;
23
22
  sessionUuid;
24
23
  patientId;
25
24
  attempt;
@@ -36,12 +35,6 @@ __decorate([
36
35
  (0, class_validator_1.IsNotEmpty)(),
37
36
  __metadata("design:type", String)
38
37
  ], FollowupLogResponseDto.prototype, "id", void 0);
39
- __decorate([
40
- (0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
41
- (0, class_validator_1.IsString)(),
42
- (0, class_validator_1.IsNotEmpty)(),
43
- __metadata("design:type", String)
44
- ], FollowupLogResponseDto.prototype, "tenant", void 0);
45
38
  __decorate([
46
39
  (0, swagger_1.ApiPropertyOptional)({ description: 'Session UUID from conversation_sessions (null for appointment-based)' }),
47
40
  (0, class_validator_1.IsOptional)(),
@@ -7,4 +7,6 @@ export * from './conversation-response.dto';
7
7
  export * from './followup-type.dto';
8
8
  export * from './followup-config-response.dto';
9
9
  export * from './followup-log-response.dto';
10
+ export * from './satisfaction-response.dto';
11
+ export * from './followup-events.dto';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
@@ -23,3 +23,5 @@ __exportStar(require("./conversation-response.dto"), exports);
23
23
  __exportStar(require("./followup-type.dto"), exports);
24
24
  __exportStar(require("./followup-config-response.dto"), exports);
25
25
  __exportStar(require("./followup-log-response.dto"), exports);
26
+ __exportStar(require("./satisfaction-response.dto"), exports);
27
+ __exportStar(require("./followup-events.dto"), exports);
@@ -0,0 +1,36 @@
1
+ /** Valid satisfaction survey types. */
2
+ export declare const SATISFACTION_TYPES: readonly ["satisfaction_booking", "satisfaction_finished"];
3
+ export type SatisfactionTypeDto = (typeof SATISFACTION_TYPES)[number];
4
+ /**
5
+ * Payload to save a patient's satisfaction rating.
6
+ * Sent from the conversation-service to the followup-service
7
+ * when the AI detects a numeric satisfaction response.
8
+ */
9
+ export declare class SaveSatisfactionRequestDto {
10
+ tenant: string;
11
+ patientId: string;
12
+ appointmentId: string;
13
+ satisfactionType: SatisfactionTypeDto;
14
+ rating: number;
15
+ comment?: string;
16
+ }
17
+ /**
18
+ * Response DTO for a saved satisfaction rating.
19
+ */
20
+ export declare class SatisfactionResponseDto {
21
+ id: string;
22
+ patientId: string;
23
+ appointmentId: string;
24
+ satisfactionType: SatisfactionTypeDto;
25
+ rating: number;
26
+ comment?: string | null;
27
+ createdAt: string;
28
+ }
29
+ /**
30
+ * Response DTO for average satisfaction stats.
31
+ */
32
+ export declare class SatisfactionAverageDto {
33
+ average: number;
34
+ count: number;
35
+ }
36
+ //# sourceMappingURL=satisfaction-response.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"satisfaction-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/satisfaction-response.dto.ts"],"names":[],"mappings":"AAYA,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,4DAGrB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;GAIG;AACH,qBAAa,0BAA0B;IAIrC,MAAM,EAAE,MAAM,CAAC;IAKf,SAAS,EAAE,MAAM,CAAC;IAKlB,aAAa,EAAE,MAAM,CAAC;IAQtB,gBAAgB,EAAE,mBAAmB,CAAC;IAMtC,MAAM,EAAE,MAAM,CAAC;IAMf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAIlC,EAAE,EAAE,MAAM,CAAC;IAKX,SAAS,EAAE,MAAM,CAAC;IAKlB,aAAa,EAAE,MAAM,CAAC;IAQtB,gBAAgB,EAAE,mBAAmB,CAAC;IAMtC,MAAM,EAAE,MAAM,CAAC;IAKf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAEjC,OAAO,EAAE,MAAM,CAAC;IAGhB,KAAK,EAAE,MAAM,CAAC;CACf"}