Align DoListAsnad with Hamkar (4 args) and treat empty ERROR as [].

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-05 11:18:37 +03:30
co-authored by Cursor
parent 1ac23e13c1
commit 3ab102ddae
3 changed files with 49 additions and 19 deletions
@@ -1,5 +1,5 @@
import { randomBytes } from 'crypto';
import type { TahesabHttpClient } from './tahesab-http.client';
import type { TahesabHttpClient, TahesabCallOptions } from './tahesab-http.client';
export type ConnCreds = {
baseUrl: string;
@@ -146,6 +146,7 @@ export class TahesabApi {
args?: unknown[],
method?: 'GET' | 'POST',
timeoutMs?: number,
extra?: Pick<TahesabCallOptions, 'emptyResultOnError'>,
) {
return this.http.call<T>({
...this.creds,
@@ -154,6 +155,7 @@ export class TahesabApi {
args,
method,
timeoutMs,
...extra,
});
}
@@ -222,15 +224,15 @@ export class TahesabApi {
fromShamsi: string,
toShamsi: string,
) {
// OpenAPI: Count_Last, Moshtari_Code, AzTarikhShamsi, TaTarikhShamsi, FilterNoSanad, Mande_Jens_Felez
return this.call('DoListAsnad', 'DoListAsnad', [
countLast,
moshtariCode,
fromShamsi,
toShamsi,
'',
0,
]);
// مثل همکار: فقط ۴ پارامتر (Count_Last, Code, از, تا) — پارامتر اضافه باعث خطای ته‌حساب می‌شود
return this.call(
'DoListAsnad',
'DoListAsnad',
[countLast, moshtariCode, fromShamsi, toShamsi],
'POST',
55_000,
{ emptyResultOnError: /رکوردی یافت نشد/i },
);
}
doListNameSekeh() {