tychat-contracts 1.6.21 → 1.6.24

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 (118) hide show
  1. package/README.md +33 -33
  2. package/dist/storage/delete-object-rpc.dto.d.ts +9 -0
  3. package/dist/storage/delete-object-rpc.dto.d.ts.map +1 -0
  4. package/dist/storage/delete-object-rpc.dto.js +48 -0
  5. package/dist/storage/index.d.ts +1 -0
  6. package/dist/storage/index.d.ts.map +1 -1
  7. package/dist/storage/index.js +1 -0
  8. package/dist/storage/storage-rmq-patterns.d.ts +2 -0
  9. package/dist/storage/storage-rmq-patterns.d.ts.map +1 -1
  10. package/dist/storage/storage-rmq-patterns.js +3 -1
  11. package/jest.config.ts +5 -5
  12. package/package.json +2 -1
  13. package/src/ai/ai-usage-response.dto.ts +47 -47
  14. package/src/ai/create-ai-usage.dto.ts +43 -43
  15. package/src/analytics/analytics-emitter.helper.ts +54 -54
  16. package/src/analytics/analytics-query.dto.ts +222 -222
  17. package/src/analytics/create-analytic-event.dto.ts +85 -85
  18. package/src/analytics/event-analytic.enum.ts +119 -119
  19. package/src/appointments/appointment-procedure.dto.ts +76 -76
  20. package/src/appointments/create-appointment.dto.ts +153 -153
  21. package/src/appointments/index.ts +10 -10
  22. package/src/appointments/list-appointments-query.dto.ts +157 -157
  23. package/src/appointments/update-appointment-procedure.dto.ts +10 -10
  24. package/src/appointments/update-appointment.dto.ts +4 -4
  25. package/src/auth/refresh-token.dto.ts +10 -10
  26. package/src/billing/billing-response.dto.ts +68 -68
  27. package/src/billing/create-billing.dto.ts +70 -70
  28. package/src/billing/index.ts +6 -6
  29. package/src/billing/list-billings-query.dto.ts +61 -61
  30. package/src/billing/update-billing.dto.ts +4 -4
  31. package/src/cashback/cashback-balance-response.dto.ts +33 -33
  32. package/src/cashback/cashback-config-response.dto.ts +43 -43
  33. package/src/cashback/cashback-enums.ts +33 -33
  34. package/src/cashback/cashback-kafka-payloads.ts +102 -102
  35. package/src/cashback/cashback-kafka-topics.ts +23 -23
  36. package/src/cashback/index.ts +7 -7
  37. package/src/cashback/referral-code-response.dto.ts +49 -49
  38. package/src/cashback/use-referral-code-response.dto.ts +15 -15
  39. package/src/configurations/clinic-configuration.dto.ts +39 -39
  40. package/src/configurations/opening-hours-slot.dto.ts +41 -41
  41. package/src/configurations/update-clinic-configuration.dto.ts +39 -39
  42. package/src/connections/whatsapp-official.dto.ts +113 -113
  43. package/src/conversations/conversation-contact-filters-query.validator.spec.ts +221 -221
  44. package/src/conversations/conversation-contact-filters-query.validator.ts +10 -10
  45. package/src/conversations/conversation-intention.dto.ts +24 -24
  46. package/src/conversations/conversation-response.dto.ts +69 -69
  47. package/src/conversations/conversation-session-response.dto.ts +65 -65
  48. package/src/conversations/conversation-type.dto.ts +15 -15
  49. package/src/conversations/create-conversation-session.dto.ts +28 -28
  50. package/src/conversations/create-conversation.dto.ts +69 -69
  51. package/src/conversations/followup-config-response.dto.ts +290 -290
  52. package/src/conversations/followup-log-response.dto.ts +58 -58
  53. package/src/conversations/followup-type.dto.ts +22 -22
  54. package/src/conversations/index.ts +17 -17
  55. package/src/conversations/list-conversation-contacts-filters.dto.ts +15 -15
  56. package/src/conversations/list-conversation-contacts-query.dto.ts +81 -81
  57. package/src/conversations/satisfaction-response.dto.ts +116 -116
  58. package/src/filters/index.ts +1 -1
  59. package/src/filters/parsed-filter.dto.ts +41 -41
  60. package/src/index.ts +23 -23
  61. package/src/patients/create-patient.dto.ts +122 -122
  62. package/src/patients/index.ts +10 -10
  63. package/src/patients/list-patients-filters.dto.ts +15 -15
  64. package/src/patients/list-patients-query.dto.ts +61 -61
  65. package/src/patients/patient-document-response.dto.ts +33 -33
  66. package/src/patients/patient-history-entry.dto.ts +22 -22
  67. package/src/patients/patient-status.dto.ts +9 -9
  68. package/src/patients/update-patient-document.dto.ts +10 -10
  69. package/src/patients/update-patient.dto.ts +15 -15
  70. package/src/payment-gateway/create-gateway-payment.dto.ts +123 -123
  71. package/src/payment-gateway/gateway-payment-response.dto.ts +65 -65
  72. package/src/payment-gateway/index.ts +12 -12
  73. package/src/payment-gateway/list-gateway-payments-query.dto.ts +63 -63
  74. package/src/payment-gateway/payment-gateway-kafka-topics.ts +25 -25
  75. package/src/payment-gateway/payment-gateway.enums.ts +34 -34
  76. package/src/payment-gateway/update-gateway-payment.dto.ts +7 -7
  77. package/src/payment-gateway/webhook-payload.dto.ts +32 -32
  78. package/src/payments/create-payment.dto.ts +73 -73
  79. package/src/payments/index.ts +6 -6
  80. package/src/payments/list-payments-query.dto.ts +44 -44
  81. package/src/payments/payment-response.dto.ts +67 -67
  82. package/src/payments/update-payment.dto.ts +4 -4
  83. package/src/procedures/create-procedure.dto.ts +104 -104
  84. package/src/procedures/index.ts +6 -6
  85. package/src/procedures/list-procedures-query.dto.ts +59 -59
  86. package/src/procedures/update-procedure.dto.ts +4 -4
  87. package/src/storage/delete-object-rpc.dto.ts +28 -0
  88. package/src/storage/index.ts +1 -0
  89. package/src/storage/storage-rmq-patterns.ts +3 -0
  90. package/src/tenants/index.ts +10 -10
  91. package/src/tenants/whatsapp-provider-kind.dto.ts +12 -12
  92. package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts +0 -7
  93. package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts.map +0 -1
  94. package/dist/analytics/should-skip-analytics-tenant-lookup.js +0 -13
  95. package/dist/appointments/opening-hours-slot.dto.d.ts +0 -6
  96. package/dist/appointments/opening-hours-slot.dto.d.ts.map +0 -1
  97. package/dist/appointments/opening-hours-slot.dto.js +0 -2
  98. package/dist/patients/patient-procedure.dto.d.ts +0 -9
  99. package/dist/patients/patient-procedure.dto.d.ts.map +0 -1
  100. package/dist/patients/patient-procedure.dto.js +0 -79
  101. package/dist/patients/update-patient-procedure.dto.d.ts +0 -6
  102. package/dist/patients/update-patient-procedure.dto.d.ts.map +0 -1
  103. package/dist/patients/update-patient-procedure.dto.js +0 -8
  104. package/dist/payments/payment.dto.d.ts +0 -15
  105. package/dist/payments/payment.dto.d.ts.map +0 -1
  106. package/dist/payments/payment.dto.js +0 -2
  107. package/dist/tenants/create-tenant.dto.d.ts +0 -10
  108. package/dist/tenants/create-tenant.dto.d.ts.map +0 -1
  109. package/dist/tenants/create-tenant.dto.js +0 -73
  110. package/dist/tenants/tenant-slug.util.spec.d.ts +0 -2
  111. package/dist/tenants/tenant-slug.util.spec.d.ts.map +0 -1
  112. package/dist/tenants/tenant-slug.util.spec.js +0 -102
  113. package/dist/tenants/update-tenant-payload.dto.d.ts +0 -6
  114. package/dist/tenants/update-tenant-payload.dto.d.ts.map +0 -1
  115. package/dist/tenants/update-tenant-payload.dto.js +0 -25
  116. package/dist/tenants/update-tenant.dto.d.ts +0 -10
  117. package/dist/tenants/update-tenant.dto.d.ts.map +0 -1
  118. package/dist/tenants/update-tenant.dto.js +0 -78
@@ -1,34 +1,34 @@
1
- /**
2
- * Supported payment gateways.
3
- */
4
- export const PAYMENT_GATEWAYS = ['ASAAS', 'MERCADO_PAGO', 'STRIPE'] as const;
5
- export type PaymentGatewayDto = (typeof PAYMENT_GATEWAYS)[number];
6
-
7
- /**
8
- * Payment methods supported across gateways.
9
- */
10
- export const GATEWAY_PAYMENT_METHODS = [
11
- 'PIX',
12
- 'CREDIT_CARD',
13
- 'DEBIT_CARD',
14
- 'BOLETO',
15
- 'VOUCHER',
16
- 'CASH',
17
- ] as const;
18
- export type GatewayPaymentMethodDto = (typeof GATEWAY_PAYMENT_METHODS)[number];
19
-
20
- /**
21
- * Payment statuses tracked by the payment gateway.
22
- */
23
- export const GATEWAY_PAYMENT_STATUSES = [
24
- 'PENDING',
25
- 'PROCESSING',
26
- 'CONFIRMED',
27
- 'PAYED',
28
- 'REFUNDED',
29
- 'CANCELED',
30
- 'FAILED',
31
- 'OVERDUE',
32
- 'EXPIRED',
33
- ] as const;
34
- export type GatewayPaymentStatusDto = (typeof GATEWAY_PAYMENT_STATUSES)[number];
1
+ /**
2
+ * Supported payment gateways.
3
+ */
4
+ export const PAYMENT_GATEWAYS = ['ASAAS', 'MERCADO_PAGO', 'STRIPE'] as const;
5
+ export type PaymentGatewayDto = (typeof PAYMENT_GATEWAYS)[number];
6
+
7
+ /**
8
+ * Payment methods supported across gateways.
9
+ */
10
+ export const GATEWAY_PAYMENT_METHODS = [
11
+ 'PIX',
12
+ 'CREDIT_CARD',
13
+ 'DEBIT_CARD',
14
+ 'BOLETO',
15
+ 'VOUCHER',
16
+ 'CASH',
17
+ ] as const;
18
+ export type GatewayPaymentMethodDto = (typeof GATEWAY_PAYMENT_METHODS)[number];
19
+
20
+ /**
21
+ * Payment statuses tracked by the payment gateway.
22
+ */
23
+ export const GATEWAY_PAYMENT_STATUSES = [
24
+ 'PENDING',
25
+ 'PROCESSING',
26
+ 'CONFIRMED',
27
+ 'PAYED',
28
+ 'REFUNDED',
29
+ 'CANCELED',
30
+ 'FAILED',
31
+ 'OVERDUE',
32
+ 'EXPIRED',
33
+ ] as const;
34
+ export type GatewayPaymentStatusDto = (typeof GATEWAY_PAYMENT_STATUSES)[number];
@@ -1,7 +1,7 @@
1
- import { PartialType } from '@nestjs/swagger';
2
- import { CreateGatewayPaymentDto } from './create-gateway-payment.dto';
3
-
4
- /**
5
- * DTO for updating an existing gateway payment (all fields optional).
6
- */
7
- export class UpdateGatewayPaymentDto extends PartialType(CreateGatewayPaymentDto) {}
1
+ import { PartialType } from '@nestjs/swagger';
2
+ import { CreateGatewayPaymentDto } from './create-gateway-payment.dto';
3
+
4
+ /**
5
+ * DTO for updating an existing gateway payment (all fields optional).
6
+ */
7
+ export class UpdateGatewayPaymentDto extends PartialType(CreateGatewayPaymentDto) {}
@@ -1,32 +1,32 @@
1
- import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
- import { PAYMENT_GATEWAYS, PaymentGatewayDto, GATEWAY_PAYMENT_STATUSES, GatewayPaymentStatusDto } from './payment-gateway.enums';
4
-
5
- /**
6
- * Normalized webhook event payload received from any payment gateway.
7
- */
8
- export class GatewayWebhookEventDto {
9
- @ApiProperty({ description: 'Payment gateway that originated the event', enum: PAYMENT_GATEWAYS })
10
- @IsEnum(PAYMENT_GATEWAYS)
11
- @IsNotEmpty()
12
- gateway: PaymentGatewayDto;
13
-
14
- @ApiProperty({ description: 'Event type from the gateway', example: 'PAYMENT_RECEIVED' })
15
- @IsString()
16
- @IsNotEmpty()
17
- eventType: string;
18
-
19
- @ApiProperty({ description: 'External payment ID from the gateway', example: 'pay_abc123' })
20
- @IsString()
21
- @IsNotEmpty()
22
- externalId: string;
23
-
24
- @ApiPropertyOptional({ description: 'New payment status after the event', enum: GATEWAY_PAYMENT_STATUSES })
25
- @IsOptional()
26
- @IsEnum(GATEWAY_PAYMENT_STATUSES)
27
- status?: GatewayPaymentStatusDto;
28
-
29
- @ApiPropertyOptional({ description: 'Raw payload from the gateway for auditing' })
30
- @IsOptional()
31
- rawPayload?: Record<string, unknown>;
32
- }
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+ import { PAYMENT_GATEWAYS, PaymentGatewayDto, GATEWAY_PAYMENT_STATUSES, GatewayPaymentStatusDto } from './payment-gateway.enums';
4
+
5
+ /**
6
+ * Normalized webhook event payload received from any payment gateway.
7
+ */
8
+ export class GatewayWebhookEventDto {
9
+ @ApiProperty({ description: 'Payment gateway that originated the event', enum: PAYMENT_GATEWAYS })
10
+ @IsEnum(PAYMENT_GATEWAYS)
11
+ @IsNotEmpty()
12
+ gateway: PaymentGatewayDto;
13
+
14
+ @ApiProperty({ description: 'Event type from the gateway', example: 'PAYMENT_RECEIVED' })
15
+ @IsString()
16
+ @IsNotEmpty()
17
+ eventType: string;
18
+
19
+ @ApiProperty({ description: 'External payment ID from the gateway', example: 'pay_abc123' })
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ externalId: string;
23
+
24
+ @ApiPropertyOptional({ description: 'New payment status after the event', enum: GATEWAY_PAYMENT_STATUSES })
25
+ @IsOptional()
26
+ @IsEnum(GATEWAY_PAYMENT_STATUSES)
27
+ status?: GatewayPaymentStatusDto;
28
+
29
+ @ApiPropertyOptional({ description: 'Raw payload from the gateway for auditing' })
30
+ @IsOptional()
31
+ rawPayload?: Record<string, unknown>;
32
+ }
@@ -1,73 +1,73 @@
1
- import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import {
3
- IsDateString,
4
- IsEnum,
5
- IsNotEmpty,
6
- IsNumber,
7
- IsOptional,
8
- IsUUID,
9
- Min,
10
- } from 'class-validator';
11
- import { PAYMENT_METHODS, PaymentMethodDto } from './payment-method.dto';
12
- import { PAYMENT_STATUSES, PaymentStatusDto } from './payment-status.dto';
13
-
14
- export class CreatePaymentDto {
15
- @ApiProperty({
16
- description: 'Payment method',
17
- enum: PAYMENT_METHODS,
18
- example: 'PIX',
19
- })
20
- @IsEnum(PAYMENT_METHODS)
21
- @IsNotEmpty()
22
- method: PaymentMethodDto;
23
-
24
- @ApiProperty({
25
- description: 'Payment value (must be greater than 0)',
26
- example: 150.5,
27
- minimum: 0.01,
28
- })
29
- @IsNumber()
30
- @Min(0.01)
31
- value: number;
32
-
33
- @ApiProperty({
34
- description: 'Patient ID (UUID)',
35
- example: '550e8400-e29b-41d4-a716-446655440000',
36
- })
37
- @IsUUID('4')
38
- @IsNotEmpty()
39
- patientId: string;
40
-
41
- @ApiProperty({
42
- description: 'Appointment ID (UUID)',
43
- example: '550e8400-e29b-41d4-a716-446655440001',
44
- })
45
- @IsUUID('4')
46
- @IsNotEmpty()
47
- appointmentId: string;
48
-
49
- @ApiPropertyOptional({
50
- description: 'Due date (ISO 8601). Defaults to now if not provided.',
51
- example: '2026-03-15T23:59:59.000Z',
52
- })
53
- @IsOptional()
54
- @IsDateString()
55
- dueDate?: string;
56
-
57
- @ApiPropertyOptional({
58
- description: 'Payment status. Defaults to PENDING if not provided.',
59
- enum: PAYMENT_STATUSES,
60
- default: 'PENDING',
61
- })
62
- @IsOptional()
63
- @IsEnum(PAYMENT_STATUSES)
64
- status?: PaymentStatusDto;
65
-
66
- @ApiPropertyOptional({
67
- description: 'Date when payment was completed (ISO 8601). Set when status is PAYED.',
68
- example: '2026-03-15T14:30:00.000Z',
69
- })
70
- @IsOptional()
71
- @IsDateString()
72
- payedAt?: string;
73
- }
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsDateString,
4
+ IsEnum,
5
+ IsNotEmpty,
6
+ IsNumber,
7
+ IsOptional,
8
+ IsUUID,
9
+ Min,
10
+ } from 'class-validator';
11
+ import { PAYMENT_METHODS, PaymentMethodDto } from './payment-method.dto';
12
+ import { PAYMENT_STATUSES, PaymentStatusDto } from './payment-status.dto';
13
+
14
+ export class CreatePaymentDto {
15
+ @ApiProperty({
16
+ description: 'Payment method',
17
+ enum: PAYMENT_METHODS,
18
+ example: 'PIX',
19
+ })
20
+ @IsEnum(PAYMENT_METHODS)
21
+ @IsNotEmpty()
22
+ method: PaymentMethodDto;
23
+
24
+ @ApiProperty({
25
+ description: 'Payment value (must be greater than 0)',
26
+ example: 150.5,
27
+ minimum: 0.01,
28
+ })
29
+ @IsNumber()
30
+ @Min(0.01)
31
+ value: number;
32
+
33
+ @ApiProperty({
34
+ description: 'Patient ID (UUID)',
35
+ example: '550e8400-e29b-41d4-a716-446655440000',
36
+ })
37
+ @IsUUID('4')
38
+ @IsNotEmpty()
39
+ patientId: string;
40
+
41
+ @ApiProperty({
42
+ description: 'Appointment ID (UUID)',
43
+ example: '550e8400-e29b-41d4-a716-446655440001',
44
+ })
45
+ @IsUUID('4')
46
+ @IsNotEmpty()
47
+ appointmentId: string;
48
+
49
+ @ApiPropertyOptional({
50
+ description: 'Due date (ISO 8601). Defaults to now if not provided.',
51
+ example: '2026-03-15T23:59:59.000Z',
52
+ })
53
+ @IsOptional()
54
+ @IsDateString()
55
+ dueDate?: string;
56
+
57
+ @ApiPropertyOptional({
58
+ description: 'Payment status. Defaults to PENDING if not provided.',
59
+ enum: PAYMENT_STATUSES,
60
+ default: 'PENDING',
61
+ })
62
+ @IsOptional()
63
+ @IsEnum(PAYMENT_STATUSES)
64
+ status?: PaymentStatusDto;
65
+
66
+ @ApiPropertyOptional({
67
+ description: 'Date when payment was completed (ISO 8601). Set when status is PAYED.',
68
+ example: '2026-03-15T14:30:00.000Z',
69
+ })
70
+ @IsOptional()
71
+ @IsDateString()
72
+ payedAt?: string;
73
+ }
@@ -1,7 +1,7 @@
1
- export * from './create-payment.dto';
2
- export * from './update-payment.dto';
3
- export * from './list-payments-query.dto';
4
- export * from './payment-response.dto';
5
- export * from './payment-method.dto';
6
- export * from './payment-status.dto';
1
+ export * from './create-payment.dto';
2
+ export * from './update-payment.dto';
3
+ export * from './list-payments-query.dto';
4
+ export * from './payment-response.dto';
5
+ export * from './payment-method.dto';
6
+ export * from './payment-status.dto';
7
7
  export * from './list-payment-response.dto';
@@ -1,44 +1,44 @@
1
- import { ApiPropertyOptional } from '@nestjs/swagger';
2
- import { IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
3
-
4
- export class ListPaymentsQueryDto {
5
- @ApiPropertyOptional({
6
- description: 'Filter by appointment ID (UUID)',
7
- example: '550e8400-e29b-41d4-a716-446655440001',
8
- })
9
- @IsOptional()
10
- @IsUUID('4')
11
- appointmentId?: string;
12
-
13
- @ApiPropertyOptional({
14
- description: 'Filter by patient ID (UUID)',
15
- example: '550e8400-e29b-41d4-a716-446655440000',
16
- })
17
- @IsOptional()
18
- @IsUUID('4')
19
- patientId?: string;
20
-
21
- @ApiPropertyOptional({
22
- description: 'Page number (starting at 1)',
23
- example: 1,
24
- minimum: 1,
25
- default: 1,
26
- })
27
- @IsOptional()
28
- @IsInt()
29
- @Min(1)
30
- page?: number;
31
-
32
- @ApiPropertyOptional({
33
- description: 'Number of records per page',
34
- example: 20,
35
- minimum: 1,
36
- maximum: 100,
37
- default: 20,
38
- })
39
- @IsOptional()
40
- @IsInt()
41
- @Min(1)
42
- @Max(100)
43
- limit?: number;
44
- }
1
+ import { ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
3
+
4
+ export class ListPaymentsQueryDto {
5
+ @ApiPropertyOptional({
6
+ description: 'Filter by appointment ID (UUID)',
7
+ example: '550e8400-e29b-41d4-a716-446655440001',
8
+ })
9
+ @IsOptional()
10
+ @IsUUID('4')
11
+ appointmentId?: string;
12
+
13
+ @ApiPropertyOptional({
14
+ description: 'Filter by patient ID (UUID)',
15
+ example: '550e8400-e29b-41d4-a716-446655440000',
16
+ })
17
+ @IsOptional()
18
+ @IsUUID('4')
19
+ patientId?: string;
20
+
21
+ @ApiPropertyOptional({
22
+ description: 'Page number (starting at 1)',
23
+ example: 1,
24
+ minimum: 1,
25
+ default: 1,
26
+ })
27
+ @IsOptional()
28
+ @IsInt()
29
+ @Min(1)
30
+ page?: number;
31
+
32
+ @ApiPropertyOptional({
33
+ description: 'Number of records per page',
34
+ example: 20,
35
+ minimum: 1,
36
+ maximum: 100,
37
+ default: 20,
38
+ })
39
+ @IsOptional()
40
+ @IsInt()
41
+ @Min(1)
42
+ @Max(100)
43
+ limit?: number;
44
+ }
@@ -1,67 +1,67 @@
1
- import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { PAYMENT_METHODS, PaymentMethodDto } from './payment-method.dto';
3
- import { PAYMENT_STATUSES, PaymentStatusDto } from './payment-status.dto';
4
-
5
- export class PaymentResponseDto {
6
- @ApiProperty({
7
- description: 'Payment ID (UUID)',
8
- example: '550e8400-e29b-41d4-a716-446655440002',
9
- })
10
- id: string;
11
-
12
- @ApiProperty({
13
- description: 'Payment method',
14
- enum: PAYMENT_METHODS,
15
- example: 'PIX',
16
- })
17
- method: PaymentMethodDto;
18
-
19
- @ApiProperty({
20
- description: 'Payment status',
21
- enum: PAYMENT_STATUSES,
22
- example: 'PENDING',
23
- })
24
- status: PaymentStatusDto;
25
-
26
- @ApiProperty({
27
- description: 'Payment value',
28
- example: 150.5,
29
- })
30
- value: number;
31
-
32
- @ApiProperty({
33
- description: 'Due date (ISO 8601)',
34
- example: '2026-03-15T23:59:59.000Z',
35
- })
36
- dueDate: string;
37
-
38
- @ApiPropertyOptional({
39
- description: 'Date when payment was completed (ISO 8601)',
40
- example: '2026-03-15T14:30:00.000Z',
41
- })
42
- payedAt?: string | null;
43
-
44
- @ApiProperty({
45
- description: 'Creation timestamp (ISO 8601)',
46
- example: '2026-03-10T12:00:00.000Z',
47
- })
48
- createdAt: string;
49
-
50
- @ApiProperty({
51
- description: 'Last update timestamp (ISO 8601)',
52
- example: '2026-03-10T12:00:00.000Z',
53
- })
54
- updatedAt: string;
55
-
56
- @ApiProperty({
57
- description: 'Patient ID (UUID)',
58
- example: '550e8400-e29b-41d4-a716-446655440000',
59
- })
60
- patientId: string;
61
-
62
- @ApiProperty({
63
- description: 'Appointment ID (UUID)',
64
- example: '550e8400-e29b-41d4-a716-446655440001',
65
- })
66
- appointmentId: string;
67
- }
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { PAYMENT_METHODS, PaymentMethodDto } from './payment-method.dto';
3
+ import { PAYMENT_STATUSES, PaymentStatusDto } from './payment-status.dto';
4
+
5
+ export class PaymentResponseDto {
6
+ @ApiProperty({
7
+ description: 'Payment ID (UUID)',
8
+ example: '550e8400-e29b-41d4-a716-446655440002',
9
+ })
10
+ id: string;
11
+
12
+ @ApiProperty({
13
+ description: 'Payment method',
14
+ enum: PAYMENT_METHODS,
15
+ example: 'PIX',
16
+ })
17
+ method: PaymentMethodDto;
18
+
19
+ @ApiProperty({
20
+ description: 'Payment status',
21
+ enum: PAYMENT_STATUSES,
22
+ example: 'PENDING',
23
+ })
24
+ status: PaymentStatusDto;
25
+
26
+ @ApiProperty({
27
+ description: 'Payment value',
28
+ example: 150.5,
29
+ })
30
+ value: number;
31
+
32
+ @ApiProperty({
33
+ description: 'Due date (ISO 8601)',
34
+ example: '2026-03-15T23:59:59.000Z',
35
+ })
36
+ dueDate: string;
37
+
38
+ @ApiPropertyOptional({
39
+ description: 'Date when payment was completed (ISO 8601)',
40
+ example: '2026-03-15T14:30:00.000Z',
41
+ })
42
+ payedAt?: string | null;
43
+
44
+ @ApiProperty({
45
+ description: 'Creation timestamp (ISO 8601)',
46
+ example: '2026-03-10T12:00:00.000Z',
47
+ })
48
+ createdAt: string;
49
+
50
+ @ApiProperty({
51
+ description: 'Last update timestamp (ISO 8601)',
52
+ example: '2026-03-10T12:00:00.000Z',
53
+ })
54
+ updatedAt: string;
55
+
56
+ @ApiProperty({
57
+ description: 'Patient ID (UUID)',
58
+ example: '550e8400-e29b-41d4-a716-446655440000',
59
+ })
60
+ patientId: string;
61
+
62
+ @ApiProperty({
63
+ description: 'Appointment ID (UUID)',
64
+ example: '550e8400-e29b-41d4-a716-446655440001',
65
+ })
66
+ appointmentId: string;
67
+ }
@@ -1,4 +1,4 @@
1
- import { PartialType } from '@nestjs/swagger';
2
- import { CreatePaymentDto } from './create-payment.dto';
3
-
4
- export class UpdatePaymentDto extends PartialType(CreatePaymentDto) {}
1
+ import { PartialType } from '@nestjs/swagger';
2
+ import { CreatePaymentDto } from './create-payment.dto';
3
+
4
+ export class UpdatePaymentDto extends PartialType(CreatePaymentDto) {}