This commit is contained in:
seb
2026-10-23 02:43:35 +02:00
parent 919713fa53
commit 8a085986e5
6 changed files with 218 additions and 0 deletions

View File

@@ -1,3 +1,12 @@
import {
TOUCH_UPDATED_AT as MSSQL_TOUCH,
TOUCH_STUECKLISTE_ARTICLES_UPDATED_AT as MSSQL_TOUCH_STUECKLISTE,
} from '../../providers/mssql/queries/article.js';
import {
TOUCH_UPDATED_AT as SQLITE_TOUCH,
TOUCH_STUECKLISTE_ARTICLES_UPDATED_AT as SQLITE_TOUCH_STUECKLISTE,
} from '../../providers/sqlite3/queries/article.js';
/**
* Centralized sync and rebuild logic for the materialized `articlewarehousesummary` table.
*
@@ -142,6 +151,11 @@ export async function syncArticleWarehouseSummaryForLedger(runner, { companyId,
warehouseId,
stock,
});
const touchSql = isSqlite ? SQLITE_TOUCH : MSSQL_TOUCH;
const touchStuecklisteSql = isSqlite ? SQLITE_TOUCH_STUECKLISTE : MSSQL_TOUCH_STUECKLISTE;
await runner.query(touchSql, { articleId });
await runner.query(touchStuecklisteSql, { articleId });
}
}