feat(numbering): declared partition sources — labeled rows + counter seeding before first use (#6506) - #6507
Merged
Merged
Conversation
…+ seeding counters before first use (#6506) A partitioned series row rendered as 'Sales Invoice [1]' (the raw partner id), and a partition's counter could not be seeded before its first document: partition rows materialize on first allocation (correct - partition values are data), so the row was not there to edit. The .numbers declaration may now name its partition source - "partitions": {"table", "key", "label"} - authored physical coordinates exactly like a .csvim's table/columns; the identifiers are parse-validated to plain SQL names (a published artefact must not become an injection surface) and a differing cross-module re-declaration fails the artefact as for the shape. The numbering endpoint resolves each partition row's value to the entity's display label and lists a VIRTUAL row for every declared value that has not allocated yet, rendered with the base row's shape; saving a virtual row provisions it exactly as the first allocation would have (base shape inherited, then the edit applied - DocumentNumberService.setNext/ setShape ensure the partition row exists). The settings page renders 'Sales Invoice — ACME Ltd.' and offers every company's row up front. NumberingSdkIT gains the end-to-end case: a declared partition source over a real table lists labeled virtual rows, seeding one provisions it, and the FIRST allocated document renders exactly the seeded number (green locally, together with the settings-surface case). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
delchev
force-pushed
the
feat/numbering-partition-source
branch
from
August 4, 2026 15:08
c1c2f9e to
95b39fc
Compare
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.
Closes #6506. Stacked on #6500 (numbering settings UX) - the diff includes it until #6500 merges; review the last commit only.
What
The platform did not know where a partitioned series' values come from, so the Document Numbering settings page showed raw ids (
Sales Invoice [1]) and could not offer a partition's row before its first allocation - an operator could not seed a company's starting number before its first document..numbersgains an optional partition source.{"name": "Sales Invoice", "prefix": "SI", "size": 10, "partitions": {"table": "CRM_COMPANY", "key": "COMPANY_ID", "label": "COMPANY_NAME"}}- authored physical coordinates, the.csvimprecedent. Identifiers are parse-validated to plain SQL names (a published artefact must not become an injection surface - they are quoted into one SELECT); a differing cross-module re-declaration fails the artefact loudly, exactly as for the shape; the synchronizer's provisioning and the DELETE contract are untouched.Sales Invoice — ACME Ltd., falling back to the raw value in brackets when unresolvable.virtual: truerow rendered with the base row's shape (next = 1). Saving one provisions it exactly as the first allocation would have -DocumentNumberService.setNext/setShapenowensurePartitionfirst (base shape inherited at row birth, then the edit applied). The base-row shape-template semantics from fix(numbering): per-row save in settings; base row of a partitioned series offers no counter (#6499) #6500 extend naturally: a series with a declared source ispartitionedeven before any allocation.Docs synced: root + engine-intent CLAUDE.md numbering sections, the intent assistant guide.
Test
NumberingSdkIT.aDeclaredPartitionSourceLabelsRowsAndSeedsCountersBeforeFirstUse(green locally alongside the #6500 settings-surface case): creates + seeds a real partition-source table, publishes the declaration, asserts the two labeled virtual rows and the base row'spartitionedflag overGET /services/core/numbering, seeds one virtual row's Next to 42 (PUTprovisions it), and asserts the FIRST allocated document renders exactlyP-0042- the outermost layer of the seeding contract.🤖 Generated with Claude Code