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

@@ -7,6 +7,18 @@ import nextSku from '../numbers/nextSku.js';
import request from '../request.js';
import slugify from '../slugify.js';
/**
* Creates a new article under a given parent category, allocating a SKU and
* a default unit.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that creates an article.
*
* @example
* const fn = createUnderParent(pool);
* const article = await fn({ googleAuthId: 42, parentId: 5, name: 'Cola' });
* // => { id, parentId, name, sku }
*/
export default function createUnderParent(pool) {
const access = resolveCategoryAccess(pool);
const ensureUnit = ensureDefaultUnit(pool);