@mbanq/core-sdk-js / commands / GetLoanSearchTemplate
Function: GetLoanSearchTemplate()
GetLoanSearchTemplate():
Command<{ }, {loanProducts:object[];offices:object[]; }>
Defined in: src/commands/rest/loan.ts:775
Retrieves the ad-hoc search query template for loans. This template provides a comprehensive structure for performing searches on loan products, listing various loan product attributes and office configurations.
Use this endpoint to obtain available loan products and offices which can then be used to filter and search for specific loans based on customizable criteria.
Returns
Command<{ }, { loanProducts: object[]; offices: object[]; }>
A Command that when executed returns the search template with loan products and offices
Example
typescript
const searchTemplateCmd = GetLoanSearchTemplate();
const result = await searchTemplateCmd.execute(config);
console.log('Loan products:', result.loanProducts.length); // Number of available loan products
console.log('Offices:', result.offices.length); // Number of offices
console.log('First product:', result.loanProducts[0].name); // "Loan Product"
console.log('First office:', result.offices[0].name); // "Head Office"
// Example usage: Use product and office IDs for filtering loan searches