tychat-contracts 1.6.27 → 1.6.29

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.
@@ -31,6 +31,9 @@ export declare class PlanSummaryDto {
31
31
  unitsExtraPrice: number;
32
32
  monthlyLegalTermsExtraPrice: number;
33
33
  concurrentSessionsExtraPrice: number;
34
+ maxCampaignsPerMonth: number;
35
+ campaignsModuleEnabled: boolean;
36
+ campaignExtraSlotPrice: number;
34
37
  createdAt?: Date;
35
38
  updatedAt?: Date;
36
39
  }
@@ -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;IAMtB,+BAA+B,EAAE,MAAM,CAAC;IAOxC,gCAAgC,EAAE,YAAY,GAAG,YAAY,CAAC;IAG9D,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,kBAAkB,EAAE,MAAM,CAAC;IAG3B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,oBAAoB,EAA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B,EAAE,MAAM,CAAC;IAG7B,2BAA2B,EAAE,MAAM,CAAC;IAGpC,eAAe,EAAE,MAAM,CAAC;IAGxB,2BAA2B,EAAE,MAAM,CAAC;IAGpC,4BAA4B,EAAE,MAAM,CAAC;IAGrC,oBAAoB,EAAE,MAAM,CAAC;IAG7B,sBAAsB,EAAE,OAAO,CAAC;IAGhC,sBAAsB,EAAE,MAAM,CAAC;IAG/B,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -44,6 +44,9 @@ class PlanSummaryDto {
44
44
  unitsExtraPrice;
45
45
  monthlyLegalTermsExtraPrice;
46
46
  concurrentSessionsExtraPrice;
47
+ maxCampaignsPerMonth;
48
+ campaignsModuleEnabled;
49
+ campaignExtraSlotPrice;
47
50
  createdAt;
48
51
  updatedAt;
49
52
  }
@@ -171,6 +174,18 @@ __decorate([
171
174
  (0, swagger_1.ApiProperty)({ description: 'Preço por sessão simultânea extra por conta', example: 0 }),
172
175
  __metadata("design:type", Number)
173
176
  ], PlanSummaryDto.prototype, "concurrentSessionsExtraPrice", void 0);
177
+ __decorate([
178
+ (0, swagger_1.ApiProperty)({ description: 'Máximo de campanhas por mês (0 = ilimitado)', example: 10 }),
179
+ __metadata("design:type", Number)
180
+ ], PlanSummaryDto.prototype, "maxCampaignsPerMonth", void 0);
181
+ __decorate([
182
+ (0, swagger_1.ApiProperty)({ description: 'Se o módulo de campanhas está habilitado', example: false }),
183
+ __metadata("design:type", Boolean)
184
+ ], PlanSummaryDto.prototype, "campaignsModuleEnabled", void 0);
185
+ __decorate([
186
+ (0, swagger_1.ApiProperty)({ description: 'Preço por campanha extra além do limite', example: 10 }),
187
+ __metadata("design:type", Number)
188
+ ], PlanSummaryDto.prototype, "campaignExtraSlotPrice", void 0);
174
189
  __decorate([
175
190
  (0, swagger_1.ApiPropertyOptional)(),
176
191
  __metadata("design:type", Date)
@@ -5,7 +5,7 @@ export type DashboardChartType = (typeof DASHBOARD_CHART_TYPES)[number];
5
5
  * Módulos de dados agregados do dashboard (cada um mapeia a permissões e a fatia do summary).
6
6
  * Manter alinhado ao `Frontend/.../lib/dashboard-data-modules.ts`.
7
7
  */
8
- export declare const DASHBOARD_DATA_MODULE_KEYS: readonly ["overview.clients_total", "overview.clients_active_inactive", "overview.units_total", "overview.revenue_totals", "overview.revenue_growth", "overview.estimated_mrr", "overview.clients_per_plan", "overview.recent_signups", "overview.invoice_counts", "billing.revenue_by_status", "billing.invoice_status_breakdown", "billing.invoice_counts", "billing.recent_invoices", "billing.payment_links", "tenants.client_list", "tenants.plan_per_client", "tenants.legal_term_policy", "tenants.whatsapp_provider", "tenants.scheduled_deletion", "tenants.hostnames", "tenants.storage_usage", "infra.storage_overview", "infra.storage_by_tenant", "limits.per_client", "limits.session_policy", "limits.extra_storage", "plans.stats", "plans.list", "plans.active_inactive", "ia.tokens_per_tenant", "ia.agents_per_tenant", "ia.agents_summary", "ia.tool_policies", "ia.models_availability", "evolution.configs_summary", "evolution.instances_totals", "evolution.connection_state", "global.platform_config", "team.panel_admins", "audit.recent_events", "audit.outcome_counts", "security.device_sessions", "security.totp_status"];
8
+ export declare const DASHBOARD_DATA_MODULE_KEYS: readonly ["overview.clients_total", "overview.clients_active_inactive", "overview.units_total", "overview.revenue_totals", "overview.revenue_growth", "overview.estimated_mrr", "overview.clients_per_plan", "overview.recent_signups", "overview.invoice_counts", "billing.revenue_by_status", "billing.invoice_status_breakdown", "billing.invoice_counts", "billing.recent_invoices", "billing.payment_links", "tenants.client_list", "tenants.plan_per_client", "tenants.legal_term_policy", "tenants.whatsapp_provider", "tenants.scheduled_deletion", "tenants.hostnames", "tenants.storage_usage", "infra.storage_overview", "infra.storage_by_tenant", "limits.per_client", "limits.session_policy", "limits.extra_storage", "plans.stats", "plans.list", "plans.active_inactive", "ia.tokens_per_tenant", "ia.agents_per_tenant", "ia.agents_summary", "ia.tool_policies", "ia.models_availability", "evolution.configs_summary", "evolution.instances_totals", "evolution.connection_state", "global.platform_config", "team.panel_admins", "audit.recent_events", "audit.outcome_counts", "security.device_sessions", "security.totp_status", "refunds.volume_by_month", "refunds.by_status", "refunds.top_tenants"];
9
9
  export type DashboardDataModuleKey = (typeof DASHBOARD_DATA_MODULE_KEYS)[number];
10
10
  export declare function isDashboardDataModuleKey(v: string): v is DashboardDataModuleKey;
11
11
  /** Posição e tamanho no painel em percentagem (0–100) relativamente ao contentor do canvas. */
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-layout.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/dashboard-layout.dto.ts"],"names":[],"mappings":"AAiBA,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,4EASxB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,0lCA4C7B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,sBAAsB,CAE/E;AAED,+FAA+F;AAC/F,qBAAa,sBAAsB;IAMjC,OAAO,EAAE,MAAM,CAAC;IAOhB,MAAM,EAAE,MAAM,CAAC;IAOf,QAAQ,EAAE,MAAM,CAAC;IAOjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,kBAAkB;IAG7B,EAAE,EAAE,MAAM,CAAC;IAKX,UAAU,EAAE,sBAAsB,CAAC;IAKnC,SAAS,EAAE,kBAAkB,CAAC;IAE9B,0CAA0C;IAK1C,CAAC,EAAE,MAAM,CAAC;IAEV,iCAAiC;IAKjC,CAAC,EAAE,MAAM,CAAC;IAEV;;;OAGG;IAOH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,2CAA2C;IAI3C,KAAK,EAAE,MAAM,CAAC;IAMd,KAA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B;IAK7B,OAAO,EAAE,MAAM,CAAC;IAOhB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B"}
@@ -73,6 +73,9 @@ exports.DASHBOARD_DATA_MODULE_KEYS = [
73
73
  'audit.outcome_counts',
74
74
  'security.device_sessions',
75
75
  'security.totp_status',
76
+ 'refunds.volume_by_month',
77
+ 'refunds.by_status',
78
+ 'refunds.top_tenants',
76
79
  ];
77
80
  function isDashboardDataModuleKey(v) {
78
81
  return exports.DASHBOARD_DATA_MODULE_KEYS.includes(v);
@@ -19,6 +19,7 @@ export declare const PANEL_RESOURCE_ACTIONS: {
19
19
  readonly admin_users: readonly ["view", "create", "update", "delete"];
20
20
  readonly access_levels: readonly ["view", "create", "update", "delete"];
21
21
  readonly conversation: readonly ["execute"];
22
+ readonly campaign_refunds: readonly ["view", "process", "cancel"];
22
23
  };
23
24
  export type PanelResource = keyof typeof PANEL_RESOURCE_ACTIONS;
24
25
  export type PanelAction<R extends PanelResource> = (typeof PANEL_RESOURCE_ACTIONS)[R][number];
@@ -1 +1 @@
1
- {"version":3,"file":"panel-permission-keys.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/panel-permission-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;CA0BzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAEhE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAC7C,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAS7C,eAAO,MAAM,qBAAqB,EAAW,SAAS,MAAM,EAAE,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE/E;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,GACjC,kBAAkB,CAEpB"}
1
+ {"version":3,"file":"panel-permission-keys.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/panel-permission-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;CA2BzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAEhE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAC7C,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAS7C,eAAO,MAAM,qBAAqB,EAAW,SAAS,MAAM,EAAE,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE/E;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,GACjC,kBAAkB,CAEpB"}
@@ -32,6 +32,7 @@ exports.PANEL_RESOURCE_ACTIONS = {
32
32
  admin_users: ['view', 'create', 'update', 'delete'],
33
33
  access_levels: ['view', 'create', 'update', 'delete'],
34
34
  conversation: ['execute'],
35
+ campaign_refunds: ['view', 'process', 'cancel'],
35
36
  };
36
37
  const keys = [];
37
38
  for (const [resource, actions] of Object.entries(exports.PANEL_RESOURCE_ACTIONS)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.27",
3
+ "version": "1.6.29",
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",
@@ -98,6 +98,15 @@ export class PlanSummaryDto {
98
98
  @ApiProperty({ description: 'Preço por sessão simultânea extra por conta', example: 0 })
99
99
  concurrentSessionsExtraPrice: number;
100
100
 
101
+ @ApiProperty({ description: 'Máximo de campanhas por mês (0 = ilimitado)', example: 10 })
102
+ maxCampaignsPerMonth: number;
103
+
104
+ @ApiProperty({ description: 'Se o módulo de campanhas está habilitado', example: false })
105
+ campaignsModuleEnabled: boolean;
106
+
107
+ @ApiProperty({ description: 'Preço por campanha extra além do limite', example: 10 })
108
+ campaignExtraSlotPrice: number;
109
+
101
110
  @ApiPropertyOptional()
102
111
  createdAt?: Date;
103
112
 
@@ -77,6 +77,9 @@ export const DASHBOARD_DATA_MODULE_KEYS = [
77
77
  'audit.outcome_counts',
78
78
  'security.device_sessions',
79
79
  'security.totp_status',
80
+ 'refunds.volume_by_month',
81
+ 'refunds.by_status',
82
+ 'refunds.top_tenants',
80
83
  ] as const;
81
84
 
82
85
  export type DashboardDataModuleKey = (typeof DASHBOARD_DATA_MODULE_KEYS)[number];
@@ -27,6 +27,7 @@ export const PANEL_RESOURCE_ACTIONS = {
27
27
  admin_users: ['view', 'create', 'update', 'delete'] as const,
28
28
  access_levels: ['view', 'create', 'update', 'delete'] as const,
29
29
  conversation: ['execute'] as const,
30
+ campaign_refunds: ['view', 'process', 'cancel'] as const,
30
31
  } as const;
31
32
 
32
33
  export type PanelResource = keyof typeof PANEL_RESOURCE_ACTIONS;