tychat-contracts 1.0.80 → 1.0.82

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 (61) 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 +8 -0
  4. package/dist/appointments/available-slots-query.dto.d.ts +2 -0
  5. package/dist/appointments/available-slots-query.dto.d.ts.map +1 -1
  6. package/dist/appointments/available-slots-query.dto.js +20 -0
  7. package/dist/appointments/available-slots-response.dto.d.ts +18 -7
  8. package/dist/appointments/available-slots-response.dto.d.ts.map +1 -1
  9. package/dist/appointments/available-slots-response.dto.js +76 -27
  10. package/dist/billing/billing-response.dto.d.ts +2 -3
  11. package/dist/billing/billing-response.dto.d.ts.map +1 -1
  12. package/dist/billing/billing-response.dto.js +6 -16
  13. package/dist/billing/create-billing.dto.d.ts +1 -6
  14. package/dist/billing/create-billing.dto.d.ts.map +1 -1
  15. package/dist/billing/create-billing.dto.js +8 -28
  16. package/dist/billing/list-billings-query.dto.d.ts +2 -3
  17. package/dist/billing/list-billings-query.dto.d.ts.map +1 -1
  18. package/dist/billing/list-billings-query.dto.js +5 -17
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -0
  22. package/dist/payment-gateway/create-gateway-payment.dto.d.ts +25 -0
  23. package/dist/payment-gateway/create-gateway-payment.dto.d.ts.map +1 -0
  24. package/dist/payment-gateway/create-gateway-payment.dto.js +147 -0
  25. package/dist/payment-gateway/gateway-payment-response.dto.d.ts +24 -0
  26. package/dist/payment-gateway/gateway-payment-response.dto.d.ts.map +1 -0
  27. package/dist/payment-gateway/gateway-payment-response.dto.js +105 -0
  28. package/dist/payment-gateway/index.d.ts +8 -0
  29. package/dist/payment-gateway/index.d.ts.map +1 -0
  30. package/dist/payment-gateway/index.js +23 -0
  31. package/dist/payment-gateway/list-gateway-payments-query.dto.d.ts +14 -0
  32. package/dist/payment-gateway/list-gateway-payments-query.dto.d.ts.map +1 -0
  33. package/dist/payment-gateway/list-gateway-payments-query.dto.js +73 -0
  34. package/dist/payment-gateway/payment-gateway-kafka-topics.d.ts +19 -0
  35. package/dist/payment-gateway/payment-gateway-kafka-topics.d.ts.map +1 -0
  36. package/dist/payment-gateway/payment-gateway-kafka-topics.js +21 -0
  37. package/dist/payment-gateway/payment-gateway.enums.d.ts +16 -0
  38. package/dist/payment-gateway/payment-gateway.enums.d.ts.map +1 -0
  39. package/dist/payment-gateway/payment-gateway.enums.js +32 -0
  40. package/dist/payment-gateway/update-gateway-payment.dto.d.ts +9 -0
  41. package/dist/payment-gateway/update-gateway-payment.dto.d.ts.map +1 -0
  42. package/dist/payment-gateway/update-gateway-payment.dto.js +11 -0
  43. package/dist/payment-gateway/webhook-payload.dto.d.ts +12 -0
  44. package/dist/payment-gateway/webhook-payload.dto.d.ts.map +1 -0
  45. package/dist/payment-gateway/webhook-payload.dto.js +55 -0
  46. package/package.json +1 -1
  47. package/src/analytics/event-analytic.enum.ts +9 -0
  48. package/src/appointments/available-slots-query.dto.ts +19 -0
  49. package/src/appointments/available-slots-response.dto.ts +63 -20
  50. package/src/billing/billing-response.dto.ts +4 -16
  51. package/src/billing/create-billing.dto.ts +6 -28
  52. package/src/billing/list-billings-query.dto.ts +4 -18
  53. package/src/index.ts +1 -0
  54. package/src/payment-gateway/create-gateway-payment.dto.ts +122 -0
  55. package/src/payment-gateway/gateway-payment-response.dto.ts +65 -0
  56. package/src/payment-gateway/index.ts +7 -0
  57. package/src/payment-gateway/list-gateway-payments-query.dto.ts +53 -0
  58. package/src/payment-gateway/payment-gateway-kafka-topics.ts +25 -0
  59. package/src/payment-gateway/payment-gateway.enums.ts +34 -0
  60. package/src/payment-gateway/update-gateway-payment.dto.ts +7 -0
  61. package/src/payment-gateway/webhook-payload.dto.ts +32 -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", "checkin.effectued", "checkout.effectued", "message.sent", "message.received", "conversation.session_started", "conversation.session_ended", "conversation.transferred_to_human", "followup.triggered", "followup.completed", "followup.config_updated", "payment.created", "payment.payed", "payment.refunded", "payment.canceled", "payment.overdue", "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", "checkin.effectued", "checkout.effectued", "message.sent", "message.received", "conversation.session_started", "conversation.session_ended", "conversation.transferred_to_human", "followup.triggered", "followup.completed", "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"];
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,6pCA2FvB,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,s5CAoGvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -38,6 +38,14 @@ exports.EVENT_ANALYTIC_TYPES = [
38
38
  'payment.refunded',
39
39
  'payment.canceled',
40
40
  'payment.overdue',
41
+ // ── Payment Gateway events ─────────────────────────────────────
42
+ 'payment_gateway.payment_created',
43
+ 'payment_gateway.payment_confirmed',
44
+ 'payment_gateway.payment_failed',
45
+ 'payment_gateway.payment_refunded',
46
+ 'payment_gateway.payment_canceled',
47
+ 'payment_gateway.payment_expired',
48
+ 'payment_gateway.webhook_received',
41
49
  // ── Billing events ──────────────────────────────────────────────
42
50
  'billing.invoice_created',
43
51
  'billing.invoice_paid',
@@ -1,5 +1,7 @@
1
1
  export declare class AvailableSlotsQueryDto {
2
2
  procedureIds: string[];
3
3
  userId?: string;
4
+ startDate?: string;
5
+ endDate?: string;
4
6
  }
5
7
  //# sourceMappingURL=available-slots-query.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"available-slots-query.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/available-slots-query.dto.ts"],"names":[],"mappings":"AAQA,qBAAa,sBAAsB;IAYjC,YAAY,EAAE,MAAM,EAAE,CAAC;IASvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"available-slots-query.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/available-slots-query.dto.ts"],"names":[],"mappings":"AASA,qBAAa,sBAAsB;IAYjC,YAAY,EAAE,MAAM,EAAE,CAAC;IASvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,SAAS,CAAC,EAAE,MAAM,CAAC;IASnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -15,6 +15,8 @@ const class_validator_1 = require("class-validator");
15
15
  class AvailableSlotsQueryDto {
16
16
  procedureIds;
17
17
  userId;
18
+ startDate;
19
+ endDate;
18
20
  }
19
21
  exports.AvailableSlotsQueryDto = AvailableSlotsQueryDto;
20
22
  __decorate([
@@ -39,3 +41,21 @@ __decorate([
39
41
  (0, class_validator_1.IsUUID)('4'),
40
42
  __metadata("design:type", String)
41
43
  ], AvailableSlotsQueryDto.prototype, "userId", void 0);
44
+ __decorate([
45
+ (0, swagger_1.ApiPropertyOptional)({
46
+ description: 'Início do intervalo (YYYY-MM-DD). Com `endDate`, delimita o período. Se ambos forem omitidos, usa só o mês civil atual.',
47
+ example: '2026-03-01',
48
+ }),
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
51
+ __metadata("design:type", String)
52
+ ], AvailableSlotsQueryDto.prototype, "startDate", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiPropertyOptional)({
55
+ description: 'Fim do intervalo (YYYY-MM-DD), inclusivo. Se omitido com `startDate`, usa o fim do mês de `startDate`.',
56
+ example: '2026-03-31',
57
+ }),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
60
+ __metadata("design:type", String)
61
+ ], AvailableSlotsQueryDto.prototype, "endDate", void 0);
@@ -1,12 +1,23 @@
1
- export declare class AvailableDaySlotsDto {
2
- date: string;
3
- slots: string[];
1
+ /** Dia do mês com lista de horários (formato HH:mm). */
2
+ export declare class AvailableSlotsDayHoursDto {
3
+ day: number;
4
+ hours: string[];
4
5
  }
5
- export declare class AvailableMonthSlotsDto {
6
+ export declare class AvailableSlotsProcedureMonthDto {
6
7
  month: string;
7
- days: AvailableDaySlotsDto[];
8
+ days: AvailableSlotsDayHoursDto[];
8
9
  }
9
- export declare class AvailableSlotsResponseDto {
10
- months: AvailableMonthSlotsDto[];
10
+ export declare class AvailableSlotsProcedureItemDto {
11
+ name: string;
12
+ slots: AvailableSlotsProcedureMonthDto[];
11
13
  }
14
+ export declare class AvailableSlotsProfessionalNameDto {
15
+ name: string;
16
+ }
17
+ export declare class AvailableSlotsProfessionalItemDto {
18
+ professional: AvailableSlotsProfessionalNameDto;
19
+ procedures: AvailableSlotsProcedureItemDto[];
20
+ }
21
+ /** Resposta de GET available-slots: array com um elemento (profissional + procedimentos). */
22
+ export type AvailableSlotsGroupedResponseDto = AvailableSlotsProfessionalItemDto[];
12
23
  //# sourceMappingURL=available-slots-response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"available-slots-response.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/available-slots-response.dto.ts"],"names":[],"mappings":"AAQA,qBAAa,oBAAoB;IAQ/B,IAAI,EAAE,MAAM,CAAC;IAUb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qBAAa,sBAAsB;IAQjC,KAAK,EAAE,MAAM,CAAC;IAOd,IAAI,EAAE,oBAAoB,EAAE,CAAC;CAC9B;AAED,qBAAa,yBAAyB;IAOpC,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"available-slots-response.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/available-slots-response.dto.ts"],"names":[],"mappings":"AAaA,wDAAwD;AACxD,qBAAa,yBAAyB;IAQpC,GAAG,EAAE,MAAM,CAAC;IASZ,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qBAAa,+BAA+B;IAQ1C,KAAK,EAAE,MAAM,CAAC;IASd,IAAI,EAAE,yBAAyB,EAAE,CAAC;CACnC;AAED,qBAAa,8BAA8B;IAOzC,IAAI,EAAE,MAAM,CAAC;IASb,KAAK,EAAE,+BAA+B,EAAE,CAAC;CAC1C;AAED,qBAAa,iCAAiC;IAM5C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,iCAAiC;IAI5C,YAAY,EAAE,iCAAiC,CAAC;IAShD,UAAU,EAAE,8BAA8B,EAAE,CAAC;CAC9C;AAED,6FAA6F;AAC7F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,EAAE,CAAC"}
@@ -9,66 +9,115 @@ 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.AvailableSlotsResponseDto = exports.AvailableMonthSlotsDto = exports.AvailableDaySlotsDto = void 0;
12
+ exports.AvailableSlotsProfessionalItemDto = exports.AvailableSlotsProfessionalNameDto = exports.AvailableSlotsProcedureItemDto = exports.AvailableSlotsProcedureMonthDto = exports.AvailableSlotsDayHoursDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
- class AvailableDaySlotsDto {
16
- date;
17
- slots;
15
+ const class_transformer_1 = require("class-transformer");
16
+ /** Dia do mês com lista de horários (formato HH:mm). */
17
+ class AvailableSlotsDayHoursDto {
18
+ day;
19
+ hours;
18
20
  }
19
- exports.AvailableDaySlotsDto = AvailableDaySlotsDto;
21
+ exports.AvailableSlotsDayHoursDto = AvailableSlotsDayHoursDto;
20
22
  __decorate([
21
23
  (0, swagger_1.ApiProperty)({
22
- description: 'Data do dia disponível para agendamentos (formato YYYY-MM-DD)',
23
- example: '2026-03-10',
24
+ description: 'Dia do mês (1–31)',
25
+ example: 15,
24
26
  }),
25
- (0, class_validator_1.IsString)(),
26
- (0, class_validator_1.IsNotEmpty)(),
27
- (0, class_validator_1.Matches)(/^\d{4}-\d{2}-\d{2}$/),
28
- __metadata("design:type", String)
29
- ], AvailableDaySlotsDto.prototype, "date", void 0);
27
+ (0, class_validator_1.IsInt)(),
28
+ (0, class_validator_1.Min)(1),
29
+ (0, class_validator_1.Max)(31),
30
+ __metadata("design:type", Number)
31
+ ], AvailableSlotsDayHoursDto.prototype, "day", void 0);
30
32
  __decorate([
31
33
  (0, swagger_1.ApiProperty)({
32
- description: 'Lista de horários disponíveis para agendamento no dia (formato HH:mm)',
34
+ description: 'Horários disponíveis neste dia',
33
35
  example: ['08:00', '08:30', '09:00'],
34
36
  }),
35
37
  (0, class_validator_1.IsArray)(),
36
38
  (0, class_validator_1.IsString)({ each: true }),
37
39
  (0, class_validator_1.Matches)(/^\d{2}:\d{2}$/, { each: true }),
38
40
  __metadata("design:type", Array)
39
- ], AvailableDaySlotsDto.prototype, "slots", void 0);
40
- class AvailableMonthSlotsDto {
41
+ ], AvailableSlotsDayHoursDto.prototype, "hours", void 0);
42
+ class AvailableSlotsProcedureMonthDto {
41
43
  month;
42
44
  days;
43
45
  }
44
- exports.AvailableMonthSlotsDto = AvailableMonthSlotsDto;
46
+ exports.AvailableSlotsProcedureMonthDto = AvailableSlotsProcedureMonthDto;
45
47
  __decorate([
46
48
  (0, swagger_1.ApiProperty)({
47
- description: 'Mês de referência (formato YYYY-MM)',
49
+ description: 'Mês (YYYY-MM)',
48
50
  example: '2026-03',
49
51
  }),
50
52
  (0, class_validator_1.IsString)(),
51
53
  (0, class_validator_1.IsNotEmpty)(),
52
54
  (0, class_validator_1.Matches)(/^\d{4}-\d{2}$/),
53
55
  __metadata("design:type", String)
54
- ], AvailableMonthSlotsDto.prototype, "month", void 0);
56
+ ], AvailableSlotsProcedureMonthDto.prototype, "month", void 0);
57
+ __decorate([
58
+ (0, swagger_1.ApiProperty)({
59
+ description: 'Dias do mês com horários',
60
+ type: [AvailableSlotsDayHoursDto],
61
+ }),
62
+ (0, class_validator_1.IsArray)(),
63
+ (0, class_validator_1.ValidateNested)({ each: true }),
64
+ (0, class_transformer_1.Type)(() => AvailableSlotsDayHoursDto),
65
+ __metadata("design:type", Array)
66
+ ], AvailableSlotsProcedureMonthDto.prototype, "days", void 0);
67
+ class AvailableSlotsProcedureItemDto {
68
+ name;
69
+ slots;
70
+ }
71
+ exports.AvailableSlotsProcedureItemDto = AvailableSlotsProcedureItemDto;
72
+ __decorate([
73
+ (0, swagger_1.ApiProperty)({
74
+ description: 'Nome do procedimento',
75
+ example: 'Consulta de rotina',
76
+ }),
77
+ (0, class_validator_1.IsString)(),
78
+ (0, class_validator_1.IsNotEmpty)(),
79
+ __metadata("design:type", String)
80
+ ], AvailableSlotsProcedureItemDto.prototype, "name", void 0);
55
81
  __decorate([
56
82
  (0, swagger_1.ApiProperty)({
57
- description: 'Dias e horários disponíveis dentro do mês',
58
- type: [AvailableDaySlotsDto],
83
+ description: 'Disponibilidade por mês',
84
+ type: [AvailableSlotsProcedureMonthDto],
59
85
  }),
60
86
  (0, class_validator_1.IsArray)(),
87
+ (0, class_validator_1.ValidateNested)({ each: true }),
88
+ (0, class_transformer_1.Type)(() => AvailableSlotsProcedureMonthDto),
61
89
  __metadata("design:type", Array)
62
- ], AvailableMonthSlotsDto.prototype, "days", void 0);
63
- class AvailableSlotsResponseDto {
64
- months;
90
+ ], AvailableSlotsProcedureItemDto.prototype, "slots", void 0);
91
+ class AvailableSlotsProfessionalNameDto {
92
+ name;
93
+ }
94
+ exports.AvailableSlotsProfessionalNameDto = AvailableSlotsProfessionalNameDto;
95
+ __decorate([
96
+ (0, swagger_1.ApiProperty)({
97
+ description: 'Nome do profissional (vazio ou “Clínica” quando não filtrado por profissional)',
98
+ example: 'Dr. João Silva',
99
+ }),
100
+ (0, class_validator_1.IsString)(),
101
+ __metadata("design:type", String)
102
+ ], AvailableSlotsProfessionalNameDto.prototype, "name", void 0);
103
+ class AvailableSlotsProfessionalItemDto {
104
+ professional;
105
+ procedures;
65
106
  }
66
- exports.AvailableSlotsResponseDto = AvailableSlotsResponseDto;
107
+ exports.AvailableSlotsProfessionalItemDto = AvailableSlotsProfessionalItemDto;
108
+ __decorate([
109
+ (0, swagger_1.ApiProperty)({ type: AvailableSlotsProfessionalNameDto }),
110
+ (0, class_validator_1.ValidateNested)(),
111
+ (0, class_transformer_1.Type)(() => AvailableSlotsProfessionalNameDto),
112
+ __metadata("design:type", AvailableSlotsProfessionalNameDto)
113
+ ], AvailableSlotsProfessionalItemDto.prototype, "professional", void 0);
67
114
  __decorate([
68
115
  (0, swagger_1.ApiProperty)({
69
- description: 'Meses, dias e horários disponíveis para agendamentos nos próximos três meses',
70
- type: [AvailableMonthSlotsDto],
116
+ description: 'Um item por procedimento solicitado',
117
+ type: [AvailableSlotsProcedureItemDto],
71
118
  }),
72
119
  (0, class_validator_1.IsArray)(),
120
+ (0, class_validator_1.ValidateNested)({ each: true }),
121
+ (0, class_transformer_1.Type)(() => AvailableSlotsProcedureItemDto),
73
122
  __metadata("design:type", Array)
74
- ], AvailableSlotsResponseDto.prototype, "months", void 0);
123
+ ], AvailableSlotsProfessionalItemDto.prototype, "procedures", void 0);
@@ -1,11 +1,10 @@
1
- import { BillingGatewayDto, BillingMethodDto, BillingStatusDto } from './create-billing.dto';
1
+ import { BillingStatusDto } from './create-billing.dto';
2
2
  export declare class BillingResponseDto {
3
3
  id: string;
4
4
  tenantId: string;
5
5
  value: number;
6
6
  status: BillingStatusDto;
7
- method: BillingMethodDto;
8
- gateway: BillingGatewayDto;
7
+ paymentId?: string | null;
9
8
  dueDate: string;
10
9
  payedAt?: string | null;
11
10
  createdAt: string;
@@ -1 +1 @@
1
- {"version":3,"file":"billing-response.dto.d.ts","sourceRoot":"","sources":["../../src/billing/billing-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,kBAAkB;IAK7B,EAAE,EAAE,MAAM,CAAC;IAMX,QAAQ,EAAE,MAAM,CAAC;IAMjB,KAAK,EAAE,MAAM,CAAC;IAOd,MAAM,EAAE,gBAAgB,CAAC;IAOzB,MAAM,EAAE,gBAAgB,CAAC;IAOzB,OAAO,EAAE,iBAAiB,CAAC;IAM3B,OAAO,EAAE,MAAM,CAAC;IAMhB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAMxB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
1
+ {"version":3,"file":"billing-response.dto.d.ts","sourceRoot":"","sources":["../../src/billing/billing-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,kBAAkB;IAK7B,EAAE,EAAE,MAAM,CAAC;IAMX,QAAQ,EAAE,MAAM,CAAC;IAMjB,KAAK,EAAE,MAAM,CAAC;IAOd,MAAM,EAAE,gBAAgB,CAAC;IAMzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1B,OAAO,EAAE,MAAM,CAAC;IAMhB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAMxB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
@@ -17,8 +17,7 @@ class BillingResponseDto {
17
17
  tenantId;
18
18
  value;
19
19
  status;
20
- method;
21
- gateway;
20
+ paymentId;
22
21
  dueDate;
23
22
  payedAt;
24
23
  createdAt;
@@ -56,21 +55,12 @@ __decorate([
56
55
  __metadata("design:type", String)
57
56
  ], BillingResponseDto.prototype, "status", void 0);
58
57
  __decorate([
59
- (0, swagger_1.ApiProperty)({
60
- description: 'Payment method',
61
- enum: create_billing_dto_1.BILLING_METHODS,
62
- example: 'PIX',
63
- }),
64
- __metadata("design:type", String)
65
- ], BillingResponseDto.prototype, "method", void 0);
66
- __decorate([
67
- (0, swagger_1.ApiProperty)({
68
- description: 'Payment gateway',
69
- enum: create_billing_dto_1.BILLING_GATEWAYS,
70
- example: 'ASAAS',
58
+ (0, swagger_1.ApiPropertyOptional)({
59
+ description: 'Payment ID from payment-gateway service (UUID)',
60
+ example: '550e8400-e29b-41d4-a716-446655440002',
71
61
  }),
72
- __metadata("design:type", String)
73
- ], BillingResponseDto.prototype, "gateway", void 0);
62
+ __metadata("design:type", Object)
63
+ ], BillingResponseDto.prototype, "paymentId", void 0);
74
64
  __decorate([
75
65
  (0, swagger_1.ApiProperty)({
76
66
  description: 'Due date (ISO 8601)',
@@ -1,15 +1,10 @@
1
1
  export declare const BILLING_STATUSES: readonly ["PENDING", "PAYED", "REFUNDED", "CANCELED", "OVERDUE"];
2
2
  export type BillingStatusDto = (typeof BILLING_STATUSES)[number];
3
- export declare const BILLING_METHODS: readonly ["PIX", "CREDIT_CARD", "DEBIT_CARD", "VOUCHER", "CASH"];
4
- export type BillingMethodDto = (typeof BILLING_METHODS)[number];
5
- export declare const BILLING_GATEWAYS: readonly ["ASAAS", "MERCADO_PAGO", "STRIPE"];
6
- export type BillingGatewayDto = (typeof BILLING_GATEWAYS)[number];
7
3
  export declare class CreateBillingDto {
8
4
  tenantId: string;
9
5
  value: number;
10
6
  status?: BillingStatusDto;
11
- method: BillingMethodDto;
12
- gateway: BillingGatewayDto;
7
+ paymentId?: string;
13
8
  dueDate: string;
14
9
  payedAt?: string;
15
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-billing.dto.d.ts","sourceRoot":"","sources":["../../src/billing/create-billing.dto.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB,kEAMnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,eAAe,kEAMlB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,gBAAgB,8CAA+C,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,qBAAa,gBAAgB;IAO3B,QAAQ,EAAE,MAAM,CAAC;IASjB,KAAK,EAAE,MAAM,CAAC;IASd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,MAAM,EAAE,gBAAgB,CAAC;IASzB,OAAO,EAAE,iBAAiB,CAAC;IAO3B,OAAO,EAAE,MAAM,CAAC;IAQhB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"create-billing.dto.d.ts","sourceRoot":"","sources":["../../src/billing/create-billing.dto.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB,kEAMnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,qBAAa,gBAAgB;IAO3B,QAAQ,EAAE,MAAM,CAAC;IASjB,KAAK,EAAE,MAAM,CAAC;IASd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAQ1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAOnB,OAAO,EAAE,MAAM,CAAC;IAQhB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateBillingDto = exports.BILLING_GATEWAYS = exports.BILLING_METHODS = exports.BILLING_STATUSES = void 0;
12
+ exports.CreateBillingDto = exports.BILLING_STATUSES = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  exports.BILLING_STATUSES = [
@@ -19,20 +19,11 @@ exports.BILLING_STATUSES = [
19
19
  'CANCELED',
20
20
  'OVERDUE',
21
21
  ];
22
- exports.BILLING_METHODS = [
23
- 'PIX',
24
- 'CREDIT_CARD',
25
- 'DEBIT_CARD',
26
- 'VOUCHER',
27
- 'CASH',
28
- ];
29
- exports.BILLING_GATEWAYS = ['ASAAS', 'MERCADO_PAGO', 'STRIPE'];
30
22
  class CreateBillingDto {
31
23
  tenantId;
32
24
  value;
33
25
  status;
34
- method;
35
- gateway;
26
+ paymentId;
36
27
  dueDate;
37
28
  payedAt;
38
29
  }
@@ -67,25 +58,14 @@ __decorate([
67
58
  __metadata("design:type", String)
68
59
  ], CreateBillingDto.prototype, "status", void 0);
69
60
  __decorate([
70
- (0, swagger_1.ApiProperty)({
71
- description: 'Payment method',
72
- enum: exports.BILLING_METHODS,
73
- example: 'PIX',
74
- }),
75
- (0, class_validator_1.IsEnum)(exports.BILLING_METHODS),
76
- (0, class_validator_1.IsNotEmpty)(),
77
- __metadata("design:type", String)
78
- ], CreateBillingDto.prototype, "method", void 0);
79
- __decorate([
80
- (0, swagger_1.ApiProperty)({
81
- description: 'Payment gateway',
82
- enum: exports.BILLING_GATEWAYS,
83
- example: 'ASAAS',
61
+ (0, swagger_1.ApiPropertyOptional)({
62
+ description: 'Payment ID from payment-gateway service (UUID)',
63
+ example: '550e8400-e29b-41d4-a716-446655440002',
84
64
  }),
85
- (0, class_validator_1.IsEnum)(exports.BILLING_GATEWAYS),
86
- (0, class_validator_1.IsNotEmpty)(),
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_1.IsUUID)('4'),
87
67
  __metadata("design:type", String)
88
- ], CreateBillingDto.prototype, "gateway", void 0);
68
+ ], CreateBillingDto.prototype, "paymentId", void 0);
89
69
  __decorate([
90
70
  (0, swagger_1.ApiProperty)({
91
71
  description: 'Due date (ISO 8601)',
@@ -1,9 +1,8 @@
1
- import { BillingGatewayDto, BillingMethodDto, BillingStatusDto } from './create-billing.dto';
1
+ import { BillingStatusDto } from './create-billing.dto';
2
2
  export declare class ListBillingsQueryDto {
3
3
  tenantId?: string;
4
4
  status?: BillingStatusDto;
5
- method?: BillingMethodDto;
6
- gateway?: BillingGatewayDto;
5
+ paymentId?: string;
7
6
  page?: number;
8
7
  limit?: number;
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-billings-query.dto.d.ts","sourceRoot":"","sources":["../../src/billing/list-billings-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,oBAAoB;IAO/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IASlB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAW5B,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"list-billings-query.dto.d.ts","sourceRoot":"","sources":["../../src/billing/list-billings-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,oBAAoB;IAO/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IASlB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAQ1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAWnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -16,8 +16,7 @@ const create_billing_dto_1 = require("./create-billing.dto");
16
16
  class ListBillingsQueryDto {
17
17
  tenantId;
18
18
  status;
19
- method;
20
- gateway;
19
+ paymentId;
21
20
  page;
22
21
  limit;
23
22
  }
@@ -43,24 +42,13 @@ __decorate([
43
42
  ], ListBillingsQueryDto.prototype, "status", void 0);
44
43
  __decorate([
45
44
  (0, swagger_1.ApiPropertyOptional)({
46
- description: 'Billing method filter',
47
- enum: create_billing_dto_1.BILLING_METHODS,
48
- example: 'PIX',
45
+ description: 'Payment ID filter (UUID)',
46
+ example: '550e8400-e29b-41d4-a716-446655440002',
49
47
  }),
50
48
  (0, class_validator_1.IsOptional)(),
51
- (0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_METHODS),
52
- __metadata("design:type", String)
53
- ], ListBillingsQueryDto.prototype, "method", void 0);
54
- __decorate([
55
- (0, swagger_1.ApiPropertyOptional)({
56
- description: 'Billing gateway filter',
57
- enum: create_billing_dto_1.BILLING_GATEWAYS,
58
- example: 'ASAAS',
59
- }),
60
- (0, class_validator_1.IsOptional)(),
61
- (0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_GATEWAYS),
49
+ (0, class_validator_1.IsUUID)('4'),
62
50
  __metadata("design:type", String)
63
- ], ListBillingsQueryDto.prototype, "gateway", void 0);
51
+ ], ListBillingsQueryDto.prototype, "paymentId", void 0);
64
52
  __decorate([
65
53
  (0, swagger_1.ApiPropertyOptional)({
66
54
  description: 'Page number (starting at 1)',
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './specialties';
8
8
  export * from './professionals';
9
9
  export * from './payments';
10
10
  export * from './billing';
11
+ export * from './payment-gateway';
11
12
  export * from './ai';
12
13
  export * from './storage';
13
14
  export * from './notifications';
@@ -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,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"}
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"}
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./specialties"), exports);
24
24
  __exportStar(require("./professionals"), exports);
25
25
  __exportStar(require("./payments"), exports);
26
26
  __exportStar(require("./billing"), exports);
27
+ __exportStar(require("./payment-gateway"), exports);
27
28
  __exportStar(require("./ai"), exports);
28
29
  __exportStar(require("./storage"), exports);
29
30
  __exportStar(require("./notifications"), exports);
@@ -0,0 +1,25 @@
1
+ import { PaymentGatewayDto, GatewayPaymentMethodDto } from './payment-gateway.enums';
2
+ /**
3
+ * Optional customer data for gateway registration.
4
+ */
5
+ export declare class GatewayCustomerDto {
6
+ name: string;
7
+ email: string;
8
+ cpfCnpj?: string;
9
+ phone?: string;
10
+ }
11
+ /**
12
+ * DTO for creating a payment through the payment gateway service.
13
+ */
14
+ export declare class CreateGatewayPaymentDto {
15
+ tenantId: string;
16
+ billingId: string;
17
+ amount: number;
18
+ gateway: PaymentGatewayDto;
19
+ method: GatewayPaymentMethodDto;
20
+ dueDate: string;
21
+ description?: string;
22
+ customer?: GatewayCustomerDto;
23
+ metadata?: Record<string, unknown>;
24
+ }
25
+ //# sourceMappingURL=create-gateway-payment.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-gateway-payment.dto.d.ts","sourceRoot":"","sources":["../../src/payment-gateway/create-gateway-payment.dto.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,iBAAiB,EAEjB,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,qBAAa,kBAAkB;IAI7B,IAAI,EAAE,MAAM,CAAC;IAKb,KAAK,EAAE,MAAM,CAAC;IAKd,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAOlC,QAAQ,EAAE,MAAM,CAAC;IAQjB,SAAS,EAAE,MAAM,CAAC;IASlB,MAAM,EAAE,MAAM,CAAC;IASf,OAAO,EAAE,iBAAiB,CAAC;IAS3B,MAAM,EAAE,uBAAuB,CAAC;IAOhC,OAAO,EAAE,MAAM,CAAC;IAQhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAO9B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}