feat(intent): auto-generate type: uuid fields on create#6386
Merged
Conversation
…ten 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>
delchev
added a commit
that referenced
this pull request
Jul 22, 2026
…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>
delchev
added a commit
that referenced
this pull request
Jul 22, 2026
…6389) * 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> * feat(intent): generate the issue-step number stamp delegate (N3b-ii) Completes first-class numbering for stampOn: issue: a `number: { stampOn: issue }` field is created with a UUID placeholder (N3b-i) and stamped with the real formatted number at the modeled issue step by a generated delegate - no hand-written SalesInvoiceNumberAction / generateNumber delegate. Mirrors the snapshot-D pattern: - NumberingSupport builds the `numbering` glue collection (one descriptor per stampOn:issue field: entity, perspective, masterPk, field, series, format, scope). - GlueIntentGenerator emits it into the .glue. - generateUtils adds the `numbering` case (sanitizes perspective -> javaPerspective). - Numbering.java.template generates gen/events/<Entity>NumberStamp.java: a JavaDelegate that reads the entity id from the process variable, loads it, and - only while the value is still the UUID placeholder (idempotent) - allocates + formats via sdk.numbering.DocumentNumbers and writes with the targeted updateProperty (a workflow system write). The process wires it via delegate: gen.events.<Entity>NumberStamp (like generateSnapshot). Verified live: a Company with `number: { series: CompanyIssue, format: "CI-{seq:05}", stampOn: issue }` emits a CompanyNumberStamp delegate that compiles clean (542 beans, no javac errors); the created record carries a UUID placeholder (the stamp runs at the issue step). Stacked on #6387 (N3b-i). This unblocks the KF migration: stampOn:issue documents (SalesInvoice / CreditNote / DebitNote) can drop SalesInvoiceNumberAction + the per-doc generateNumber delegates + kf-mod-numbers, replacing them with `number: { ..., stampOn: issue }` + a delegate: step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
type: uuidfield is now platform-generated: the generated repository assigns a random UUID on create when the value is empty — so a document's system/business-keyuuidno longer needs a hand-writtencalculatedActionOnCreate. An explicitly seeded/imported value is respected (filled only when blank).EdmIntentGeneratormarks a uuid propertygeneratedUuid="true"(beside the existing read-only flag).Repository.java.templatesave()(create path) assignsjava.util.UUID.randomUUID().toString()to eachgeneratedUuidproperty that is null/blank, next to the calculated-on-create assignments.Verified
EdmIntentGeneratorTestassertsCustomer.UuidcarriesgeneratedUuid.CompanyRepository.save()contains the UUID auto-fill and compiles clean (544 beans, no javac errors).Context
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 (e.g.SalesInvoiceNumberAction). Independent of the numbering PR stack.🤖 Generated with Claude Code