proposal: what a copy does not carry over - #76
Open
delchev wants to merge 1 commit into
Open
Conversation
`duplicable: true` clones the source header verbatim, so a copied invoice keeps the source's date, due date and tax-event date - and a create-time rule cannot correct them, because such a rule fills an empty value and respects a present one. Propose the object form: `reset:` hands a field back to its create-time rule, `defaults:` writes a constant, with the `now` token in the field's own shape. Co-Authored-By: Claude Opus 5 <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.
duplicable: trueis a bare boolean. The Duplicate it adds clones the source header verbatim - minus the values no user authored - so every ordinary user field rides along, including the ones a business rule says must be fresh. On a sales invoice that is the three dates: "same invoice as last month" opens as a draft dated last month, due last month, with last month's tax event, and an unnoticed tax-event date is a legally wrong document.The model cannot say otherwise on its own side: a
calculatedActionOnCreatefills an empty value and respects a present one - the right contract for a hand-made invoice, and exactly what makes the copied value stick - and a plainrequireddate carries no rule at all.Proposes the object form, reusing the vocabulary
generates:already has:Two keywords rather than
defaults: { due: null }:resetsays what actually happens - the value is handed back to the entity's create-time rule instead of being assigned - and the two compose,resetfor a field that HAS such a rule,defaultsfor one that does not.duplicable: truestays the shorthand and generates byte-identically.The proposal carries the
Specification text(anchored after Entities > Control order), its two normative blocks including the local-calendar rule fornow, and the Appendix A row. The implicit alternative - dropping everycalculatedActionOnCreatefield on duplicate, with no authoring change - is recorded as considered and rejected as a default, since it would also recompute fields the source deliberately overrode.Implemented in eclipse-dirigible#7360; docs in dirigible-io.github.io#245.
🤖 Generated with Claude Code