// New method in veeqo.ts
async batchCreateOrders(params: BatchCreateOrdersParams): Promise<any> {
try {
if (!params.orders || !Array.isArray(params.orders)) {
throw new ValidationError('orders array is required');
}
const results = [];
for (const order of params.orders) {
const result = await client.createOrder(order, params.idempotency_key);
results.push({
id: result.id,
number: result.number,
status: result.status
});
}
return { orders: results };
} catch (error) {
logger.error('Error in veeqo.batchCreateOrders', { error });
if (error instanceof RpcBaseError) throw error;
throw new RpcBaseError('VEEQO_BATCH_CREATE_ORDERS_ERROR', 'Failed to batch create orders', error);
}
}
// New method in veeqo.ts
async batchUpdateOrders(params: BatchUpdateOrdersParams): Promise<any> {
try {
if (!params.updates || !Array.isArray(params.updates)) {
throw new ValidationError('updates array is required');
}
const results = [];
for (const update of params.updates) {
const result = await client.updateOrder(update.order_id, update.order);
results.push({
id: result.id,
status: result.status,
updated_at: result.updated_at
});
}
return { orders: results };
} catch (error) {
logger.error('Error in veeqo.batchUpdateOrders', { error });
if (error instanceof RpcBaseError) throw error;
throw new RpcBaseError('VEEQO_BATCH_UPDATE_ORDERS_ERROR', 'Failed to batch update orders', error);
}
}