tychat-contracts 1.6.4 → 1.6.7
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/configurations/app-module-policy.dto.d.ts +23 -0
- package/dist/configurations/app-module-policy.dto.d.ts.map +1 -0
- package/dist/configurations/app-module-policy.dto.js +95 -0
- package/dist/configurations/app-module-policy.enums.d.ts +9 -0
- package/dist/configurations/app-module-policy.enums.d.ts.map +1 -0
- package/dist/configurations/app-module-policy.enums.js +29 -0
- package/dist/configurations/configuration-tenant-summary.dto.d.ts +2 -0
- package/dist/configurations/configuration-tenant-summary.dto.d.ts.map +1 -1
- package/dist/configurations/configuration-tenant-summary.dto.js +9 -0
- package/dist/configurations/index.d.ts +2 -0
- package/dist/configurations/index.d.ts.map +1 -1
- package/dist/configurations/index.js +2 -0
- package/package.json +1 -1
- package/src/configurations/app-module-policy.dto.ts +72 -0
- package/src/configurations/app-module-policy.enums.ts +30 -0
- package/src/configurations/configuration-tenant-summary.dto.ts +79 -72
- package/src/configurations/index.ts +2 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type TychatAppModuleKey, type TychatAppModulePolicyLevel } from './app-module-policy.enums';
|
|
2
|
+
export declare class AppModulePolicyDto {
|
|
3
|
+
moduleKey: TychatAppModuleKey;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
level?: TychatAppModulePolicyLevel;
|
|
6
|
+
}
|
|
7
|
+
export declare class UpdateAppModulePolicyDto {
|
|
8
|
+
moduleKey: TychatAppModuleKey;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class UpdateAppModulePoliciesDto {
|
|
12
|
+
policies: UpdateAppModulePolicyDto[];
|
|
13
|
+
}
|
|
14
|
+
export declare class ResolveAppModulePoliciesQueryDto {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class EffectiveAppModulePolicyDto extends AppModulePolicyDto {
|
|
18
|
+
reasonCode?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class EffectiveAppModulePoliciesDto {
|
|
21
|
+
policies: EffectiveAppModulePolicyDto[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=app-module-policy.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-module-policy.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/app-module-policy.dto.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,kBAAkB;IAG7B,SAAS,EAAE,kBAAkB,CAAC;IAI9B,OAAO,EAAE,OAAO,CAAC;IAKjB,KAAK,CAAC,EAAE,0BAA0B,CAAC;CACpC;AAED,qBAAa,wBAAwB;IAGnC,SAAS,EAAE,kBAAkB,CAAC;IAI9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,0BAA0B;IAKrC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;CACtC;AAED,qBAAa,gCAAgC;IAI3C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,2BAA4B,SAAQ,kBAAkB;IAIjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,6BAA6B;IAKxC,QAAQ,EAAE,2BAA2B,EAAE,CAAC;CACzC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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.EffectiveAppModulePoliciesDto = exports.EffectiveAppModulePolicyDto = exports.ResolveAppModulePoliciesQueryDto = exports.UpdateAppModulePoliciesDto = exports.UpdateAppModulePolicyDto = exports.AppModulePolicyDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const app_module_policy_enums_1 = require("./app-module-policy.enums");
|
|
17
|
+
class AppModulePolicyDto {
|
|
18
|
+
moduleKey;
|
|
19
|
+
enabled;
|
|
20
|
+
level;
|
|
21
|
+
}
|
|
22
|
+
exports.AppModulePolicyDto = AppModulePolicyDto;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, swagger_1.ApiProperty)({ enum: app_module_policy_enums_1.TYCHAT_APP_MODULE_KEYS }),
|
|
25
|
+
(0, class_validator_1.IsEnum)(app_module_policy_enums_1.TYCHAT_APP_MODULE_KEYS),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AppModulePolicyDto.prototype, "moduleKey", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiProperty)(),
|
|
30
|
+
(0, class_validator_1.IsBoolean)(),
|
|
31
|
+
__metadata("design:type", Boolean)
|
|
32
|
+
], AppModulePolicyDto.prototype, "enabled", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: app_module_policy_enums_1.TYCHAT_APP_MODULE_POLICY_LEVELS }),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsEnum)(app_module_policy_enums_1.TYCHAT_APP_MODULE_POLICY_LEVELS),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AppModulePolicyDto.prototype, "level", void 0);
|
|
39
|
+
class UpdateAppModulePolicyDto {
|
|
40
|
+
moduleKey;
|
|
41
|
+
enabled;
|
|
42
|
+
}
|
|
43
|
+
exports.UpdateAppModulePolicyDto = UpdateAppModulePolicyDto;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({ enum: app_module_policy_enums_1.TYCHAT_APP_MODULE_KEYS }),
|
|
46
|
+
(0, class_validator_1.IsEnum)(app_module_policy_enums_1.TYCHAT_APP_MODULE_KEYS),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], UpdateAppModulePolicyDto.prototype, "moduleKey", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)(),
|
|
51
|
+
(0, class_validator_1.IsBoolean)(),
|
|
52
|
+
__metadata("design:type", Boolean)
|
|
53
|
+
], UpdateAppModulePolicyDto.prototype, "enabled", void 0);
|
|
54
|
+
class UpdateAppModulePoliciesDto {
|
|
55
|
+
policies;
|
|
56
|
+
}
|
|
57
|
+
exports.UpdateAppModulePoliciesDto = UpdateAppModulePoliciesDto;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({ type: () => [UpdateAppModulePolicyDto] }),
|
|
60
|
+
(0, class_validator_1.IsArray)(),
|
|
61
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
62
|
+
(0, class_transformer_1.Type)(() => UpdateAppModulePolicyDto),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], UpdateAppModulePoliciesDto.prototype, "policies", void 0);
|
|
65
|
+
class ResolveAppModulePoliciesQueryDto {
|
|
66
|
+
tenantId;
|
|
67
|
+
}
|
|
68
|
+
exports.ResolveAppModulePoliciesQueryDto = ResolveAppModulePoliciesQueryDto;
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)(),
|
|
71
|
+
(0, class_validator_1.IsString)(),
|
|
72
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], ResolveAppModulePoliciesQueryDto.prototype, "tenantId", void 0);
|
|
75
|
+
class EffectiveAppModulePolicyDto extends AppModulePolicyDto {
|
|
76
|
+
reasonCode;
|
|
77
|
+
}
|
|
78
|
+
exports.EffectiveAppModulePolicyDto = EffectiveAppModulePolicyDto;
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
(0, class_validator_1.IsString)(),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], EffectiveAppModulePolicyDto.prototype, "reasonCode", void 0);
|
|
85
|
+
class EffectiveAppModulePoliciesDto {
|
|
86
|
+
policies;
|
|
87
|
+
}
|
|
88
|
+
exports.EffectiveAppModulePoliciesDto = EffectiveAppModulePoliciesDto;
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, swagger_1.ApiProperty)({ type: () => [EffectiveAppModulePolicyDto] }),
|
|
91
|
+
(0, class_validator_1.IsArray)(),
|
|
92
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
93
|
+
(0, class_transformer_1.Type)(() => EffectiveAppModulePolicyDto),
|
|
94
|
+
__metadata("design:type", Array)
|
|
95
|
+
], EffectiveAppModulePoliciesDto.prototype, "policies", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Módulos da aplicação web do tenant (Tychat-v2), controlados por plano e override por tenant.
|
|
3
|
+
* Valores estáveis para API e persistência.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TYCHAT_APP_MODULE_KEYS: readonly ["dashboard", "check_in", "check_out", "schedule", "conversations", "patients", "patients_documents", "patients_legal_terms", "clinic_legal_terms", "patients_anamneses", "clinic_anamneses", "ai_conversation", "follow_up", "funnel", "satisfaction", "clinic", "billings", "connections", "settings"];
|
|
6
|
+
export type TychatAppModuleKey = (typeof TYCHAT_APP_MODULE_KEYS)[number];
|
|
7
|
+
export declare const TYCHAT_APP_MODULE_POLICY_LEVELS: readonly ["default", "plan", "tenant"];
|
|
8
|
+
export type TychatAppModulePolicyLevel = (typeof TYCHAT_APP_MODULE_POLICY_LEVELS)[number];
|
|
9
|
+
//# sourceMappingURL=app-module-policy.enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-module-policy.enums.d.ts","sourceRoot":"","sources":["../../src/configurations/app-module-policy.enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,mTAoBzB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,eAAO,MAAM,+BAA+B,wCAAyC,CAAC;AACtF,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TYCHAT_APP_MODULE_POLICY_LEVELS = exports.TYCHAT_APP_MODULE_KEYS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Módulos da aplicação web do tenant (Tychat-v2), controlados por plano e override por tenant.
|
|
6
|
+
* Valores estáveis para API e persistência.
|
|
7
|
+
*/
|
|
8
|
+
exports.TYCHAT_APP_MODULE_KEYS = [
|
|
9
|
+
'dashboard',
|
|
10
|
+
'check_in',
|
|
11
|
+
'check_out',
|
|
12
|
+
'schedule',
|
|
13
|
+
'conversations',
|
|
14
|
+
'patients',
|
|
15
|
+
'patients_documents',
|
|
16
|
+
'patients_legal_terms',
|
|
17
|
+
'clinic_legal_terms',
|
|
18
|
+
'patients_anamneses',
|
|
19
|
+
'clinic_anamneses',
|
|
20
|
+
'ai_conversation',
|
|
21
|
+
'follow_up',
|
|
22
|
+
'funnel',
|
|
23
|
+
'satisfaction',
|
|
24
|
+
'clinic',
|
|
25
|
+
'billings',
|
|
26
|
+
'connections',
|
|
27
|
+
'settings',
|
|
28
|
+
];
|
|
29
|
+
exports.TYCHAT_APP_MODULE_POLICY_LEVELS = ['default', 'plan', 'tenant'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TenantAiTokenStateDto } from '../tenants/tenant-ai-token-state.dto';
|
|
2
|
+
import { EffectiveAppModulePolicyDto } from './app-module-policy.dto';
|
|
2
3
|
import { PlanSummaryDto } from './plan-summary.dto';
|
|
3
4
|
import { TenantLimitsSummaryDto } from './tenant-limits-summary.dto';
|
|
4
5
|
import { TenantStorageUsageSummaryDto } from './tenant-storage-usage-summary.dto';
|
|
@@ -20,5 +21,6 @@ export declare class ConfigurationTenantSummaryDto {
|
|
|
20
21
|
clinicEffectiveLimitBytes?: string;
|
|
21
22
|
extraStorageCharge?: number;
|
|
22
23
|
effectivePlanPrice?: number;
|
|
24
|
+
appModules?: EffectiveAppModulePolicyDto[];
|
|
23
25
|
}
|
|
24
26
|
//# 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,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,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;IAOlD,YAAY,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAG5C,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAGzC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAKnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration-tenant-summary.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/configuration-tenant-summary.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,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;IAOlD,YAAY,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAG5C,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAGzC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAKnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAM5B,UAAU,CAAC,EAAE,2BAA2B,EAAE,CAAC;CAC5C"}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ConfigurationTenantSummaryDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const tenant_ai_token_state_dto_1 = require("../tenants/tenant-ai-token-state.dto");
|
|
15
|
+
const app_module_policy_dto_1 = require("./app-module-policy.dto");
|
|
15
16
|
const plan_summary_dto_1 = require("./plan-summary.dto");
|
|
16
17
|
const tenant_limits_summary_dto_1 = require("./tenant-limits-summary.dto");
|
|
17
18
|
const tenant_storage_usage_summary_dto_1 = require("./tenant-storage-usage-summary.dto");
|
|
@@ -33,6 +34,7 @@ class ConfigurationTenantSummaryDto {
|
|
|
33
34
|
clinicEffectiveLimitBytes;
|
|
34
35
|
extraStorageCharge;
|
|
35
36
|
effectivePlanPrice;
|
|
37
|
+
appModules;
|
|
36
38
|
}
|
|
37
39
|
exports.ConfigurationTenantSummaryDto = ConfigurationTenantSummaryDto;
|
|
38
40
|
__decorate([
|
|
@@ -111,3 +113,10 @@ __decorate([
|
|
|
111
113
|
}),
|
|
112
114
|
__metadata("design:type", Number)
|
|
113
115
|
], ConfigurationTenantSummaryDto.prototype, "effectivePlanPrice", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
118
|
+
description: 'Módulos do app liberados para o tenant (resolução plano + override)',
|
|
119
|
+
type: () => [app_module_policy_dto_1.EffectiveAppModulePolicyDto],
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], ConfigurationTenantSummaryDto.prototype, "appModules", void 0);
|
|
@@ -4,6 +4,8 @@ export * from './update-clinic-configuration.dto';
|
|
|
4
4
|
export * from './clinic-configuration.dto';
|
|
5
5
|
export * from './ai-tool-policy.enums';
|
|
6
6
|
export * from './ai-tool-policy.dto';
|
|
7
|
+
export * from './app-module-policy.enums';
|
|
8
|
+
export * from './app-module-policy.dto';
|
|
7
9
|
export * from './plan-summary.dto';
|
|
8
10
|
export * from './tenant-limits-summary.dto';
|
|
9
11
|
export * from './tenant-storage-usage-summary.dto';
|
|
@@ -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,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,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC"}
|
|
@@ -20,6 +20,8 @@ __exportStar(require("./update-clinic-configuration.dto"), exports);
|
|
|
20
20
|
__exportStar(require("./clinic-configuration.dto"), exports);
|
|
21
21
|
__exportStar(require("./ai-tool-policy.enums"), exports);
|
|
22
22
|
__exportStar(require("./ai-tool-policy.dto"), exports);
|
|
23
|
+
__exportStar(require("./app-module-policy.enums"), exports);
|
|
24
|
+
__exportStar(require("./app-module-policy.dto"), exports);
|
|
23
25
|
__exportStar(require("./plan-summary.dto"), exports);
|
|
24
26
|
__exportStar(require("./tenant-limits-summary.dto"), exports);
|
|
25
27
|
__exportStar(require("./tenant-storage-usage-summary.dto"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import {
|
|
4
|
+
IsArray,
|
|
5
|
+
IsBoolean,
|
|
6
|
+
IsEnum,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
ValidateNested,
|
|
11
|
+
} from 'class-validator';
|
|
12
|
+
import {
|
|
13
|
+
TYCHAT_APP_MODULE_KEYS,
|
|
14
|
+
TYCHAT_APP_MODULE_POLICY_LEVELS,
|
|
15
|
+
type TychatAppModuleKey,
|
|
16
|
+
type TychatAppModulePolicyLevel,
|
|
17
|
+
} from './app-module-policy.enums';
|
|
18
|
+
|
|
19
|
+
export class AppModulePolicyDto {
|
|
20
|
+
@ApiProperty({ enum: TYCHAT_APP_MODULE_KEYS })
|
|
21
|
+
@IsEnum(TYCHAT_APP_MODULE_KEYS)
|
|
22
|
+
moduleKey: TychatAppModuleKey;
|
|
23
|
+
|
|
24
|
+
@ApiProperty()
|
|
25
|
+
@IsBoolean()
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
|
|
28
|
+
@ApiPropertyOptional({ enum: TYCHAT_APP_MODULE_POLICY_LEVELS })
|
|
29
|
+
@IsOptional()
|
|
30
|
+
@IsEnum(TYCHAT_APP_MODULE_POLICY_LEVELS)
|
|
31
|
+
level?: TychatAppModulePolicyLevel;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class UpdateAppModulePolicyDto {
|
|
35
|
+
@ApiProperty({ enum: TYCHAT_APP_MODULE_KEYS })
|
|
36
|
+
@IsEnum(TYCHAT_APP_MODULE_KEYS)
|
|
37
|
+
moduleKey: TychatAppModuleKey;
|
|
38
|
+
|
|
39
|
+
@ApiProperty()
|
|
40
|
+
@IsBoolean()
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class UpdateAppModulePoliciesDto {
|
|
45
|
+
@ApiProperty({ type: () => [UpdateAppModulePolicyDto] })
|
|
46
|
+
@IsArray()
|
|
47
|
+
@ValidateNested({ each: true })
|
|
48
|
+
@Type(() => UpdateAppModulePolicyDto)
|
|
49
|
+
policies: UpdateAppModulePolicyDto[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class ResolveAppModulePoliciesQueryDto {
|
|
53
|
+
@ApiProperty()
|
|
54
|
+
@IsString()
|
|
55
|
+
@IsNotEmpty()
|
|
56
|
+
tenantId: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class EffectiveAppModulePolicyDto extends AppModulePolicyDto {
|
|
60
|
+
@ApiPropertyOptional()
|
|
61
|
+
@IsOptional()
|
|
62
|
+
@IsString()
|
|
63
|
+
reasonCode?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class EffectiveAppModulePoliciesDto {
|
|
67
|
+
@ApiProperty({ type: () => [EffectiveAppModulePolicyDto] })
|
|
68
|
+
@IsArray()
|
|
69
|
+
@ValidateNested({ each: true })
|
|
70
|
+
@Type(() => EffectiveAppModulePolicyDto)
|
|
71
|
+
policies: EffectiveAppModulePolicyDto[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Módulos da aplicação web do tenant (Tychat-v2), controlados por plano e override por tenant.
|
|
3
|
+
* Valores estáveis para API e persistência.
|
|
4
|
+
*/
|
|
5
|
+
export const TYCHAT_APP_MODULE_KEYS = [
|
|
6
|
+
'dashboard',
|
|
7
|
+
'check_in',
|
|
8
|
+
'check_out',
|
|
9
|
+
'schedule',
|
|
10
|
+
'conversations',
|
|
11
|
+
'patients',
|
|
12
|
+
'patients_documents',
|
|
13
|
+
'patients_legal_terms',
|
|
14
|
+
'clinic_legal_terms',
|
|
15
|
+
'patients_anamneses',
|
|
16
|
+
'clinic_anamneses',
|
|
17
|
+
'ai_conversation',
|
|
18
|
+
'follow_up',
|
|
19
|
+
'funnel',
|
|
20
|
+
'satisfaction',
|
|
21
|
+
'clinic',
|
|
22
|
+
'billings',
|
|
23
|
+
'connections',
|
|
24
|
+
'settings',
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
export type TychatAppModuleKey = (typeof TYCHAT_APP_MODULE_KEYS)[number];
|
|
28
|
+
|
|
29
|
+
export const TYCHAT_APP_MODULE_POLICY_LEVELS = ['default', 'plan', 'tenant'] as const;
|
|
30
|
+
export type TychatAppModulePolicyLevel = (typeof TYCHAT_APP_MODULE_POLICY_LEVELS)[number];
|
|
@@ -1,72 +1,79 @@
|
|
|
1
|
-
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import { TenantAiTokenStateDto } from '../tenants/tenant-ai-token-state.dto';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
status: 'active'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { TenantAiTokenStateDto } from '../tenants/tenant-ai-token-state.dto';
|
|
3
|
+
import { EffectiveAppModulePolicyDto } from './app-module-policy.dto';
|
|
4
|
+
import { PlanSummaryDto } from './plan-summary.dto';
|
|
5
|
+
import { TenantLimitsSummaryDto } from './tenant-limits-summary.dto';
|
|
6
|
+
import { TenantStorageUsageSummaryDto } from './tenant-storage-usage-summary.dto';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tenant branding and subscription info returned with clinic configuration (no DB credentials).
|
|
10
|
+
*/
|
|
11
|
+
export class ConfigurationTenantSummaryDto {
|
|
12
|
+
@ApiProperty({ description: 'Tenant display name', example: 'Clínica Demo' })
|
|
13
|
+
name: string;
|
|
14
|
+
|
|
15
|
+
@ApiProperty({ description: 'CNPJ', example: '12345678000199' })
|
|
16
|
+
cnpj: string;
|
|
17
|
+
|
|
18
|
+
@ApiPropertyOptional({ description: 'Location / address', nullable: true })
|
|
19
|
+
location: string | null;
|
|
20
|
+
|
|
21
|
+
@ApiPropertyOptional({ description: 'Logo URL (light background)', nullable: true })
|
|
22
|
+
logoWhite: string | null;
|
|
23
|
+
|
|
24
|
+
@ApiPropertyOptional({ description: 'Logo URL (dark background)', nullable: true })
|
|
25
|
+
logoDark: string | null;
|
|
26
|
+
|
|
27
|
+
@ApiProperty({ description: 'Tenant status', enum: ['active', 'inactive'] })
|
|
28
|
+
status: 'active' | 'inactive';
|
|
29
|
+
|
|
30
|
+
@ApiPropertyOptional({
|
|
31
|
+
description: 'Subscription plan',
|
|
32
|
+
type: () => PlanSummaryDto,
|
|
33
|
+
nullable: true,
|
|
34
|
+
})
|
|
35
|
+
plan: PlanSummaryDto | null;
|
|
36
|
+
|
|
37
|
+
@ApiPropertyOptional({
|
|
38
|
+
description: 'Per-tenant limit overrides',
|
|
39
|
+
type: () => TenantLimitsSummaryDto,
|
|
40
|
+
nullable: true,
|
|
41
|
+
})
|
|
42
|
+
limits: TenantLimitsSummaryDto | null;
|
|
43
|
+
|
|
44
|
+
@ApiPropertyOptional({
|
|
45
|
+
description: 'Uso acumulado por tipo (bytes como string)',
|
|
46
|
+
type: () => TenantStorageUsageSummaryDto,
|
|
47
|
+
nullable: true,
|
|
48
|
+
})
|
|
49
|
+
storageUsage: TenantStorageUsageSummaryDto | null;
|
|
50
|
+
|
|
51
|
+
@ApiPropertyOptional({
|
|
52
|
+
description: 'Saldo e cota de tokens de IA no ciclo atual',
|
|
53
|
+
type: () => TenantAiTokenStateDto,
|
|
54
|
+
nullable: true,
|
|
55
|
+
})
|
|
56
|
+
aiTokenState?: TenantAiTokenStateDto | null;
|
|
57
|
+
|
|
58
|
+
@ApiPropertyOptional({ description: 'Limite efetivo de conversas em bytes (plano + extras)' })
|
|
59
|
+
conversationEffectiveLimitBytes?: string;
|
|
60
|
+
|
|
61
|
+
@ApiPropertyOptional({ description: 'Limite efetivo clínico em bytes (plano + extras)' })
|
|
62
|
+
clinicEffectiveLimitBytes?: string;
|
|
63
|
+
|
|
64
|
+
@ApiPropertyOptional({
|
|
65
|
+
description: 'Valor mensal estimado pelos GB extras de armazenamento (soma dos dois tipos)',
|
|
66
|
+
})
|
|
67
|
+
extraStorageCharge?: number;
|
|
68
|
+
|
|
69
|
+
@ApiPropertyOptional({
|
|
70
|
+
description: 'Preço base do plano + extraStorageCharge',
|
|
71
|
+
})
|
|
72
|
+
effectivePlanPrice?: number;
|
|
73
|
+
|
|
74
|
+
@ApiPropertyOptional({
|
|
75
|
+
description: 'Módulos do app liberados para o tenant (resolução plano + override)',
|
|
76
|
+
type: () => [EffectiveAppModulePolicyDto],
|
|
77
|
+
})
|
|
78
|
+
appModules?: EffectiveAppModulePolicyDto[];
|
|
79
|
+
}
|
|
@@ -4,6 +4,8 @@ export * from './update-clinic-configuration.dto';
|
|
|
4
4
|
export * from './clinic-configuration.dto';
|
|
5
5
|
export * from './ai-tool-policy.enums';
|
|
6
6
|
export * from './ai-tool-policy.dto';
|
|
7
|
+
export * from './app-module-policy.enums';
|
|
8
|
+
export * from './app-module-policy.dto';
|
|
7
9
|
export * from './plan-summary.dto';
|
|
8
10
|
export * from './tenant-limits-summary.dto';
|
|
9
11
|
export * from './tenant-storage-usage-summary.dto';
|