docs: add JSDoc headers to all externally exported store functions

This commit is contained in:
seb
2026-08-07 03:58:48 +02:00
parent c290fe8f4b
commit 4833acd680
101 changed files with 1134 additions and 0 deletions

View File

@@ -6,6 +6,18 @@ function parseJsonArray(raw) {
return Array.isArray(arr) ? arr : [];
}
/**
* Returns the full detail of an article by its SKU, including unit, brand,
* categories, photos, EANs and prices.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that fetches an article by SKU.
*
* @example
* const fn = getBySku(pool);
* const article = await fn(42, 'SKU-1');
* // => { article: { id, sku, name, unit, brand, categoryIds, photos, eans, prices, ... } }
*/
export default function getBySku(pool) {
return async (googleAuthId, sku) => {
const t0 = performance.now();