tychat-contracts 1.4.1 → 1.4.3

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 (45) hide show
  1. package/dist/configurations/configuration-tenant-summary.dto.d.ts +6 -0
  2. package/dist/configurations/configuration-tenant-summary.dto.d.ts.map +1 -1
  3. package/dist/configurations/configuration-tenant-summary.dto.js +34 -0
  4. package/dist/configurations/index.d.ts +1 -0
  5. package/dist/configurations/index.d.ts.map +1 -1
  6. package/dist/configurations/index.js +1 -0
  7. package/dist/configurations/plan-summary.dto.d.ts +4 -0
  8. package/dist/configurations/plan-summary.dto.d.ts.map +1 -1
  9. package/dist/configurations/plan-summary.dto.js +20 -0
  10. package/dist/configurations/tenant-limits-summary.dto.d.ts +2 -0
  11. package/dist/configurations/tenant-limits-summary.dto.d.ts.map +1 -1
  12. package/dist/configurations/tenant-limits-summary.dto.js +10 -0
  13. package/dist/configurations/tenant-storage-usage-summary.dto.d.ts +6 -0
  14. package/dist/configurations/tenant-storage-usage-summary.dto.d.ts.map +1 -0
  15. package/dist/configurations/tenant-storage-usage-summary.dto.js +27 -0
  16. package/dist/notifications/index.d.ts +2 -2
  17. package/dist/notifications/index.d.ts.map +1 -1
  18. package/dist/notifications/index.js +3 -1
  19. package/dist/notifications/notifications-kafka-topics.d.ts +1 -0
  20. package/dist/notifications/notifications-kafka-topics.d.ts.map +1 -1
  21. package/dist/notifications/notifications-kafka-topics.js +2 -1
  22. package/dist/notifications/register-push-token.dto.d.ts +8 -0
  23. package/dist/notifications/register-push-token.dto.d.ts.map +1 -1
  24. package/dist/notifications/register-push-token.dto.js +24 -1
  25. package/dist/storage/presign-upload.dto.d.ts +3 -0
  26. package/dist/storage/presign-upload.dto.d.ts.map +1 -1
  27. package/dist/storage/presign-upload.dto.js +35 -0
  28. package/dist/tenants/index.d.ts +1 -0
  29. package/dist/tenants/index.d.ts.map +1 -1
  30. package/dist/tenants/index.js +1 -0
  31. package/dist/tenants/tenant-storage-usage-apply-delta.dto.d.ts +8 -0
  32. package/dist/tenants/tenant-storage-usage-apply-delta.dto.d.ts.map +1 -0
  33. package/dist/tenants/tenant-storage-usage-apply-delta.dto.js +40 -0
  34. package/package.json +1 -1
  35. package/src/configurations/configuration-tenant-summary.dto.ts +24 -0
  36. package/src/configurations/index.ts +1 -0
  37. package/src/configurations/plan-summary.dto.ts +12 -0
  38. package/src/configurations/tenant-limits-summary.dto.ts +6 -0
  39. package/src/configurations/tenant-storage-usage-summary.dto.ts +10 -0
  40. package/src/notifications/index.ts +2 -0
  41. package/src/notifications/notifications-kafka-topics.ts +3 -0
  42. package/src/notifications/register-push-token.dto.ts +16 -0
  43. package/src/storage/presign-upload.dto.ts +43 -1
  44. package/src/tenants/index.ts +1 -0
  45. package/src/tenants/tenant-storage-usage-apply-delta.dto.ts +23 -0
@@ -1,5 +1,6 @@
1
1
  import { PlanSummaryDto } from './plan-summary.dto';
2
2
  import { TenantLimitsSummaryDto } from './tenant-limits-summary.dto';
3
+ import { TenantStorageUsageSummaryDto } from './tenant-storage-usage-summary.dto';
3
4
  /**
4
5
  * Tenant branding and subscription info returned with clinic configuration (no DB credentials).
5
6
  */
@@ -12,5 +13,10 @@ export declare class ConfigurationTenantSummaryDto {
12
13
  status: 'active' | 'inactive';
13
14
  plan: PlanSummaryDto | null;
14
15
  limits: TenantLimitsSummaryDto | null;
16
+ storageUsage: TenantStorageUsageSummaryDto | null;
17
+ conversationEffectiveLimitBytes?: string;
18
+ clinicEffectiveLimitBytes?: string;
19
+ extraStorageCharge?: number;
20
+ effectivePlanPrice?: number;
15
21
  }
16
22
  //# sourceMappingURL=configuration-tenant-summary.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration-tenant-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/configuration-tenant-summary.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;GAEG;AACH,qBAAa,6BAA6B;IAExC,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAO9B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAO5B,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACvC"}
1
+ {"version":3,"file":"configuration-tenant-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/configuration-tenant-summary.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF;;GAEG;AACH,qBAAa,6BAA6B;IAExC,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAO9B,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAO5B,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAOtC,YAAY,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAGlD,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAGzC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAKnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
@@ -13,6 +13,7 @@ exports.ConfigurationTenantSummaryDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const plan_summary_dto_1 = require("./plan-summary.dto");
15
15
  const tenant_limits_summary_dto_1 = require("./tenant-limits-summary.dto");
16
+ const tenant_storage_usage_summary_dto_1 = require("./tenant-storage-usage-summary.dto");
16
17
  /**
17
18
  * Tenant branding and subscription info returned with clinic configuration (no DB credentials).
18
19
  */
@@ -25,6 +26,11 @@ class ConfigurationTenantSummaryDto {
25
26
  status;
26
27
  plan;
27
28
  limits;
29
+ storageUsage;
30
+ conversationEffectiveLimitBytes;
31
+ clinicEffectiveLimitBytes;
32
+ extraStorageCharge;
33
+ effectivePlanPrice;
28
34
  }
29
35
  exports.ConfigurationTenantSummaryDto = ConfigurationTenantSummaryDto;
30
36
  __decorate([
@@ -67,3 +73,31 @@ __decorate([
67
73
  }),
68
74
  __metadata("design:type", Object)
69
75
  ], ConfigurationTenantSummaryDto.prototype, "limits", void 0);
76
+ __decorate([
77
+ (0, swagger_1.ApiPropertyOptional)({
78
+ description: 'Uso acumulado por tipo (bytes como string)',
79
+ type: () => tenant_storage_usage_summary_dto_1.TenantStorageUsageSummaryDto,
80
+ nullable: true,
81
+ }),
82
+ __metadata("design:type", Object)
83
+ ], ConfigurationTenantSummaryDto.prototype, "storageUsage", void 0);
84
+ __decorate([
85
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Limite efetivo de conversas em bytes (plano + extras)' }),
86
+ __metadata("design:type", String)
87
+ ], ConfigurationTenantSummaryDto.prototype, "conversationEffectiveLimitBytes", void 0);
88
+ __decorate([
89
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Limite efetivo clínico em bytes (plano + extras)' }),
90
+ __metadata("design:type", String)
91
+ ], ConfigurationTenantSummaryDto.prototype, "clinicEffectiveLimitBytes", void 0);
92
+ __decorate([
93
+ (0, swagger_1.ApiPropertyOptional)({
94
+ description: 'Valor mensal estimado pelos GB extras de armazenamento (soma dos dois tipos)',
95
+ }),
96
+ __metadata("design:type", Number)
97
+ ], ConfigurationTenantSummaryDto.prototype, "extraStorageCharge", void 0);
98
+ __decorate([
99
+ (0, swagger_1.ApiPropertyOptional)({
100
+ description: 'Preço base do plano + extraStorageCharge',
101
+ }),
102
+ __metadata("design:type", Number)
103
+ ], ConfigurationTenantSummaryDto.prototype, "effectivePlanPrice", void 0);
@@ -6,6 +6,7 @@ export * from './ai-tool-policy.enums';
6
6
  export * from './ai-tool-policy.dto';
7
7
  export * from './plan-summary.dto';
8
8
  export * from './tenant-limits-summary.dto';
9
+ export * from './tenant-storage-usage-summary.dto';
9
10
  export * from './configuration-tenant-summary.dto';
10
11
  export * from './clinic-configuration-with-tenant.dto';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
@@ -22,5 +22,6 @@ __exportStar(require("./ai-tool-policy.enums"), exports);
22
22
  __exportStar(require("./ai-tool-policy.dto"), exports);
23
23
  __exportStar(require("./plan-summary.dto"), exports);
24
24
  __exportStar(require("./tenant-limits-summary.dto"), exports);
25
+ __exportStar(require("./tenant-storage-usage-summary.dto"), exports);
25
26
  __exportStar(require("./configuration-tenant-summary.dto"), exports);
26
27
  __exportStar(require("./clinic-configuration-with-tenant.dto"), exports);
@@ -16,6 +16,10 @@ export declare class PlanSummaryDto {
16
16
  maxProcedures: number;
17
17
  monthlyAiTokens: number;
18
18
  monthlyLegalTerms: number;
19
+ conversationStorageGb: number;
20
+ clinicStorageGb: number;
21
+ conversationExtraPricePerGb: number;
22
+ clinicExtraPricePerGb: number;
19
23
  createdAt?: Date;
20
24
  updatedAt?: Date;
21
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plan-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/plan-summary.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,cAAc;IAEzB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,cAAc,EAAE,MAAM,CAAC;IAGvB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAG9B,oBAAoB,EAAE,MAAM,CAAC;IAG7B,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAGtB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,aAAa,EAAE,MAAM,CAAC;IAGtB,eAAe,EAAE,MAAM,CAAC;IAGxB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
1
+ {"version":3,"file":"plan-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/plan-summary.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,cAAc;IAEzB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,cAAc,EAAE,MAAM,CAAC;IAGvB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAG9B,oBAAoB,EAAE,MAAM,CAAC;IAG7B,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAGtB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,aAAa,EAAE,MAAM,CAAC;IAGtB,eAAe,EAAE,MAAM,CAAC;IAGxB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,qBAAqB,EAAE,MAAM,CAAC;IAG9B,eAAe,EAAE,MAAM,CAAC;IAGxB,2BAA2B,EAAE,MAAM,CAAC;IAGpC,qBAAqB,EAAE,MAAM,CAAC;IAG9B,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -29,6 +29,10 @@ class PlanSummaryDto {
29
29
  maxProcedures;
30
30
  monthlyAiTokens;
31
31
  monthlyLegalTerms;
32
+ conversationStorageGb;
33
+ clinicStorageGb;
34
+ conversationExtraPricePerGb;
35
+ clinicExtraPricePerGb;
32
36
  createdAt;
33
37
  updatedAt;
34
38
  }
@@ -89,6 +93,22 @@ __decorate([
89
93
  (0, swagger_1.ApiProperty)({ description: 'Max legal term dispatches per calendar month (UTC)', example: 100 }),
90
94
  __metadata("design:type", Number)
91
95
  ], PlanSummaryDto.prototype, "monthlyLegalTerms", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({ description: 'Franquia base de armazenamento de conversas (GB)', example: 1 }),
98
+ __metadata("design:type", Number)
99
+ ], PlanSummaryDto.prototype, "conversationStorageGb", void 0);
100
+ __decorate([
101
+ (0, swagger_1.ApiProperty)({ description: 'Franquia base de armazenamento clínico (GB)', example: 1 }),
102
+ __metadata("design:type", Number)
103
+ ], PlanSummaryDto.prototype, "clinicStorageGb", void 0);
104
+ __decorate([
105
+ (0, swagger_1.ApiProperty)({ description: 'Preço unitário por GB extra de conversas', example: 0 }),
106
+ __metadata("design:type", Number)
107
+ ], PlanSummaryDto.prototype, "conversationExtraPricePerGb", void 0);
108
+ __decorate([
109
+ (0, swagger_1.ApiProperty)({ description: 'Preço unitário por GB extra clínico', example: 0 }),
110
+ __metadata("design:type", Number)
111
+ ], PlanSummaryDto.prototype, "clinicExtraPricePerGb", void 0);
92
112
  __decorate([
93
113
  (0, swagger_1.ApiPropertyOptional)(),
94
114
  __metadata("design:type", Date)
@@ -11,5 +11,7 @@ export declare class TenantLimitsSummaryDto {
11
11
  maxWhatsappInstances: number | null;
12
12
  maxUnits: number | null;
13
13
  monthlyLegalTerms: number | null;
14
+ extraConversationStorageGb: number;
15
+ extraClinicStorageGb: number;
14
16
  }
15
17
  //# sourceMappingURL=tenant-limits-summary.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenant-limits-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/tenant-limits-summary.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,sBAAsB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
1
+ {"version":3,"file":"tenant-limits-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/tenant-limits-summary.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,sBAAsB;IAEjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,0BAA0B,EAAE,MAAM,CAAC;IAGnC,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
@@ -24,6 +24,8 @@ class TenantLimitsSummaryDto {
24
24
  maxWhatsappInstances;
25
25
  maxUnits;
26
26
  monthlyLegalTerms;
27
+ extraConversationStorageGb;
28
+ extraClinicStorageGb;
27
29
  }
28
30
  exports.TenantLimitsSummaryDto = TenantLimitsSummaryDto;
29
31
  __decorate([
@@ -62,3 +64,11 @@ __decorate([
62
64
  (0, swagger_1.ApiPropertyOptional)({ description: 'Override max legal term dispatches per month (UTC)' }),
63
65
  __metadata("design:type", Object)
64
66
  ], TenantLimitsSummaryDto.prototype, "monthlyLegalTerms", void 0);
67
+ __decorate([
68
+ (0, swagger_1.ApiPropertyOptional)({ description: 'GB extras de armazenamento de conversas (somados ao plano)', default: 0 }),
69
+ __metadata("design:type", Number)
70
+ ], TenantLimitsSummaryDto.prototype, "extraConversationStorageGb", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiPropertyOptional)({ description: 'GB extras de armazenamento clínico (somados ao plano)', default: 0 }),
73
+ __metadata("design:type", Number)
74
+ ], TenantLimitsSummaryDto.prototype, "extraClinicStorageGb", void 0);
@@ -0,0 +1,6 @@
1
+ /** Uso acumulado de armazenamento (core DB), exposto no resumo de configuração. */
2
+ export declare class TenantStorageUsageSummaryDto {
3
+ conversationUsedBytes: string;
4
+ clinicUsedBytes: string;
5
+ }
6
+ //# sourceMappingURL=tenant-storage-usage-summary.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant-storage-usage-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/tenant-storage-usage-summary.dto.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,qBAAa,4BAA4B;IAEvC,qBAAqB,EAAE,MAAM,CAAC;IAG9B,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,27 @@
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.TenantStorageUsageSummaryDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ /** Uso acumulado de armazenamento (core DB), exposto no resumo de configuração. */
15
+ class TenantStorageUsageSummaryDto {
16
+ conversationUsedBytes;
17
+ clinicUsedBytes;
18
+ }
19
+ exports.TenantStorageUsageSummaryDto = TenantStorageUsageSummaryDto;
20
+ __decorate([
21
+ (0, swagger_1.ApiProperty)({ description: 'Bytes usados em mídia de conversas', example: '0' }),
22
+ __metadata("design:type", String)
23
+ ], TenantStorageUsageSummaryDto.prototype, "conversationUsedBytes", void 0);
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({ description: 'Bytes usados em armazenamento clínico', example: '0' }),
26
+ __metadata("design:type", String)
27
+ ], TenantStorageUsageSummaryDto.prototype, "clinicUsedBytes", void 0);
@@ -1,7 +1,7 @@
1
1
  export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationConversationChangeToHumanEventPayload, NotificationTenantAiTokensThresholdEventPayload, } from './notifications-kafka.payloads';
2
- export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_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_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
- export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, } from './register-push-token.dto';
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';
6
6
  export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto';
7
7
  export { NotificationListItemDto } from './notification-list-item.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,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,GACvC,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,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,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.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_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
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.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; } });
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "NotificationTenantAiTokensThresholdEventPayload"
9
9
  var notifications_kafka_topics_1 = require("./notifications-kafka-topics");
10
10
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_FIND_ALL; } });
11
11
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
12
+ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN; } });
12
13
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UPDATE_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UPDATE_VIEWED; } });
13
14
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER; } });
14
15
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH; } });
@@ -21,6 +22,7 @@ Object.defineProperty(exports, "ADMIN_NOTIFICATION_KINDS", { enumerable: true, g
21
22
  var register_push_token_dto_1 = require("./register-push-token.dto");
22
23
  Object.defineProperty(exports, "RegisterPushTokenDto", { enumerable: true, get: function () { return register_push_token_dto_1.RegisterPushTokenDto; } });
23
24
  Object.defineProperty(exports, "NotificationsRegisterPushTokenKafkaDto", { enumerable: true, get: function () { return register_push_token_dto_1.NotificationsRegisterPushTokenKafkaDto; } });
25
+ Object.defineProperty(exports, "NotificationsUnregisterPushTokenKafkaDto", { enumerable: true, get: function () { return register_push_token_dto_1.NotificationsUnregisterPushTokenKafkaDto; } });
24
26
  var list_notifications_query_dto_1 = require("./list-notifications-query.dto");
25
27
  Object.defineProperty(exports, "ListNotificationsQueryDto", { enumerable: true, get: function () { return list_notifications_query_dto_1.ListNotificationsQueryDto; } });
26
28
  Object.defineProperty(exports, "NOTIFICATION_PROVIDER_FILTERS", { enumerable: true, get: function () { return list_notifications_query_dto_1.NOTIFICATION_PROVIDER_FILTERS; } });
@@ -1,6 +1,7 @@
1
1
  /** Kafka request–reply: lista notificações persistidas no banco do tenant. */
2
2
  export declare const TOPIC_NOTIFICATIONS_FIND_ALL = "notifications.findAll";
3
3
  export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.registerPushToken";
4
+ export declare const TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = "notifications.unregisterPushToken";
4
5
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
5
6
  export declare const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = "notifications.updateViewed";
6
7
  /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
@@ -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,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,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,9 +1,10 @@
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_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_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
+ exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = 'notifications.unregisterPushToken';
7
8
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
8
9
  exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
9
10
  /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
@@ -12,4 +12,12 @@ export declare class NotificationsRegisterPushTokenKafkaDto {
12
12
  userId: string;
13
13
  payload: RegisterPushTokenDto;
14
14
  }
15
+ /**
16
+ * Payload Kafka `notifications.unregisterPushToken`.
17
+ */
18
+ export declare class NotificationsUnregisterPushTokenKafkaDto {
19
+ tenant: string;
20
+ userId: string;
21
+ payload: RegisterPushTokenDto;
22
+ }
15
23
  //# sourceMappingURL=register-push-token.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-push-token.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/register-push-token.dto.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,qBAAa,oBAAoB;IAS/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,sCAAsC;IAGjD,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,oBAAoB,CAAC;CAC/B"}
1
+ {"version":3,"file":"register-push-token.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/register-push-token.dto.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,qBAAa,oBAAoB;IAS/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,sCAAsC;IAGjD,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED;;GAEG;AACH,qBAAa,wCAAwC;IAGnD,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,oBAAoB,CAAC;CAC/B"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = void 0;
12
+ exports.NotificationsUnregisterPushTokenKafkaDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
@@ -54,3 +54,26 @@ __decorate([
54
54
  (0, class_transformer_1.Type)(() => RegisterPushTokenDto),
55
55
  __metadata("design:type", RegisterPushTokenDto)
56
56
  ], NotificationsRegisterPushTokenKafkaDto.prototype, "payload", void 0);
57
+ /**
58
+ * Payload Kafka `notifications.unregisterPushToken`.
59
+ */
60
+ class NotificationsUnregisterPushTokenKafkaDto {
61
+ tenant;
62
+ userId;
63
+ payload;
64
+ }
65
+ exports.NotificationsUnregisterPushTokenKafkaDto = NotificationsUnregisterPushTokenKafkaDto;
66
+ __decorate([
67
+ (0, class_validator_1.IsString)(),
68
+ (0, class_validator_1.IsNotEmpty)(),
69
+ __metadata("design:type", String)
70
+ ], NotificationsUnregisterPushTokenKafkaDto.prototype, "tenant", void 0);
71
+ __decorate([
72
+ (0, class_validator_1.IsUUID)('4'),
73
+ __metadata("design:type", String)
74
+ ], NotificationsUnregisterPushTokenKafkaDto.prototype, "userId", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.ValidateNested)(),
77
+ (0, class_transformer_1.Type)(() => RegisterPushTokenDto),
78
+ __metadata("design:type", RegisterPushTokenDto)
79
+ ], NotificationsUnregisterPushTokenKafkaDto.prototype, "payload", void 0);
@@ -2,5 +2,8 @@ export declare class PresignUploadDto {
2
2
  key: string;
3
3
  contentType: string;
4
4
  expiresInSeconds?: number;
5
+ fileSizeBytes?: number;
6
+ storageKind?: 'conversation' | 'clinic';
7
+ tenantSlug?: string;
5
8
  }
6
9
  //# sourceMappingURL=presign-upload.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presign-upload.dto.d.ts","sourceRoot":"","sources":["../../src/storage/presign-upload.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,gBAAgB;IAQ3B,GAAG,EAAE,MAAM,CAAC;IAQZ,WAAW,EAAE,MAAM,CAAC;IAYpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
1
+ {"version":3,"file":"presign-upload.dto.d.ts","sourceRoot":"","sources":["../../src/storage/presign-upload.dto.ts"],"names":[],"mappings":"AAaA,qBAAa,gBAAgB;IAQ3B,GAAG,EAAE,MAAM,CAAC;IAQZ,WAAW,EAAE,MAAM,CAAC;IAYpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAW1B,aAAa,CAAC,EAAE,MAAM,CAAC;IAUvB,WAAW,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC;IAWxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -16,6 +16,9 @@ class PresignUploadDto {
16
16
  key;
17
17
  contentType;
18
18
  expiresInSeconds;
19
+ fileSizeBytes;
20
+ storageKind;
21
+ tenantSlug;
19
22
  }
20
23
  exports.PresignUploadDto = PresignUploadDto;
21
24
  __decorate([
@@ -50,3 +53,35 @@ __decorate([
50
53
  (0, class_validator_1.Max)(604800),
51
54
  __metadata("design:type", Number)
52
55
  ], PresignUploadDto.prototype, "expiresInSeconds", void 0);
56
+ __decorate([
57
+ (0, swagger_1.ApiPropertyOptional)({
58
+ description: 'Tamanho em bytes (obrigatório para uploads que persistem no DB do tenant e contam na cota)',
59
+ example: 524288,
60
+ minimum: 1,
61
+ }),
62
+ (0, class_validator_1.ValidateIf)((_o, v) => v !== undefined && v !== null),
63
+ (0, class_validator_1.IsInt)(),
64
+ (0, class_validator_1.Min)(1),
65
+ __metadata("design:type", Number)
66
+ ], PresignUploadDto.prototype, "fileSizeBytes", void 0);
67
+ __decorate([
68
+ (0, swagger_1.ApiPropertyOptional)({
69
+ description: 'conversation = mídia de conversas; clinic = exames/documentos clínicos',
70
+ enum: ['conversation', 'clinic'],
71
+ default: 'conversation',
72
+ }),
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_validator_1.IsIn)(['conversation', 'clinic']),
75
+ __metadata("design:type", String)
76
+ ], PresignUploadDto.prototype, "storageKind", void 0);
77
+ __decorate([
78
+ (0, swagger_1.ApiPropertyOptional)({
79
+ description: 'Slug do tenant quando o token de sistema é usado sem host {slug}-storage (ex.: chamadas internas). Se enviado, tem precedência sobre o host.',
80
+ example: 'clinica_demo',
81
+ maxLength: 255,
82
+ }),
83
+ (0, class_validator_1.IsOptional)(),
84
+ (0, class_validator_1.IsString)(),
85
+ (0, class_validator_1.MaxLength)(255),
86
+ __metadata("design:type", String)
87
+ ], PresignUploadDto.prototype, "tenantSlug", void 0);
@@ -7,4 +7,5 @@ export * from './tenant-ai-token-state.dto';
7
7
  export * from './consume-tenant-ai-tokens.dto';
8
8
  export * from './recharge-tenant-ai-tokens.dto';
9
9
  export * from './renew-tenant-ai-tokens.dto';
10
+ export * from './tenant-storage-usage-apply-delta.dto';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tenants/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tenants/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC"}
@@ -23,3 +23,4 @@ __exportStar(require("./tenant-ai-token-state.dto"), exports);
23
23
  __exportStar(require("./consume-tenant-ai-tokens.dto"), exports);
24
24
  __exportStar(require("./recharge-tenant-ai-tokens.dto"), exports);
25
25
  __exportStar(require("./renew-tenant-ai-tokens.dto"), exports);
26
+ __exportStar(require("./tenant-storage-usage-apply-delta.dto"), exports);
@@ -0,0 +1,8 @@
1
+ export type TenantStorageUsageKind = 'conversation' | 'clinic';
2
+ /** Payload para `tenant.storageUsage.applyDelta` (RMQ/Kafka). */
3
+ export declare class TenantStorageUsageApplyDeltaDto {
4
+ tenantSlug: string;
5
+ kind: TenantStorageUsageKind;
6
+ deltaBytes: number;
7
+ }
8
+ //# sourceMappingURL=tenant-storage-usage-apply-delta.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant-storage-usage-apply-delta.dto.d.ts","sourceRoot":"","sources":["../../src/tenants/tenant-storage-usage-apply-delta.dto.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE/D,iEAAiE;AACjE,qBAAa,+BAA+B;IAI1C,UAAU,EAAE,MAAM,CAAC;IAInB,IAAI,EAAE,sBAAsB,CAAC;IAO7B,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,40 @@
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.TenantStorageUsageApplyDeltaDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Payload para `tenant.storageUsage.applyDelta` (RMQ/Kafka). */
16
+ class TenantStorageUsageApplyDeltaDto {
17
+ tenantSlug;
18
+ kind;
19
+ deltaBytes;
20
+ }
21
+ exports.TenantStorageUsageApplyDeltaDto = TenantStorageUsageApplyDeltaDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({ example: 'acme' }),
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.MaxLength)(255),
26
+ __metadata("design:type", String)
27
+ ], TenantStorageUsageApplyDeltaDto.prototype, "tenantSlug", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ enum: ['conversation', 'clinic'] }),
30
+ (0, class_validator_1.IsIn)(['conversation', 'clinic']),
31
+ __metadata("design:type", String)
32
+ ], TenantStorageUsageApplyDeltaDto.prototype, "kind", void 0);
33
+ __decorate([
34
+ (0, swagger_1.ApiProperty)({
35
+ description: 'Positivo após upload persistido; negativo após exclusão.',
36
+ example: 1024,
37
+ }),
38
+ (0, class_validator_1.IsInt)(),
39
+ __metadata("design:type", Number)
40
+ ], TenantStorageUsageApplyDeltaDto.prototype, "deltaBytes", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import { PlanSummaryDto } from './plan-summary.dto';
3
3
  import { TenantLimitsSummaryDto } from './tenant-limits-summary.dto';
4
+ import { TenantStorageUsageSummaryDto } from './tenant-storage-usage-summary.dto';
4
5
 
5
6
  /**
6
7
  * Tenant branding and subscription info returned with clinic configuration (no DB credentials).
@@ -37,4 +38,27 @@ export class ConfigurationTenantSummaryDto {
37
38
  nullable: true,
38
39
  })
39
40
  limits: TenantLimitsSummaryDto | null;
41
+
42
+ @ApiPropertyOptional({
43
+ description: 'Uso acumulado por tipo (bytes como string)',
44
+ type: () => TenantStorageUsageSummaryDto,
45
+ nullable: true,
46
+ })
47
+ storageUsage: TenantStorageUsageSummaryDto | null;
48
+
49
+ @ApiPropertyOptional({ description: 'Limite efetivo de conversas em bytes (plano + extras)' })
50
+ conversationEffectiveLimitBytes?: string;
51
+
52
+ @ApiPropertyOptional({ description: 'Limite efetivo clínico em bytes (plano + extras)' })
53
+ clinicEffectiveLimitBytes?: string;
54
+
55
+ @ApiPropertyOptional({
56
+ description: 'Valor mensal estimado pelos GB extras de armazenamento (soma dos dois tipos)',
57
+ })
58
+ extraStorageCharge?: number;
59
+
60
+ @ApiPropertyOptional({
61
+ description: 'Preço base do plano + extraStorageCharge',
62
+ })
63
+ effectivePlanPrice?: number;
40
64
  }
@@ -6,5 +6,6 @@ export * from './ai-tool-policy.enums';
6
6
  export * from './ai-tool-policy.dto';
7
7
  export * from './plan-summary.dto';
8
8
  export * from './tenant-limits-summary.dto';
9
+ export * from './tenant-storage-usage-summary.dto';
9
10
  export * from './configuration-tenant-summary.dto';
10
11
  export * from './clinic-configuration-with-tenant.dto';
@@ -46,6 +46,18 @@ export class PlanSummaryDto {
46
46
  @ApiProperty({ description: 'Max legal term dispatches per calendar month (UTC)', example: 100 })
47
47
  monthlyLegalTerms: number;
48
48
 
49
+ @ApiProperty({ description: 'Franquia base de armazenamento de conversas (GB)', example: 1 })
50
+ conversationStorageGb: number;
51
+
52
+ @ApiProperty({ description: 'Franquia base de armazenamento clínico (GB)', example: 1 })
53
+ clinicStorageGb: number;
54
+
55
+ @ApiProperty({ description: 'Preço unitário por GB extra de conversas', example: 0 })
56
+ conversationExtraPricePerGb: number;
57
+
58
+ @ApiProperty({ description: 'Preço unitário por GB extra clínico', example: 0 })
59
+ clinicExtraPricePerGb: number;
60
+
49
61
  @ApiPropertyOptional()
50
62
  createdAt?: Date;
51
63
 
@@ -30,4 +30,10 @@ export class TenantLimitsSummaryDto {
30
30
 
31
31
  @ApiPropertyOptional({ description: 'Override max legal term dispatches per month (UTC)' })
32
32
  monthlyLegalTerms: number | null;
33
+
34
+ @ApiPropertyOptional({ description: 'GB extras de armazenamento de conversas (somados ao plano)', default: 0 })
35
+ extraConversationStorageGb: number;
36
+
37
+ @ApiPropertyOptional({ description: 'GB extras de armazenamento clínico (somados ao plano)', default: 0 })
38
+ extraClinicStorageGb: number;
33
39
  }
@@ -0,0 +1,10 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+
3
+ /** Uso acumulado de armazenamento (core DB), exposto no resumo de configuração. */
4
+ export class TenantStorageUsageSummaryDto {
5
+ @ApiProperty({ description: 'Bytes usados em mídia de conversas', example: '0' })
6
+ conversationUsedBytes: string;
7
+
8
+ @ApiProperty({ description: 'Bytes usados em armazenamento clínico', example: '0' })
9
+ clinicUsedBytes: string;
10
+ }
@@ -7,6 +7,7 @@ export {
7
7
  export {
8
8
  TOPIC_NOTIFICATIONS_FIND_ALL,
9
9
  TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
10
+ TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN,
10
11
  TOPIC_NOTIFICATIONS_UPDATE_VIEWED,
11
12
  TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER,
12
13
  EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH,
@@ -22,6 +23,7 @@ export {
22
23
  export {
23
24
  RegisterPushTokenDto,
24
25
  NotificationsRegisterPushTokenKafkaDto,
26
+ NotificationsUnregisterPushTokenKafkaDto,
25
27
  } from './register-push-token.dto';
26
28
  export {
27
29
  ListNotificationsQueryDto,
@@ -4,6 +4,9 @@ export const TOPIC_NOTIFICATIONS_FIND_ALL = 'notifications.findAll';
4
4
  export const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN =
5
5
  'notifications.registerPushToken';
6
6
 
7
+ export const TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN =
8
+ 'notifications.unregisterPushToken';
9
+
7
10
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
8
11
  export const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
9
12
 
@@ -38,3 +38,19 @@ export class NotificationsRegisterPushTokenKafkaDto {
38
38
  @Type(() => RegisterPushTokenDto)
39
39
  payload: RegisterPushTokenDto;
40
40
  }
41
+
42
+ /**
43
+ * Payload Kafka `notifications.unregisterPushToken`.
44
+ */
45
+ export class NotificationsUnregisterPushTokenKafkaDto {
46
+ @IsString()
47
+ @IsNotEmpty()
48
+ tenant: string;
49
+
50
+ @IsUUID('4')
51
+ userId: string;
52
+
53
+ @ValidateNested()
54
+ @Type(() => RegisterPushTokenDto)
55
+ payload: RegisterPushTokenDto;
56
+ }
@@ -1,5 +1,15 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { IsInt, IsNotEmpty, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
2
+ import {
3
+ IsIn,
4
+ IsInt,
5
+ IsNotEmpty,
6
+ IsOptional,
7
+ IsString,
8
+ Max,
9
+ MaxLength,
10
+ Min,
11
+ ValidateIf,
12
+ } from 'class-validator';
3
13
 
4
14
  export class PresignUploadDto {
5
15
  @ApiProperty({
@@ -30,4 +40,36 @@ export class PresignUploadDto {
30
40
  @Min(60)
31
41
  @Max(604800)
32
42
  expiresInSeconds?: number;
43
+
44
+ @ApiPropertyOptional({
45
+ description:
46
+ 'Tamanho em bytes (obrigatório para uploads que persistem no DB do tenant e contam na cota)',
47
+ example: 524288,
48
+ minimum: 1,
49
+ })
50
+ @ValidateIf((_o, v) => v !== undefined && v !== null)
51
+ @IsInt()
52
+ @Min(1)
53
+ fileSizeBytes?: number;
54
+
55
+ @ApiPropertyOptional({
56
+ description:
57
+ 'conversation = mídia de conversas; clinic = exames/documentos clínicos',
58
+ enum: ['conversation', 'clinic'],
59
+ default: 'conversation',
60
+ })
61
+ @IsOptional()
62
+ @IsIn(['conversation', 'clinic'])
63
+ storageKind?: 'conversation' | 'clinic';
64
+
65
+ @ApiPropertyOptional({
66
+ description:
67
+ 'Slug do tenant quando o token de sistema é usado sem host {slug}-storage (ex.: chamadas internas). Se enviado, tem precedência sobre o host.',
68
+ example: 'clinica_demo',
69
+ maxLength: 255,
70
+ })
71
+ @IsOptional()
72
+ @IsString()
73
+ @MaxLength(255)
74
+ tenantSlug?: string;
33
75
  }
@@ -7,3 +7,4 @@ export * from './tenant-ai-token-state.dto';
7
7
  export * from './consume-tenant-ai-tokens.dto';
8
8
  export * from './recharge-tenant-ai-tokens.dto';
9
9
  export * from './renew-tenant-ai-tokens.dto';
10
+ export * from './tenant-storage-usage-apply-delta.dto';
@@ -0,0 +1,23 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsIn, IsInt, IsString, MaxLength, Min } from 'class-validator';
3
+
4
+ export type TenantStorageUsageKind = 'conversation' | 'clinic';
5
+
6
+ /** Payload para `tenant.storageUsage.applyDelta` (RMQ/Kafka). */
7
+ export class TenantStorageUsageApplyDeltaDto {
8
+ @ApiProperty({ example: 'acme' })
9
+ @IsString()
10
+ @MaxLength(255)
11
+ tenantSlug: string;
12
+
13
+ @ApiProperty({ enum: ['conversation', 'clinic'] })
14
+ @IsIn(['conversation', 'clinic'])
15
+ kind: TenantStorageUsageKind;
16
+
17
+ @ApiProperty({
18
+ description: 'Positivo após upload persistido; negativo após exclusão.',
19
+ example: 1024,
20
+ })
21
+ @IsInt()
22
+ deltaBytes: number;
23
+ }