Commit Graph

115 Commits

Author SHA1 Message Date
seb
b5255bdd17 u 2026-09-25 11:34:00 +02:00
seb
387147ccf3 u 2026-09-25 07:27:22 +02:00
seb
f8f61a1212 u 2026-09-24 23:26:25 +02:00
seb
075b1f0ddc u 2026-09-22 08:35:36 +02:00
seb
dce65db435 bench 2026-09-22 08:31:01 +02:00
seb
cca131d83a sqlite 2026-09-22 07:25:16 +02:00
seb
4ed6260e91 providerrefactor part1 2026-09-21 03:33:55 +02:00
seb
53a20c4353 refactor: introduce database provider abstraction, isolate MSSQL layer
- Add provider contract (src/providers/provider.js): query() -> {rows,
  rowsAffected, insertId}, callback transaction(fn), exec() for stored
  procs, initialize/purge lifecycle
- Add MssqlProvider (src/providers/mssql/index.js) wrapping an mssql
  ConnectionPool with normalized results, tx commit/rollback and
  constraint-error classifiers (unique 2627/2601, FK 547)
- LibDashStore constructor now takes a provider instead of a pool
  (breaking); adds LibDashStore.create() async factory; keeps pool as
  transitional bridge until store modules are converted (see TODO.md)
- Move MSSQL-specific code into the provider: src/sql/* ->
  src/providers/mssql/queries/*, src/schema.js ->
  src/providers/mssql/schema.js, purge SQL -> purgeSql.js
- Update scripts, generate-schema-graph.js and package.json exports
  (./providers/mssql, ./providers/provider)
- Add TODO.md with the remaining provider/SQLite migration plan

No SQL or behavioral changes.
2026-09-20 13:51:01 +02:00
seb
67b3f8b6bf u 2026-09-20 09:21:29 +02:00
seb
8a6f724ec5 u 2026-09-20 07:46:07 +02:00
seb
8bc1def4ef u 2026-09-20 07:41:44 +02:00
seb
b20803eda0 mssql 2026-09-20 07:23:26 +02:00
seb
a9460e886d u 2026-09-20 06:11:59 +02:00
seb
68372055fa pdf convert wasm only 2026-09-20 04:09:22 +02:00
seb
9d88823167 thumb 2026-09-19 06:33:45 +02:00
seb
b69110f1c2 fllabcks hmmm 2026-09-18 08:28:44 +02:00
seb
bac6f2a801 u 2026-09-18 07:13:56 +02:00
seb
9e9d3154ca file meta 2026-09-18 05:19:47 +02:00
seb
e10a8d10e7 schema generation in api.md 2026-09-18 02:56:00 +02:00
seb
3208f54f81 feat(articlesupplier): add listByEntityAndSkus API with linked article, photos, and eans 2026-09-18 02:23:13 +02:00
seb
e3d30b296b feat: add size, created, and modified columns to file table and manifestattachment APIs 2026-09-18 01:45:27 +02:00
seb
cfb7f86f0e feat: add hash and thumbnail columns to file, sort column and order method to manifestattachment 2026-09-18 01:21:54 +02:00
seb
980eda629b u 2026-09-17 12:36:37 +02:00
seb
af52ff595f feat(articlesupplier): add sort column, reorder method, and update queries and schema 2026-09-17 12:00:41 +02:00
seb
4c196c7209 feat(articlesupplier): implement store methods, schema constraints, and embed in getBySku 2026-09-17 11:41:13 +02:00
seb
1fafeeb5f2 refactor(manifestLines): standardize on taxrate and change schema type to float 2026-09-17 11:02:44 +02:00
seb
5a7773df79 docs: expand input and output object types in API signatures 2026-09-16 17:45:46 +02:00
seb
9b1b7615e2 refactor(manifestLines): standardize on tax and remove taxrate alias 2026-09-16 17:04:08 +02:00
seb
8f23dd8c75 feat: manage files via manifestattachment with auth and cascade trigger, format API.md method signatures 2026-09-16 16:49:59 +02:00
seb
8b97948a75 refactor(manifestLines): remove customname migration fallback 2026-09-16 10:15:39 +02:00
seb
7b3d2141fa feat(schema): rename manifestarticle customname to name, add pu, and use taxrate 2026-09-16 10:05:24 +02:00
seb
63f83b6822 ncu 2026-09-15 09:34:48 +02:00
seb
00bbd2e764 feat(schema): replace manifestarticle article_id FK with sku, rename articlesupplier sku/stock fields 2026-09-15 09:24:43 +02:00
seb
e56f725bd9 feat(companysetting): add writeonly column and mask values for GUI 2026-09-15 08:48:24 +02:00
seb
2e16a22c99 feat(schema): add articlesupplier table and manifestarticle custom sku/name fields 2026-09-14 22:43:03 +02:00
seb
af416246b4 feat(article): add article import with V/K compound linking
Add article.importRows to create articles by SKU from CSV-style rows,
running in two passes so fatherSku links to rows later in the file still
resolve. Existing SKUs are skipped, duplicate EANs are dropped, prices and
taxes are ensured, brands are upserted by name, and parent categories are
resolved/created via breadcrumb path.

Also add:
- article.setFatherBySku to link/unlink a child to its father article
- category.ensureByPath to resolve or create categories by path (tx-aware)
- supporting SQL constants (GET_ID_BY_SKU, EAN_EXISTS, father-link helpers,
  GET_BY_PARENT_AND_NAME)
- regenerated API docs
2026-08-11 05:36:07 +02:00
seb
fb88cb92a5 Auto-allocate delivery number via getnextnumberwithprefixandpadding 2026-08-08 10:09:08 +02:00
seb
91e7c03655 Record articlehistory entry on article creation 2026-08-08 10:09:02 +02:00
seb
53acc6a8ff Use dark color scheme for schema graph in browser preview 2026-08-08 10:08:56 +02:00
seb
29099b2a16 feat(manifest): add externalNumber reference to quote/order/delivery
- Add `external_number NVARCHAR(100)` column to the `manifest` table.
- Thread `externalNumber` through manifestDoc and delivery SQL (list,
  header, create, update).
- Include `externalNumber` in shapeSummary and quote/order/delivery
  create/update/list/getById handlers (optional, clearable on update).
- Update README type definitions and regenerate API/schema docs.
2026-08-08 09:13:20 +02:00
seb
f302cda39e feat(numbers): add number sequences store; restrict companysetting keys
- Add `numbers` store module with `list` and `update` methods backed by
  the `numbers` table (prefix, padding, next) per company.
- Add sql queries LIST_BY_COMPANY, GET_BY_COMPANY_AND_ID, UPDATE_...
- Regenerate and wire API docs for `numbers`.

companysetting:
- Remove the `delete` endpoint (settings are now upsert/read only).
- Restrict `set` to a fixed allow-list of keys:
  ui.theme, keys.tavily, keys.openrouter, labelprinter.addr, labelprinter.type.
- Drop DELETE_BY_COMPANY_AND_KEY sql and the delete store file.

Docs: update README, API.md, API.companysetting.md, API.numbers.md.
2026-08-08 09:03:51 +02:00
seb
aefd97a171 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
2026-08-07 06:23:17 +02:00
seb
396389457f part1 2026-08-07 05:21:56 +02:00
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
seb
1e89e19863 docs 2026-08-07 04:05:01 +02:00
seb
4833acd680 docs: add JSDoc headers to all externally exported store functions 2026-08-07 03:58:48 +02:00
seb
c290fe8f4b Add customergroup sort with bulk order and locked implicit names.
Reorder via customergroup.order (exact id list → sort 0…n-1); block renaming POS/Lieferanten while still allowing create/update of other groups by name.
2026-08-07 03:38:01 +02:00
seb
b095ab6199 Add quote and order stores plus ledger hash_version.
Mirror delivery on manifest for quote/order with customer entityId (excluding Lieferanten/POS), and support entity.list role=customer for pickers.
2026-08-06 19:58:35 +02:00
seb
ae549fd022 Add ledger, address/contact sort, and tighter schema-graph layout.
Replace manifestarticle.transactedamount with an append-only ledger, add sort on entity address/contact, and allow same-rank FKs with crossing-aware exits in the graph.
2026-08-06 07:39:48 +02:00
seb
3b77a1c946 Add entity address/contact tables and CRUD for entity resources 2026-08-06 05:43:50 +02:00