@hed-hog/finance 0.0.350 → 0.0.351
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/dto/create-financial-title.dto.d.ts +6 -0
- package/dist/dto/create-financial-title.dto.d.ts.map +1 -1
- package/dist/dto/create-financial-title.dto.js +27 -1
- package/dist/dto/create-financial-title.dto.js.map +1 -1
- package/dist/finance-data.controller.d.ts +12 -0
- package/dist/finance-data.controller.d.ts.map +1 -1
- package/dist/finance-installments.controller.d.ts +120 -0
- package/dist/finance-installments.controller.d.ts.map +1 -1
- package/dist/finance-realtime.controller.d.ts +7 -0
- package/dist/finance-realtime.controller.d.ts.map +1 -0
- package/dist/finance-realtime.controller.js +34 -0
- package/dist/finance-realtime.controller.js.map +1 -0
- package/dist/finance-realtime.service.d.ts +36 -0
- package/dist/finance-realtime.service.d.ts.map +1 -0
- package/dist/finance-realtime.service.js +59 -0
- package/dist/finance-realtime.service.js.map +1 -0
- package/dist/finance-statements.controller.d.ts +6 -0
- package/dist/finance-statements.controller.d.ts.map +1 -1
- package/dist/finance.module.d.ts.map +1 -1
- package/dist/finance.module.js +28 -0
- package/dist/finance.module.js.map +1 -1
- package/dist/finance.service.d.ts +142 -1
- package/dist/finance.service.d.ts.map +1 -1
- package/dist/finance.service.js +134 -19
- package/dist/finance.service.js.map +1 -1
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.d.ts +8 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.js +60 -0
- package/dist/mcp-tools/finance-audit-logs.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.js +121 -0
- package/dist/mcp-tools/finance-bank-accounts.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.d.ts +20 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.js +135 -0
- package/dist/mcp-tools/finance-categories.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.js +91 -0
- package/dist/mcp-tools/finance-collections.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.js +114 -0
- package/dist/mcp-tools/finance-cost-centers.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.d.ts +16 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.js +120 -0
- package/dist/mcp-tools/finance-currencies.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-data.mcp-tools.d.ts +15 -0
- package/dist/mcp-tools/finance-data.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-data.mcp-tools.js +80 -0
- package/dist/mcp-tools/finance-data.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.d.ts +93 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.js +646 -0
- package/dist/mcp-tools/finance-installments.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.d.ts +9 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.js +79 -0
- package/dist/mcp-tools/finance-period-close.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.d.ts +10 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.js +89 -0
- package/dist/mcp-tools/finance-reports.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.d.ts +34 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.js +253 -0
- package/dist/mcp-tools/finance-statements.mcp-tools.js.map +1 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.d.ts +9 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.js +79 -0
- package/dist/mcp-tools/finance-transfers.mcp-tools.js.map +1 -0
- package/hedhog/data/route.yaml +659 -1
- package/hedhog/frontend/app/_components/finance-title-actions-menu.tsx.ejs +9 -3
- package/hedhog/frontend/app/_lib/http-error.ts.ejs +105 -0
- package/hedhog/frontend/app/_lib/use-finance-realtime-refresh.ts.ejs +62 -0
- package/hedhog/frontend/app/accounts-payable/approvals/page.tsx.ejs +3 -0
- package/hedhog/frontend/app/accounts-payable/installments/[id]/page.tsx.ejs +5 -5
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +776 -344
- package/hedhog/frontend/app/accounts-receivable/collections-default/page.tsx.ejs +7 -13
- package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +5 -5
- package/hedhog/frontend/app/accounts-receivable/installments/page.tsx.ejs +802 -355
- package/hedhog/frontend/app/administration/categories/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/cost-centers/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/currencies/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/administration/period-close/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/cash-and-banks/bank-accounts/page.tsx.ejs +7 -3
- package/hedhog/frontend/app/cash-and-banks/bank-reconciliation/page.tsx.ejs +3 -3
- package/hedhog/frontend/app/cash-and-banks/statements/page.tsx.ejs +28 -7
- package/hedhog/frontend/app/cash-and-banks/transfers/page.tsx.ejs +12 -3
- package/hedhog/frontend/messages/en.json +63 -3
- package/hedhog/frontend/messages/pt.json +63 -3
- package/hedhog/table/financial_title.yaml +10 -0
- package/package.json +5 -5
- package/src/dto/create-financial-title.dto.ts +23 -0
- package/src/finance-realtime.controller.ts +12 -0
- package/src/finance-realtime.service.ts +106 -0
- package/src/finance.module.ts +28 -0
- package/src/finance.service.ts +184 -45
- package/src/mcp-tools/finance-audit-logs.mcp-tools.ts +38 -0
- package/src/mcp-tools/finance-bank-accounts.mcp-tools.ts +76 -0
- package/src/mcp-tools/finance-categories.mcp-tools.ts +86 -0
- package/src/mcp-tools/finance-collections.mcp-tools.ts +50 -0
- package/src/mcp-tools/finance-cost-centers.mcp-tools.ts +69 -0
- package/src/mcp-tools/finance-currencies.mcp-tools.ts +75 -0
- package/src/mcp-tools/finance-data.mcp-tools.ts +43 -0
- package/src/mcp-tools/finance-installments.mcp-tools.ts +560 -0
- package/src/mcp-tools/finance-period-close.mcp-tools.ts +53 -0
- package/src/mcp-tools/finance-reports.mcp-tools.ts +59 -0
- package/src/mcp-tools/finance-statements.mcp-tools.ts +202 -0
- package/src/mcp-tools/finance-transfers.mcp-tools.ts +53 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { McpContext, McpTool } from '@hed-hog/core';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { FinanceService } from '../finance.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class FinanceCategoriesMcpTools {
|
|
7
|
+
constructor(private readonly financeService: FinanceService) {}
|
|
8
|
+
|
|
9
|
+
@McpTool({
|
|
10
|
+
name: 'finance.categories.list',
|
|
11
|
+
description: 'Lists finance categories.',
|
|
12
|
+
inputSchema: { type: 'object', properties: {} },
|
|
13
|
+
readOnly: true,
|
|
14
|
+
})
|
|
15
|
+
async list(_args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
16
|
+
return this.financeService.listFinanceCategories();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@McpTool({
|
|
20
|
+
name: 'finance.categories.create',
|
|
21
|
+
description: 'Creates a finance category.',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
name: { type: 'string', description: 'Category name' },
|
|
26
|
+
kind: { type: 'string', description: 'Category kind' },
|
|
27
|
+
parent_id: { type: 'number', description: 'Parent category ID' },
|
|
28
|
+
},
|
|
29
|
+
required: ['name', 'kind'],
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
async create(args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
33
|
+
return this.financeService.createFinanceCategory(args as any);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@McpTool({
|
|
37
|
+
name: 'finance.categories.update',
|
|
38
|
+
description: 'Updates a finance category.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
id: { type: 'number', description: 'Category ID' },
|
|
43
|
+
name: { type: 'string', description: 'Category name' },
|
|
44
|
+
kind: { type: 'string', description: 'Category kind' },
|
|
45
|
+
},
|
|
46
|
+
required: ['id'],
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
async update(args: { id: number; [key: string]: any }, _context: McpContext): Promise<any> {
|
|
50
|
+
const { id, ...data } = args;
|
|
51
|
+
return this.financeService.updateFinanceCategory(id, data as any);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@McpTool({
|
|
55
|
+
name: 'finance.categories.move',
|
|
56
|
+
description: 'Moves/reorders a finance category.',
|
|
57
|
+
inputSchema: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
id: { type: 'number', description: 'Category ID' },
|
|
61
|
+
parent_id: { type: 'number', description: 'New parent ID' },
|
|
62
|
+
order: { type: 'number', description: 'Order index in siblings' },
|
|
63
|
+
},
|
|
64
|
+
required: ['id'],
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
async move(args: { id: number; [key: string]: any }, _context: McpContext): Promise<any> {
|
|
68
|
+
const { id, ...data } = args;
|
|
69
|
+
return this.financeService.moveFinanceCategory(id, data as any);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@McpTool({
|
|
73
|
+
name: 'finance.categories.delete',
|
|
74
|
+
description: 'Deletes a finance category.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
id: { type: 'number', description: 'Category ID' },
|
|
79
|
+
},
|
|
80
|
+
required: ['id'],
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
async delete(args: { id: number }, _context: McpContext): Promise<any> {
|
|
84
|
+
return this.financeService.deleteFinanceCategory(args.id);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { McpContext, McpTool } from '@hed-hog/core';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { FinanceService } from '../finance.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class FinanceCollectionsMcpTools {
|
|
7
|
+
constructor(private readonly financeService: FinanceService) {}
|
|
8
|
+
|
|
9
|
+
@McpTool({
|
|
10
|
+
name: 'finance.collections-default.get',
|
|
11
|
+
description: 'Returns default collections settings for accounts receivable.',
|
|
12
|
+
inputSchema: { type: 'object', properties: {} },
|
|
13
|
+
readOnly: true,
|
|
14
|
+
})
|
|
15
|
+
async getDefault(_args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
16
|
+
return this.financeService.getAccountsReceivableCollectionsDefault();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@McpTool({
|
|
20
|
+
name: 'finance.collections-default.send',
|
|
21
|
+
description: 'Sends a collection action to a person.',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
personId: { type: 'number', description: 'Person ID' },
|
|
26
|
+
},
|
|
27
|
+
required: ['personId'],
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
async send(args: { personId: number; [key: string]: any }, context: McpContext): Promise<any> {
|
|
31
|
+
const { personId, ...data } = args;
|
|
32
|
+
return this.financeService.sendCollection(personId, data as any, context.userId);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@McpTool({
|
|
36
|
+
name: 'finance.collections-default.register-agreement',
|
|
37
|
+
description: 'Registers a collection agreement for a person.',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
personId: { type: 'number', description: 'Person ID' },
|
|
42
|
+
},
|
|
43
|
+
required: ['personId'],
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
async registerAgreement(args: { personId: number; [key: string]: any }, context: McpContext): Promise<any> {
|
|
47
|
+
const { personId, ...data } = args;
|
|
48
|
+
return this.financeService.registerCollectionAgreement(personId, data as any, context.userId);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { McpContext, McpTool } from '@hed-hog/core';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { FinanceService } from '../finance.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class FinanceCostCentersMcpTools {
|
|
7
|
+
constructor(private readonly financeService: FinanceService) {}
|
|
8
|
+
|
|
9
|
+
@McpTool({
|
|
10
|
+
name: 'finance.cost-centers.list',
|
|
11
|
+
description: 'Lists cost centers.',
|
|
12
|
+
inputSchema: { type: 'object', properties: {} },
|
|
13
|
+
readOnly: true,
|
|
14
|
+
})
|
|
15
|
+
async list(_args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
16
|
+
return this.financeService.listCostCenters();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@McpTool({
|
|
20
|
+
name: 'finance.cost-centers.create',
|
|
21
|
+
description: 'Creates a cost center.',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
name: { type: 'string', description: 'Name' },
|
|
26
|
+
code: { type: 'string', description: 'Code' },
|
|
27
|
+
description: { type: 'string', description: 'Description' },
|
|
28
|
+
},
|
|
29
|
+
required: ['name'],
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
async create(args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
33
|
+
return this.financeService.createCostCenter(args as any);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@McpTool({
|
|
37
|
+
name: 'finance.cost-centers.update',
|
|
38
|
+
description: 'Updates a cost center.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
id: { type: 'number', description: 'Cost center ID' },
|
|
43
|
+
name: { type: 'string', description: 'Name' },
|
|
44
|
+
code: { type: 'string', description: 'Code' },
|
|
45
|
+
description: { type: 'string', description: 'Description' },
|
|
46
|
+
},
|
|
47
|
+
required: ['id'],
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
async update(args: { id: number; [key: string]: any }, _context: McpContext): Promise<any> {
|
|
51
|
+
const { id, ...data } = args;
|
|
52
|
+
return this.financeService.updateCostCenter(id, data as any);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@McpTool({
|
|
56
|
+
name: 'finance.cost-centers.delete',
|
|
57
|
+
description: 'Deletes a cost center.',
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
id: { type: 'number', description: 'Cost center ID' },
|
|
62
|
+
},
|
|
63
|
+
required: ['id'],
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
async delete(args: { id: number }, _context: McpContext): Promise<any> {
|
|
67
|
+
return this.financeService.deleteCostCenter(args.id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { McpContext, McpTool } from '@hed-hog/core';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { FinanceService } from '../finance.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class FinanceCurrenciesMcpTools {
|
|
7
|
+
constructor(private readonly financeService: FinanceService) {}
|
|
8
|
+
|
|
9
|
+
@McpTool({
|
|
10
|
+
name: 'finance.currencies.list',
|
|
11
|
+
description: 'Lists currencies with pagination.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
page: { type: 'number', description: 'Page number (default: 1)' },
|
|
16
|
+
pageSize: { type: 'number', description: 'Items per page (default: 20)' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
readOnly: true,
|
|
20
|
+
})
|
|
21
|
+
async list(args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
22
|
+
return this.financeService.listCurrencies(args as any);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@McpTool({
|
|
26
|
+
name: 'finance.currencies.create',
|
|
27
|
+
description: 'Creates a currency.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
code: { type: 'string', description: 'Currency code' },
|
|
32
|
+
name: { type: 'string', description: 'Currency name' },
|
|
33
|
+
symbol: { type: 'string', description: 'Currency symbol' },
|
|
34
|
+
},
|
|
35
|
+
required: ['code', 'name'],
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
async create(args: Record<string, any>, _context: McpContext): Promise<any> {
|
|
39
|
+
return this.financeService.createCurrency(args as any);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@McpTool({
|
|
43
|
+
name: 'finance.currencies.update',
|
|
44
|
+
description: 'Updates a currency.',
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
id: { type: 'number', description: 'Currency ID' },
|
|
49
|
+
code: { type: 'string', description: 'Currency code' },
|
|
50
|
+
name: { type: 'string', description: 'Currency name' },
|
|
51
|
+
symbol: { type: 'string', description: 'Currency symbol' },
|
|
52
|
+
},
|
|
53
|
+
required: ['id'],
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
async update(args: { id: number; [key: string]: any }, _context: McpContext): Promise<any> {
|
|
57
|
+
const { id, ...data } = args;
|
|
58
|
+
return this.financeService.updateCurrency(id, data as any);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@McpTool({
|
|
62
|
+
name: 'finance.currencies.delete',
|
|
63
|
+
description: 'Deletes a currency.',
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
id: { type: 'number', description: 'Currency ID' },
|
|
68
|
+
},
|
|
69
|
+
required: ['id'],
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
async delete(args: { id: number }, _context: McpContext): Promise<any> {
|
|
73
|
+
return this.financeService.deleteCurrency(args.id);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { McpContext, McpTool } from '@hed-hog/core';
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { FinanceService } from '../finance.service';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class FinanceDataMcpTools {
|
|
7
|
+
constructor(private readonly financeService: FinanceService) {}
|
|
8
|
+
|
|
9
|
+
@McpTool({
|
|
10
|
+
name: 'finance.data.get',
|
|
11
|
+
description: 'Returns financial data for horizon and scenario.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
horizonte: { type: 'string', description: 'Forecast horizon in days' },
|
|
16
|
+
cenario: { type: 'string', description: 'Scenario name' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
readOnly: true,
|
|
20
|
+
})
|
|
21
|
+
async get(args: { horizonte?: string; cenario?: string }, _context: McpContext): Promise<any> {
|
|
22
|
+
return this.financeService.getData({
|
|
23
|
+
horizonteDias: args.horizonte,
|
|
24
|
+
cenario: args.cenario,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@McpTool({
|
|
29
|
+
name: 'finance.scenarios.update',
|
|
30
|
+
description: 'Updates scenario settings.',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
cenario: { type: 'string', description: 'Scenario slug/name' },
|
|
35
|
+
},
|
|
36
|
+
required: ['cenario'],
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
async updateScenario(args: { cenario: string; [key: string]: any }, _context: McpContext): Promise<any> {
|
|
40
|
+
const { cenario, ...data } = args;
|
|
41
|
+
return this.financeService.updateScenarioSettings(cenario, data as any);
|
|
42
|
+
}
|
|
43
|
+
}
|