Commit a364d84
feat(numbering): sdk.numbering.DocumentNumbers — client SDK (N3a) (#6385)
* feat(numbering): per-tenant document-number counter store + runtime + shell settings (N2)
N2 of first-class document numbering (kf-catalog UPSTREAM_PLAN #11a): the runtime the DSL (N1,
#6382) will generate against, plus the application-shell settings surface.
New module components/engine/engine-numbering:
- DocumentNumberStore — a per-tenant DIRIGIBLE_DOCUMENT_NUMBERS table (via the tenant-routed default
datasource + SqlFactory, like DIRIGIBLE_CONFIGURATIONS), keyed by (series, scope). allocate() is
gap-free: the increment takes a row lock so concurrent allocations of the same counter serialize;
the row is created on first use.
- DocumentNumberService — allocate + the format grammar ({seq}/{seq:0N} zero-pad, {series}, and scope
tokens {year}/{<Field>}) + scope-key derivation; plus list()/setNext() for management.
- DocumentNumberEndpoint — /services/core/numbering (ADMINISTRATOR/OPERATOR): GET the tenant's
counters, PUT the next value a (series, scope) counter will allocate.
Application shell (resources-application) — a built-in "Document Numbering" Settings entry (next to
Region & Language / Tenant Configuration): lists the counters and lets an admin set each series'
next value (reset/seed a sequence, e.g. start invoices at 1000); read-only on a 403.
Verified on a booted instance: GET [] then PUT {series:SalesInvoice,next:1000} (204) then GET shows
counter 999 (next allocate = 1000); the settings page + appShell.js serve the new entry.
DocumentNumberServiceTest covers the format renderer + scope-key. The SDK entry + generated stamping
+ idempotency are N3.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(numbering): sdk.numbering.DocumentNumbers — client SDK for first-class numbering (N3a)
The SDK bridge from client-Java to the per-tenant counter runtime (N2, #6384): allocate the next
gap-free number for a series and render it through the format. Both hand-written custom/ code and
the forthcoming generated stamping (N3b) share one engine + one sequence + the same counter the
application shell's Document Numbering settings manage.
- DocumentNumbers.next(series, format, scope) / next(series, format) → the formatted number, via
Beans.get(DocumentNumberService).
- api-modules-java depends on engine-numbering (same precedent as engine-document for sdk.print).
Verified: NumberingSdkIT drops a client-Java @controller calling DocumentNumbers.next and asserts a
gap-free formatted sequence over HTTP (T-0001, T-0002) in the caller's tenant scope.
N3b (generation): turn a `number: {}` field (N1, #6382) into the create-time stamp/placeholder + the
issue-step stamp delegate + idempotency, calling this SDK. Depends on #6384.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent bf18ecf commit a364d84
3 files changed
Lines changed: 172 additions & 0 deletions
File tree
- components/api/api-modules-java
- src/main/java/org/eclipse/dirigible/sdk/numbering
- tests/tests-integrations/src/main/java/org/eclipse/dirigible/integration/tests/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
0 commit comments