tychat-contracts 1.6.45 → 1.6.46

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 (28) 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/analytics/followup-analytic-event-type.util.d.ts +2 -0
  5. package/dist/analytics/followup-analytic-event-type.util.d.ts.map +1 -1
  6. package/dist/analytics/followup-analytic-event-type.util.js +3 -1
  7. package/dist/appointments/appointment.dto.d.ts +1 -0
  8. package/dist/appointments/appointment.dto.d.ts.map +1 -1
  9. package/dist/appointments/create-appointment.dto.d.ts +1 -0
  10. package/dist/appointments/create-appointment.dto.d.ts.map +1 -1
  11. package/dist/appointments/create-appointment.dto.js +10 -0
  12. package/dist/procedures/create-procedure.dto.d.ts +6 -1
  13. package/dist/procedures/create-procedure.dto.d.ts.map +1 -1
  14. package/dist/procedures/create-procedure.dto.js +39 -2
  15. package/dist/procedures/list-procedures-query.dto.d.ts +1 -1
  16. package/dist/procedures/list-procedures-query.dto.d.ts.map +1 -1
  17. package/dist/procedures/list-procedures-query.dto.js +3 -0
  18. package/dist/procedures/procedure-response.dto.d.ts +5 -1
  19. package/dist/procedures/procedure-response.dto.d.ts.map +1 -1
  20. package/dist/procedures/procedure-response.dto.js +20 -2
  21. package/package.json +1 -1
  22. package/src/analytics/event-analytic.enum.ts +2 -0
  23. package/src/analytics/followup-analytic-event-type.util.ts +6 -0
  24. package/src/appointments/appointment.dto.ts +5 -0
  25. package/src/appointments/create-appointment.dto.ts +9 -0
  26. package/src/procedures/create-procedure.dto.ts +40 -2
  27. package/src/procedures/list-procedures-query.dto.ts +3 -0
  28. package/src/procedures/procedure-response.dto.ts +14 -2
@@ -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.checkin_not_completed.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", "whatsapp.official.credits.consume.failed", "whatsapp_credits.recharged", "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"];
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.appointment_confirmation.confirmed", "followup.appointment_confirmation.reschedule_requested", "followup.satisfaction_booking.sent", "followup.satisfaction_finished.sent", "followup.no_show_reschedule.sent", "followup.checkin_not_completed.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", "whatsapp.official.credits.consume.failed", "whatsapp_credits.recharged", "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,83DAmHvB,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,u+DAqHvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -33,6 +33,8 @@ exports.EVENT_ANALYTIC_TYPES = [
33
33
  // ── Follow-up events (tychat-followup-service) ─────────────────
34
34
  'followup.abandonment.sent',
35
35
  'followup.appointment_confirmation.sent',
36
+ 'followup.appointment_confirmation.confirmed',
37
+ 'followup.appointment_confirmation.reschedule_requested',
36
38
  'followup.satisfaction_booking.sent',
37
39
  'followup.satisfaction_finished.sent',
38
40
  'followup.no_show_reschedule.sent',
@@ -9,4 +9,6 @@ export type FollowupSatisfactionSurveyKind = 'satisfaction_booking' | 'satisfact
9
9
  export declare function followupSatisfactionResponseEventType(satisfactionType: FollowupSatisfactionSurveyKind): EventAnalyticType;
10
10
  /** Evento quando um passo de abandono é enviado com sucesso. */
11
11
  export declare const FOLLOWUP_ABANDONMENT_SENT_EVENT: EventAnalyticType;
12
+ export declare const FOLLOWUP_APPOINTMENT_CONFIRMATION_CONFIRMED_EVENT: EventAnalyticType;
13
+ export declare const FOLLOWUP_APPOINTMENT_CONFIRMATION_RESCHEDULE_REQUESTED_EVENT: EventAnalyticType;
12
14
  //# sourceMappingURL=followup-analytic-event-type.util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"followup-analytic-event-type.util.d.ts","sourceRoot":"","sources":["../../src/analytics/followup-analytic-event-type.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GACvC,0BAA0B,GAC1B,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,GACpB,uBAAuB,GACvB,gBAAgB,GAChB,mBAAmB,CAAC;AAYxB,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,+BAA+B,GACpC,iBAAiB,CAEnB;AAED,MAAM,MAAM,8BAA8B,GACtC,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B,wBAAgB,qCAAqC,CACnD,gBAAgB,EAAE,8BAA8B,GAC/C,iBAAiB,CAKnB;AAED,gEAAgE;AAChE,eAAO,MAAM,+BAA+B,EAAE,iBAA+C,CAAC"}
1
+ {"version":3,"file":"followup-analytic-event-type.util.d.ts","sourceRoot":"","sources":["../../src/analytics/followup-analytic-event-type.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GACvC,0BAA0B,GAC1B,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,GACpB,uBAAuB,GACvB,gBAAgB,GAChB,mBAAmB,CAAC;AAYxB,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,+BAA+B,GACpC,iBAAiB,CAEnB;AAED,MAAM,MAAM,8BAA8B,GACtC,sBAAsB,GACtB,uBAAuB,CAAC;AAE5B,wBAAgB,qCAAqC,CACnD,gBAAgB,EAAE,8BAA8B,GAC/C,iBAAiB,CAKnB;AAED,gEAAgE;AAChE,eAAO,MAAM,+BAA+B,EAAE,iBAA+C,CAAC;AAE9F,eAAO,MAAM,iDAAiD,EAAE,iBACjB,CAAC;AAEhD,eAAO,MAAM,4DAA4D,EAAE,iBACjB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FOLLOWUP_ABANDONMENT_SENT_EVENT = void 0;
3
+ exports.FOLLOWUP_APPOINTMENT_CONFIRMATION_RESCHEDULE_REQUESTED_EVENT = exports.FOLLOWUP_APPOINTMENT_CONFIRMATION_CONFIRMED_EVENT = exports.FOLLOWUP_ABANDONMENT_SENT_EVENT = void 0;
4
4
  exports.followupAppointmentSentEventType = followupAppointmentSentEventType;
5
5
  exports.followupSatisfactionResponseEventType = followupSatisfactionResponseEventType;
6
6
  const APPOINTMENT_SENT = {
@@ -23,3 +23,5 @@ function followupSatisfactionResponseEventType(satisfactionType) {
23
23
  }
24
24
  /** Evento quando um passo de abandono é enviado com sucesso. */
25
25
  exports.FOLLOWUP_ABANDONMENT_SENT_EVENT = 'followup.abandonment.sent';
26
+ exports.FOLLOWUP_APPOINTMENT_CONFIRMATION_CONFIRMED_EVENT = 'followup.appointment_confirmation.confirmed';
27
+ exports.FOLLOWUP_APPOINTMENT_CONFIRMATION_RESCHEDULE_REQUESTED_EVENT = 'followup.appointment_confirmation.reschedule_requested';
@@ -26,6 +26,7 @@ export interface AppointmentDto {
26
26
  observation?: string;
27
27
  cancellationReason?: string;
28
28
  status: AppointmentStatusDto;
29
+ patientConfirmedAt?: string;
29
30
  appointmentType: AppointmentTypeDto;
30
31
  rescheduledFromId?: string;
31
32
  returnFromAppointmentId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,mEAAmE;AACnE,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mFAAmF;IACnF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,QAAQ,CAAC,EAAE,MAAM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C;IAK5B,MAAM,EAAE,oBAAoB,CAAC;IAK7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,eAAe,EAAE,kBAAkB,CAAC;IAKpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAK3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAIjC,UAAU,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAChD"}
@@ -10,6 +10,7 @@ export declare class CreateAppointmentDto {
10
10
  observation?: string;
11
11
  cancellationReason?: string;
12
12
  status?: AppointmentStatusDto;
13
+ patientConfirmedAt?: string;
13
14
  appointmentType?: AppointmentTypeDto;
14
15
  rescheduledFromId?: string;
15
16
  returnFromAppointmentId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAIlC,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAS9B,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAQrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAQ3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAWjC,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAQ9C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAW7B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAIlC,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAS9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAQrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAQ3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAWjC,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAQ9C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAW7B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC"}
@@ -25,6 +25,7 @@ class CreateAppointmentDto {
25
25
  observation;
26
26
  cancellationReason;
27
27
  status;
28
+ patientConfirmedAt;
28
29
  appointmentType;
29
30
  rescheduledFromId;
30
31
  returnFromAppointmentId;
@@ -116,6 +117,15 @@ __decorate([
116
117
  (0, class_validator_1.IsEnum)(appointment_status_dto_1.APPOINTMENT_STATUSES),
117
118
  __metadata("design:type", String)
118
119
  ], CreateAppointmentDto.prototype, "status", void 0);
120
+ __decorate([
121
+ (0, swagger_1.ApiPropertyOptional)({
122
+ description: 'Data/hora em que o paciente confirmou presença via WhatsApp (ISO 8601)',
123
+ example: '2026-03-14T10:30:00.000Z',
124
+ }),
125
+ (0, class_validator_1.IsOptional)(),
126
+ (0, class_validator_1.IsDateString)(),
127
+ __metadata("design:type", String)
128
+ ], CreateAppointmentDto.prototype, "patientConfirmedAt", void 0);
119
129
  __decorate([
120
130
  (0, swagger_1.ApiPropertyOptional)({
121
131
  description: 'Tipo do agendamento (regular ou retorno)',
@@ -1,3 +1,5 @@
1
+ export declare const PROCEDURE_PRICING_TYPES: readonly ["fixed", "variable"];
2
+ export type ProcedurePricingTypeDto = (typeof PROCEDURE_PRICING_TYPES)[number];
1
3
  export declare class CreateProcedureDto {
2
4
  name: string;
3
5
  category?: string | null;
@@ -5,7 +7,10 @@ export declare class CreateProcedureDto {
5
7
  blockTime?: number | null;
6
8
  defaultValue?: number | null;
7
9
  returnDays?: number | null;
8
- value: number;
10
+ pricingType: ProcedurePricingTypeDto;
11
+ value?: number;
12
+ minValue?: number;
13
+ maxValue?: number;
9
14
  duration: number;
10
15
  side_effects?: string | null;
11
16
  specialtyId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/create-procedure.dto.ts"],"names":[],"mappings":"AAYA,qBAAa,kBAAkB;IAS7B,IAAI,EAAE,MAAM,CAAC;IAUb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,QAAQ,EAAE,MAAM,CAAC;IAUjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"create-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/create-procedure.dto.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,uBAAuB,gCAAiC,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,qBAAa,kBAAkB;IAS7B,IAAI,EAAE,MAAM,CAAC;IAUb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,WAAW,EAAE,uBAAuB,CAAC;IAUrC,KAAK,CAAC,EAAE,MAAM,CAAC;IAWf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAWlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,QAAQ,EAAE,MAAM,CAAC;IAUjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -9,9 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateProcedureDto = void 0;
12
+ exports.CreateProcedureDto = exports.PROCEDURE_PRICING_TYPES = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ exports.PROCEDURE_PRICING_TYPES = ['fixed', 'variable'];
15
16
  class CreateProcedureDto {
16
17
  name;
17
18
  category;
@@ -19,7 +20,10 @@ class CreateProcedureDto {
19
20
  blockTime;
20
21
  defaultValue;
21
22
  returnDays;
23
+ pricingType;
22
24
  value;
25
+ minValue;
26
+ maxValue;
23
27
  duration;
24
28
  side_effects;
25
29
  specialtyId;
@@ -90,13 +94,46 @@ __decorate([
90
94
  ], CreateProcedureDto.prototype, "returnDays", void 0);
91
95
  __decorate([
92
96
  (0, swagger_1.ApiProperty)({
93
- description: 'Valor monetário do procedimento',
97
+ description: 'Tipo de precificacao do procedimento',
98
+ enum: exports.PROCEDURE_PRICING_TYPES,
99
+ example: 'fixed',
100
+ }),
101
+ (0, class_validator_1.IsIn)(exports.PROCEDURE_PRICING_TYPES),
102
+ __metadata("design:type", String)
103
+ ], CreateProcedureDto.prototype, "pricingType", void 0);
104
+ __decorate([
105
+ (0, swagger_1.ApiPropertyOptional)({
106
+ description: 'Valor fixo do procedimento (obrigatorio quando pricingType = fixed)',
94
107
  example: 150.5,
95
108
  }),
109
+ (0, class_validator_1.ValidateIf)((o) => o.pricingType === 'fixed'),
110
+ (0, class_validator_1.IsDefined)(),
96
111
  (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
97
112
  (0, class_validator_1.Min)(0),
98
113
  __metadata("design:type", Number)
99
114
  ], CreateProcedureDto.prototype, "value", void 0);
115
+ __decorate([
116
+ (0, swagger_1.ApiPropertyOptional)({
117
+ description: 'Valor minimo da faixa de preco (obrigatorio quando pricingType = variable)',
118
+ example: 120,
119
+ }),
120
+ (0, class_validator_1.ValidateIf)((o) => o.pricingType === 'variable'),
121
+ (0, class_validator_1.IsDefined)(),
122
+ (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
123
+ (0, class_validator_1.Min)(0),
124
+ __metadata("design:type", Number)
125
+ ], CreateProcedureDto.prototype, "minValue", void 0);
126
+ __decorate([
127
+ (0, swagger_1.ApiPropertyOptional)({
128
+ description: 'Valor maximo da faixa de preco (obrigatorio quando pricingType = variable)',
129
+ example: 220,
130
+ }),
131
+ (0, class_validator_1.ValidateIf)((o) => o.pricingType === 'variable'),
132
+ (0, class_validator_1.IsDefined)(),
133
+ (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
134
+ (0, class_validator_1.Min)(0),
135
+ __metadata("design:type", Number)
136
+ ], CreateProcedureDto.prototype, "maxValue", void 0);
100
137
  __decorate([
101
138
  (0, swagger_1.ApiProperty)({
102
139
  description: 'Duração do procedimento em minutos',
@@ -1,5 +1,5 @@
1
1
  import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
2
- export declare const PROCEDURE_LIST_FILTER_KEYS: readonly ["id", "name", "category", "description", "blockTime", "defaultValue", "returnDays", "value", "duration", "sideEffects", "specialtyId", "createdAt", "updatedAt", "deletedAt"];
2
+ export declare const PROCEDURE_LIST_FILTER_KEYS: readonly ["id", "name", "category", "description", "blockTime", "defaultValue", "returnDays", "value", "pricingType", "minValue", "maxValue", "duration", "sideEffects", "specialtyId", "createdAt", "updatedAt", "deletedAt"];
3
3
  export type ProcedureListFilterKeyDto = (typeof PROCEDURE_LIST_FILTER_KEYS)[number];
4
4
  export declare class ListProceduresQueryDto {
5
5
  page?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"list-procedures-query.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/list-procedures-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,0BAA0B,yLAe7B,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,qBAAa,sBAAsB;IAUjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;IAYf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B"}
1
+ {"version":3,"file":"list-procedures-query.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/list-procedures-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,0BAA0B,gOAkB7B,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,qBAAa,sBAAsB;IAUjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;IAYf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B"}
@@ -21,6 +21,9 @@ exports.PROCEDURE_LIST_FILTER_KEYS = [
21
21
  'defaultValue',
22
22
  'returnDays',
23
23
  'value',
24
+ 'pricingType',
25
+ 'minValue',
26
+ 'maxValue',
24
27
  'duration',
25
28
  'sideEffects',
26
29
  'specialtyId',
@@ -1,4 +1,5 @@
1
1
  import { SpecialtyEmbedDto } from './specialty-embed.dto';
2
+ import { ProcedurePricingTypeDto } from './create-procedure.dto';
2
3
  /**
3
4
  * Procedimento como retornado pela API (inclui especialidade carregada).
4
5
  */
@@ -10,7 +11,10 @@ export declare class ProcedureResponseDto {
10
11
  blockTime: number | null;
11
12
  defaultValue: number | null;
12
13
  returnDays: number | null;
13
- value: number;
14
+ pricingType: ProcedurePricingTypeDto;
15
+ value: number | null;
16
+ minValue: number | null;
17
+ maxValue: number | null;
14
18
  duration: number;
15
19
  side_effects: string | null;
16
20
  specialtyId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"procedure-response.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/procedure-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,qBAAa,oBAAoB;IAE/B,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,YAAY,EAAE,MAAM,GA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;IAGhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB"}
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProcedureResponseDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const specialty_embed_dto_1 = require("./specialty-embed.dto");
15
+ const create_procedure_dto_1 = require("./create-procedure.dto");
15
16
  /**
16
17
  * Procedimento como retornado pela API (inclui especialidade carregada).
17
18
  */
@@ -23,7 +24,10 @@ class ProcedureResponseDto {
23
24
  blockTime;
24
25
  defaultValue;
25
26
  returnDays;
27
+ pricingType;
26
28
  value;
29
+ minValue;
30
+ maxValue;
27
31
  duration;
28
32
  side_effects;
29
33
  specialtyId;
@@ -62,9 +66,23 @@ __decorate([
62
66
  __metadata("design:type", Object)
63
67
  ], ProcedureResponseDto.prototype, "returnDays", void 0);
64
68
  __decorate([
65
- (0, swagger_1.ApiProperty)(),
66
- __metadata("design:type", Number)
69
+ (0, swagger_1.ApiProperty)({
70
+ enum: create_procedure_dto_1.PROCEDURE_PRICING_TYPES,
71
+ }),
72
+ __metadata("design:type", String)
73
+ ], ProcedureResponseDto.prototype, "pricingType", void 0);
74
+ __decorate([
75
+ (0, swagger_1.ApiPropertyOptional)({ nullable: true }),
76
+ __metadata("design:type", Object)
67
77
  ], ProcedureResponseDto.prototype, "value", void 0);
78
+ __decorate([
79
+ (0, swagger_1.ApiPropertyOptional)({ nullable: true }),
80
+ __metadata("design:type", Object)
81
+ ], ProcedureResponseDto.prototype, "minValue", void 0);
82
+ __decorate([
83
+ (0, swagger_1.ApiPropertyOptional)({ nullable: true }),
84
+ __metadata("design:type", Object)
85
+ ], ProcedureResponseDto.prototype, "maxValue", void 0);
68
86
  __decorate([
69
87
  (0, swagger_1.ApiProperty)(),
70
88
  __metadata("design:type", Number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.45",
3
+ "version": "1.6.46",
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",
@@ -35,6 +35,8 @@ export const EVENT_ANALYTIC_TYPES = [
35
35
  // ── Follow-up events (tychat-followup-service) ─────────────────
36
36
  'followup.abandonment.sent',
37
37
  'followup.appointment_confirmation.sent',
38
+ 'followup.appointment_confirmation.confirmed',
39
+ 'followup.appointment_confirmation.reschedule_requested',
38
40
  'followup.satisfaction_booking.sent',
39
41
  'followup.satisfaction_finished.sent',
40
42
  'followup.no_show_reschedule.sent',
@@ -44,3 +44,9 @@ export function followupSatisfactionResponseEventType(
44
44
 
45
45
  /** Evento quando um passo de abandono é enviado com sucesso. */
46
46
  export const FOLLOWUP_ABANDONMENT_SENT_EVENT: EventAnalyticType = 'followup.abandonment.sent';
47
+
48
+ export const FOLLOWUP_APPOINTMENT_CONFIRMATION_CONFIRMED_EVENT: EventAnalyticType =
49
+ 'followup.appointment_confirmation.confirmed';
50
+
51
+ export const FOLLOWUP_APPOINTMENT_CONFIRMATION_RESCHEDULE_REQUESTED_EVENT: EventAnalyticType =
52
+ 'followup.appointment_confirmation.reschedule_requested';
@@ -66,6 +66,11 @@ export interface AppointmentDto {
66
66
  */
67
67
  status: AppointmentStatusDto;
68
68
  /*
69
+ * Data/hora em que o paciente confirmou presença via WhatsApp (ISO 8601)
70
+ * @example '2026-03-14T10:30:00.000Z'
71
+ */
72
+ patientConfirmedAt?: string;
73
+ /*
69
74
  * Type of the appointment (regular or return visit)
70
75
  * @example 'regular'
71
76
  */
@@ -96,6 +96,15 @@ export class CreateAppointmentDto {
96
96
  @IsEnum(APPOINTMENT_STATUSES)
97
97
  status?: AppointmentStatusDto;
98
98
 
99
+ @ApiPropertyOptional({
100
+ description:
101
+ 'Data/hora em que o paciente confirmou presença via WhatsApp (ISO 8601)',
102
+ example: '2026-03-14T10:30:00.000Z',
103
+ })
104
+ @IsOptional()
105
+ @IsDateString()
106
+ patientConfirmedAt?: string;
107
+
99
108
  @ApiPropertyOptional({
100
109
  description: 'Tipo do agendamento (regular ou retorno)',
101
110
  enum: APPOINTMENT_TYPES,
@@ -1,15 +1,21 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import {
3
+ IsDefined,
3
4
  IsInt,
4
5
  IsNotEmpty,
5
6
  IsNumber,
6
7
  IsOptional,
8
+ IsIn,
7
9
  IsString,
8
10
  IsUUID,
9
11
  MaxLength,
10
12
  Min,
13
+ ValidateIf,
11
14
  } from 'class-validator';
12
15
 
16
+ export const PROCEDURE_PRICING_TYPES = ['fixed', 'variable'] as const;
17
+ export type ProcedurePricingTypeDto = (typeof PROCEDURE_PRICING_TYPES)[number];
18
+
13
19
  export class CreateProcedureDto {
14
20
  @ApiProperty({
15
21
  description: 'Nome do procedimento',
@@ -69,12 +75,44 @@ export class CreateProcedureDto {
69
75
  returnDays?: number | null;
70
76
 
71
77
  @ApiProperty({
72
- description: 'Valor monetário do procedimento',
78
+ description: 'Tipo de precificacao do procedimento',
79
+ enum: PROCEDURE_PRICING_TYPES,
80
+ example: 'fixed',
81
+ })
82
+ @IsIn(PROCEDURE_PRICING_TYPES)
83
+ pricingType: ProcedurePricingTypeDto;
84
+
85
+ @ApiPropertyOptional({
86
+ description: 'Valor fixo do procedimento (obrigatorio quando pricingType = fixed)',
73
87
  example: 150.5,
74
88
  })
89
+ @ValidateIf((o: CreateProcedureDto) => o.pricingType === 'fixed')
90
+ @IsDefined()
91
+ @IsNumber({ maxDecimalPlaces: 2 })
92
+ @Min(0)
93
+ value?: number;
94
+
95
+ @ApiPropertyOptional({
96
+ description:
97
+ 'Valor minimo da faixa de preco (obrigatorio quando pricingType = variable)',
98
+ example: 120,
99
+ })
100
+ @ValidateIf((o: CreateProcedureDto) => o.pricingType === 'variable')
101
+ @IsDefined()
102
+ @IsNumber({ maxDecimalPlaces: 2 })
103
+ @Min(0)
104
+ minValue?: number;
105
+
106
+ @ApiPropertyOptional({
107
+ description:
108
+ 'Valor maximo da faixa de preco (obrigatorio quando pricingType = variable)',
109
+ example: 220,
110
+ })
111
+ @ValidateIf((o: CreateProcedureDto) => o.pricingType === 'variable')
112
+ @IsDefined()
75
113
  @IsNumber({ maxDecimalPlaces: 2 })
76
114
  @Min(0)
77
- value: number;
115
+ maxValue?: number;
78
116
 
79
117
  @ApiProperty({
80
118
  description: 'Duração do procedimento em minutos',
@@ -11,6 +11,9 @@ export const PROCEDURE_LIST_FILTER_KEYS = [
11
11
  'defaultValue',
12
12
  'returnDays',
13
13
  'value',
14
+ 'pricingType',
15
+ 'minValue',
16
+ 'maxValue',
14
17
  'duration',
15
18
  'sideEffects',
16
19
  'specialtyId',
@@ -1,5 +1,6 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import { SpecialtyEmbedDto } from './specialty-embed.dto';
3
+ import { PROCEDURE_PRICING_TYPES, ProcedurePricingTypeDto } from './create-procedure.dto';
3
4
 
4
5
  /**
5
6
  * Procedimento como retornado pela API (inclui especialidade carregada).
@@ -26,8 +27,19 @@ export class ProcedureResponseDto {
26
27
  @ApiPropertyOptional({ nullable: true })
27
28
  returnDays: number | null;
28
29
 
29
- @ApiProperty()
30
- value: number;
30
+ @ApiProperty({
31
+ enum: PROCEDURE_PRICING_TYPES,
32
+ })
33
+ pricingType: ProcedurePricingTypeDto;
34
+
35
+ @ApiPropertyOptional({ nullable: true })
36
+ value: number | null;
37
+
38
+ @ApiPropertyOptional({ nullable: true })
39
+ minValue: number | null;
40
+
41
+ @ApiPropertyOptional({ nullable: true })
42
+ maxValue: number | null;
31
43
 
32
44
  @ApiProperty()
33
45
  duration: number;