Commit Graph

77 Commits

Author SHA1 Message Date
seb
7c8c24eb4d u 2026-10-15 15:54:59 +02:00
seb
f38d1f11a6 u 2026-10-14 22:48:00 +02:00
seb
b718cdb047 u 2026-10-14 13:31:23 +02:00
seb
8a626b17fc u 2026-10-13 13:21:11 +02:00
seb
4b2ca7ce0e u 2026-10-13 00:36:36 +02:00
seb
8a8aeaedd7 u 2026-10-12 22:32:21 +02:00
seb
28e62093b3 u 2026-10-12 19:48:07 +02:00
seb
c614a67b97 u 2026-10-12 13:11:33 +02:00
seb
7f4092971d u 2026-10-11 17:26:11 +02:00
seb
906ebafbbe u 2026-10-09 21:43:20 +02:00
seb
4ae3439289 u 2026-10-09 17:55:47 +02:00
seb
f3674edcb7 u 2026-10-09 10:41:17 +02:00
seb
69eb2c9a0d u 2026-10-08 01:37:26 +02:00
seb
4718cb5726 u 2026-10-04 21:22:05 +02:00
seb
2158ac475b u 2026-10-04 18:56:55 +02:00
seb
89fe6e6451 u 2026-10-04 09:33:27 +02:00
seb
3b74c12f4e u 2026-10-03 23:13:40 +02:00
seb
84e547660e u 2026-10-01 17:40:04 +02:00
seb
894f72eba5 u 2026-09-30 17:35:22 +02:00
seb
280a45a11f u 2026-09-30 09:48:01 +02:00
seb
9885c489f0 u 2026-09-29 20:10:49 +02:00
seb
69bd0935cc u 2026-09-29 18:26:42 +02:00
seb
ae5d5cc6f8 u 2026-09-29 16:16:05 +02:00
seb
7bb674d5e7 u 2026-09-29 11:21:57 +02:00
seb
87da854de4 u 2026-09-27 22:01:56 +02:00
seb
0cafa11a32 u 2026-09-27 21:01:30 +02:00
seb
cd57f21af8 u 2026-09-27 16:19:45 +02:00
seb
e7f92ebef8 u 2026-09-26 23:06:05 +02:00
seb
f8f61a1212 u 2026-09-24 23:26:25 +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
3208f54f81 feat(articlesupplier): add listByEntityAndSkus API with linked article, photos, and eans 2026-09-18 02:23:13 +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
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
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
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
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
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
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
3b77a1c946 Add entity address/contact tables and CRUD for entity resources 2026-08-06 05:43:50 +02:00
seb
0b7e40ac9c Add company-scoped delivery store on manifest 2026-08-06 05:32:48 +02:00
seb
4f46967f28 Add supplier CRUD on entity with Lieferanten group and entityhistory 2026-08-06 03:56:32 +02:00
seb
561ba5bb99 Store Google profile picture bytes on google_auth 2026-08-05 11:08:06 +02:00
seb
d1eb2716ae Link articlehistory to companyuser; store Google picture and sub on google_auth 2026-08-05 10:57:50 +02:00
seb
46c85fe29e Add articlehistory on updateBySku and getHistoryBySku 2026-08-05 09:17:17 +02:00
seb
82c61e599d export 2026-08-04 01:24:27 +02:00