docs(intent): a value required only under a condition - checks: requiredWhen (#7094) - #236
Merged
Conversation
…redWhen (#7094) `required: true` is unconditional, and most rules about a missing value are not: the value is needed for one way of handling the record and meaningless for the others. An invoice sent by e-mail needs the customer's e-mail address; one sent by post does not, so `required` on the address is not the rule - and until this kind existed the real one could not be declared at all, so an e-mailed invoice whose customer carried no address reached status SENT with nobody to send it to and told the clerk it had succeeded. Documents the new row-level `checks` kind on the DSL reference: the one-hop `Relation.field` value (cross-model included), the closed and typed condition and why both of its refusals are parse errors, and the optional `status:` gate - whose presence decides whether the rule holds on every write or at the transition that finally needs the value. 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.
Documents the new row-level
checkskind delivered in eclipse-dirigible/dirigible#7129 (issue eclipse-dirigible/dirigible#7094).required: trueis unconditional, and most rules about a missing value are not: the value is needed for ONE way of handling the record and meaningless for the others. An invoice sent by e-mail needs the customer's e-mail address; one sent by post does not - sorequiredon the address is not the rule, and until this kind existed the real one could not be declared at all. An e-mailed invoice whose customer carried no address therefore reached status SENT with nobody to send it to, and the clerk who pressed the button was told it had succeeded.The new section covers the three things an author has to decide:
Customer.email) - including a relation whose target is owned by another model, and why an unset relation counts as an absent value;requirednobody authored; read as "always false" it switches the rule off - both silently);status:gate, whose presence decides whether the rule holds on every user write or only at the transition that finally needs the value - which is what makes the rule expressible at all, since a record being typed has not chosen how it will be sent.npm run docs:buildpasses.🤖 Generated with Claude Code