Skip to content

feat(intent): auto-generate type: uuid fields on create#6386

Merged
delchev merged 1 commit into
masterfrom
feat/intent-uuid-autogen
Jul 22, 2026
Merged

feat(intent): auto-generate type: uuid fields on create#6386
delchev merged 1 commit into
masterfrom
feat/intent-uuid-autogen

Conversation

@delchev

@delchev delchev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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. An explicitly seeded/imported value is respected (filled only when blank).

  • EdmIntentGenerator marks a uuid property generatedUuid="true" (beside the existing read-only flag).
  • Repository.java.template save() (create path) assigns java.util.UUID.randomUUID().toString() to each generatedUuid property that is null/blank, next to the calculated-on-create assignments.

Verified

  • EdmIntentGeneratorTest asserts Customer.Uuid carries generatedUuid.
  • Live: a generated 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

…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
delchev merged commit 466a898 into master Jul 22, 2026
10 checks passed
@delchev
delchev deleted the feat/intent-uuid-autogen branch July 22, 2026 15:35
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant