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

@@ -4,20 +4,22 @@ import request from '../request.js';
import resolveSelectedCompanyAccess from '../companyuser/resolveSelectedCompanyAccess.js';
import ensureLieferantenGroup from './ensureLieferantenGroup.js';
/**
* Creates a new supplier for a company, recording history.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that creates a supplier.
*
* @example
* const fn = create(pool);
* const supplier = await fn(42, { name: 'Acme Supplies' });
* // => { id, name, createdAt, updatedAt }
*/
export default function create(pool) {
const access = resolveSelectedCompanyAccess(pool);
/**
* Creates a new supplier for the user's selected company, recording history.
*
* @param {number} googleAuthId - The id of the Google auth user.
* @param {object} input - The supplier input.
* @param {string} input.name - The supplier name.
* @returns {Promise<{id: number, name: string, createdAt: string, updatedAt: string}>} The created supplier.
* @throws {Error} If the name is empty.
*
* @example
* const supplier = await store.supplier.create(42, { name: 'Acme Supplies' });
* // => { id, name, createdAt, updatedAt }
*/
return async (googleAuthId, { name } = {}) => {
const cleaned = name?.trim();
if (!cleaned) {