tychat-contracts 1.6.21 → 1.6.23

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,102 +1,102 @@
1
- import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
2
-
3
- // ─── Config Payloads ───
4
-
5
- export interface GetCashbackConfigPayload {
6
- tenant: string;
7
- }
8
-
9
- export interface UpdateCashbackConfigPayload {
10
- tenant: string;
11
- isActive?: boolean;
12
- cashbackPercentage?: number;
13
- discountType?: CashbackDiscountTypeDto;
14
- discountValue?: number;
15
- expirationType?: CashbackExpirationTypeDto;
16
- expirationDays?: number | null;
17
- maxTotalUses?: number | null;
18
- maxUsesPerPatient?: number | null;
19
- codeExpirationDays?: number | null;
20
- }
21
-
22
- // ─── Referral Payloads ───
23
-
24
- export interface GenerateReferralCodePayload {
25
- tenant: string;
26
- patientId: string;
27
- /** Se true, não cria código novo quando cashback global está inativo (resposta null). */
28
- onlyIfActive?: boolean;
29
- }
30
-
31
- export interface ValidateReferralCodePayload {
32
- tenant: string;
33
- code: string;
34
- referredPatientId: string;
35
- }
36
-
37
- export interface UseReferralCodePayload {
38
- tenant: string;
39
- code: string;
40
- referredPatientId: string;
41
- checkoutId: string;
42
- checkoutAmount: number;
43
- }
44
-
45
- /** Vínculo de código no cadastro do paciente (sem checkout). */
46
- export interface LinkReferralAtRegistrationPayload {
47
- tenant: string;
48
- code: string;
49
- referredPatientId: string;
50
- }
51
-
52
- export interface GetReferralByPatientPayload {
53
- tenant: string;
54
- patientId: string;
55
- }
56
-
57
- export interface GetReferralByCodePayload {
58
- tenant: string;
59
- code: string;
60
- }
61
-
62
- export interface GetReferralUsagesPayload {
63
- tenant: string;
64
- referralCodeId: string;
65
- }
66
-
67
- // ─── Balance / Ledger Payloads ───
68
-
69
- export interface GetCashbackBalancePayload {
70
- tenant: string;
71
- patientId: string;
72
- }
73
-
74
- export interface CreditCashbackPayload {
75
- tenant: string;
76
- patientId: string;
77
- amount: number;
78
- description: string;
79
- referenceId?: string;
80
- referenceType?: string;
81
- expiresAt?: string;
82
- }
83
-
84
- export interface DebitCashbackPayload {
85
- tenant: string;
86
- patientId: string;
87
- amount: number;
88
- description: string;
89
- referenceId?: string;
90
- referenceType?: string;
91
- }
92
-
93
- export interface GetCashbackLedgerPayload {
94
- tenant: string;
95
- patientId: string;
96
- page?: number;
97
- limit?: number;
98
- }
99
-
100
- export interface ExpireCashbackCreditsPayload {
101
- tenant: string;
102
- }
1
+ import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
2
+
3
+ // ─── Config Payloads ───
4
+
5
+ export interface GetCashbackConfigPayload {
6
+ tenant: string;
7
+ }
8
+
9
+ export interface UpdateCashbackConfigPayload {
10
+ tenant: string;
11
+ isActive?: boolean;
12
+ cashbackPercentage?: number;
13
+ discountType?: CashbackDiscountTypeDto;
14
+ discountValue?: number;
15
+ expirationType?: CashbackExpirationTypeDto;
16
+ expirationDays?: number | null;
17
+ maxTotalUses?: number | null;
18
+ maxUsesPerPatient?: number | null;
19
+ codeExpirationDays?: number | null;
20
+ }
21
+
22
+ // ─── Referral Payloads ───
23
+
24
+ export interface GenerateReferralCodePayload {
25
+ tenant: string;
26
+ patientId: string;
27
+ /** Se true, não cria código novo quando cashback global está inativo (resposta null). */
28
+ onlyIfActive?: boolean;
29
+ }
30
+
31
+ export interface ValidateReferralCodePayload {
32
+ tenant: string;
33
+ code: string;
34
+ referredPatientId: string;
35
+ }
36
+
37
+ export interface UseReferralCodePayload {
38
+ tenant: string;
39
+ code: string;
40
+ referredPatientId: string;
41
+ checkoutId: string;
42
+ checkoutAmount: number;
43
+ }
44
+
45
+ /** Vínculo de código no cadastro do paciente (sem checkout). */
46
+ export interface LinkReferralAtRegistrationPayload {
47
+ tenant: string;
48
+ code: string;
49
+ referredPatientId: string;
50
+ }
51
+
52
+ export interface GetReferralByPatientPayload {
53
+ tenant: string;
54
+ patientId: string;
55
+ }
56
+
57
+ export interface GetReferralByCodePayload {
58
+ tenant: string;
59
+ code: string;
60
+ }
61
+
62
+ export interface GetReferralUsagesPayload {
63
+ tenant: string;
64
+ referralCodeId: string;
65
+ }
66
+
67
+ // ─── Balance / Ledger Payloads ───
68
+
69
+ export interface GetCashbackBalancePayload {
70
+ tenant: string;
71
+ patientId: string;
72
+ }
73
+
74
+ export interface CreditCashbackPayload {
75
+ tenant: string;
76
+ patientId: string;
77
+ amount: number;
78
+ description: string;
79
+ referenceId?: string;
80
+ referenceType?: string;
81
+ expiresAt?: string;
82
+ }
83
+
84
+ export interface DebitCashbackPayload {
85
+ tenant: string;
86
+ patientId: string;
87
+ amount: number;
88
+ description: string;
89
+ referenceId?: string;
90
+ referenceType?: string;
91
+ }
92
+
93
+ export interface GetCashbackLedgerPayload {
94
+ tenant: string;
95
+ patientId: string;
96
+ page?: number;
97
+ limit?: number;
98
+ }
99
+
100
+ export interface ExpireCashbackCreditsPayload {
101
+ tenant: string;
102
+ }
@@ -1,23 +1,23 @@
1
- /**
2
- * Kafka topic constants for the cashback microservice.
3
- * All topics follow the pattern: cashback.<module>.<action>
4
- */
5
-
6
- // ─── Promotion / Config ───
7
- export const TOPIC_CASHBACK_CONFIG_GET = 'cashback.config.get';
8
- export const TOPIC_CASHBACK_CONFIG_UPDATE = 'cashback.config.update';
9
-
10
- // ─── Referral ───
11
- export const TOPIC_CASHBACK_REFERRAL_GENERATE = 'cashback.referral.generate';
12
- export const TOPIC_CASHBACK_REFERRAL_VALIDATE = 'cashback.referral.validate';
13
- export const TOPIC_CASHBACK_REFERRAL_USE = 'cashback.referral.use';
14
- export const TOPIC_CASHBACK_REFERRAL_GET_BY_PATIENT = 'cashback.referral.getByPatient';
15
- export const TOPIC_CASHBACK_REFERRAL_GET_BY_CODE = 'cashback.referral.getByCode';
16
- export const TOPIC_CASHBACK_REFERRAL_GET_USAGES = 'cashback.referral.getUsagesByCode';
17
-
18
- // ─── Balance / Ledger ───
19
- export const TOPIC_CASHBACK_BALANCE_GET = 'cashback.balance.get';
20
- export const TOPIC_CASHBACK_BALANCE_CREDIT = 'cashback.balance.credit';
21
- export const TOPIC_CASHBACK_BALANCE_DEBIT = 'cashback.balance.debit';
22
- export const TOPIC_CASHBACK_LEDGER_GET = 'cashback.ledger.get';
23
- export const TOPIC_CASHBACK_CREDITS_EXPIRE = 'cashback.credits.expire';
1
+ /**
2
+ * Kafka topic constants for the cashback microservice.
3
+ * All topics follow the pattern: cashback.<module>.<action>
4
+ */
5
+
6
+ // ─── Promotion / Config ───
7
+ export const TOPIC_CASHBACK_CONFIG_GET = 'cashback.config.get';
8
+ export const TOPIC_CASHBACK_CONFIG_UPDATE = 'cashback.config.update';
9
+
10
+ // ─── Referral ───
11
+ export const TOPIC_CASHBACK_REFERRAL_GENERATE = 'cashback.referral.generate';
12
+ export const TOPIC_CASHBACK_REFERRAL_VALIDATE = 'cashback.referral.validate';
13
+ export const TOPIC_CASHBACK_REFERRAL_USE = 'cashback.referral.use';
14
+ export const TOPIC_CASHBACK_REFERRAL_GET_BY_PATIENT = 'cashback.referral.getByPatient';
15
+ export const TOPIC_CASHBACK_REFERRAL_GET_BY_CODE = 'cashback.referral.getByCode';
16
+ export const TOPIC_CASHBACK_REFERRAL_GET_USAGES = 'cashback.referral.getUsagesByCode';
17
+
18
+ // ─── Balance / Ledger ───
19
+ export const TOPIC_CASHBACK_BALANCE_GET = 'cashback.balance.get';
20
+ export const TOPIC_CASHBACK_BALANCE_CREDIT = 'cashback.balance.credit';
21
+ export const TOPIC_CASHBACK_BALANCE_DEBIT = 'cashback.balance.debit';
22
+ export const TOPIC_CASHBACK_LEDGER_GET = 'cashback.ledger.get';
23
+ export const TOPIC_CASHBACK_CREDITS_EXPIRE = 'cashback.credits.expire';
@@ -1,7 +1,7 @@
1
- export * from './cashback-enums';
2
- export * from './cashback-kafka-topics';
3
- export * from './cashback-kafka-payloads';
4
- export * from './cashback-config-response.dto';
5
- export * from './referral-code-response.dto';
6
- export * from './use-referral-code-response.dto';
7
- export * from './cashback-balance-response.dto';
1
+ export * from './cashback-enums';
2
+ export * from './cashback-kafka-topics';
3
+ export * from './cashback-kafka-payloads';
4
+ export * from './cashback-config-response.dto';
5
+ export * from './referral-code-response.dto';
6
+ export * from './use-referral-code-response.dto';
7
+ export * from './cashback-balance-response.dto';
@@ -1,49 +1,49 @@
1
- import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
3
-
4
- /**
5
- * Response DTO for a referral code
6
- */
7
- export class ReferralCodeResponseDto {
8
- @ApiProperty({ description: 'Referral code ID (UUID)' })
9
- id: string;
10
-
11
- @ApiProperty({ description: 'Patient ID who owns this code' })
12
- patientId: string;
13
-
14
- @ApiProperty({ description: 'The 8-character referral code', example: 'ABCD1234' })
15
- code: string;
16
-
17
- @ApiProperty({ description: 'Cashback percentage snapshot' })
18
- cashbackPercentage: number;
19
-
20
- @ApiProperty({ description: 'Discount type snapshot', enum: CashbackDiscountTypeDto })
21
- discountType: CashbackDiscountTypeDto;
22
-
23
- @ApiProperty({ description: 'Discount value snapshot' })
24
- discountValue: number;
25
-
26
- @ApiProperty({ description: 'Expiration type snapshot', enum: CashbackExpirationTypeDto })
27
- expirationType: CashbackExpirationTypeDto;
28
-
29
- @ApiPropertyOptional({ description: 'Expiration days snapshot' })
30
- expirationDays?: number | null;
31
-
32
- @ApiPropertyOptional({ description: 'Max total uses snapshot' })
33
- maxTotalUses?: number | null;
34
-
35
- @ApiPropertyOptional({ description: 'Max uses per patient snapshot' })
36
- maxUsesPerPatient?: number | null;
37
-
38
- @ApiPropertyOptional({ description: 'Code expiration date' })
39
- codeExpiresAt?: string | null;
40
-
41
- @ApiProperty({ description: 'Total number of times used' })
42
- totalUsesCount: number;
43
-
44
- @ApiProperty({ description: 'Whether code is active' })
45
- isActive: boolean;
46
-
47
- @ApiProperty({ description: 'Creation timestamp' })
48
- createdAt: string;
49
- }
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
3
+
4
+ /**
5
+ * Response DTO for a referral code
6
+ */
7
+ export class ReferralCodeResponseDto {
8
+ @ApiProperty({ description: 'Referral code ID (UUID)' })
9
+ id: string;
10
+
11
+ @ApiProperty({ description: 'Patient ID who owns this code' })
12
+ patientId: string;
13
+
14
+ @ApiProperty({ description: 'The 8-character referral code', example: 'ABCD1234' })
15
+ code: string;
16
+
17
+ @ApiProperty({ description: 'Cashback percentage snapshot' })
18
+ cashbackPercentage: number;
19
+
20
+ @ApiProperty({ description: 'Discount type snapshot', enum: CashbackDiscountTypeDto })
21
+ discountType: CashbackDiscountTypeDto;
22
+
23
+ @ApiProperty({ description: 'Discount value snapshot' })
24
+ discountValue: number;
25
+
26
+ @ApiProperty({ description: 'Expiration type snapshot', enum: CashbackExpirationTypeDto })
27
+ expirationType: CashbackExpirationTypeDto;
28
+
29
+ @ApiPropertyOptional({ description: 'Expiration days snapshot' })
30
+ expirationDays?: number | null;
31
+
32
+ @ApiPropertyOptional({ description: 'Max total uses snapshot' })
33
+ maxTotalUses?: number | null;
34
+
35
+ @ApiPropertyOptional({ description: 'Max uses per patient snapshot' })
36
+ maxUsesPerPatient?: number | null;
37
+
38
+ @ApiPropertyOptional({ description: 'Code expiration date' })
39
+ codeExpiresAt?: string | null;
40
+
41
+ @ApiProperty({ description: 'Total number of times used' })
42
+ totalUsesCount: number;
43
+
44
+ @ApiProperty({ description: 'Whether code is active' })
45
+ isActive: boolean;
46
+
47
+ @ApiProperty({ description: 'Creation timestamp' })
48
+ createdAt: string;
49
+ }
@@ -1,15 +1,15 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
-
3
- /**
4
- * Response DTO for using a referral code
5
- */
6
- export class UseReferralCodeResponseDto {
7
- @ApiProperty({ description: 'Cashback amount awarded to the referrer' })
8
- cashbackAmount: number;
9
-
10
- @ApiProperty({ description: 'Discount amount applied to the referred patient' })
11
- discountAmount: number;
12
-
13
- @ApiProperty({ description: 'Patient ID of the referrer (code owner)' })
14
- referrerPatientId: string;
15
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+
3
+ /**
4
+ * Response DTO for using a referral code
5
+ */
6
+ export class UseReferralCodeResponseDto {
7
+ @ApiProperty({ description: 'Cashback amount awarded to the referrer' })
8
+ cashbackAmount: number;
9
+
10
+ @ApiProperty({ description: 'Discount amount applied to the referred patient' })
11
+ discountAmount: number;
12
+
13
+ @ApiProperty({ description: 'Patient ID of the referrer (code owner)' })
14
+ referrerPatientId: string;
15
+ }
@@ -1,39 +1,39 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
3
- import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
4
-
5
- /**
6
- * Response DTO for clinic configuration (opening hours, etc.).
7
- */
8
- export class ClinicConfigurationDto {
9
- @ApiProperty({
10
- description: 'Configuration ID (UUID)',
11
- example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
12
- })
13
- id: string;
14
-
15
- @ApiProperty({
16
- description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
17
- type: [OpeningHoursSlotDto],
18
- })
19
- opening_hours: OpeningHoursSlotDto[];
20
-
21
- @ApiProperty({
22
- description: 'Campos adicionais de anamnese configurados pela clínica',
23
- type: [AnamnesisCustomFieldDto],
24
- required: false,
25
- })
26
- anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
27
-
28
- @ApiProperty({
29
- description: 'Creation timestamp',
30
- example: '2026-03-10T12:00:00.000Z',
31
- })
32
- createdAt: Date;
33
-
34
- @ApiProperty({
35
- description: 'Last update timestamp',
36
- example: '2026-03-10T12:00:00.000Z',
37
- })
38
- updatedAt: Date;
39
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
3
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
4
+
5
+ /**
6
+ * Response DTO for clinic configuration (opening hours, etc.).
7
+ */
8
+ export class ClinicConfigurationDto {
9
+ @ApiProperty({
10
+ description: 'Configuration ID (UUID)',
11
+ example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
12
+ })
13
+ id: string;
14
+
15
+ @ApiProperty({
16
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
17
+ type: [OpeningHoursSlotDto],
18
+ })
19
+ opening_hours: OpeningHoursSlotDto[];
20
+
21
+ @ApiProperty({
22
+ description: 'Campos adicionais de anamnese configurados pela clínica',
23
+ type: [AnamnesisCustomFieldDto],
24
+ required: false,
25
+ })
26
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
27
+
28
+ @ApiProperty({
29
+ description: 'Creation timestamp',
30
+ example: '2026-03-10T12:00:00.000Z',
31
+ })
32
+ createdAt: Date;
33
+
34
+ @ApiProperty({
35
+ description: 'Last update timestamp',
36
+ example: '2026-03-10T12:00:00.000Z',
37
+ })
38
+ updatedAt: Date;
39
+ }
@@ -1,41 +1,41 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsNumber, IsString, Matches, Max, Min } from 'class-validator';
3
-
4
- /**
5
- * Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
6
- * open/close: time in HH:mm (24h).
7
- */
8
- export class OpeningHoursSlotDto {
9
- @ApiProperty({
10
- description: 'Day of week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)',
11
- example: 1,
12
- minimum: 0,
13
- maximum: 6,
14
- })
15
- @IsNumber()
16
- @Min(0)
17
- @Max(6)
18
- dayOfWeek: number;
19
-
20
- @ApiProperty({
21
- description: 'Opening time in HH:mm (24h)',
22
- example: '08:00',
23
- pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
24
- })
25
- @IsString()
26
- @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
27
- message: 'open must be HH:mm (24h)',
28
- })
29
- open: string;
30
-
31
- @ApiProperty({
32
- description: 'Closing time in HH:mm (24h)',
33
- example: '18:00',
34
- pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
35
- })
36
- @IsString()
37
- @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
38
- message: 'close must be HH:mm (24h)',
39
- })
40
- close: string;
41
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsNumber, IsString, Matches, Max, Min } from 'class-validator';
3
+
4
+ /**
5
+ * Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
6
+ * open/close: time in HH:mm (24h).
7
+ */
8
+ export class OpeningHoursSlotDto {
9
+ @ApiProperty({
10
+ description: 'Day of week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)',
11
+ example: 1,
12
+ minimum: 0,
13
+ maximum: 6,
14
+ })
15
+ @IsNumber()
16
+ @Min(0)
17
+ @Max(6)
18
+ dayOfWeek: number;
19
+
20
+ @ApiProperty({
21
+ description: 'Opening time in HH:mm (24h)',
22
+ example: '08:00',
23
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
24
+ })
25
+ @IsString()
26
+ @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
27
+ message: 'open must be HH:mm (24h)',
28
+ })
29
+ open: string;
30
+
31
+ @ApiProperty({
32
+ description: 'Closing time in HH:mm (24h)',
33
+ example: '18:00',
34
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
35
+ })
36
+ @IsString()
37
+ @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
38
+ message: 'close must be HH:mm (24h)',
39
+ })
40
+ close: string;
41
+ }
@@ -1,39 +1,39 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { Type } from 'class-transformer';
3
- import {
4
- IsArray,
5
- IsOptional,
6
- ValidateNested,
7
- } from 'class-validator';
8
- import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
9
- import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
10
-
11
- export class UpdateClinicConfigurationDto {
12
- @ApiProperty({
13
- description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
14
- type: [OpeningHoursSlotDto],
15
- example: [
16
- { dayOfWeek: 1, open: '08:00', close: '18:00' },
17
- { dayOfWeek: 2, open: '08:00', close: '18:00' },
18
- ],
19
- })
20
- @IsArray()
21
- @ValidateNested({ each: true })
22
- @Type(() => OpeningHoursSlotDto)
23
- opening_hours: OpeningHoursSlotDto[];
24
-
25
- @ApiProperty({
26
- description: 'Campos adicionais de anamnese configurados pela clínica',
27
- type: [AnamnesisCustomFieldDto],
28
- required: false,
29
- example: [
30
- { enabled: true, question: 'Qual foi sua última glicemia?', type: 'number' },
31
- { enabled: true, question: 'Data do último exame?', type: 'date' },
32
- ],
33
- })
34
- @IsOptional()
35
- @IsArray()
36
- @ValidateNested({ each: true })
37
- @Type(() => AnamnesisCustomFieldDto)
38
- anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
39
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { Type } from 'class-transformer';
3
+ import {
4
+ IsArray,
5
+ IsOptional,
6
+ ValidateNested,
7
+ } from 'class-validator';
8
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
9
+ import { AnamnesisCustomFieldDto } from './anamnesis-custom-field.dto';
10
+
11
+ export class UpdateClinicConfigurationDto {
12
+ @ApiProperty({
13
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
14
+ type: [OpeningHoursSlotDto],
15
+ example: [
16
+ { dayOfWeek: 1, open: '08:00', close: '18:00' },
17
+ { dayOfWeek: 2, open: '08:00', close: '18:00' },
18
+ ],
19
+ })
20
+ @IsArray()
21
+ @ValidateNested({ each: true })
22
+ @Type(() => OpeningHoursSlotDto)
23
+ opening_hours: OpeningHoursSlotDto[];
24
+
25
+ @ApiProperty({
26
+ description: 'Campos adicionais de anamnese configurados pela clínica',
27
+ type: [AnamnesisCustomFieldDto],
28
+ required: false,
29
+ example: [
30
+ { enabled: true, question: 'Qual foi sua última glicemia?', type: 'number' },
31
+ { enabled: true, question: 'Data do último exame?', type: 'date' },
32
+ ],
33
+ })
34
+ @IsOptional()
35
+ @IsArray()
36
+ @ValidateNested({ each: true })
37
+ @Type(() => AnamnesisCustomFieldDto)
38
+ anamnesis_custom_fields?: AnamnesisCustomFieldDto[];
39
+ }