tychat-contracts 1.6.52 → 1.6.56
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/dist/legal-terms/default-legal-term-document.d.ts +23 -0
- package/dist/legal-terms/default-legal-term-document.d.ts.map +1 -0
- package/dist/legal-terms/default-legal-term-document.js +170 -0
- package/dist/legal-terms/index.d.ts +4 -0
- package/dist/legal-terms/index.d.ts.map +1 -1
- package/dist/legal-terms/index.js +4 -0
- package/dist/legal-terms/legal-term-body-format.d.ts +1 -1
- package/dist/legal-terms/legal-term-body-format.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-body-format.js +1 -1
- package/dist/legal-terms/legal-term-document-compile.d.ts +3 -0
- package/dist/legal-terms/legal-term-document-compile.d.ts.map +1 -0
- package/dist/legal-terms/legal-term-document-compile.js +166 -0
- package/dist/legal-terms/legal-term-document-compile.spec.d.ts +2 -0
- package/dist/legal-terms/legal-term-document-compile.spec.d.ts.map +1 -0
- package/dist/legal-terms/legal-term-document-compile.spec.js +49 -0
- package/dist/legal-terms/legal-term-document.dto.d.ts +21 -0
- package/dist/legal-terms/legal-term-document.dto.d.ts.map +1 -0
- package/dist/legal-terms/legal-term-document.dto.js +127 -0
- package/dist/legal-terms/legal-term-document.types.d.ts +30 -0
- package/dist/legal-terms/legal-term-document.types.d.ts.map +1 -0
- package/dist/legal-terms/legal-term-document.types.js +14 -0
- package/dist/legal-terms/legal-term-preview.dto.d.ts +2 -0
- package/dist/legal-terms/legal-term-preview.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-preview.dto.js +14 -1
- package/dist/legal-terms/legal-term-template.dto.d.ts +4 -1
- package/dist/legal-terms/legal-term-template.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-template.dto.js +25 -6
- package/dist/notifications/index.d.ts +2 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +5 -1
- package/dist/notifications/mark-all-notifications-viewed.dto.d.ts +14 -0
- package/dist/notifications/mark-all-notifications-viewed.dto.d.ts.map +1 -0
- package/dist/notifications/mark-all-notifications-viewed.dto.js +53 -0
- package/dist/notifications/notifications-kafka-topics.d.ts +2 -0
- package/dist/notifications/notifications-kafka-topics.d.ts.map +1 -1
- package/dist/notifications/notifications-kafka-topics.js +3 -1
- package/package.json +1 -1
- package/src/legal-terms/default-legal-term-document.ts +170 -0
- package/src/legal-terms/index.ts +4 -0
- package/src/legal-terms/legal-term-body-format.ts +1 -1
- package/src/legal-terms/legal-term-document-compile.spec.ts +53 -0
- package/src/legal-terms/legal-term-document-compile.ts +192 -0
- package/src/legal-terms/legal-term-document.dto.ts +100 -0
- package/src/legal-terms/legal-term-document.types.ts +42 -0
- package/src/legal-terms/legal-term-preview.dto.ts +13 -1
- package/src/legal-terms/legal-term-template.dto.ts +23 -7
- package/src/notifications/index.ts +5 -0
- package/src/notifications/mark-all-notifications-viewed.dto.ts +33 -0
- package/src/notifications/notifications-kafka-topics.ts +3 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Blocos do editor visual do termo jurídico (sem HTML do usuário). */
|
|
2
|
+
export declare const LEGAL_TERM_BLOCK_TYPES: readonly ["document_title", "legal_reference", "section", "paragraph", "table_side_effects", "signature_footer"];
|
|
3
|
+
export type LegalTermBlockType = (typeof LEGAL_TERM_BLOCK_TYPES)[number];
|
|
4
|
+
export type LegalTermSectionLevel = 1 | 2 | 3;
|
|
5
|
+
export declare const LEGAL_TERM_TEXT_ALIGNS: readonly ["left", "center", "right"];
|
|
6
|
+
export type LegalTermTextAlign = (typeof LEGAL_TERM_TEXT_ALIGNS)[number];
|
|
7
|
+
export type LegalTermDocumentBlock = {
|
|
8
|
+
id: string;
|
|
9
|
+
type: LegalTermBlockType;
|
|
10
|
+
/** Nível de numeração para `section` (1 → 1., 2 → 1.1., 3 → 1.1.1.). */
|
|
11
|
+
level?: LegalTermSectionLevel;
|
|
12
|
+
/** Título visível (seção) ou ignorado em tipos sem título. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Texto com placeholders `{{ token }}`; vazio em blocos só estruturais. */
|
|
15
|
+
body?: string;
|
|
16
|
+
titleAlign?: LegalTermTextAlign;
|
|
17
|
+
titleBold?: boolean;
|
|
18
|
+
titleItalic?: boolean;
|
|
19
|
+
titleUnderline?: boolean;
|
|
20
|
+
bodyAlign?: LegalTermTextAlign;
|
|
21
|
+
bodyBold?: boolean;
|
|
22
|
+
bodyItalic?: boolean;
|
|
23
|
+
bodyUnderline?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type LegalTermDocument = {
|
|
26
|
+
version: 1;
|
|
27
|
+
blocks: LegalTermDocumentBlock[];
|
|
28
|
+
};
|
|
29
|
+
export declare const LEGAL_TERM_DOCUMENT_VERSION: 1;
|
|
30
|
+
//# sourceMappingURL=legal-term-document.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legal-term-document.types.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-document.types.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,kHAOzB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,qBAAqB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9C,eAAO,MAAM,sBAAsB,sCAAuC,CAAC;AAC3E,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,wEAAwE;IACxE,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAG,CAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LEGAL_TERM_DOCUMENT_VERSION = exports.LEGAL_TERM_TEXT_ALIGNS = exports.LEGAL_TERM_BLOCK_TYPES = void 0;
|
|
4
|
+
/** Blocos do editor visual do termo jurídico (sem HTML do usuário). */
|
|
5
|
+
exports.LEGAL_TERM_BLOCK_TYPES = [
|
|
6
|
+
'document_title',
|
|
7
|
+
'legal_reference',
|
|
8
|
+
'section',
|
|
9
|
+
'paragraph',
|
|
10
|
+
'table_side_effects',
|
|
11
|
+
'signature_footer',
|
|
12
|
+
];
|
|
13
|
+
exports.LEGAL_TERM_TEXT_ALIGNS = ['left', 'center', 'right'];
|
|
14
|
+
exports.LEGAL_TERM_DOCUMENT_VERSION = 1;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type LegalTermBodyFormat } from './legal-term-body-format';
|
|
2
|
+
import { LegalTermDocumentDto } from './legal-term-document.dto';
|
|
2
3
|
declare const LEGAL_TERM_SIGNATURE_METHODS: readonly ["digital", "printed"];
|
|
3
4
|
export type LegalTermSignatureMethodDto = (typeof LEGAL_TERM_SIGNATURE_METHODS)[number];
|
|
4
5
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
5
6
|
export declare class LegalTermPreviewRequestDto {
|
|
7
|
+
body_document?: LegalTermDocumentDto;
|
|
6
8
|
body_html?: string;
|
|
7
9
|
body_format?: LegalTermBodyFormat;
|
|
8
10
|
nome_paciente?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAA,MAAM,4BAA4B,iCAAkC,CAAC;AACrE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,aAAa,CAAC,EAAE,oBAAoB,CAAC;IASrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAU9B,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAM3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAS3B,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAK9C,YAAY,EAAE,MAAM,EAAE,CAAC;IAUvB,eAAe,CAAC,EAAE,MAAM,CAAC;IAMzB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,aAAa,CAAC,EAAE,MAAM,CAAC;IAQvB,cAAc,CAAC,EAAE,OAAO,CAAC;IAMzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAM9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAWnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -12,10 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.LegalTermSendDto = exports.LegalTermPreviewRequestDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
16
|
const legal_term_body_format_1 = require("./legal-term-body-format");
|
|
17
|
+
const legal_term_document_dto_1 = require("./legal-term-document.dto");
|
|
16
18
|
const LEGAL_TERM_SIGNATURE_METHODS = ['digital', 'printed'];
|
|
17
19
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
18
20
|
class LegalTermPreviewRequestDto {
|
|
21
|
+
body_document;
|
|
19
22
|
body_html;
|
|
20
23
|
body_format;
|
|
21
24
|
nome_paciente;
|
|
@@ -27,7 +30,17 @@ class LegalTermPreviewRequestDto {
|
|
|
27
30
|
exports.LegalTermPreviewRequestDto = LegalTermPreviewRequestDto;
|
|
28
31
|
__decorate([
|
|
29
32
|
(0, swagger_1.ApiPropertyOptional)({
|
|
30
|
-
description: '
|
|
33
|
+
description: 'Rascunho do documento visual; se omitido, usa o modelo salvo',
|
|
34
|
+
type: legal_term_document_dto_1.LegalTermDocumentDto,
|
|
35
|
+
}),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.ValidateNested)(),
|
|
38
|
+
(0, class_transformer_1.Type)(() => legal_term_document_dto_1.LegalTermDocumentDto),
|
|
39
|
+
__metadata("design:type", legal_term_document_dto_1.LegalTermDocumentDto)
|
|
40
|
+
], LegalTermPreviewRequestDto.prototype, "body_document", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
43
|
+
description: 'HTML legado (rascunho); ignorado se body_document for enviado',
|
|
31
44
|
maxLength: 500_000,
|
|
32
45
|
}),
|
|
33
46
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { type LegalTermBodyFormat } from './legal-term-body-format';
|
|
2
|
+
import { LegalTermDocumentDto } from './legal-term-document.dto';
|
|
2
3
|
export declare class LegalTermTemplateDto {
|
|
3
4
|
id: string;
|
|
4
5
|
body_html: string;
|
|
5
6
|
body_format: LegalTermBodyFormat;
|
|
7
|
+
body_document: LegalTermDocumentDto;
|
|
6
8
|
mandatory_procedure_ids: string[];
|
|
7
9
|
createdAt: Date;
|
|
8
10
|
updatedAt: Date;
|
|
9
11
|
}
|
|
10
12
|
export declare class UpsertLegalTermTemplateDto {
|
|
11
|
-
|
|
13
|
+
body_document: LegalTermDocumentDto;
|
|
14
|
+
body_html?: string;
|
|
12
15
|
body_format?: LegalTermBodyFormat;
|
|
13
16
|
mandatory_procedure_ids?: string[];
|
|
14
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-template.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-template.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"legal-term-template.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-template.dto.ts"],"names":[],"mappings":"AAYA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBAAa,oBAAoB;IAE/B,EAAE,EAAE,MAAM,CAAC;IAKX,SAAS,EAAE,MAAM,CAAC;IAMlB,WAAW,EAAE,mBAAmB,CAAC;IAMjC,aAAa,EAAE,oBAAoB,CAAC;IAOpC,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAGlC,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,qBAAa,0BAA0B;IAOrC,aAAa,EAAE,oBAAoB,CAAC;IASpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAWlC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -11,12 +11,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UpsertLegalTermTemplateDto = exports.LegalTermTemplateDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
15
|
const class_validator_1 = require("class-validator");
|
|
15
16
|
const legal_term_body_format_1 = require("./legal-term-body-format");
|
|
17
|
+
const legal_term_document_dto_1 = require("./legal-term-document.dto");
|
|
16
18
|
class LegalTermTemplateDto {
|
|
17
19
|
id;
|
|
18
20
|
body_html;
|
|
19
21
|
body_format;
|
|
22
|
+
body_document;
|
|
20
23
|
mandatory_procedure_ids;
|
|
21
24
|
createdAt;
|
|
22
25
|
updatedAt;
|
|
@@ -28,17 +31,24 @@ __decorate([
|
|
|
28
31
|
], LegalTermTemplateDto.prototype, "id", void 0);
|
|
29
32
|
__decorate([
|
|
30
33
|
(0, swagger_1.ApiProperty)({
|
|
31
|
-
description: '
|
|
34
|
+
description: 'HTML compilado a partir de body_document (cache para PDF)',
|
|
32
35
|
}),
|
|
33
36
|
__metadata("design:type", String)
|
|
34
37
|
], LegalTermTemplateDto.prototype, "body_html", void 0);
|
|
35
38
|
__decorate([
|
|
36
39
|
(0, swagger_1.ApiProperty)({
|
|
37
40
|
enum: legal_term_body_format_1.LEGAL_TERM_BODY_FORMATS,
|
|
38
|
-
description: '
|
|
41
|
+
description: 'structured: editor visual; demais formatos legados',
|
|
39
42
|
}),
|
|
40
43
|
__metadata("design:type", String)
|
|
41
44
|
], LegalTermTemplateDto.prototype, "body_format", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({
|
|
47
|
+
description: 'Documento estruturado do editor visual',
|
|
48
|
+
type: legal_term_document_dto_1.LegalTermDocumentDto,
|
|
49
|
+
}),
|
|
50
|
+
__metadata("design:type", legal_term_document_dto_1.LegalTermDocumentDto)
|
|
51
|
+
], LegalTermTemplateDto.prototype, "body_document", void 0);
|
|
42
52
|
__decorate([
|
|
43
53
|
(0, swagger_1.ApiProperty)({
|
|
44
54
|
type: [String],
|
|
@@ -56,6 +66,7 @@ __decorate([
|
|
|
56
66
|
__metadata("design:type", Date)
|
|
57
67
|
], LegalTermTemplateDto.prototype, "updatedAt", void 0);
|
|
58
68
|
class UpsertLegalTermTemplateDto {
|
|
69
|
+
body_document;
|
|
59
70
|
body_html;
|
|
60
71
|
body_format;
|
|
61
72
|
mandatory_procedure_ids;
|
|
@@ -63,19 +74,27 @@ class UpsertLegalTermTemplateDto {
|
|
|
63
74
|
exports.UpsertLegalTermTemplateDto = UpsertLegalTermTemplateDto;
|
|
64
75
|
__decorate([
|
|
65
76
|
(0, swagger_1.ApiProperty)({
|
|
66
|
-
description: '
|
|
67
|
-
|
|
77
|
+
description: 'Documento do editor visual (obrigatório no fluxo structured)',
|
|
78
|
+
type: legal_term_document_dto_1.LegalTermDocumentDto,
|
|
79
|
+
}),
|
|
80
|
+
(0, class_validator_1.ValidateNested)(),
|
|
81
|
+
(0, class_transformer_1.Type)(() => legal_term_document_dto_1.LegalTermDocumentDto),
|
|
82
|
+
__metadata("design:type", legal_term_document_dto_1.LegalTermDocumentDto)
|
|
83
|
+
], UpsertLegalTermTemplateDto.prototype, "body_document", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
86
|
+
description: 'Ignorado no fluxo structured; servidor compila body_html',
|
|
68
87
|
maxLength: 500_000,
|
|
69
88
|
}),
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
90
|
(0, class_validator_1.IsString)(),
|
|
71
|
-
(0, class_validator_1.MinLength)(1),
|
|
72
91
|
(0, class_validator_1.MaxLength)(500_000),
|
|
73
92
|
__metadata("design:type", String)
|
|
74
93
|
], UpsertLegalTermTemplateDto.prototype, "body_html", void 0);
|
|
75
94
|
__decorate([
|
|
76
95
|
(0, swagger_1.ApiPropertyOptional)({
|
|
77
96
|
enum: legal_term_body_format_1.LEGAL_TERM_BODY_FORMATS,
|
|
78
|
-
description: 'Padrão:
|
|
97
|
+
description: 'Padrão: structured',
|
|
79
98
|
}),
|
|
80
99
|
(0, class_validator_1.IsOptional)(),
|
|
81
100
|
(0, class_validator_1.IsIn)(legal_term_body_format_1.LEGAL_TERM_BODY_FORMATS),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationNewDeviceLoginEventPayload, NotificationConversationChangeToHumanEventPayload, NotificationTenantAiTokensThresholdEventPayload, } from './notifications-kafka.payloads';
|
|
2
|
-
export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
|
|
2
|
+
export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED, TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
|
|
3
3
|
export { AdminBroadcastPushDto, ADMIN_NOTIFICATION_KINDS, type AdminNotificationKind, } from './admin-broadcast-push.dto';
|
|
4
4
|
export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, NotificationsUnregisterPushTokenKafkaDto, } from './register-push-token.dto';
|
|
5
5
|
export { ListNotificationsQueryDto, NOTIFICATION_PROVIDER_FILTERS, NOTIFICATION_STATUS_FILTERS, type NotificationProviderFilterDto, type NotificationStatusFilterDto, } from './list-notifications-query.dto';
|
|
@@ -7,4 +7,5 @@ export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto
|
|
|
7
7
|
export { NotificationListItemDto } from './notification-list-item.dto';
|
|
8
8
|
export { UpdateNotificationViewedDto, NotificationsUpdateViewedKafkaDto, } from './update-notification-viewed.dto';
|
|
9
9
|
export { NotificationsSendPushToUserKafkaDto } from './notifications-send-push-to-user.dto';
|
|
10
|
+
export { MarkAllNotificationsViewedResultDto, NotificationsMarkAllViewedKafkaDto, } from './mark-all-notifications-viewed.dto';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,sCAAsC,EACtC,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,yCAAyC,EACzC,iCAAiC,EACjC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,wCAAwC,GACzC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,sCAAsC,EACtC,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,yCAAyC,EACzC,iCAAiC,EACjC,mCAAmC,EACnC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,wCAAwC,GACzC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EACL,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationsSendPushToUserKafkaDto = exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsUnregisterPushTokenKafkaDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationNewDeviceLoginEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
|
|
3
|
+
exports.NotificationsMarkAllViewedKafkaDto = exports.MarkAllNotificationsViewedResultDto = exports.NotificationsSendPushToUserKafkaDto = exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsUnregisterPushTokenKafkaDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationNewDeviceLoginEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
|
|
4
4
|
var notifications_kafka_payloads_1 = require("./notifications-kafka.payloads");
|
|
5
5
|
Object.defineProperty(exports, "NotificationUserCreatedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationUserCreatedEventPayload; } });
|
|
6
6
|
Object.defineProperty(exports, "NotificationPasswordResetRequestedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationPasswordResetRequestedEventPayload; } });
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: tru
|
|
|
12
12
|
Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
|
|
13
13
|
Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN; } });
|
|
14
14
|
Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UPDATE_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UPDATE_VIEWED; } });
|
|
15
|
+
Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED; } });
|
|
15
16
|
Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER; } });
|
|
16
17
|
Object.defineProperty(exports, "EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH; } });
|
|
17
18
|
Object.defineProperty(exports, "EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH; } });
|
|
@@ -37,3 +38,6 @@ Object.defineProperty(exports, "UpdateNotificationViewedDto", { enumerable: true
|
|
|
37
38
|
Object.defineProperty(exports, "NotificationsUpdateViewedKafkaDto", { enumerable: true, get: function () { return update_notification_viewed_dto_1.NotificationsUpdateViewedKafkaDto; } });
|
|
38
39
|
var notifications_send_push_to_user_dto_1 = require("./notifications-send-push-to-user.dto");
|
|
39
40
|
Object.defineProperty(exports, "NotificationsSendPushToUserKafkaDto", { enumerable: true, get: function () { return notifications_send_push_to_user_dto_1.NotificationsSendPushToUserKafkaDto; } });
|
|
41
|
+
var mark_all_notifications_viewed_dto_1 = require("./mark-all-notifications-viewed.dto");
|
|
42
|
+
Object.defineProperty(exports, "MarkAllNotificationsViewedResultDto", { enumerable: true, get: function () { return mark_all_notifications_viewed_dto_1.MarkAllNotificationsViewedResultDto; } });
|
|
43
|
+
Object.defineProperty(exports, "NotificationsMarkAllViewedKafkaDto", { enumerable: true, get: function () { return mark_all_notifications_viewed_dto_1.NotificationsMarkAllViewedKafkaDto; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resposta HTTP PUT /notifications/mark-all-viewed e RPC `notifications.markAllViewed`.
|
|
3
|
+
*/
|
|
4
|
+
export declare class MarkAllNotificationsViewedResultDto {
|
|
5
|
+
updatedCount: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Payload RPC `notifications.markAllViewed` (sem body HTTP — só tenant + utilizador).
|
|
9
|
+
*/
|
|
10
|
+
export declare class NotificationsMarkAllViewedKafkaDto {
|
|
11
|
+
tenant: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=mark-all-notifications-viewed.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-all-notifications-viewed.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/mark-all-notifications-viewed.dto.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,mCAAmC;IAQ9C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,kCAAkC;IAI7C,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.NotificationsMarkAllViewedKafkaDto = exports.MarkAllNotificationsViewedResultDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
/**
|
|
16
|
+
* Resposta HTTP PUT /notifications/mark-all-viewed e RPC `notifications.markAllViewed`.
|
|
17
|
+
*/
|
|
18
|
+
class MarkAllNotificationsViewedResultDto {
|
|
19
|
+
updatedCount;
|
|
20
|
+
}
|
|
21
|
+
exports.MarkAllNotificationsViewedResultDto = MarkAllNotificationsViewedResultDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({
|
|
24
|
+
description: 'Quantidade de notificações atualizadas (viewed_at preenchido).',
|
|
25
|
+
example: 12,
|
|
26
|
+
minimum: 0,
|
|
27
|
+
}),
|
|
28
|
+
(0, class_validator_1.IsInt)(),
|
|
29
|
+
(0, class_validator_1.Min)(0),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], MarkAllNotificationsViewedResultDto.prototype, "updatedCount", void 0);
|
|
32
|
+
/**
|
|
33
|
+
* Payload RPC `notifications.markAllViewed` (sem body HTTP — só tenant + utilizador).
|
|
34
|
+
*/
|
|
35
|
+
class NotificationsMarkAllViewedKafkaDto {
|
|
36
|
+
tenant;
|
|
37
|
+
userId;
|
|
38
|
+
}
|
|
39
|
+
exports.NotificationsMarkAllViewedKafkaDto = NotificationsMarkAllViewedKafkaDto;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({ example: 'default' }),
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], NotificationsMarkAllViewedKafkaDto.prototype, "tenant", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiProperty)({
|
|
48
|
+
description: 'ID do utilizador (ex.: JWT sub).',
|
|
49
|
+
format: 'uuid',
|
|
50
|
+
}),
|
|
51
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], NotificationsMarkAllViewedKafkaDto.prototype, "userId", void 0);
|
|
@@ -4,6 +4,8 @@ export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.re
|
|
|
4
4
|
export declare const TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = "notifications.unregisterPushToken";
|
|
5
5
|
/** Kafka request–reply: atualizar visualização de uma notificação persistida. */
|
|
6
6
|
export declare const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = "notifications.updateViewed";
|
|
7
|
+
/** Kafka request–reply: marcar todas as notificações não visualizadas do utilizador. */
|
|
8
|
+
export declare const TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = "notifications.markAllViewed";
|
|
7
9
|
/** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
|
|
8
10
|
export declare const TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = "notifications.sendPushToUser";
|
|
9
11
|
/** Kafka event: push FCM em massa (painel administrativo). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,eAAO,MAAM,yCAAyC,sCACjB,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAEpF,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,2FAA2F;AAC3F,eAAO,MAAM,qDAAqD,oDACf,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,eAAO,MAAM,yCAAyC,sCACjB,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,wFAAwF;AACxF,eAAO,MAAM,mCAAmC,gCAAgC,CAAC;AAEjF,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAEpF,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,2FAA2F;AAC3F,eAAO,MAAM,qDAAqD,oDACf,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
|
|
3
|
+
exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
|
|
4
4
|
/** Kafka request–reply: lista notificações persistidas no banco do tenant. */
|
|
5
5
|
exports.TOPIC_NOTIFICATIONS_FIND_ALL = 'notifications.findAll';
|
|
6
6
|
exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = 'notifications.registerPushToken';
|
|
7
7
|
exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = 'notifications.unregisterPushToken';
|
|
8
8
|
/** Kafka request–reply: atualizar visualização de uma notificação persistida. */
|
|
9
9
|
exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
|
|
10
|
+
/** Kafka request–reply: marcar todas as notificações não visualizadas do utilizador. */
|
|
11
|
+
exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = 'notifications.markAllViewed';
|
|
10
12
|
/** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
|
|
11
13
|
exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 'notifications.sendPushToUser';
|
|
12
14
|
/** Kafka event: push FCM em massa (painel administrativo). */
|
package/package.json
CHANGED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { LegalTermDocument, LegalTermDocumentBlock } from './legal-term-document.types';
|
|
2
|
+
|
|
3
|
+
/** IDs estáveis dos blocos do modelo CFM padrão (restauração no editor). */
|
|
4
|
+
export const DEFAULT_LEGAL_TERM_BLOCK_IDS = {
|
|
5
|
+
title: 'cfm-title',
|
|
6
|
+
reference: 'cfm-reference',
|
|
7
|
+
s1: 'cfm-s1-identificacao',
|
|
8
|
+
s2: 'cfm-s2-procedimento',
|
|
9
|
+
s3: 'cfm-s3-indicacao',
|
|
10
|
+
s4: 'cfm-s4-riscos',
|
|
11
|
+
s4Table: 'cfm-s4-riscos-table',
|
|
12
|
+
s5: 'cfm-s5-beneficios',
|
|
13
|
+
s6: 'cfm-s6-alternativas',
|
|
14
|
+
s7: 'cfm-s7-orientacoes',
|
|
15
|
+
s8: 'cfm-s8-lgpd',
|
|
16
|
+
s9: 'cfm-s9-consentimento',
|
|
17
|
+
s10: 'cfm-s10-revogacao',
|
|
18
|
+
signatures: 'cfm-signatures',
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
function block(partial: LegalTermDocumentBlock): LegalTermDocumentBlock {
|
|
22
|
+
return partial;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Modelo CFM (TCLE) — texto em português; placeholders suportados pelo backend. */
|
|
26
|
+
export function createDefaultCfmLegalTermDocument(): LegalTermDocument {
|
|
27
|
+
return {
|
|
28
|
+
version: 1,
|
|
29
|
+
blocks: [
|
|
30
|
+
block({
|
|
31
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.title,
|
|
32
|
+
type: 'document_title',
|
|
33
|
+
title: 'Termo de consentimento livre e esclarecido',
|
|
34
|
+
titleAlign: 'center',
|
|
35
|
+
titleBold: true,
|
|
36
|
+
}),
|
|
37
|
+
block({
|
|
38
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.reference,
|
|
39
|
+
type: 'legal_reference',
|
|
40
|
+
body: 'Conforme Resolução CFM nº 2.217/2018 (Código de Ética Médica)',
|
|
41
|
+
bodyAlign: 'center',
|
|
42
|
+
}),
|
|
43
|
+
block({
|
|
44
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s1,
|
|
45
|
+
type: 'section',
|
|
46
|
+
level: 1,
|
|
47
|
+
title: 'Identificação das partes',
|
|
48
|
+
body: [
|
|
49
|
+
'Paciente: {{ nome_paciente }}',
|
|
50
|
+
'CPF: {{ cpf_formatado }}',
|
|
51
|
+
'Data de Nascimento: {{ data_nascimento }}',
|
|
52
|
+
'Telefone: {{ telefone_paciente }}',
|
|
53
|
+
'E-mail: {{ email_paciente }}',
|
|
54
|
+
'Endereço: {{ endereco_paciente }}',
|
|
55
|
+
'Instituição: (preencher dados da clínica no cadastro)',
|
|
56
|
+
].join('\n'),
|
|
57
|
+
}),
|
|
58
|
+
block({
|
|
59
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s2,
|
|
60
|
+
type: 'section',
|
|
61
|
+
level: 1,
|
|
62
|
+
title: 'Descrição do procedimento',
|
|
63
|
+
body: [
|
|
64
|
+
'Declaro que fui devidamente informado(a), de forma clara, objetiva e compreensível, acerca da natureza, finalidade, indicação clínica, etapas, duração e métodos envolvidos no procedimento médico descrito abaixo:',
|
|
65
|
+
'{{ procedimentos }}',
|
|
66
|
+
].join('\n\n'),
|
|
67
|
+
}),
|
|
68
|
+
block({
|
|
69
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s3,
|
|
70
|
+
type: 'section',
|
|
71
|
+
level: 1,
|
|
72
|
+
title: 'Indicação e justificativa',
|
|
73
|
+
body: 'O procedimento foi indicado com base em avaliação clínica individualizada, considerando meu histórico de saúde, sintomas apresentados e exames complementares, visando o melhor resultado terapêutico possível.',
|
|
74
|
+
}),
|
|
75
|
+
block({
|
|
76
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s4,
|
|
77
|
+
type: 'section',
|
|
78
|
+
level: 1,
|
|
79
|
+
title: 'Riscos e complicações possíveis',
|
|
80
|
+
body: [
|
|
81
|
+
'Fui informado(a) de que todo procedimento médico envolve riscos inerentes, podendo ocorrer intercorrências imediatas ou tardias, previsíveis ou não, incluindo, mas não se limitando a:',
|
|
82
|
+
].join('\n'),
|
|
83
|
+
}),
|
|
84
|
+
block({
|
|
85
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s4Table,
|
|
86
|
+
type: 'table_side_effects',
|
|
87
|
+
body: '',
|
|
88
|
+
}),
|
|
89
|
+
block({
|
|
90
|
+
id: 'cfm-s4-riscos-after',
|
|
91
|
+
type: 'paragraph',
|
|
92
|
+
body: 'Estou ciente de que não há garantia absoluta de resultados, podendo ser necessária a realização de procedimentos adicionais.',
|
|
93
|
+
}),
|
|
94
|
+
block({
|
|
95
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s5,
|
|
96
|
+
type: 'section',
|
|
97
|
+
level: 1,
|
|
98
|
+
title: 'Benefícios esperados',
|
|
99
|
+
body: 'Fui informado(a) sobre os benefícios esperados, incluindo melhora clínica, controle de sintomas e/ou prevenção de agravamentos, respeitando as limitações individuais de resposta ao tratamento.',
|
|
100
|
+
}),
|
|
101
|
+
block({
|
|
102
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s6,
|
|
103
|
+
type: 'section',
|
|
104
|
+
level: 1,
|
|
105
|
+
title: 'Alternativas terapêuticas',
|
|
106
|
+
body: 'Foram apresentadas e discutidas alternativas ao procedimento proposto, incluindo tratamentos conservadores, outras técnicas disponíveis e a possibilidade de não realização do procedimento, estando ciente das consequências dessa decisão.',
|
|
107
|
+
}),
|
|
108
|
+
block({
|
|
109
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s7,
|
|
110
|
+
type: 'section',
|
|
111
|
+
level: 1,
|
|
112
|
+
title: 'Orientações pré e pós-procedimento',
|
|
113
|
+
body: 'Recebi orientações detalhadas quanto aos cuidados necessários antes e após o procedimento, incluindo restrições, uso de medicamentos, sinais de alerta e acompanhamento médico.',
|
|
114
|
+
}),
|
|
115
|
+
block({
|
|
116
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s8,
|
|
117
|
+
type: 'section',
|
|
118
|
+
level: 1,
|
|
119
|
+
title: 'Confidencialidade e proteção de dados',
|
|
120
|
+
body: 'Autorizo o tratamento dos meus dados pessoais e sensíveis para fins médicos, assistenciais e administrativos, conforme a Lei Geral de Proteção de Dados (Lei nº 13.709/2018 - LGPD).',
|
|
121
|
+
}),
|
|
122
|
+
block({
|
|
123
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s9,
|
|
124
|
+
type: 'section',
|
|
125
|
+
level: 1,
|
|
126
|
+
title: 'Declaração de consentimento',
|
|
127
|
+
body: [
|
|
128
|
+
'Declaro que:',
|
|
129
|
+
'Recebi todas as informações necessárias de forma clara e adequada;',
|
|
130
|
+
'Tive oportunidade de realizar perguntas e obtive respostas satisfatórias;',
|
|
131
|
+
'Estou ciente dos riscos, benefícios e alternativas;',
|
|
132
|
+
'Não fui submetido(a) a qualquer tipo de pressão ou indução;',
|
|
133
|
+
'Autorizo, de forma livre e esclarecida, a realização do procedimento descrito.',
|
|
134
|
+
].join('\n'),
|
|
135
|
+
}),
|
|
136
|
+
block({
|
|
137
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.s10,
|
|
138
|
+
type: 'section',
|
|
139
|
+
level: 1,
|
|
140
|
+
title: 'Direito de revogação',
|
|
141
|
+
body: 'Estou ciente de que posso revogar este consentimento a qualquer momento antes da realização do procedimento, sem prejuízo ao meu atendimento médico.',
|
|
142
|
+
}),
|
|
143
|
+
block({
|
|
144
|
+
id: DEFAULT_LEGAL_TERM_BLOCK_IDS.signatures,
|
|
145
|
+
type: 'signature_footer',
|
|
146
|
+
body: [
|
|
147
|
+
'Local: (cidade da clínica)',
|
|
148
|
+
'Data: {{ data_hora }}',
|
|
149
|
+
'',
|
|
150
|
+
'______________________________',
|
|
151
|
+
'Paciente',
|
|
152
|
+
'',
|
|
153
|
+
'______________________________',
|
|
154
|
+
'Responsável Legal',
|
|
155
|
+
'',
|
|
156
|
+
'______________________________',
|
|
157
|
+
'Médico Responsável',
|
|
158
|
+
'',
|
|
159
|
+
'Documento gerado eletronicamente. Assinatura válida conforme legislação vigente.',
|
|
160
|
+
].join('\n'),
|
|
161
|
+
}),
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Mapa id → bloco do seed CFM (para restaurar tópicos padrão). */
|
|
167
|
+
export function getDefaultCfmBlocksById(): Map<string, LegalTermDocumentBlock> {
|
|
168
|
+
const doc = createDefaultCfmLegalTermDocument();
|
|
169
|
+
return new Map(doc.blocks.map((b) => [b.id, { ...b }]));
|
|
170
|
+
}
|
package/src/legal-terms/index.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from './legal-term-body-format';
|
|
2
|
+
export * from './legal-term-document.types';
|
|
3
|
+
export * from './legal-term-document.dto';
|
|
4
|
+
export * from './legal-term-document-compile';
|
|
5
|
+
export * from './default-legal-term-document';
|
|
2
6
|
export * from './legal-term-template.dto';
|
|
3
7
|
export * from './legal-term-preview.dto';
|
|
4
8
|
export * from './legal-term-dispatch.dto';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Formato de armazenamento do modelo; conversão para HTML/PDF é determinística por enum. */
|
|
2
|
-
export const LEGAL_TERM_BODY_FORMATS = ['html', 'markdown', 'plain_text'] as const;
|
|
2
|
+
export const LEGAL_TERM_BODY_FORMATS = ['structured', 'html', 'markdown', 'plain_text'] as const;
|
|
3
3
|
|
|
4
4
|
export type LegalTermBodyFormat = (typeof LEGAL_TERM_BODY_FORMATS)[number];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compileLegalTermDocumentToHtml } from './legal-term-document-compile';
|
|
2
|
+
import { createDefaultCfmLegalTermDocument } from './default-legal-term-document';
|
|
3
|
+
import type { LegalTermDocument } from './legal-term-document.types';
|
|
4
|
+
|
|
5
|
+
describe('compileLegalTermDocumentToHtml', () => {
|
|
6
|
+
it('returns empty paragraph for no blocks', () => {
|
|
7
|
+
expect(compileLegalTermDocumentToHtml({ version: 1, blocks: [] })).toBe('<p></p>');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('numbers sections hierarchically', () => {
|
|
11
|
+
const doc: LegalTermDocument = {
|
|
12
|
+
version: 1,
|
|
13
|
+
blocks: [
|
|
14
|
+
{ id: 'a', type: 'section', level: 1, title: 'ONE', body: 'a' },
|
|
15
|
+
{ id: 'b', type: 'section', level: 2, title: 'TWO', body: 'b' },
|
|
16
|
+
{ id: 'c', type: 'section', level: 3, title: 'THREE', body: 'c' },
|
|
17
|
+
{ id: 'd', type: 'section', level: 1, title: 'FOUR', body: 'd' },
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
const html = compileLegalTermDocumentToHtml(doc);
|
|
21
|
+
expect(html).toContain('1. ONE');
|
|
22
|
+
expect(html).toContain('1.1. TWO');
|
|
23
|
+
expect(html).toContain('1.1.1. THREE');
|
|
24
|
+
expect(html).toContain('2. FOUR');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('escapes HTML in body text', () => {
|
|
28
|
+
const doc: LegalTermDocument = {
|
|
29
|
+
version: 1,
|
|
30
|
+
blocks: [{ id: 'x', type: 'paragraph', body: '<script>alert(1)</script>' }],
|
|
31
|
+
};
|
|
32
|
+
const html = compileLegalTermDocumentToHtml(doc);
|
|
33
|
+
expect(html).not.toContain('<script>');
|
|
34
|
+
expect(html).toContain('<script>');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('emits table placeholder token', () => {
|
|
38
|
+
const doc: LegalTermDocument = {
|
|
39
|
+
version: 1,
|
|
40
|
+
blocks: [{ id: 't', type: 'table_side_effects', body: 'intro' }],
|
|
41
|
+
};
|
|
42
|
+
const html = compileLegalTermDocumentToHtml(doc);
|
|
43
|
+
expect(html).toContain('{{ table_side_effects_en_list }}');
|
|
44
|
+
expect(html).toContain('intro');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('compiles default CFM document', () => {
|
|
48
|
+
const html = compileLegalTermDocumentToHtml(createDefaultCfmLegalTermDocument());
|
|
49
|
+
expect(html).toContain('Termo de consentimento livre e esclarecido');
|
|
50
|
+
expect(html).toContain('{{ nome_paciente }}');
|
|
51
|
+
expect(html).toContain('Identificação das partes');
|
|
52
|
+
});
|
|
53
|
+
});
|