Files
dashlibstorage/API.customergroup.md
seb 70e0a9ddc4 Add entity customer numbers and scope APIs via selected company.
Entity gets an optional unique-per-company number with allocate/peek/isNumberFree helpers. Company-scoped store methods no longer take companyId and resolve google_auth.selected_company instead.
2026-08-07 04:29:35 +02:00

1.2 KiB

customergroup

This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.

customergroup.create

Source: src/store/customergroup/create.js

Creates a new customer group for a company.

const fn = create(pool);
const group = await fn(42, { name: 'Wholesale' });
// => { id, name, sort }

customergroup.delete

Source: src/store/customergroup/delete.js

Deletes a customer group for a company by its id.

const fn = del(pool);
await fn(42, 5);

customergroup.list

Source: src/store/customergroup/list.js

Lists the customer groups of a company.

const fn = list(pool);
const groups = await fn(42);
// => [{ id, name, sort }]

customergroup.order

Source: src/store/customergroup/order.js

Reorders the customer groups of a company.

const fn = order(pool);
const result = await fn(42, { customergroupIds: [3, 1, 2] });
// => { customergroupIds: [3, 1, 2] }

customergroup.update

Source: src/store/customergroup/update.js

Updates the name of a customer group for a company.

const fn = update(pool);
const group = await fn(42, 5, { name: 'Retail' });
// => { id, name, sort }