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

@@ -11,6 +11,24 @@ import langEnsure from '../lang/ensure.js';
import taxEnsure from '../tax/ensure.js';
import request from '../request.js';
/**
* Creates a new company together with its root category, POS customer group,
* default language and tax rates, and links it to the given Google auth user.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that creates a company.
*
* @example
* const fn = create(pool);
* const company = await fn({
* iso639: 'de',
* name: 'Acme',
* taxrate: 19,
* reducedtaxrate: 7,
* googleAuthId: 42,
* });
* // => { id, rootCategoryId, languageId, taxrateId, reducedtaxrateId, taxfreerateId, posCustomerGroupId }
*/
export default function create(pool) {
const nameTaken = getByName(pool);
const ensureLang = langEnsure(pool);