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.
- package/README.md +33 -33
- package/dist/storage/delete-object-rpc.dto.d.ts +9 -0
- package/dist/storage/delete-object-rpc.dto.d.ts.map +1 -0
- package/dist/storage/delete-object-rpc.dto.js +48 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -0
- package/dist/storage/storage-rmq-patterns.d.ts +2 -0
- package/dist/storage/storage-rmq-patterns.d.ts.map +1 -1
- package/dist/storage/storage-rmq-patterns.js +3 -1
- package/jest.config.ts +5 -5
- package/package.json +2 -1
- package/src/ai/ai-usage-response.dto.ts +47 -47
- package/src/ai/create-ai-usage.dto.ts +43 -43
- package/src/analytics/analytics-emitter.helper.ts +54 -54
- package/src/analytics/analytics-query.dto.ts +222 -222
- package/src/analytics/create-analytic-event.dto.ts +85 -85
- package/src/analytics/event-analytic.enum.ts +119 -119
- package/src/appointments/appointment-procedure.dto.ts +76 -76
- package/src/appointments/create-appointment.dto.ts +153 -153
- package/src/appointments/index.ts +10 -10
- package/src/appointments/list-appointments-query.dto.ts +157 -157
- package/src/appointments/update-appointment-procedure.dto.ts +10 -10
- package/src/appointments/update-appointment.dto.ts +4 -4
- package/src/auth/refresh-token.dto.ts +10 -10
- package/src/billing/billing-response.dto.ts +68 -68
- package/src/billing/create-billing.dto.ts +70 -70
- package/src/billing/index.ts +6 -6
- package/src/billing/list-billings-query.dto.ts +61 -61
- package/src/billing/update-billing.dto.ts +4 -4
- package/src/cashback/cashback-balance-response.dto.ts +33 -33
- package/src/cashback/cashback-config-response.dto.ts +43 -43
- package/src/cashback/cashback-enums.ts +33 -33
- package/src/cashback/cashback-kafka-payloads.ts +102 -102
- package/src/cashback/cashback-kafka-topics.ts +23 -23
- package/src/cashback/index.ts +7 -7
- package/src/cashback/referral-code-response.dto.ts +49 -49
- package/src/cashback/use-referral-code-response.dto.ts +15 -15
- package/src/configurations/clinic-configuration.dto.ts +39 -39
- package/src/configurations/opening-hours-slot.dto.ts +41 -41
- package/src/configurations/update-clinic-configuration.dto.ts +39 -39
- package/src/connections/whatsapp-official.dto.ts +113 -113
- package/src/conversations/conversation-contact-filters-query.validator.spec.ts +221 -221
- package/src/conversations/conversation-contact-filters-query.validator.ts +10 -10
- package/src/conversations/conversation-intention.dto.ts +24 -24
- package/src/conversations/conversation-response.dto.ts +69 -69
- package/src/conversations/conversation-session-response.dto.ts +65 -65
- package/src/conversations/conversation-type.dto.ts +15 -15
- package/src/conversations/create-conversation-session.dto.ts +28 -28
- package/src/conversations/create-conversation.dto.ts +69 -69
- package/src/conversations/followup-config-response.dto.ts +290 -290
- package/src/conversations/followup-log-response.dto.ts +58 -58
- package/src/conversations/followup-type.dto.ts +22 -22
- package/src/conversations/index.ts +17 -17
- package/src/conversations/list-conversation-contacts-filters.dto.ts +15 -15
- package/src/conversations/list-conversation-contacts-query.dto.ts +81 -81
- package/src/conversations/satisfaction-response.dto.ts +116 -116
- package/src/filters/index.ts +1 -1
- package/src/filters/parsed-filter.dto.ts +41 -41
- package/src/index.ts +23 -23
- package/src/patients/create-patient.dto.ts +122 -122
- package/src/patients/index.ts +10 -10
- package/src/patients/list-patients-filters.dto.ts +15 -15
- package/src/patients/list-patients-query.dto.ts +61 -61
- package/src/patients/patient-document-response.dto.ts +33 -33
- package/src/patients/patient-history-entry.dto.ts +22 -22
- package/src/patients/patient-status.dto.ts +9 -9
- package/src/patients/update-patient-document.dto.ts +10 -10
- package/src/patients/update-patient.dto.ts +15 -15
- package/src/payment-gateway/create-gateway-payment.dto.ts +123 -123
- package/src/payment-gateway/gateway-payment-response.dto.ts +65 -65
- package/src/payment-gateway/index.ts +12 -12
- package/src/payment-gateway/list-gateway-payments-query.dto.ts +63 -63
- package/src/payment-gateway/payment-gateway-kafka-topics.ts +25 -25
- package/src/payment-gateway/payment-gateway.enums.ts +34 -34
- package/src/payment-gateway/update-gateway-payment.dto.ts +7 -7
- package/src/payment-gateway/webhook-payload.dto.ts +32 -32
- package/src/payments/create-payment.dto.ts +73 -73
- package/src/payments/index.ts +6 -6
- package/src/payments/list-payments-query.dto.ts +44 -44
- package/src/payments/payment-response.dto.ts +67 -67
- package/src/payments/update-payment.dto.ts +4 -4
- package/src/procedures/create-procedure.dto.ts +104 -104
- package/src/procedures/index.ts +6 -6
- package/src/procedures/list-procedures-query.dto.ts +59 -59
- package/src/procedures/update-procedure.dto.ts +4 -4
- package/src/storage/delete-object-rpc.dto.ts +28 -0
- package/src/storage/index.ts +1 -0
- package/src/storage/storage-rmq-patterns.ts +3 -0
- package/src/tenants/index.ts +10 -10
- package/src/tenants/whatsapp-provider-kind.dto.ts +12 -12
- package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts +0 -7
- package/dist/analytics/should-skip-analytics-tenant-lookup.d.ts.map +0 -1
- package/dist/analytics/should-skip-analytics-tenant-lookup.js +0 -13
- package/dist/appointments/opening-hours-slot.dto.d.ts +0 -6
- package/dist/appointments/opening-hours-slot.dto.d.ts.map +0 -1
- package/dist/appointments/opening-hours-slot.dto.js +0 -2
- package/dist/patients/patient-procedure.dto.d.ts +0 -9
- package/dist/patients/patient-procedure.dto.d.ts.map +0 -1
- package/dist/patients/patient-procedure.dto.js +0 -79
- package/dist/patients/update-patient-procedure.dto.d.ts +0 -6
- package/dist/patients/update-patient-procedure.dto.d.ts.map +0 -1
- package/dist/patients/update-patient-procedure.dto.js +0 -8
- package/dist/payments/payment.dto.d.ts +0 -15
- package/dist/payments/payment.dto.d.ts.map +0 -1
- package/dist/payments/payment.dto.js +0 -2
- package/dist/tenants/create-tenant.dto.d.ts +0 -10
- package/dist/tenants/create-tenant.dto.d.ts.map +0 -1
- package/dist/tenants/create-tenant.dto.js +0 -73
- package/dist/tenants/tenant-slug.util.spec.d.ts +0 -2
- package/dist/tenants/tenant-slug.util.spec.d.ts.map +0 -1
- package/dist/tenants/tenant-slug.util.spec.js +0 -102
- package/dist/tenants/update-tenant-payload.dto.d.ts +0 -6
- package/dist/tenants/update-tenant-payload.dto.d.ts.map +0 -1
- package/dist/tenants/update-tenant-payload.dto.js +0 -25
- package/dist/tenants/update-tenant.dto.d.ts +0 -10
- package/dist/tenants/update-tenant.dto.d.ts.map +0 -1
- package/dist/tenants/update-tenant.dto.js +0 -78
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
3
|
-
IsInt,
|
|
4
|
-
IsNotEmpty,
|
|
5
|
-
IsNumber,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsString,
|
|
8
|
-
IsUUID,
|
|
9
|
-
MaxLength,
|
|
10
|
-
Min,
|
|
11
|
-
} from 'class-validator';
|
|
12
|
-
|
|
13
|
-
export class CreateProcedureDto {
|
|
14
|
-
@ApiProperty({
|
|
15
|
-
description: 'Nome do procedimento',
|
|
16
|
-
example: 'Consulta clínica',
|
|
17
|
-
maxLength: 255,
|
|
18
|
-
})
|
|
19
|
-
@IsString()
|
|
20
|
-
@IsNotEmpty()
|
|
21
|
-
@MaxLength(255)
|
|
22
|
-
name: string;
|
|
23
|
-
|
|
24
|
-
@ApiPropertyOptional({
|
|
25
|
-
description: 'Categoria do procedimento',
|
|
26
|
-
example: 'Consulta',
|
|
27
|
-
maxLength: 100,
|
|
28
|
-
})
|
|
29
|
-
@IsString()
|
|
30
|
-
@IsOptional()
|
|
31
|
-
@MaxLength(100)
|
|
32
|
-
category?: string | null;
|
|
33
|
-
|
|
34
|
-
@ApiPropertyOptional({
|
|
35
|
-
description: 'Descrição detalhada do procedimento',
|
|
36
|
-
example: 'Consulta clínica com anamnese e avaliação geral',
|
|
37
|
-
maxLength: 5000,
|
|
38
|
-
})
|
|
39
|
-
@IsString()
|
|
40
|
-
@IsOptional()
|
|
41
|
-
@MaxLength(5000)
|
|
42
|
-
description?: string | null;
|
|
43
|
-
|
|
44
|
-
@ApiPropertyOptional({
|
|
45
|
-
description: 'Tempo de bloqueio da agenda em minutos',
|
|
46
|
-
example: 30,
|
|
47
|
-
})
|
|
48
|
-
@IsInt()
|
|
49
|
-
@IsOptional()
|
|
50
|
-
@Min(1)
|
|
51
|
-
blockTime?: number | null;
|
|
52
|
-
|
|
53
|
-
@ApiPropertyOptional({
|
|
54
|
-
description: 'Valor padrão sugerido para o procedimento',
|
|
55
|
-
example: 150.5,
|
|
56
|
-
})
|
|
57
|
-
@IsNumber({ maxDecimalPlaces: 2 })
|
|
58
|
-
@IsOptional()
|
|
59
|
-
@Min(0)
|
|
60
|
-
defaultValue?: number | null;
|
|
61
|
-
|
|
62
|
-
@ApiPropertyOptional({
|
|
63
|
-
description: 'Quantidade de dias sugerida para retorno',
|
|
64
|
-
example: 30,
|
|
65
|
-
})
|
|
66
|
-
@IsInt()
|
|
67
|
-
@IsOptional()
|
|
68
|
-
@Min(0)
|
|
69
|
-
returnDays?: number | null;
|
|
70
|
-
|
|
71
|
-
@ApiProperty({
|
|
72
|
-
description: 'Valor monetário do procedimento',
|
|
73
|
-
example: 150.5,
|
|
74
|
-
})
|
|
75
|
-
@IsNumber({ maxDecimalPlaces: 2 })
|
|
76
|
-
@Min(0)
|
|
77
|
-
value: number;
|
|
78
|
-
|
|
79
|
-
@ApiProperty({
|
|
80
|
-
description: 'Duração do procedimento em minutos',
|
|
81
|
-
example: 30,
|
|
82
|
-
})
|
|
83
|
-
@IsNumber()
|
|
84
|
-
@Min(1)
|
|
85
|
-
duration: number;
|
|
86
|
-
|
|
87
|
-
@ApiPropertyOptional({
|
|
88
|
-
description: 'Efeitos colaterais ou observações sobre o procedimento',
|
|
89
|
-
example: 'Pode causar sonolência leve',
|
|
90
|
-
maxLength: 5000,
|
|
91
|
-
})
|
|
92
|
-
@IsString()
|
|
93
|
-
@IsOptional()
|
|
94
|
-
@MaxLength(5000)
|
|
95
|
-
side_effects?: string | null;
|
|
96
|
-
|
|
97
|
-
@ApiProperty({
|
|
98
|
-
description: 'ID da especialidade do procedimento (UUID v4)',
|
|
99
|
-
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
100
|
-
})
|
|
101
|
-
@IsUUID('4')
|
|
102
|
-
@IsNotEmpty()
|
|
103
|
-
specialtyId: string;
|
|
104
|
-
}
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
IsInt,
|
|
4
|
+
IsNotEmpty,
|
|
5
|
+
IsNumber,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
IsUUID,
|
|
9
|
+
MaxLength,
|
|
10
|
+
Min,
|
|
11
|
+
} from 'class-validator';
|
|
12
|
+
|
|
13
|
+
export class CreateProcedureDto {
|
|
14
|
+
@ApiProperty({
|
|
15
|
+
description: 'Nome do procedimento',
|
|
16
|
+
example: 'Consulta clínica',
|
|
17
|
+
maxLength: 255,
|
|
18
|
+
})
|
|
19
|
+
@IsString()
|
|
20
|
+
@IsNotEmpty()
|
|
21
|
+
@MaxLength(255)
|
|
22
|
+
name: string;
|
|
23
|
+
|
|
24
|
+
@ApiPropertyOptional({
|
|
25
|
+
description: 'Categoria do procedimento',
|
|
26
|
+
example: 'Consulta',
|
|
27
|
+
maxLength: 100,
|
|
28
|
+
})
|
|
29
|
+
@IsString()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@MaxLength(100)
|
|
32
|
+
category?: string | null;
|
|
33
|
+
|
|
34
|
+
@ApiPropertyOptional({
|
|
35
|
+
description: 'Descrição detalhada do procedimento',
|
|
36
|
+
example: 'Consulta clínica com anamnese e avaliação geral',
|
|
37
|
+
maxLength: 5000,
|
|
38
|
+
})
|
|
39
|
+
@IsString()
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@MaxLength(5000)
|
|
42
|
+
description?: string | null;
|
|
43
|
+
|
|
44
|
+
@ApiPropertyOptional({
|
|
45
|
+
description: 'Tempo de bloqueio da agenda em minutos',
|
|
46
|
+
example: 30,
|
|
47
|
+
})
|
|
48
|
+
@IsInt()
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@Min(1)
|
|
51
|
+
blockTime?: number | null;
|
|
52
|
+
|
|
53
|
+
@ApiPropertyOptional({
|
|
54
|
+
description: 'Valor padrão sugerido para o procedimento',
|
|
55
|
+
example: 150.5,
|
|
56
|
+
})
|
|
57
|
+
@IsNumber({ maxDecimalPlaces: 2 })
|
|
58
|
+
@IsOptional()
|
|
59
|
+
@Min(0)
|
|
60
|
+
defaultValue?: number | null;
|
|
61
|
+
|
|
62
|
+
@ApiPropertyOptional({
|
|
63
|
+
description: 'Quantidade de dias sugerida para retorno',
|
|
64
|
+
example: 30,
|
|
65
|
+
})
|
|
66
|
+
@IsInt()
|
|
67
|
+
@IsOptional()
|
|
68
|
+
@Min(0)
|
|
69
|
+
returnDays?: number | null;
|
|
70
|
+
|
|
71
|
+
@ApiProperty({
|
|
72
|
+
description: 'Valor monetário do procedimento',
|
|
73
|
+
example: 150.5,
|
|
74
|
+
})
|
|
75
|
+
@IsNumber({ maxDecimalPlaces: 2 })
|
|
76
|
+
@Min(0)
|
|
77
|
+
value: number;
|
|
78
|
+
|
|
79
|
+
@ApiProperty({
|
|
80
|
+
description: 'Duração do procedimento em minutos',
|
|
81
|
+
example: 30,
|
|
82
|
+
})
|
|
83
|
+
@IsNumber()
|
|
84
|
+
@Min(1)
|
|
85
|
+
duration: number;
|
|
86
|
+
|
|
87
|
+
@ApiPropertyOptional({
|
|
88
|
+
description: 'Efeitos colaterais ou observações sobre o procedimento',
|
|
89
|
+
example: 'Pode causar sonolência leve',
|
|
90
|
+
maxLength: 5000,
|
|
91
|
+
})
|
|
92
|
+
@IsString()
|
|
93
|
+
@IsOptional()
|
|
94
|
+
@MaxLength(5000)
|
|
95
|
+
side_effects?: string | null;
|
|
96
|
+
|
|
97
|
+
@ApiProperty({
|
|
98
|
+
description: 'ID da especialidade do procedimento (UUID v4)',
|
|
99
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
100
|
+
})
|
|
101
|
+
@IsUUID('4')
|
|
102
|
+
@IsNotEmpty()
|
|
103
|
+
specialtyId: string;
|
|
104
|
+
}
|
package/src/procedures/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './create-procedure.dto';
|
|
2
|
-
export * from './update-procedure.dto';
|
|
3
|
-
export * from './list-procedures-query.dto';
|
|
4
|
-
export * from './specialty-embed.dto';
|
|
5
|
-
export * from './procedure-response.dto';
|
|
6
|
-
export * from './paginated-procedures-response.dto';
|
|
1
|
+
export * from './create-procedure.dto';
|
|
2
|
+
export * from './update-procedure.dto';
|
|
3
|
+
export * from './list-procedures-query.dto';
|
|
4
|
+
export * from './specialty-embed.dto';
|
|
5
|
+
export * from './procedure-response.dto';
|
|
6
|
+
export * from './paginated-procedures-response.dto';
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
|
3
|
-
import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
|
|
4
|
-
|
|
5
|
-
export const PROCEDURE_LIST_FILTER_KEYS = [
|
|
6
|
-
'id',
|
|
7
|
-
'name',
|
|
8
|
-
'category',
|
|
9
|
-
'description',
|
|
10
|
-
'blockTime',
|
|
11
|
-
'defaultValue',
|
|
12
|
-
'returnDays',
|
|
13
|
-
'value',
|
|
14
|
-
'duration',
|
|
15
|
-
'sideEffects',
|
|
16
|
-
'specialtyId',
|
|
17
|
-
'createdAt',
|
|
18
|
-
'updatedAt',
|
|
19
|
-
'deletedAt',
|
|
20
|
-
] as const;
|
|
21
|
-
export type ProcedureListFilterKeyDto = (typeof PROCEDURE_LIST_FILTER_KEYS)[number];
|
|
22
|
-
|
|
23
|
-
export class ListProceduresQueryDto {
|
|
24
|
-
@ApiPropertyOptional({
|
|
25
|
-
description: 'Número da página (iniciando em 1)',
|
|
26
|
-
example: 1,
|
|
27
|
-
minimum: 1,
|
|
28
|
-
default: 1,
|
|
29
|
-
})
|
|
30
|
-
@IsOptional()
|
|
31
|
-
@IsInt()
|
|
32
|
-
@Min(1)
|
|
33
|
-
page?: number;
|
|
34
|
-
|
|
35
|
-
@ApiPropertyOptional({
|
|
36
|
-
description: 'Quantidade de registros por página',
|
|
37
|
-
example: 20,
|
|
38
|
-
minimum: 1,
|
|
39
|
-
maximum: 100,
|
|
40
|
-
default: 20,
|
|
41
|
-
})
|
|
42
|
-
@IsOptional()
|
|
43
|
-
@IsInt()
|
|
44
|
-
@Min(1)
|
|
45
|
-
@Max(100)
|
|
46
|
-
limit?: number;
|
|
47
|
-
|
|
48
|
-
@ApiPropertyOptional({
|
|
49
|
-
description:
|
|
50
|
-
'JSON string with an array of filter objects `{ key, op, value }`. ' +
|
|
51
|
-
'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
|
|
52
|
-
'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern). ' +
|
|
53
|
-
'Use key `sideEffects` for the `side_effects` column.',
|
|
54
|
-
type: String,
|
|
55
|
-
example: '[{"key":"name","op":"==","value":"Consulta"}]',
|
|
56
|
-
})
|
|
57
|
-
@IsOptional()
|
|
58
|
-
filters?: ParsedFilterDto[];
|
|
59
|
-
}
|
|
1
|
+
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsInt, IsOptional, Max, Min } from 'class-validator';
|
|
3
|
+
import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
|
|
4
|
+
|
|
5
|
+
export const PROCEDURE_LIST_FILTER_KEYS = [
|
|
6
|
+
'id',
|
|
7
|
+
'name',
|
|
8
|
+
'category',
|
|
9
|
+
'description',
|
|
10
|
+
'blockTime',
|
|
11
|
+
'defaultValue',
|
|
12
|
+
'returnDays',
|
|
13
|
+
'value',
|
|
14
|
+
'duration',
|
|
15
|
+
'sideEffects',
|
|
16
|
+
'specialtyId',
|
|
17
|
+
'createdAt',
|
|
18
|
+
'updatedAt',
|
|
19
|
+
'deletedAt',
|
|
20
|
+
] as const;
|
|
21
|
+
export type ProcedureListFilterKeyDto = (typeof PROCEDURE_LIST_FILTER_KEYS)[number];
|
|
22
|
+
|
|
23
|
+
export class ListProceduresQueryDto {
|
|
24
|
+
@ApiPropertyOptional({
|
|
25
|
+
description: 'Número da página (iniciando em 1)',
|
|
26
|
+
example: 1,
|
|
27
|
+
minimum: 1,
|
|
28
|
+
default: 1,
|
|
29
|
+
})
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsInt()
|
|
32
|
+
@Min(1)
|
|
33
|
+
page?: number;
|
|
34
|
+
|
|
35
|
+
@ApiPropertyOptional({
|
|
36
|
+
description: 'Quantidade de registros por página',
|
|
37
|
+
example: 20,
|
|
38
|
+
minimum: 1,
|
|
39
|
+
maximum: 100,
|
|
40
|
+
default: 20,
|
|
41
|
+
})
|
|
42
|
+
@IsOptional()
|
|
43
|
+
@IsInt()
|
|
44
|
+
@Min(1)
|
|
45
|
+
@Max(100)
|
|
46
|
+
limit?: number;
|
|
47
|
+
|
|
48
|
+
@ApiPropertyOptional({
|
|
49
|
+
description:
|
|
50
|
+
'JSON string with an array of filter objects `{ key, op, value }`. ' +
|
|
51
|
+
'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
|
|
52
|
+
'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern). ' +
|
|
53
|
+
'Use key `sideEffects` for the `side_effects` column.',
|
|
54
|
+
type: String,
|
|
55
|
+
example: '[{"key":"name","op":"==","value":"Consulta"}]',
|
|
56
|
+
})
|
|
57
|
+
@IsOptional()
|
|
58
|
+
filters?: ParsedFilterDto[];
|
|
59
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PartialType } from '@nestjs/swagger';
|
|
2
|
-
import { CreateProcedureDto } from './create-procedure.dto';
|
|
3
|
-
|
|
4
|
-
export class UpdateProcedureDto extends PartialType(CreateProcedureDto) {}
|
|
1
|
+
import { PartialType } from '@nestjs/swagger';
|
|
2
|
+
import { CreateProcedureDto } from './create-procedure.dto';
|
|
3
|
+
|
|
4
|
+
export class UpdateProcedureDto extends PartialType(CreateProcedureDto) {}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsString, MaxLength, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
/** RMQ: serviço interno pede remoção de objeto validando escopo por tenant. */
|
|
5
|
+
export class DeleteObjectRpcDto {
|
|
6
|
+
@ApiProperty({
|
|
7
|
+
description: 'Tenant slug (deve corresponder ao prefixo do objectKey)',
|
|
8
|
+
example: 'clinica_sampaio',
|
|
9
|
+
})
|
|
10
|
+
@IsString()
|
|
11
|
+
@MinLength(1)
|
|
12
|
+
@MaxLength(255)
|
|
13
|
+
tenantSlug: string;
|
|
14
|
+
|
|
15
|
+
@ApiProperty({
|
|
16
|
+
description: 'Chave S3 do objeto',
|
|
17
|
+
example: 'tenants/clinica_sampaio/patients/.../doc.pdf',
|
|
18
|
+
})
|
|
19
|
+
@IsString()
|
|
20
|
+
@MinLength(1)
|
|
21
|
+
@MaxLength(2048)
|
|
22
|
+
objectKey: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class DeleteObjectRpcResultDto {
|
|
26
|
+
@ApiProperty({ description: 'Confirmação da remoção' })
|
|
27
|
+
ok: true;
|
|
28
|
+
}
|
package/src/storage/index.ts
CHANGED
|
@@ -3,3 +3,6 @@ export const STORAGE_ISSUE_UPLOAD_TOKEN = 'storage.issueUploadToken';
|
|
|
3
3
|
|
|
4
4
|
/** URL presigned GET (chamada interna; sem JWT HTTP para o storage) */
|
|
5
5
|
export const STORAGE_PRESIGN_DOWNLOAD = 'storage.presignDownload';
|
|
6
|
+
|
|
7
|
+
/** Delete object via RMQ (chamada interna; sem JWT HTTP para o storage) */
|
|
8
|
+
export const STORAGE_DELETE_OBJECT = 'storage.deleteObject';
|
package/src/tenants/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './update-tenant-environment-url.dto';
|
|
2
|
-
export * from './get-tenant-by-address.query.dto';
|
|
3
|
-
export * from './tenant-public-by-address-response.dto';
|
|
4
|
-
export * from './whatsapp-provider-kind.dto';
|
|
5
|
-
export * from './tenant-slug.util';
|
|
6
|
-
export * from './tenant-ai-token-state.dto';
|
|
7
|
-
export * from './consume-tenant-ai-tokens.dto';
|
|
8
|
-
export * from './recharge-tenant-ai-tokens.dto';
|
|
9
|
-
export * from './renew-tenant-ai-tokens.dto';
|
|
10
|
-
export * from './tenant-storage-usage-apply-delta.dto';
|
|
1
|
+
export * from './update-tenant-environment-url.dto';
|
|
2
|
+
export * from './get-tenant-by-address.query.dto';
|
|
3
|
+
export * from './tenant-public-by-address-response.dto';
|
|
4
|
+
export * from './whatsapp-provider-kind.dto';
|
|
5
|
+
export * from './tenant-slug.util';
|
|
6
|
+
export * from './tenant-ai-token-state.dto';
|
|
7
|
+
export * from './consume-tenant-ai-tokens.dto';
|
|
8
|
+
export * from './recharge-tenant-ai-tokens.dto';
|
|
9
|
+
export * from './renew-tenant-ai-tokens.dto';
|
|
10
|
+
export * from './tenant-storage-usage-apply-delta.dto';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported WhatsApp provider types for tenant instance provisioning.
|
|
3
|
-
*
|
|
4
|
-
* - `evolution_api`: Evolution API v2 (Baileys-based unofficial).
|
|
5
|
-
* - `whatsapp_official`: Meta Cloud API (official WhatsApp Business).
|
|
6
|
-
*/
|
|
7
|
-
export const WHATSAPP_PROVIDER_KINDS = [
|
|
8
|
-
'evolution_api',
|
|
9
|
-
'whatsapp_official',
|
|
10
|
-
] as const;
|
|
11
|
-
|
|
12
|
-
export type WhatsAppProviderKindDto = (typeof WHATSAPP_PROVIDER_KINDS)[number];
|
|
1
|
+
/**
|
|
2
|
+
* Supported WhatsApp provider types for tenant instance provisioning.
|
|
3
|
+
*
|
|
4
|
+
* - `evolution_api`: Evolution API v2 (Baileys-based unofficial).
|
|
5
|
+
* - `whatsapp_official`: Meta Cloud API (official WhatsApp Business).
|
|
6
|
+
*/
|
|
7
|
+
export const WHATSAPP_PROVIDER_KINDS = [
|
|
8
|
+
'evolution_api',
|
|
9
|
+
'whatsapp_official',
|
|
10
|
+
] as const;
|
|
11
|
+
|
|
12
|
+
export type WhatsAppProviderKindDto = (typeof WHATSAPP_PROVIDER_KINDS)[number];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tenants that must not trigger tenant-service DB resolution for analytics ingestion.
|
|
3
|
-
* Events for these slugs are acknowledged without persistence (no per-tenant DB row).
|
|
4
|
-
*/
|
|
5
|
-
export declare const TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = "__tychat_system__";
|
|
6
|
-
export declare function shouldSkipAnalyticsTenantLookup(tenantSlug: string): boolean;
|
|
7
|
-
//# sourceMappingURL=should-skip-analytics-tenant-lookup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"should-skip-analytics-tenant-lookup.d.ts","sourceRoot":"","sources":["../../src/analytics/should-skip-analytics-tenant-lookup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAE5E,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAG3E"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = void 0;
|
|
4
|
-
exports.shouldSkipAnalyticsTenantLookup = shouldSkipAnalyticsTenantLookup;
|
|
5
|
-
/**
|
|
6
|
-
* Tenants that must not trigger tenant-service DB resolution for analytics ingestion.
|
|
7
|
-
* Events for these slugs are acknowledged without persistence (no per-tenant DB row).
|
|
8
|
-
*/
|
|
9
|
-
exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = '__tychat_system__';
|
|
10
|
-
function shouldSkipAnalyticsTenantLookup(tenantSlug) {
|
|
11
|
-
const t = tenantSlug?.trim();
|
|
12
|
-
return t === exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opening-hours-slot.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/opening-hours-slot.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patient-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/patients/patient-procedure.dto.ts"],"names":[],"mappings":"AAYA,qBAAa,mBAAmB;IAS9B,IAAI,EAAE,MAAM,CAAC;IAOb,KAAK,EAAE,MAAM,CAAC;IAOd,QAAQ,EAAE,OAAO,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PatientProcedureDto = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
class PatientProcedureDto {
|
|
16
|
-
name;
|
|
17
|
-
value;
|
|
18
|
-
finished;
|
|
19
|
-
finished_at;
|
|
20
|
-
observation;
|
|
21
|
-
appointmentId;
|
|
22
|
-
}
|
|
23
|
-
exports.PatientProcedureDto = PatientProcedureDto;
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, swagger_1.ApiProperty)({
|
|
26
|
-
description: 'Nome do procedimento que o paciente irá realizar ou realizou',
|
|
27
|
-
example: 'Consulta clínica',
|
|
28
|
-
maxLength: 255,
|
|
29
|
-
}),
|
|
30
|
-
(0, class_validator_1.IsString)(),
|
|
31
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
-
(0, class_validator_1.MaxLength)(255),
|
|
33
|
-
__metadata("design:type", String)
|
|
34
|
-
], PatientProcedureDto.prototype, "name", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, swagger_1.ApiProperty)({
|
|
37
|
-
description: 'Valor monetário do procedimento',
|
|
38
|
-
example: 150.5,
|
|
39
|
-
}),
|
|
40
|
-
(0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
|
|
41
|
-
__metadata("design:type", Number)
|
|
42
|
-
], PatientProcedureDto.prototype, "value", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, swagger_1.ApiProperty)({
|
|
45
|
-
description: 'Indica se o procedimento já foi finalizado',
|
|
46
|
-
example: false,
|
|
47
|
-
}),
|
|
48
|
-
(0, class_validator_1.IsBoolean)(),
|
|
49
|
-
__metadata("design:type", Boolean)
|
|
50
|
-
], PatientProcedureDto.prototype, "finished", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
53
|
-
description: 'Data e hora em que o procedimento foi finalizado (ISO 8601)',
|
|
54
|
-
example: '2026-03-10T14:30:00.000Z',
|
|
55
|
-
}),
|
|
56
|
-
(0, class_validator_1.IsOptional)(),
|
|
57
|
-
(0, class_validator_1.IsDateString)(),
|
|
58
|
-
__metadata("design:type", Object)
|
|
59
|
-
], PatientProcedureDto.prototype, "finished_at", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
62
|
-
description: 'Observação adicional sobre o procedimento',
|
|
63
|
-
example: 'Paciente chegou em jejum',
|
|
64
|
-
maxLength: 2000,
|
|
65
|
-
}),
|
|
66
|
-
(0, class_validator_1.IsString)(),
|
|
67
|
-
(0, class_validator_1.IsOptional)(),
|
|
68
|
-
(0, class_validator_1.MaxLength)(2000),
|
|
69
|
-
__metadata("design:type", Object)
|
|
70
|
-
], PatientProcedureDto.prototype, "observation", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
73
|
-
description: 'ID do agendamento (consulta) ao qual o procedimento está vinculado',
|
|
74
|
-
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
75
|
-
}),
|
|
76
|
-
(0, class_validator_1.IsOptional)(),
|
|
77
|
-
(0, class_validator_1.IsUUID)(),
|
|
78
|
-
__metadata("design:type", Object)
|
|
79
|
-
], PatientProcedureDto.prototype, "appointmentId", void 0);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PatientProcedureDto } from './patient-procedure.dto';
|
|
2
|
-
declare const UpdatePatientProcedureDto_base: import("@nestjs/common").Type<Partial<PatientProcedureDto>>;
|
|
3
|
-
export declare class UpdatePatientProcedureDto extends UpdatePatientProcedureDto_base {
|
|
4
|
-
}
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=update-patient-procedure.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-patient-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/patients/update-patient-procedure.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;;AAE9D,qBAAa,yBAA0B,SAAQ,8BAAgC;CAAG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdatePatientProcedureDto = void 0;
|
|
4
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
5
|
-
const patient_procedure_dto_1 = require("./patient-procedure.dto");
|
|
6
|
-
class UpdatePatientProcedureDto extends (0, swagger_1.PartialType)(patient_procedure_dto_1.PatientProcedureDto) {
|
|
7
|
-
}
|
|
8
|
-
exports.UpdatePatientProcedureDto = UpdatePatientProcedureDto;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PaymentMethodDto } from "./payment-method.dto";
|
|
2
|
-
import { PaymentStatusDto } from "./payment-status.dto";
|
|
3
|
-
export interface PaymentDto {
|
|
4
|
-
id: string;
|
|
5
|
-
method: PaymentMethodDto;
|
|
6
|
-
status: PaymentStatusDto;
|
|
7
|
-
value: number;
|
|
8
|
-
dueDate: string;
|
|
9
|
-
payedAt: string | null;
|
|
10
|
-
createdAt: string;
|
|
11
|
-
updatedAt: string;
|
|
12
|
-
patientId: string;
|
|
13
|
-
appointmentId: string;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=payment.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment.dto.d.ts","sourceRoot":"","sources":["../../src/payments/payment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-tenant.dto.d.ts","sourceRoot":"","sources":["../../src/tenants/create-tenant.dto.ts"],"names":[],"mappings":"AAYA,qBAAa,eAAe;IAK1B,IAAI,EAAE,MAAM,CAAC;IAMb,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,MAAM,EAAE,MAAM,CAAC;IAMf,MAAM,EAAE,MAAM,CAAC;IAMf,UAAU,EAAE,MAAM,CAAC;IAKnB,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAChC"}
|