@@ -23,9 +23,10 @@ class LiquidSamplerRunner {
2323 * @param {Array<string> } templateHandles.reconciliationTexts - Array of reconciliation text handles
2424 * @param {Array<string> } templateHandles.accountTemplates - Array of account template names
2525 * @param {Array<string> } templateHandles.sharedParts - Array of shared part names
26+ * @param {Array<number> } firmIds - Array of firm IDs to use in the sampler
2627 * @returns {Promise<void> }
2728 */
28- async run ( templateHandles = { } ) {
29+ async run ( templateHandles = { } , firmIds = [ ] ) {
2930 try {
3031 // Validate at least one template specified
3132 const { reconciliationTexts = [ ] , accountTemplates = [ ] , sharedParts = [ ] } = templateHandles ;
@@ -35,7 +36,7 @@ class LiquidSamplerRunner {
3536 }
3637
3738 // Build payload
38- const samplerParams = await this . #buildSamplerParams( templateHandles ) ;
39+ const samplerParams = await this . #buildSamplerParams( templateHandles , firmIds ) ;
3940
4041 consola . info ( `Starting sampler run with ${ samplerParams . templates . length } template(s)...` ) ;
4142
@@ -83,9 +84,10 @@ class LiquidSamplerRunner {
8384 * @param {Array<string> } templateHandles.reconciliationTexts - Array of reconciliation text handles
8485 * @param {Array<string> } templateHandles.accountTemplates - Array of account template names
8586 * @param {Array<string> } templateHandles.sharedParts - Array of shared part names
87+ * @param {Array<number> } firmIds - Array of firm IDs to use in the sampler
8688 * @returns {Object } Sampler payload with templates array
8789 */
88- async #buildSamplerParams( templateHandles = { } ) {
90+ async #buildSamplerParams( templateHandles = { } , firmIds = [ ] ) {
8991 const templates = [ ] ;
9092 const { reconciliationTexts = [ ] , accountTemplates = [ ] , sharedParts = [ ] } = templateHandles ;
9193
@@ -175,7 +177,7 @@ class LiquidSamplerRunner {
175177 } ) ;
176178 }
177179
178- return { templates } ;
180+ return { templates, firm_ids : firmIds } ;
179181 }
180182
181183 /**
@@ -237,6 +239,11 @@ class LiquidSamplerRunner {
237239 }
238240 break ;
239241
242+ case "pending" :
243+ case "running" :
244+ consola . info ( `Sampler run is still in progress. Current status: "${ response . status } ". Please check again later.` ) ;
245+ break ;
246+
240247 default :
241248 consola . error ( `Unexpected sampler status: ${ response . status } ` ) ;
242249 process . exit ( 1 ) ;
0 commit comments