docs: add JSDoc headers to all externally exported store functions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user