Skip to content

feat(intent): generate the issue-step number stamp delegate (N3b-ii)#6389

Merged
delchev merged 3 commits into
masterfrom
feat/intent-numbering-n3b-issue
Jul 22, 2026
Merged

feat(intent): generate the issue-step number stamp delegate (N3b-ii)#6389
delchev merged 3 commits into
masterfrom
feat/intent-numbering-n3b-issue

Conversation

@delchev

@delchev delchev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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 per stampOn:issue field).
  • GlueIntentGenerator emits it; generateUtils adds the numbering case (perspective → javaPerspective).
  • Numbering.java.templategen/events/<Entity>NumberStamp.java: a JavaDelegate that reads the entity id from the process variable and — only while the value is still the UUID placeholder (idempotent) — allocates + formats via sdk.numbering.DocumentNumbers and writes with the targeted updateProperty. Wired 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 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: SalesInvoice / CreditNote / DebitNote drop SalesInvoiceNumberAction + the per-doc generateNumber delegates + kf-mod-numbers, replaced by number: { …, stampOn: issue } + a delegate: step. N4 (scope/resetOn) is the remaining DSL refinement.

🤖 Generated with Claude Code

delchev and others added 3 commits July 22, 2026 18:18
…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>
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>
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>
Base automatically changed from feat/intent-numbering-n3b to master July 22, 2026 16:08
@delchev
delchev merged commit dc2a313 into master Jul 22, 2026
7 checks passed
@delchev
delchev deleted the feat/intent-numbering-n3b-issue branch July 22, 2026 16:08
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