Rewrite store JSDoc, split quote/order into modules, and generate typed API docs

- Rewrite JSDoc across all store methods to document the actual async
  methods (real params, returns, throws) instead of the internal wrappers
- Split quote/order into individual module files backed by shared
  manifestDoc helpers; remove the createStore factory and thin wrappers
- Deduplicate manifest line helpers into src/store/manifestLines.js
- Extend generate-api-doc.js to render parameter/return/throws types and
  emit per-namespace API.<module>.md files with an API.md index
- Regenerate all API docs
This commit is contained in:
seb
2026-08-07 06:23:17 +02:00
parent 396389457f
commit aefd97a171
127 changed files with 3956 additions and 1684 deletions

View File

@@ -1,20 +1,21 @@
import { GET_BY_ID, SET_OFF_ALL, LIST_CATEGORY_IDS } from '../../sql/posterminal.js';
import resolveSelectedCompanyAccess from '../companyuser/resolveSelectedCompanyAccess.js';
/**
* Removes all category assignments from a posterminal.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that clears all categories from a posterminal.
*
* @example
* const fn = setOffAll(pool);
* const result = await fn(42, 5);
* // => { id, categoryIds: [] }
*/
export default function setOffAll(pool) {
const access = resolveSelectedCompanyAccess(pool);
/**
* Removes all category assignments from a posterminal.
*
* @param {number} googleAuthId - The id of the Google auth user.
* @param {number} posterminalId - The id of the posterminal.
* @returns {Promise<{id: number, categoryIds: Array<number>}>} The posterminal with an empty category list.
* @throws {Error} If the posterminal is not found.
*
* @example
* const result = await store.posterminal.setOffAll(42, 5);
* // => { id, categoryIds: [] }
*/
return async (googleAuthId, posterminalId) => {
if (!Number.isFinite(posterminalId)) {
throw new Error('Invalid posterminal');