Commit d0ed5f1
feat(intent): generate create-time numbering from number: {} (N3b-i) (#6387)
* feat(intent): auto-generate type: uuid fields on create (no hand-written action)
A `type: uuid` field is now platform-generated: the generated repository assigns a random UUID on
create when the value is empty, so a document's system/business-key uuid no longer needs a
hand-written calculatedActionOnCreate. The author can still seed/import an explicit value - it is
only filled when blank.
- EdmIntentGenerator marks a uuid property generatedUuid="true" (alongside the existing read-only
flag).
- The DAO Repository.java.template save() (create path) assigns java.util.UUID.randomUUID() to each
generatedUuid property that is null/blank, next to the calculated-on-create assignments.
Verified: the EDM marks Customer.Uuid generatedUuid; a generated CompanyRepository.save() contains
the UUID auto-fill and compiles clean (544 beans, no javac errors).
This is the reusable UUID primitive the first-class numbering placeholder (stampOn: issue, N3b) will
reuse - together they retire the hand-written per-document UUID/number placeholder actions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(intent): generate create-time numbering from number: {} (N3b-i)
N3b-i of first-class document numbering: turn a `number: {}` field (N1) into its create-time
behavior against the runtime (N2) via the SDK (N3a). No hand-written placeholder action.
- EdmIntentGenerator emits per-field number markers (numberSeries / numberFormat / numberScope
[PascalCased] / numberStampOn) and, by mode: stampOn:create -> numberStampOnCreate="true";
stampOn:issue -> generatedUuid="true" (a UUID placeholder on create, reusing the uuid auto-fill),
pending the issue stamp step (N3b-ii). The number field is read-only.
- Repository.java.template save() (create path): for a numberStampOnCreate field, build the scope
map (year = current year; any other name reads the entity's field) and stamp the real number via
sdk.numbering.DocumentNumbers.next(series, format, scope) when the field is blank.
Verified live: a Company with `number: { series: CompanyDoc, format: "CO-{seq:05}", stampOn: create }`
stamps CO-00001 / CO-00002 / CO-00003 on successive REST creates (gap-free), the counter shows in the
shell's Document Numbering settings, and it compiles clean. EdmIntentGeneratorTest#numberFieldEmitsStampMarkers
covers both modes.
Stacked on #6386 (uuid auto-fill — the issue placeholder). N3b-ii: the generated issue stamp delegate
(gen.events.<Entity>NumberStamp, idempotent) the process wires via delegate:, so stampOn:issue
documents (invoices) drop SalesInvoiceNumberAction + the generateNumber delegate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 466a898 commit d0ed5f1
3 files changed
Lines changed: 80 additions & 0 deletions
File tree
- components
- engine/engine-intent/src
- main/java/org/eclipse/dirigible/components/intent/generator/edm
- test/java/org/eclipse/dirigible/components/intent/generator/edm
- template/template-application-dao-java/src/main/resources/META-INF/dirigible/template-application-dao-java/data
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
924 | 925 | | |
925 | 926 | | |
926 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
927 | 954 | | |
928 | 955 | | |
929 | 956 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 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 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
80 | 113 | | |
81 | 114 | | |
82 | 115 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
154 | 174 | | |
155 | 175 | | |
156 | 176 | | |
| |||
0 commit comments