feat(finance): BTC basket flows, client scoping, and jewelry-box store
- Finance API: baskets, holdings, rebalances, deposits, bridge withdrawals, vault checks. - Schemas: btc-basket; api-client finance types; workspace lockfile update. - Vitest config for finance service; expanded tests. Made-with: Cursor
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
import { query } from './client';
|
||||
import { listDocuments, getDocumentById } from './schema';
|
||||
|
||||
export interface DocumentSearchResult {
|
||||
documents: Array<{
|
||||
@@ -102,8 +101,8 @@ export async function searchDocuments(
|
||||
/**
|
||||
* Get search suggestions
|
||||
*/
|
||||
export async function getSearchSuggestions(query: string, limit = 10): Promise<string[]> {
|
||||
if (!query || query.length < 2) {
|
||||
export async function getSearchSuggestions(searchTerm: string, limit = 10): Promise<string[]> {
|
||||
if (!searchTerm || searchTerm.length < 2) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -113,9 +112,8 @@ export async function getSearchSuggestions(query: string, limit = 10): Promise<s
|
||||
WHERE title ILIKE $1
|
||||
ORDER BY title
|
||||
LIMIT $2`,
|
||||
[`%${query}%`, limit]
|
||||
[`%${searchTerm}%`, limit]
|
||||
);
|
||||
|
||||
return result.rows.map((row) => row.title);
|
||||
}
|
||||
|
||||
|
||||
@@ -320,9 +320,11 @@ export function extractTemplateVariables(template_content: string): string[] {
|
||||
const matches = template_content.matchAll(/\{\{(\w+(?:\.\w+)*)\}\}/g);
|
||||
|
||||
for (const match of matches) {
|
||||
variables.add(match[1]);
|
||||
const variableName = match[1];
|
||||
if (variableName) {
|
||||
variables.add(variableName);
|
||||
}
|
||||
}
|
||||
|
||||
return Array.from(variables).sort();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user