@wildo-ai/framework-knowledge 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-marketplace/.claude-plugin/marketplace.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/references/acceptance.md +11 -0
- package/dist/claude-marketplace/plugins/wildo/references/composites-and-the-loop.md +9 -2
- package/dist/claude-marketplace/plugins/wildo/references/creation-state.md +21 -0
- package/dist/claude-marketplace/plugins/wildo/references/derived-artifacts.md +121 -0
- package/dist/claude-marketplace/plugins/wildo/references/expert-personas-and-deliberations.md +26 -7
- package/dist/claude-marketplace/plugins/wildo/references/runs-judges-and-questions.md +31 -5
- package/dist/claude-marketplace/plugins/wildo/skills/accept/SKILL.md +4 -2
- package/dist/claude-marketplace/plugins/wildo/skills/answer/SKILL.md +29 -2
- package/dist/claude-marketplace/plugins/wildo/skills/build/SKILL.md +69 -24
- package/dist/claude-marketplace/plugins/wildo/skills/doctor/SKILL.md +10 -0
- package/dist/claude-marketplace/plugins/wildo/skills/run/SKILL.md +21 -5
- package/dist/claude-marketplace/plugins/wildo/skills/start/SKILL.md +31 -5
- package/dist/claude-marketplace/plugins/wildo/skills/status/SKILL.md +2 -0
- package/dist/claude-marketplace/plugins/wildo/skills/why/SKILL.md +20 -4
- package/dist/esm/framework-knowledge.definitions.d.ts +1 -1
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -1
- package/dist/esm/framework-knowledge.definitions.js +95 -5
- package/dist/esm/framework-knowledge.definitions.js.map +1 -1
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts +2 -2
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js +2 -2
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build/playbook.definition.d.ts +11 -11
- package/dist/esm/playbooks/bottom_up.build/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.build/playbook.definition.js +29 -22
- package/dist/esm/playbooks/bottom_up.build/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +41 -3
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +175 -14
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js +3 -3
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js +1 -1
- package/dist/esm/playbooks/bottom_up.build-scale/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts +8 -4
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js +13 -6
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +4 -2
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +90 -13
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts +4 -3
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js +4 -3
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +8 -0
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +12 -4
- package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +12 -3
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +8 -4
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts +4 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js +2 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/cross_cutting.application-creation/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.compliance/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.feature-development/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.refinement/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +13 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/refinement.feature-contribution/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.governance-document-candidate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +25 -27
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +91 -43
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts +41 -0
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js +43 -0
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts +200 -0
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js +203 -0
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts +81 -0
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts.map +1 -0
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js +93 -0
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js.map +1 -0
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts +3 -1
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js +27 -18
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.d.ts +11 -1
- package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.js +11 -11
- package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.d.ts +2 -0
- package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.js +3 -1
- package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-evidence-adequacy/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts +2 -0
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js +3 -1
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-research/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.definition/playbook.definition.d.ts +5 -2
- package/dist/esm/playbooks/top_down.definition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.definition/playbook.definition.js +16 -4
- package/dist/esm/playbooks/top_down.definition/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts +27 -6
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js +32 -12
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.feature-drafts/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +13 -5
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts +7 -3
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +71 -2
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +23 -8
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.risk-register/playbook.definition.d.ts +7 -1
- package/dist/esm/playbooks/top_down.risk-register/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.risk-register/playbook.definition.js +4 -2
- package/dist/esm/playbooks/top_down.risk-register/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts +9 -3
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js +3 -3
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts +35 -2
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +41 -17
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -1
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -1
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
- package/dist/knowledge/manifest.json +8 -8
- package/dist/knowledge/playbooks/bottom_up.assemble-verify/method.md +22 -7
- package/dist/knowledge/playbooks/bottom_up.assemble-verify/playbook.json +3 -3
- package/dist/knowledge/playbooks/bottom_up.build/method.md +17 -15
- package/dist/knowledge/playbooks/bottom_up.build/playbook.json +4 -3
- package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +261 -34
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +42 -4
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +188 -59
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +2 -2
- package/dist/knowledge/playbooks/bottom_up.build-scale/method.md +169 -276
- package/dist/knowledge/playbooks/bottom_up.build-scale/playbook.json +2 -2
- package/dist/knowledge/playbooks/bottom_up.capability-composition/method.md +8 -1
- package/dist/knowledge/playbooks/bottom_up.capability-composition/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.conception/method.md +3 -2
- package/dist/knowledge/playbooks/bottom_up.conception/playbook.json +11 -3
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +129 -17
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +7 -4
- package/dist/knowledge/playbooks/bottom_up.experience-plan/method.md +28 -6
- package/dist/knowledge/playbooks/bottom_up.experience-plan/playbook.json +5 -4
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +13 -5
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +50 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +16 -4
- package/dist/knowledge/playbooks/bottom_up.website-plan/method.md +19 -0
- package/dist/knowledge/playbooks/bottom_up.website-plan/playbook.json +5 -2
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +7 -3
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +8 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +3 -2
- package/dist/knowledge/playbooks/refinement.feature-contribution/method.md +5 -2
- package/dist/knowledge/playbooks/refinement.feature-contribution/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +75 -37
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +35 -38
- package/dist/knowledge/playbooks/top_down.brand-name-research/method.md +145 -0
- package/dist/knowledge/playbooks/top_down.brand-name-research/playbook.json +57 -0
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-protocol.json +1 -0
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-treatment.json +1 -0
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/method.md +99 -0
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/playbook.json +65 -0
- package/dist/knowledge/playbooks/top_down.brand-naming/method.md +56 -0
- package/dist/knowledge/playbooks/top_down.brand-naming/playbook.json +76 -0
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.business-model/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.business-model/method.md +60 -6
- package/dist/knowledge/playbooks/top_down.business-model/playbook.json +15 -10
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +10 -9
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.compliance-analysis/playbook.json +30 -10
- package/dist/knowledge/playbooks/top_down.compliance-conception/playbook.json +3 -1
- package/dist/knowledge/playbooks/top_down.compliance-posture/playbook.json +4 -1
- package/dist/knowledge/playbooks/top_down.definition/method.md +8 -3
- package/dist/knowledge/playbooks/top_down.definition/playbook.json +6 -4
- package/dist/knowledge/playbooks/top_down.expert-personas/playbook.json +16 -2
- package/dist/knowledge/playbooks/top_down.feature-drafts/method.md +5 -2
- package/dist/knowledge/playbooks/top_down.feature-drafts/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +26 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +4 -2
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +11 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +84 -9
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +6 -3
- package/dist/knowledge/playbooks/top_down.risk-register/method.md +21 -0
- package/dist/knowledge/playbooks/top_down.risk-register/playbook.json +8 -2
- package/dist/knowledge/playbooks/top_down.scope-roadmap/playbook.json +4 -2
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +29 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +58 -17
- package/dist/knowledge/references/brand.name-choice.config.md +144 -0
- package/dist/knowledge/references/brand.name-screening.config.md +308 -0
- package/dist/knowledge/references/build-plan.task-graph.config.md +119 -11
- package/dist/knowledge/references/business-model.pricing-plan.config.md +16 -0
- package/dist/knowledge/references/business-model.snapshot.config.md +64 -0
- package/dist/knowledge/references/business-model.snapshot.validation.md +68 -4
- package/dist/knowledge/references/capability-composition.config.md +67 -4
- package/dist/knowledge/references/companion.market.prompt-renderer.md +11 -6
- package/dist/knowledge/references/example.authorization.application-roles.office-and-field.md +44 -0
- package/dist/knowledge/references/example.backend.custom-operation.audit-event.md +81 -0
- package/dist/knowledge/references/example.backend.custom-operation.child-line-total.md +258 -0
- package/dist/knowledge/references/example.backend.custom-operation.computed-total.md +153 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-related-resource.md +107 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +39 -10
- package/dist/knowledge/references/example.data-seeding.row-reference.md +80 -0
- package/dist/knowledge/references/example.email.template.minimal.md +1 -1
- package/dist/knowledge/references/example.resource.config-wiring.retention-policy-operations.md +74 -0
- package/dist/knowledge/references/example.resource.personal-data.free-text-field.md +19 -0
- package/dist/knowledge/references/example.resource.personal-data.person-without-account.md +27 -0
- package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +152 -0
- package/dist/knowledge/references/example.resource.ui-behavior.filter-presets.md +15 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -0
- package/dist/knowledge/references/example.views.app-level.home-definition.md +13 -0
- package/dist/knowledge/references/example.views.chart-definition.shared.md +83 -0
- package/dist/knowledge/references/experience-plan.config.md +60 -7
- package/dist/knowledge/references/market.context-block.builder.md +1 -1
- package/dist/knowledge/references/market.snapshot.validation.md +1 -1
- package/dist/knowledge/references/placement-plan.config.md +43 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +8 -2
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +2 -0
- package/dist/knowledge/references/requirements.references.conventions.md +1 -1
- package/dist/knowledge/references/requirements.snapshot.config.md +57 -1
- package/dist/knowledge/references/requirements.snapshot.validation.md +35 -1
- package/dist/knowledge/references/saas.backend.audit-logs.log-event.md +63 -0
- package/dist/knowledge/references/saas.backend.document-sequence.issue-in-operation.md +60 -0
- package/dist/knowledge/references/saas.backend.document-sequence.raise-floor.md +156 -0
- package/dist/knowledge/references/saas.backend.email.send.md +77 -0
- package/dist/knowledge/references/saas.backend.notifications.operation-email-template-ref.md +60 -0
- package/dist/knowledge/references/saas.data-seeding.bootstrap-wiring.md +7 -1
- package/dist/knowledge/references/saas.data-seeding.computed-entry.md +43 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +14 -2
- package/dist/knowledge/references/saas.data-seeding.row-reference.md +93 -0
- package/dist/knowledge/references/saas.frontend.collection-filter-presets.md +124 -0
- package/dist/knowledge/references/saas.frontend.launcher.item-refs.md +316 -0
- package/dist/knowledge/references/saas.frontend.launcher.merge-rules.md +106 -0
- package/dist/knowledge/references/saas.frontend.launcher.runtime-availability.md +60 -0
- package/dist/knowledge/references/saas.frontend.resource-label-params.md +52 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +47 -18
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +4 -1
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destination-roles.md +25 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +2 -2
- package/dist/knowledge/references/saas.models.audit.trail-config.md +45 -0
- package/dist/knowledge/references/saas.models.notifications.user-notification-definition.md +5 -3
- package/dist/knowledge/references/saas.models.queue.scheduled-recovery.md +81 -2
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +26 -0
- package/dist/knowledge/references/saas.models.roles.definition.md +61 -0
- package/dist/knowledge/references/saas.models.roles.organization-defaults.md +97 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +26 -0
- package/dist/knowledge/references/saas.specifications.companion-exports.contract.md +10 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +10 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +12 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +14 -1
- package/dist/knowledge/references/saas.website.astro.site-context.md +13 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +4 -0
- package/dist/knowledge/references/saas.website.config.site-context-loader.md +3 -0
- package/dist/knowledge/references/saas.website.factories.define-section.md +4 -0
- package/dist/knowledge/references/saas.website.legal.public-document-links.md +76 -0
- package/dist/knowledge/references/saas.website.page-manifest.schema.md +12 -3
- package/dist/knowledge/references/saas.website.page-sections.component.md +72 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +2 -1
- package/dist/knowledge/references/saas.website.runtime.context.md +7 -0
- package/dist/knowledge/references/saas.website.sections.definition-schema.md +11 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +2 -0
- package/dist/knowledge/references/website-plan.config.md +26 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +13 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +7 -0
- package/dist/knowledge/references/zod.decorators.document-sequence.md +65 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +1 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +21 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +1 -0
- package/dist/knowledge/references/zod.factories.code.md +1 -0
- package/dist/knowledge/references/zod.factories.duration.md +1 -0
- package/dist/knowledge/references/zod.factories.money.md +1 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
- package/dist/knowledge/registries/framework-topics.json +374 -1
- package/dist/knowledge/registries/playbooks.json +76 -28
- package/dist/knowledge/registries/source-tags.json +1513 -898
- package/dist/knowledge/rules/live-context-door.md +5 -2
- package/dist/knowledge/skills/INDEX.md +5 -2
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +16 -3
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +14 -3
- package/dist/knowledge/skills/application-roles-authoring/SKILL.md +158 -0
- package/dist/knowledge/skills/application-roles-authoring/references/framework-application-roles-api.md +169 -0
- package/dist/knowledge/skills/application-roles-authoring/references/office-and-field-worked-example.md +63 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +6 -1
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +256 -9
- package/dist/knowledge/skills/backend-custom-operation/references/after-the-operation.md +42 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-audit-log-event-api.md +220 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +5 -0
- package/dist/knowledge/skills/brand-name-screening/SKILL.md +178 -0
- package/dist/knowledge/skills/brand-name-screening/references/framework-brand-name-screening-api.md +466 -0
- package/dist/knowledge/skills/brand-name-screening/references/screening-procedure.md +87 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +7 -3
- package/dist/knowledge/skills/config-app-shell/SKILL.md +58 -5
- package/dist/knowledge/skills/config-app-shell/references/framework-launcher-items-api.md +461 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-launcher-visibility-api.md +80 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +28 -6
- package/dist/knowledge/skills/config-navigation/SKILL.md +14 -3
- package/dist/knowledge/skills/config-saas/SKILL.md +56 -15
- package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +65 -2
- package/dist/knowledge/skills/config-saas/references/framework-audit-trail-config-api.md +62 -2
- package/dist/knowledge/skills/config-saas/references/framework-background-work-api.md +81 -2
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +6 -1
- package/dist/knowledge/skills/configure-billing/SKILL.md +18 -4
- package/dist/knowledge/skills/email-add-template/SKILL.md +28 -6
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +1 -1
- package/dist/knowledge/skills/email-add-template/references/framework-email-send-api.md +128 -0
- package/dist/knowledge/skills/email-add-template/references/framework-operation-email-template-ref-api.md +99 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +6 -1
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +21 -8
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +10 -2
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +18 -4
- package/dist/knowledge/skills/frontend-component-catalog/SKILL.md +11 -3
- package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-catalog.md +2 -1
- package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-usage.md +8 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +19 -5
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +10 -2
- package/dist/knowledge/skills/inbound-channels/SKILL.md +2 -2
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +6 -1
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +17 -2
- package/dist/knowledge/skills/local-environment-bootstrap/references/derived-artifact-currency.md +122 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/framework-upgrade-and-dependency-alignment.md +11 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +9 -2
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +10 -2
- package/dist/knowledge/skills/market-alternatives/SKILL.md +10 -2
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +10 -2
- package/dist/knowledge/skills/market-category/SKILL.md +21 -7
- package/dist/knowledge/skills/market-channels/SKILL.md +6 -1
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +22 -4
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +12 -2
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +21 -11
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +11 -6
- package/dist/knowledge/skills/market-icp/SKILL.md +10 -2
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +6 -1
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +6 -1
- package/dist/knowledge/skills/market-message-templates-authoring/references/framework-message-template-api.md +1 -1
- package/dist/knowledge/skills/market-persona/SKILL.md +14 -3
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +6 -1
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +10 -2
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +6 -1
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +15 -4
- package/dist/knowledge/skills/market-snapshot-validation/references/framework-snapshot-validation-api.md +1 -1
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +6 -1
- package/dist/knowledge/skills/model-cost-attribution/references/framework-work-unit-api.md +26 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +7 -1
- package/dist/knowledge/skills/module-companion-exports/references/companion-exports-by-package.md +10 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +37 -8
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +4 -2
- package/dist/knowledge/skills/provider-address-lookup/SKILL.md +14 -3
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +6 -1
- package/dist/knowledge/skills/provider-operation-calls/SKILL.md +14 -3
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-add-field/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +46 -17
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +14 -2
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +26 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +29 -3
- package/dist/knowledge/skills/resource-config-wiring/references/framework-collection-operation-declarations.md +19 -4
- package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +5 -2
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +103 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-retention-policy-operations.md +135 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +26 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-user-notifications-api.md +26 -7
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +46 -17
- package/dist/knowledge/skills/resource-external-data/references/erasure-suppression.md +2 -2
- package/dist/knowledge/skills/resource-retention-binding/SKILL.md +5 -1
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +15 -1
- package/dist/knowledge/skills/resource-schema-authoring/references/computed-totals.md +569 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/document-numbers.md +358 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +8 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +21 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +7 -2
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +13 -0
- package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +153 -0
- package/dist/knowledge/skills/resource-status-lifecycle/references/commercial-documents.md +46 -0
- package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +198 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +30 -4
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-collection-filter-presets-api.md +157 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +101 -19
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +202 -39
- package/dist/knowledge/skills/seeding-authoring/references/cross-seed-row-references.md +67 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +154 -4
- package/dist/knowledge/skills/seeding-authoring/references/seed-row-overlay.md +22 -0
- package/dist/knowledge/skills/seeding-operations/references/framework-data-seeding-operations-api.md +7 -1
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +43 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +2 -2
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +6 -1
- package/dist/knowledge/skills/spec-companion-exports/references/framework-companion-exports-contract-api.md +10 -0
- package/dist/knowledge/skills/spec-component-update/SKILL.md +10 -2
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +2 -2
- package/dist/knowledge/skills/spec-family-update/SKILL.md +71 -66
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +1 -1
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +30 -10
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +28 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +22 -5
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +6 -1
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +10 -2
- package/dist/knowledge/skills/views-app-level/SKILL.md +13 -3
- package/dist/knowledge/skills/views-app-level/references/application-home.md +56 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +221 -37
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +22 -5
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +1 -1
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +32 -2
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +16 -3
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +4 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +7 -1
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +13 -1
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +14 -2
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +13 -1
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +6 -1
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +19 -1
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +55 -18
- package/dist/knowledge/skills/website-navigation-authoring/references/framework-public-document-links-api.md +98 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +8 -11
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +100 -8
- package/dist/knowledge/skills/website-page-authoring/references/framework-site-context-loader-api.md +3 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-contact/SKILL.md +15 -0
- package/dist/knowledge/skills/website-section-contact/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-cta/SKILL.md +15 -0
- package/dist/knowledge/skills/website-section-cta/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-faq/SKILL.md +21 -1
- package/dist/knowledge/skills/website-section-faq/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +21 -1
- package/dist/knowledge/skills/website-section-feature-benefit-summary/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +25 -2
- package/dist/knowledge/skills/website-section-feature-detail/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-footer-cta/SKILL.md +15 -0
- package/dist/knowledge/skills/website-section-footer-cta/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-hero/SKILL.md +33 -10
- package/dist/knowledge/skills/website-section-hero/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +21 -1
- package/dist/knowledge/skills/website-section-pricing/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +27 -2
- package/dist/knowledge/skills/website-section-social-proof/references/define-website-section-api.md +15 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +16 -4
- package/dist/knowledge/skills/website-seo-aeo-geo/references/aeo-api.md +11 -0
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +16 -1
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +2 -1
- package/dist/knowledge/topic-index.json +1590 -292
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
# Document numbers (invoice, quote, job numbers)
|
|
2
|
+
|
|
3
|
+
A number the SERVER allocates, consecutive and without gaps: `INV-2026-00042`. Use it for every field that numbers a
|
|
4
|
+
business document. Never a free-text field the user types, and never an index or a timestamp: EU VAT invoicing requires
|
|
5
|
+
a sequential number that identifies each invoice once, and a typed or derived number can repeat or skip.
|
|
6
|
+
|
|
7
|
+
Read this when:
|
|
8
|
+
|
|
9
|
+
- a resource is an invoice, quote, order, job, credit note, delivery note, or any document people refer to by number;
|
|
10
|
+
- a requirement says documents are "numbered", "sequential", or "have a reference";
|
|
11
|
+
- you are about to declare a `reference` or `number` field as a plain `z.string()`.
|
|
12
|
+
|
|
13
|
+
## Declare it
|
|
14
|
+
|
|
15
|
+
## Import Origins
|
|
16
|
+
|
|
17
|
+
- `@wildo-ai/zod-decorators`
|
|
18
|
+
|
|
19
|
+
## Source Excerpts
|
|
20
|
+
|
|
21
|
+
### Origin Package: `@wildo-ai/zod-decorators`
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
*
|
|
25
|
+
* A DOCUMENT NUMBER the server allocates: an invoice, quote or job number such as `INV-2026-00042`.
|
|
26
|
+
*
|
|
27
|
+
* Declared on a string field with `.documentSequence({ format, scope })`. The server assigns the next number of the
|
|
28
|
+
* field's sequence when the row is created (or, with `allocation: EXPLICIT`, when the application's own operation asks
|
|
29
|
+
* for it, such as an "issue" transition), inside the same transaction as the write. So two documents created at the same
|
|
30
|
+
* instant in one organization get consecutive numbers, and a failed write consumes none: the sequence has no gaps.
|
|
31
|
+
* EU VAT invoicing requires exactly that, a sequential number that identifies each invoice once.
|
|
32
|
+
*
|
|
33
|
+
* The field is never written by a client: the decorator implies `excludeFromCreate`, `excludeFromUpdate`, and a unique
|
|
34
|
+
* index in the sequence's scope.
|
|
35
|
+
*
|
|
36
|
+
* Import from `@wildo-ai/zod-decorators` (the decorator is installed on every string schema).
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* invoiceNumber: z.string().documentSequence({ format: 'INV-{YYYY}-{n:5}', scope: DocumentSequenceScope.ORGANIZATION }),
|
|
40
|
+
* // first invoice of 2026 in an organization: INV-2026-00001; the count restarts at 1 in 2027
|
|
41
|
+
*/
|
|
42
|
+
export enum DocumentSequenceScope {
|
|
43
|
+
/** One sequence per organization: two organizations each have their own INV-2026-00001. */
|
|
44
|
+
ORGANIZATION = 'organization',
|
|
45
|
+
/** One sequence across the whole application. */
|
|
46
|
+
APPLICATION = 'application',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** WHEN the number is allocated. */
|
|
50
|
+
export enum DocumentSequenceAllocation {
|
|
51
|
+
/** When the row is created. The default. */
|
|
52
|
+
CREATE = 'create',
|
|
53
|
+
/**
|
|
54
|
+
* When the application's own operation allocates it, through the backend's document-sequence allocator: an invoice
|
|
55
|
+
* drafted without a number and numbered when it is issued. The field stays empty until then, so declare it optional.
|
|
56
|
+
*/
|
|
57
|
+
EXPLICIT = 'explicit',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The parameters of `.documentSequence(...)`.
|
|
62
|
+
*
|
|
63
|
+
* `format` is literal text with these tokens:
|
|
64
|
+
* - `{n}` or `{n:5}`: the sequence number, zero-padded to the width given (exactly one, required);
|
|
65
|
+
* - `{YYYY}` or `{YY}`: the year, which also RESTARTS the count every year;
|
|
66
|
+
* - `{MM}`: the month (with a year token), which restarts the count every month.
|
|
67
|
+
*
|
|
68
|
+
* The year and month are those of the moment the number is allocated, in the organization's timezone for an
|
|
69
|
+
* ORGANIZATION sequence (its profile's `timezone`) and in UTC for an APPLICATION sequence.
|
|
70
|
+
*/
|
|
71
|
+
export interface DocumentSequenceParams {
|
|
72
|
+
format: string;
|
|
73
|
+
scope: DocumentSequenceScope;
|
|
74
|
+
/** Defaults to {@link DocumentSequenceAllocation.CREATE}. */
|
|
75
|
+
allocation?: DocumentSequenceAllocation;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- `scope: DocumentSequenceScope.ORGANIZATION` gives each organization its own sequence (the usual case);
|
|
80
|
+
`APPLICATION` gives one sequence for the whole application.
|
|
81
|
+
- The format's tokens decide when the count restarts: `{YYYY}` every year, `{YYYY}` with `{MM}` every month, neither
|
|
82
|
+
never. The year is the organization's, read in its regional timezone (`organizationPreferences.timezone`); an
|
|
83
|
+
APPLICATION sequence counts in UTC.
|
|
84
|
+
- The decorator makes the field server-only (excluded from create and update DTOs) and unique in its scope. Do not add
|
|
85
|
+
`excludeFromCreate`, `excludeFromUpdate` or `isUnique` yourself.
|
|
86
|
+
- The field is never `.nullable()` and never `.default(...)`: the decorator refuses both when the schema loads.
|
|
87
|
+
- Never set the number yourself, in seed data or in server code: a create, or a seed row inserted with a number, is
|
|
88
|
+
refused, because a number the counter did not hand out collides with the sequence later (a seed re-run repeating the
|
|
89
|
+
row's own stored number is accepted, and changing it is refused). A seed row is numbered by the server when it is
|
|
90
|
+
first inserted, exactly like a create, and keeps its number when the seed runs again; an existing row with no number
|
|
91
|
+
is numbered on the next run. To continue an existing numbering (a previous system's, or a field that already holds
|
|
92
|
+
values), raise the counter instead: see "Continue an existing numbering" below.
|
|
93
|
+
- An external-data pipeline that brings the source system's own document number maps it to a SEPARATE field (for
|
|
94
|
+
example `sourceInvoiceNumber`), never to the sequenced one: a sequenced field refuses every number it did not allocate.
|
|
95
|
+
|
|
96
|
+
## When the number is allocated
|
|
97
|
+
|
|
98
|
+
| The document is numbered | Declare | What happens |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| when it is created (a quote, a job) | the default (`allocation` omitted) | the create takes the next number, inside its own transaction |
|
|
101
|
+
| when it is issued, not when drafted (an invoice) | `allocation: DocumentSequenceAllocation.EXPLICIT`, and the field `.optional()` | the field stays empty until your "issue" operation allocates it |
|
|
102
|
+
|
|
103
|
+
For an EXPLICIT sequence, the issuing operation's custom implementation numbers the row with
|
|
104
|
+
`issueDocumentSequenceNumberInOperation`, which reserves the number and writes it in one transaction. Register the
|
|
105
|
+
implementation with `transactionalCore: true`, and name the counters in its `transactionParticipants` with the exported
|
|
106
|
+
constant `DOCUMENT_SEQUENCE_COUNTERS_RESOURCE_TYPE` (never the string). Issuing an already-numbered row throws a
|
|
107
|
+
CONFLICT and consumes no number:
|
|
108
|
+
|
|
109
|
+
## Import Origins
|
|
110
|
+
|
|
111
|
+
- `@wildo-ai/saas-backend-lib`
|
|
112
|
+
|
|
113
|
+
## Source Excerpts
|
|
114
|
+
|
|
115
|
+
### Origin Package: `@wildo-ai/saas-backend-lib`
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
*
|
|
119
|
+
* Number a row from inside the application's own operation: the EXPLICIT case, an invoice drafted without a number and
|
|
120
|
+
* numbered when an "issue" operation runs. It reserves the next number and writes it to the row (with any other fields
|
|
121
|
+
* you pass in `set`) in ONE transaction, and returns the number.
|
|
122
|
+
*
|
|
123
|
+
* Register the operation with `transactionalCore: true` and name the counters as a participant
|
|
124
|
+
* (`documentSequenceCounters: DOCUMENT_SEQUENCE_COUNTERS_RESOURCE_TYPE`), so the counter's increment joins the
|
|
125
|
+
* operation's transaction. The write only lands while the row's number is still empty: issuing an already-numbered row
|
|
126
|
+
* throws a CONFLICT, and the transaction rolls back, so no number is consumed. If anything else in the operation fails,
|
|
127
|
+
* the number is released the same way and the sequence stays gapless.
|
|
128
|
+
*
|
|
129
|
+
* Import from `@wildo-ai/saas-backend-lib`.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* const INVOICE_ISSUE_PARTICIPANTS = { invoices: AppResourceType.INVOICES, documentSequenceCounters: DOCUMENT_SEQUENCE_COUNTERS_RESOURCE_TYPE };
|
|
133
|
+
* // in the "issue" custom implementation, registered with transactionalCore: true and transactionParticipants: INVOICE_ISSUE_PARTICIPANTS
|
|
134
|
+
* const invoiceNumber = await issueDocumentSequenceNumberInOperation(utils, {
|
|
135
|
+
* resourceType: AppResourceType.INVOICES, fieldName: 'invoiceNumber', row: invoice,
|
|
136
|
+
* set: { status: InvoiceStatus.ISSUED, issuedAt: new Date() }, executionContext,
|
|
137
|
+
* });
|
|
138
|
+
*/
|
|
139
|
+
export async function issueDocumentSequenceNumberInOperation(
|
|
140
|
+
utils: {
|
|
141
|
+
readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService;
|
|
142
|
+
readonly errorBuilder: ErrorBuilderBackendService;
|
|
143
|
+
readonly resourcesRegistry: { getResourceConfiguration(resourceType: string): { mainSchema: z.ZodTypeAny } };
|
|
144
|
+
readonly serviceOptions?: { readonly transaction?: RepositoryOptions['transaction'] };
|
|
145
|
+
},
|
|
146
|
+
input: {
|
|
147
|
+
readonly resourceType: string;
|
|
148
|
+
readonly fieldName: string;
|
|
149
|
+
readonly row: Record<string, unknown>;
|
|
150
|
+
readonly set?: Record<string, unknown>;
|
|
151
|
+
readonly executionContext: ExecutionContext<any>;
|
|
152
|
+
},
|
|
153
|
+
): Promise<string> {
|
|
154
|
+
return issueDocumentSequenceNumber({
|
|
155
|
+
registry: utils.repositoriesRegistry,
|
|
156
|
+
errorBuilder: utils.errorBuilder,
|
|
157
|
+
resourceType: input.resourceType,
|
|
158
|
+
mainSchema: utils.resourcesRegistry.getResourceConfiguration(input.resourceType).mainSchema,
|
|
159
|
+
fieldName: input.fieldName,
|
|
160
|
+
row: input.row,
|
|
161
|
+
set: input.set,
|
|
162
|
+
executionContext: input.executionContext,
|
|
163
|
+
options: utils.serviceOptions?.transaction === undefined ? undefined : { transaction: utils.serviceOptions.transaction },
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Continue an existing numbering
|
|
169
|
+
|
|
170
|
+
Two cases, both handled by raising a sequence's counter, never by writing numbers into rows:
|
|
171
|
+
|
|
172
|
+
| The situation | Call | Effect |
|
|
173
|
+
|---|---|---|
|
|
174
|
+
| The application replaces another tool whose last invoice was `INV-2026-00417` | `raiseDocumentSequenceFloorInOperation(utils, { …, periodKey: '2026', floor: 417 })` from your operation | the next invoice is `INV-2026-00418` |
|
|
175
|
+
| A field that already held numbers gains `.documentSequence(...)` | `raiseDocumentSequenceFloorsToExistingRows({ …, rows })`, once, from a migration script | each organization and period continues after the highest number its rows hold, so no new number collides with an old one |
|
|
176
|
+
|
|
177
|
+
- It only raises. A floor below the counter is refused, because lowering it would hand out numbers already issued.
|
|
178
|
+
- The engine has no endpoint for it. Your operation decides who may do it and what the trail keeps:
|
|
179
|
+
- **Who**: mount the operation under `/organizations/{organizationId}/…` with your organization administrator role
|
|
180
|
+
for an ORGANIZATION sequence. `raiseDocumentSequenceFloorInOperation` takes the organization from that route and
|
|
181
|
+
refuses when there is none. Never read it from the request body: that would let one organization's administrator
|
|
182
|
+
move another's numbering. For an APPLICATION sequence, restrict the operation to an application administrator role.
|
|
183
|
+
- **Why**: a required, bounded `justification` string in the request DTO, declared with
|
|
184
|
+
`auditableEvent: { reasonField: 'justification' }`, and a `HIGH` or `CRITICAL` risk level. The trail records who ran
|
|
185
|
+
it, when, and the justification.
|
|
186
|
+
- **Not recorded**: the counter's previous and new value. No other request value reaches the trail, so ask for the
|
|
187
|
+
floor to be stated in the justification, and return the outcome (`previousValue`, `value`) from the operation.
|
|
188
|
+
- Register it with `transactionalCore: true` and the counters as a participant, like the "issue" operation.
|
|
189
|
+
- **Which rows to pass** to `raiseDocumentSequenceFloorsToExistingRows`: every row of the resource, in every
|
|
190
|
+
organization, read without the caller's organization filter. A row left out keeps its number, so the counter can
|
|
191
|
+
reach that number and collide with it.
|
|
192
|
+
- Rows held under a retention policy are an exception. They are excluded from the unique index and from unscoped reads,
|
|
193
|
+
so they never collide and the helper never sees them. Their numbers were still issued, though: if the legal sequence
|
|
194
|
+
must skip them too, add their highest number yourself with `raiseDocumentSequenceFloor`.
|
|
195
|
+
- A value the format could not have produced (free text, other padding) is ignored, and counted in `unreadValues`: it
|
|
196
|
+
can never collide with a number the counter hands out.
|
|
197
|
+
|
|
198
|
+
## Import Origins
|
|
199
|
+
|
|
200
|
+
- `@wildo-ai/saas-backend-lib`
|
|
201
|
+
|
|
202
|
+
## Source Excerpts
|
|
203
|
+
|
|
204
|
+
### Origin Package: `@wildo-ai/saas-backend-lib`
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
*
|
|
208
|
+
* CONTINUE an existing numbering: set the last number one document sequence has issued, so the next document gets
|
|
209
|
+
* `floor + 1`. Use it when the application replaces another invoicing tool (its last invoice was INV-2026-00417, so
|
|
210
|
+
* pass `floor: 417` and the next is INV-2026-00418), or when a field that already held numbers gains
|
|
211
|
+
* `.documentSequence(...)` (see `raiseDocumentSequenceFloorsToExistingRows`).
|
|
212
|
+
*
|
|
213
|
+
* It only RAISES. A floor below the counter is refused (`document_sequence_floor_below_counter`), because lowering it
|
|
214
|
+
* would hand out numbers already issued; pass `whenBelowCounter: KEEP_COUNTER` to keep the counter instead. Raising
|
|
215
|
+
* skips numbers on purpose: the numbers between the old counter and the floor must exist in the other system or in the
|
|
216
|
+
* existing rows.
|
|
217
|
+
*
|
|
218
|
+
* It runs in the caller's transaction and refuses without one. It serializes with documents numbered at the same
|
|
219
|
+
* moment: on PostgreSQL it waits on the counter's row lock, and on MongoDB the transaction is retried. A
|
|
220
|
+
* compare-and-set on the counter's value backs that up (`document_sequence_counter_moved`), so a stale read can never
|
|
221
|
+
* overwrite a number already handed out.
|
|
222
|
+
*
|
|
223
|
+
* From an operation, call {@link raiseDocumentSequenceFloorInOperation}. The engine exposes no endpoint for it, so your
|
|
224
|
+
* operation is what decides who may continue a numbering, and what the audit trail keeps:
|
|
225
|
+
*
|
|
226
|
+
* - **Who**: mount the operation under the organization route for an ORGANIZATION sequence, with your organization
|
|
227
|
+
* administrator role, and the wrapper takes the organization from that route, never from the request body. For an
|
|
228
|
+
* APPLICATION sequence, restrict it to an application administrator role.
|
|
229
|
+
* - **Why**: put a required, bounded `justification` string in the request DTO and declare
|
|
230
|
+
* `auditableEvent: { reasonField: 'justification' }`, with a `HIGH` or `CRITICAL` risk level. The trail then records
|
|
231
|
+
* who ran it, when, and the justification.
|
|
232
|
+
* - **What it does NOT record**: the counter's previous and new value. No other request value is copied into the
|
|
233
|
+
* trail, so state the floor in the justification, and return the outcome from the operation. A dedicated event
|
|
234
|
+
* recording the move is planned.
|
|
235
|
+
*
|
|
236
|
+
* Import from `@wildo-ai/saas-backend-lib`.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* // a "continue numbering" custom operation on invoices, under /organizations/{organizationId}/…, registered with
|
|
240
|
+
* // transactionalCore: true and transactionParticipants: { invoices: AppResourceType.INVOICES,
|
|
241
|
+
* // documentSequenceCounters: DOCUMENT_SEQUENCE_COUNTERS_RESOURCE_TYPE }; request DTO { floor, periodKey, justification }
|
|
242
|
+
* const outcome = await raiseDocumentSequenceFloorInOperation(utils, {
|
|
243
|
+
* resourceType: AppResourceType.INVOICES, fieldName: 'invoiceNumber',
|
|
244
|
+
* periodKey: input.periodKey, floor: input.floor, executionContext,
|
|
245
|
+
* });
|
|
246
|
+
* // outcome: { previousValue, value, raised }
|
|
247
|
+
*/
|
|
248
|
+
export async function raiseDocumentSequenceFloor(input: {
|
|
249
|
+
readonly registry: DocumentSequenceAllocationRegistry;
|
|
250
|
+
readonly errorBuilder: ErrorBuilderBackendService;
|
|
251
|
+
readonly resourceType: string;
|
|
252
|
+
readonly mainSchema: z.ZodTypeAny;
|
|
253
|
+
readonly fieldName: string;
|
|
254
|
+
/** The organization of an ORGANIZATION sequence. Omit it for an APPLICATION sequence. */
|
|
255
|
+
readonly organizationId?: string;
|
|
256
|
+
/**
|
|
257
|
+
* The counting period: `'2026'` for a yearly sequence, `'2026-10'` for a monthly one, `''` for one that never
|
|
258
|
+
* restarts. Defaults to the current period, read in the organization's timezone.
|
|
259
|
+
*/
|
|
260
|
+
readonly periodKey?: string;
|
|
261
|
+
/** The last number already issued in that sequence. */
|
|
262
|
+
readonly floor: number;
|
|
263
|
+
readonly whenBelowCounter?: DocumentSequenceFloorBelowCounter;
|
|
264
|
+
readonly executionContext: ExecutionContext<any>;
|
|
265
|
+
readonly options: RepositoryOptions | undefined;
|
|
266
|
+
/** Only used to default `periodKey`. */
|
|
267
|
+
readonly now?: Date;
|
|
268
|
+
}): Promise<DocumentSequenceFloorRaise> {
|
|
269
|
+
const { registry, errorBuilder, executionContext, resourceType } = input;
|
|
270
|
+
const refuse = (type: ErrorType, reason: string, extra: Record<string, unknown> = {}) =>
|
|
271
|
+
errorBuilder.buildError(type, executionContext, { context: { reason, resourceType, fieldName: input.fieldName, ...extra } });
|
|
272
|
+
const field = documentSequenceFieldsOf(input.mainSchema).find((candidate) => candidate.fieldName === input.fieldName);
|
|
273
|
+
if (field === undefined) throw refuse(ErrorType.CONFIGURATION, 'document_sequence_field_not_declared');
|
|
274
|
+
if (!Number.isSafeInteger(input.floor) || input.floor < 0) throw refuse(ErrorType.VALIDATION, 'document_sequence_floor_invalid', { floor: input.floor });
|
|
275
|
+
const transaction = input.options?.transaction;
|
|
276
|
+
if (transaction === undefined) throw refuse(ErrorType.CONFIGURATION, 'document_sequence_requires_transaction');
|
|
277
|
+
|
|
278
|
+
const isOrganizationSequence = field.params.scope === DocumentSequenceScope.ORGANIZATION;
|
|
279
|
+
const organizationId = input.organizationId;
|
|
280
|
+
if (isOrganizationSequence && (typeof organizationId !== 'string' || organizationId.length === 0)) {
|
|
281
|
+
throw refuse(ErrorType.VALIDATION, 'document_sequence_floor_without_organization');
|
|
282
|
+
}
|
|
283
|
+
// An organization named for an APPLICATION sequence would be silently ignored, and the floor applied to everyone.
|
|
284
|
+
if (!isOrganizationSequence && organizationId !== undefined) throw refuse(ErrorType.VALIDATION, 'document_sequence_floor_organization_for_application_sequence');
|
|
285
|
+
const scopeKey = isOrganizationSequence ? organizationId! : DOCUMENT_SEQUENCE_APPLICATION_SCOPE_KEY;
|
|
286
|
+
|
|
287
|
+
const parsed = parseDocumentSequenceFormat(field.params.format);
|
|
288
|
+
const periodKey = input.periodKey
|
|
289
|
+
?? documentSequencePeriodKey(parsed, input.now ?? new Date(), await organizationTimeZone(input, field, scopeKey, new Map()));
|
|
290
|
+
if (!PERIOD_KEY_SHAPE[parsed.period].test(periodKey)) throw refuse(ErrorType.VALIDATION, 'document_sequence_floor_period_invalid', { periodKey, period: parsed.period });
|
|
291
|
+
|
|
292
|
+
const _id = await ensureDocumentSequenceCounter(registry, executionContext, transaction, { resourceType, fieldName: field.fieldName, scopeKey, periodKey });
|
|
293
|
+
const current = await registry.readUnscopedByKey<DocumentSequenceCounter>(COUNTERS, { _id }, { transaction });
|
|
294
|
+
const previousValue = current?.value;
|
|
295
|
+
if (typeof previousValue !== 'number') throw refuse(ErrorType.INTERNAL, 'document_sequence_counter_not_advanced');
|
|
296
|
+
if (input.floor === previousValue) return { previousValue, value: previousValue, raised: false };
|
|
297
|
+
if (input.floor < previousValue) {
|
|
298
|
+
if ((input.whenBelowCounter ?? DocumentSequenceFloorBelowCounter.REFUSE) === DocumentSequenceFloorBelowCounter.KEEP_COUNTER) {
|
|
299
|
+
return { previousValue, value: previousValue, raised: false };
|
|
300
|
+
}
|
|
301
|
+
throw refuse(ErrorType.CONFLICT, 'document_sequence_floor_below_counter', { floor: input.floor, counter: previousValue, periodKey });
|
|
302
|
+
}
|
|
303
|
+
// Compare-and-set: a number allocated since the read moves the value, and this write then matches nothing.
|
|
304
|
+
const written = await registry.atomicGuardedMutation<DocumentSequenceCounter>(COUNTERS, { _id, value: previousValue }, { set: { value: input.floor } }, undefined, { transaction });
|
|
305
|
+
if (written === null) throw refuse(ErrorType.CONFLICT, 'document_sequence_counter_moved', { periodKey });
|
|
306
|
+
return { previousValue, value: input.floor, raised: true };
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* {@link raiseDocumentSequenceFloor} from inside the application's own operation: the schema comes from the resource
|
|
311
|
+
* registry, the transaction from the operation, and an ORGANIZATION sequence's organization from the operation's
|
|
312
|
+
* organization route (`/organizations/{organizationId}/…`), which the framework has already authorized the caller for.
|
|
313
|
+
* Refuses an ORGANIZATION sequence when the operation has no organization in its route, rather than accept one from the
|
|
314
|
+
* request, which would let one organization's administrator move another's numbering.
|
|
315
|
+
*/
|
|
316
|
+
export async function raiseDocumentSequenceFloorInOperation(
|
|
317
|
+
utils: {
|
|
318
|
+
readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService;
|
|
319
|
+
readonly errorBuilder: ErrorBuilderBackendService;
|
|
320
|
+
readonly resourcesRegistry: { getResourceConfiguration(resourceType: string): { mainSchema: z.ZodTypeAny } };
|
|
321
|
+
readonly serviceOptions?: { readonly transaction?: RepositoryOptions['transaction'] };
|
|
322
|
+
},
|
|
323
|
+
input: {
|
|
324
|
+
readonly resourceType: string;
|
|
325
|
+
readonly fieldName: string;
|
|
326
|
+
readonly periodKey?: string;
|
|
327
|
+
readonly floor: number;
|
|
328
|
+
readonly whenBelowCounter?: DocumentSequenceFloorBelowCounter;
|
|
329
|
+
readonly executionContext: ExecutionContext<any>;
|
|
330
|
+
},
|
|
331
|
+
): Promise<DocumentSequenceFloorRaise> {
|
|
332
|
+
const mainSchema = utils.resourcesRegistry.getResourceConfiguration(input.resourceType).mainSchema;
|
|
333
|
+
const field = documentSequenceFieldsOf(mainSchema).find((candidate) => candidate.fieldName === input.fieldName);
|
|
334
|
+
const routeOrganizationId = input.executionContext.getContextResourceId(coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS]);
|
|
335
|
+
const isOrganizationSequence = field?.params.scope === DocumentSequenceScope.ORGANIZATION;
|
|
336
|
+
return raiseDocumentSequenceFloor({
|
|
337
|
+
registry: utils.repositoriesRegistry,
|
|
338
|
+
errorBuilder: utils.errorBuilder,
|
|
339
|
+
resourceType: input.resourceType,
|
|
340
|
+
mainSchema,
|
|
341
|
+
fieldName: input.fieldName,
|
|
342
|
+
// Absent for an ORGANIZATION sequence when the route names no organization: the raise then refuses.
|
|
343
|
+
...(isOrganizationSequence && routeOrganizationId !== undefined ? { organizationId: routeOrganizationId } : {}),
|
|
344
|
+
...(input.periodKey === undefined ? {} : { periodKey: input.periodKey }),
|
|
345
|
+
floor: input.floor,
|
|
346
|
+
...(input.whenBelowCounter === undefined ? {} : { whenBelowCounter: input.whenBelowCounter }),
|
|
347
|
+
executionContext: input.executionContext,
|
|
348
|
+
options: utils.serviceOptions?.transaction === undefined ? undefined : { transaction: utils.serviceOptions.transaction },
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Verify
|
|
354
|
+
|
|
355
|
+
- `rg -n "documentSequence\(" shared-lib/src` lists every numbered field; each document resource has one.
|
|
356
|
+
- `rg -n "invoiceNumber|quoteNumber|reference: z.string\(\)" shared-lib/src --glob "*.schemas.ts"`: no document number is a
|
|
357
|
+
plain string.
|
|
358
|
+
- A migration exists for the `documentsequencecounters` table on a PostgreSQL application (`wildo db diff --check`).
|
|
@@ -178,6 +178,11 @@ export enum ZodDecorator {
|
|
|
178
178
|
* `OBJECT_BUSINESS_KEY_SET` decorator on the schema root.
|
|
179
179
|
*/
|
|
180
180
|
IS_BUSINESS_KEY = "isBusinessKey",
|
|
181
|
+
/**
|
|
182
|
+
* A server-allocated document number (`INV-2026-00042`), consecutive and gapless per scope. Composite: implies
|
|
183
|
+
* `excludeFromCreate`, `excludeFromUpdate` and a unique index in the sequence's scope. See `DocumentSequenceParams`.
|
|
184
|
+
*/
|
|
185
|
+
DOCUMENT_SEQUENCE = "documentSequence",
|
|
181
186
|
/**
|
|
182
187
|
* Object-level decorator declaring a **composite business key** for the
|
|
183
188
|
* schema (e.g. `(organizationId, templateKey)`). Schema-level analog of
|
|
@@ -294,6 +299,7 @@ export type ZodDecorator_ParamsType = {
|
|
|
294
299
|
[ZodDecorator.IS_PRIMARY_KEY]: undefined;
|
|
295
300
|
// Business key marker (parameterless field-level marker for the data-seeding subsystem)
|
|
296
301
|
[ZodDecorator.IS_BUSINESS_KEY]: undefined;
|
|
302
|
+
[ZodDecorator.DOCUMENT_SEQUENCE]: DocumentSequenceParams;
|
|
297
303
|
// Composite business key (object-level decorator carrying the ordered list of field names)
|
|
298
304
|
[ZodDecorator.OBJECT_BUSINESS_KEY_SET]: BusinessKeySetParams | DecoratorUpdater<BusinessKeySetParams>;
|
|
299
305
|
[ZodDecorator.TTL]: TtlFieldParams | DecoratorUpdater<TtlFieldParams>;
|
|
@@ -387,6 +393,7 @@ export type ZodDecorator_Types = {
|
|
|
387
393
|
[ZodDecorator.IS_PRIMARY_KEY]: true;
|
|
388
394
|
// Business key marker (parameterless field-level marker for the data-seeding subsystem)
|
|
389
395
|
[ZodDecorator.IS_BUSINESS_KEY]: true;
|
|
396
|
+
[ZodDecorator.DOCUMENT_SEQUENCE]: DocumentSequenceParams;
|
|
390
397
|
// Composite business key (object-level — stored params shape after resolver unwraps DecoratorUpdater)
|
|
391
398
|
[ZodDecorator.OBJECT_BUSINESS_KEY_SET]: BusinessKeySetParams;
|
|
392
399
|
[ZodDecorator.TTL]: TtlFieldParams;
|
|
@@ -488,6 +495,7 @@ export interface CustomFieldMetadata {
|
|
|
488
495
|
[ZodDecorator.IS_UNIQUE]?: ZodDecorator_Types[ZodDecorator.IS_UNIQUE];
|
|
489
496
|
[ZodDecorator.IS_PRIMARY_KEY]?: ZodDecorator_Types[ZodDecorator.IS_PRIMARY_KEY];
|
|
490
497
|
[ZodDecorator.IS_BUSINESS_KEY]?: ZodDecorator_Types[ZodDecorator.IS_BUSINESS_KEY];
|
|
498
|
+
[ZodDecorator.DOCUMENT_SEQUENCE]?: ZodDecorator_Types[ZodDecorator.DOCUMENT_SEQUENCE];
|
|
491
499
|
[ZodDecorator.OBJECT_BUSINESS_KEY_SET]?: ZodDecorator_Types[ZodDecorator.OBJECT_BUSINESS_KEY_SET];
|
|
492
500
|
[ZodDecorator.TTL]?: ZodDecorator_Types[ZodDecorator.TTL];
|
|
493
501
|
// String edit mode convenience decorators
|
|
@@ -83,6 +83,25 @@ Use it when you need to confirm:
|
|
|
83
83
|
isBusinessKey: function(this: z.ZodTypeAny): DecoratedPrimitiveZodType<z.ZodTypeAny> {
|
|
84
84
|
return addDecorators(this, [ZodDecorator.IS_BUSINESS_KEY]);
|
|
85
85
|
},
|
|
86
|
+
// documentSequence is COMPOSITE (#2509): a server-allocated number is never written by a client, and is unique in its
|
|
87
|
+
// sequence's scope (sparse, so an EXPLICIT sequence's not-yet-numbered rows do not collide on the empty value).
|
|
88
|
+
documentSequence: function(this: z.ZodTypeAny, params: DocumentSequenceParams): DecoratedPrimitiveZodType<z.ZodTypeAny> {
|
|
89
|
+
// A document number is either present or absent, never null, and never defaulted. A null would be stored on MongoDB
|
|
90
|
+
// and matched by the scope's sparse unique index there (but not on PostgreSQL, where nulls are distinct), so two
|
|
91
|
+
// not-yet-numbered rows would collide on one adapter only; a default would be a number the counter never handed out.
|
|
92
|
+
for (let candidate: unknown = this; candidate instanceof z.ZodOptional; candidate = candidate.unwrap()) {
|
|
93
|
+
if (candidate.unwrap() instanceof z.ZodNullable || candidate.unwrap() instanceof z.ZodDefault) throw new Error('documentSequence: a document number cannot be nullable or defaulted; declare it .optional() for an EXPLICIT sequence.');
|
|
94
|
+
}
|
|
95
|
+
if (this instanceof z.ZodNullable || this instanceof z.ZodDefault) {
|
|
96
|
+
throw new Error('documentSequence: a document number cannot be nullable or defaulted; declare it .optional() for an EXPLICIT sequence.');
|
|
97
|
+
}
|
|
98
|
+
return addDecorators(this, [
|
|
99
|
+
{ ref: ZodDecorator.DOCUMENT_SEQUENCE, params },
|
|
100
|
+
ZodDecorator.EXCLUDE_FROM_CREATE,
|
|
101
|
+
ZodDecorator.EXCLUDE_FROM_UPDATE,
|
|
102
|
+
{ ref: ZodDecorator.IS_UNIQUE, params: { scope: params?.scope === DocumentSequenceScope.APPLICATION ? UniqueScope.GLOBAL : UniqueScope.ORGANIZATION, sparse: true } },
|
|
103
|
+
]);
|
|
104
|
+
},
|
|
86
105
|
// businessKeySet is the OBJECT-LEVEL composite analog of isBusinessKey.
|
|
87
106
|
// Validates at decoration time that every named field exists on the
|
|
88
107
|
// underlying ZodObject shape and that the array is non-empty. Mixing
|
|
@@ -166,6 +185,7 @@ Use it when you need to confirm:
|
|
|
166
185
|
[ZodDecorator.IS_UNIQUE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_UNIQUE]): DecoratedPrimitiveZodType<T>;
|
|
167
186
|
[ZodDecorator.IS_PRIMARY_KEY](): DecoratedPrimitiveZodType<T>;
|
|
168
187
|
[ZodDecorator.IS_BUSINESS_KEY](): DecoratedPrimitiveZodType<T>;
|
|
188
|
+
[ZodDecorator.DOCUMENT_SEQUENCE](params: DocumentSequenceParams): DecoratedPrimitiveZodType<T>;
|
|
169
189
|
[ZodDecorator.OBJECT_BUSINESS_KEY_SET](fields: string[], params?: Omit<BusinessKeySetParams, 'fields'>): DecoratedPrimitiveZodType<T>;
|
|
170
190
|
[ZodDecorator.TTL](params: ZodDecorator_ParamsType[ZodDecorator.TTL]): DecoratedPrimitiveZodType<T>;
|
|
171
191
|
```
|
|
@@ -196,4 +216,5 @@ Use it when you need to confirm:
|
|
|
196
216
|
[ZodDecorator.EXCLUDE_FROM_CREATE](): DecoratedPrimitiveZodType<this>;
|
|
197
217
|
[ZodDecorator.EXCLUDE_FROM_UPDATE](): DecoratedPrimitiveZodType<this>;
|
|
198
218
|
[ZodDecorator.IS_UNIQUE](params?: UniqueFieldParams): DecoratedPrimitiveZodType<this>;
|
|
219
|
+
[ZodDecorator.DOCUMENT_SEQUENCE](params: DocumentSequenceParams): DecoratedPrimitiveZodType<this>;
|
|
199
220
|
```
|
|
@@ -124,6 +124,7 @@ export type DecoratedMoneySchema = z.ZodObject<{
|
|
|
124
124
|
[ZodDecorator.IS_DB_INDEXED](): DecoratedMoneySchema;
|
|
125
125
|
/** Installed at runtime with the other chainable methods; declared here so an authored `.moneyUI(…)` typechecks. */
|
|
126
126
|
[ZodDecorator.MONEY_UI](params?: ZodDecorator_ParamsType[ZodDecorator.MONEY_UI]): DecoratedMoneySchema;
|
|
127
|
+
[ZodDecorator.MONEY_SPEC](params?: ZodDecorator_ParamsType[ZodDecorator.MONEY_SPEC]): DecoratedMoneySchema;
|
|
127
128
|
[ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedMoneySchema;
|
|
128
129
|
[ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedMoneySchema;
|
|
129
130
|
// Resource-level decorators (applicable to all types including ZodObject)
|
|
@@ -566,6 +567,7 @@ export type DecoratedDurationSchema = z.ZodObject<{
|
|
|
566
567
|
[ZodDecorator.IS_DB_INDEXED](): DecoratedDurationSchema;
|
|
567
568
|
/** Installed at runtime with the other chainable methods; declared here so an authored `.durationUI(…)` typechecks. */
|
|
568
569
|
[ZodDecorator.DURATION_UI](params?: ZodDecorator_ParamsType[ZodDecorator.DURATION_UI]): DecoratedDurationSchema;
|
|
570
|
+
[ZodDecorator.DURATION_SPEC](params?: ZodDecorator_ParamsType[ZodDecorator.DURATION_SPEC]): DecoratedDurationSchema;
|
|
569
571
|
[ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedDurationSchema;
|
|
570
572
|
[ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedDurationSchema;
|
|
571
573
|
[ZodDecorator.IS_SUMMARY_FIELD](params?: SummaryFieldParams): DecoratedDurationSchema;
|
|
@@ -913,6 +915,7 @@ export type DecoratedCodeSchema = z.ZodObject<{
|
|
|
913
915
|
[ZodDecorator.IS_DB_INDEXED](): DecoratedCodeSchema;
|
|
914
916
|
/** Installed at runtime with the other chainable methods; declared here so an authored `.codeUI(…)` typechecks. */
|
|
915
917
|
[ZodDecorator.CODE_UI](params?: ZodDecorator_ParamsType[ZodDecorator.CODE_UI]): DecoratedCodeSchema;
|
|
918
|
+
[ZodDecorator.CODE_SPEC](params?: ZodDecorator_ParamsType[ZodDecorator.CODE_SPEC]): DecoratedCodeSchema;
|
|
916
919
|
[ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedCodeSchema;
|
|
917
920
|
[ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedCodeSchema;
|
|
918
921
|
addDecorators(decorators: DecoratorInput[]): DecoratedCodeSchema;
|
|
@@ -1061,6 +1064,7 @@ export type DecoratedBigDecimalSchema = z.ZodString & {
|
|
|
1061
1064
|
[ZodDecorator.IS_HIDDEN](params?: ZodDecorator_ParamsType[ZodDecorator.IS_HIDDEN]): DecoratedBigDecimalSchema;
|
|
1062
1065
|
[ZodDecorator.IS_NOT_EDITABLE](params?: ZodDecorator_ParamsType[ZodDecorator.IS_NOT_EDITABLE]): DecoratedBigDecimalSchema;
|
|
1063
1066
|
[ZodDecorator.BIGDECIMAL_UI](params?: ZodDecorator_ParamsType[ZodDecorator.BIGDECIMAL_UI]): DecoratedBigDecimalSchema;
|
|
1067
|
+
[ZodDecorator.BIGDECIMAL_SPEC](params?: ZodDecorator_ParamsType[ZodDecorator.BIGDECIMAL_SPEC]): DecoratedBigDecimalSchema;
|
|
1064
1068
|
addDecorators(decorators: DecoratorInput[]): DecoratedBigDecimalSchema;
|
|
1065
1069
|
};
|
|
1066
1070
|
|
|
@@ -1595,8 +1599,9 @@ export interface FileNatureConstraints_Document {
|
|
|
1595
1599
|
|
|
1596
1600
|
The VALUES a `z_file()` field selects: which media kind (`nature`), where the bytes go
|
|
1597
1601
|
(`storageAccepted`) and what a parent delete does (`onParentDelete`). Read this before choosing any
|
|
1598
|
-
of the three — three of the five storage targets
|
|
1599
|
-
|
|
1602
|
+
of the three — the engine itself serves only three of the five storage targets (`ONEDRIVE` needs the
|
|
1603
|
+
`microsoft-onedrive` provider, and nothing serves `DROPBOX`), and one `onParentDelete` member does not
|
|
1604
|
+
yet behave differently from the default.
|
|
1600
1605
|
|
|
1601
1606
|
## Import Origins
|
|
1602
1607
|
|
|
@@ -874,6 +874,19 @@ function applySingleDecorator<T extends z.ZodTypeAny>(
|
|
|
874
874
|
case ZodDecorator.IS_BUSINESS_KEY:
|
|
875
875
|
currentMetadata[ZodDecorator.IS_BUSINESS_KEY] = true;
|
|
876
876
|
break;
|
|
877
|
+
case ZodDecorator.DOCUMENT_SEQUENCE: {
|
|
878
|
+
// Parsed HERE, so a bad format fails when the schema loads, never when the first document is created.
|
|
879
|
+
const sequence = p as DocumentSequenceParams | undefined;
|
|
880
|
+
if (!sequence || !Object.values(DocumentSequenceScope).includes(sequence.scope)) {
|
|
881
|
+
throw new Error('documentSequence: params need a format and a DocumentSequenceScope.');
|
|
882
|
+
}
|
|
883
|
+
if (sequence.allocation !== undefined && !Object.values(DocumentSequenceAllocation).includes(sequence.allocation)) {
|
|
884
|
+
throw new Error(`documentSequence: unknown allocation "${String(sequence.allocation)}".`);
|
|
885
|
+
}
|
|
886
|
+
parseDocumentSequenceFormat(sequence.format);
|
|
887
|
+
currentMetadata[ZodDecorator.DOCUMENT_SEQUENCE] = sequence;
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
877
890
|
case ZodDecorator.OBJECT_BUSINESS_KEY_SET:
|
|
878
891
|
currentMetadata[ZodDecorator.OBJECT_BUSINESS_KEY_SET] = p;
|
|
879
892
|
break;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: resource-status-lifecycle
|
|
3
|
+
description: Give a resource a real lifecycle — states a person moves it through, transitions the application allows and refuses, timestamps each one stamps, and a record that freezes once it reaches a locked or final state — instead of a status field anyone edits. Use when the user says "accept a quote", "issue the invoice", "mark it paid", "close the case", "only allow X when Y", "lock it after it is sent", "an approved request cannot change", "convert the quote into a job", or when a requirement describes a record moving through stages.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Resource Status Lifecycle
|
|
8
|
+
|
|
9
|
+
### Target Application Framing
|
|
10
|
+
|
|
11
|
+
This knowledge is for configuring behavior in the target application.
|
|
12
|
+
Wildo is the framework surface being used, not the product being built.
|
|
13
|
+
|
|
14
|
+
Read and apply these patterns from the application-developer point of view:
|
|
15
|
+
|
|
16
|
+
- how the application should configure the relevant app-level file
|
|
17
|
+
- how the application should use framework-provided factories, enums, and helpers
|
|
18
|
+
- how the application should avoid mixing frontend, backend, and infrastructure concerns
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
|
|
23
|
+
A status field that users edit by hand is not a workflow: any state can jump to any other, nothing
|
|
24
|
+
is stamped, and a sent quote can be rewritten after the customer read it. This skill turns the
|
|
25
|
+
states of a resource into a lifecycle the engine enforces: each transition is its own operation,
|
|
26
|
+
the engine refuses it from the wrong state, it stamps the moment it happened, and the record freezes
|
|
27
|
+
once it is locked (no edits, yet it still moves on) or final (nothing moves it again).
|
|
28
|
+
|
|
29
|
+
It is all configuration on the resource — no backend code — except when a transition also writes
|
|
30
|
+
another resource (a conversion), where one custom implementation does that write.
|
|
31
|
+
|
|
32
|
+
## App Paths
|
|
33
|
+
|
|
34
|
+
| Surface | Glob (relative to app root) |
|
|
35
|
+
|---|---|
|
|
36
|
+
| The status enum and the fields a transition stamps | `shared-lib/src/modules/<module>/resources/<resource>/<resource>.schemas.ts` |
|
|
37
|
+
| The transitions | `shared-lib/src/modules/<module>/resources/<resource>/<resource>.resources-config.ts` |
|
|
38
|
+
| A conversion's write (only when a transition creates another resource) | `backend-api/src/modules/<module>/resources/<resource>/<resource>.<operation>.operation.ts` |
|
|
39
|
+
| The transitions as actions in the UI | `frontend/src/modules/<module>/resources/<resource>/<resource>.ui-behavior.tsx` |
|
|
40
|
+
|
|
41
|
+
## When to Use
|
|
42
|
+
|
|
43
|
+
- A requirement says a record is accepted, sent, issued, approved, paid, closed, cancelled, completed.
|
|
44
|
+
- Some edits must stop once a record reaches a state ("an issued invoice cannot be edited").
|
|
45
|
+
- One record's transition creates or fills another ("an accepted quote creates a job").
|
|
46
|
+
- The record is a document a customer receives (a quote, an order, an invoice): its lifecycle is one of several parts.
|
|
47
|
+
Start from `references/commercial-documents.md`, which routes each part (number, money, lines, total, PDF).
|
|
48
|
+
|
|
49
|
+
## When NOT to Use
|
|
50
|
+
|
|
51
|
+
- **A value derived from other records** ("the next action", "what is overdue") — never a stored
|
|
52
|
+
status; compute it and show it in a view (`views-app-level`).
|
|
53
|
+
- **Who may perform a transition** — that is the variant's `roles`; to add a user group, see
|
|
54
|
+
`application-roles-authoring`.
|
|
55
|
+
- **A one-off operation that changes no state** (export, recompute) — `backend-custom-operation`.
|
|
56
|
+
|
|
57
|
+
## Workflow
|
|
58
|
+
|
|
59
|
+
### Step 1 — Name the states and the transitions
|
|
60
|
+
|
|
61
|
+
List the states, which transition moves between which, who may call each, which states are locked and which are final.
|
|
62
|
+
Read `references/quote-lifecycle-worked-example.md` for the shape.
|
|
63
|
+
|
|
64
|
+
### Step 2 — Make the status impossible to set by hand
|
|
65
|
+
|
|
66
|
+
In the schema, the status is a named enum with a default, marked `.excludeFromCreate().excludeFromUpdate()`.
|
|
67
|
+
Each timestamp a transition stamps (`sentAt`, `decidedAt`, `paidAt`) is optional and excluded the same
|
|
68
|
+
way. Without this, the transitions are shortcuts beside a door that is still open.
|
|
69
|
+
|
|
70
|
+
### Step 3 — One operation per transition
|
|
71
|
+
|
|
72
|
+
Add a custom operation enum (`Quote_Operations`) and `customOperation` on the configuration. Each
|
|
73
|
+
transition is a variant with `resourceOperationLike: CoreResourceOperation.UPDATE`, an empty
|
|
74
|
+
`requestDto` (the server decides the state), `enabledCondition` on the starting state,
|
|
75
|
+
`basicPrefixOperation` returning only the new state and its timestamp, and `authoritativeFields`
|
|
76
|
+
naming them. Give transitions a customer relies on `riskLevel: HIGH`, which audits each one.
|
|
77
|
+
|
|
78
|
+
Every variant of a transition needs its own `enabledCondition`: a second variant (an administrator's,
|
|
79
|
+
say) without one is not checked against the starting state at all. Two transitions arriving at the
|
|
80
|
+
same moment are not serialized; the worked example says why, and why that is not yours to fix.
|
|
81
|
+
|
|
82
|
+
### Step 4 — Freeze what is locked or final
|
|
83
|
+
|
|
84
|
+
Add an `enabledCondition` to UPDATE (and DELETE, if offered) that holds only in the states where the
|
|
85
|
+
record may still be edited. That excludes LOCKED states (a sent quote, an issued invoice: no edits, but
|
|
86
|
+
the record still moves on) as well as FINAL ones (nothing moves it again); the domain plan names both.
|
|
87
|
+
|
|
88
|
+
### Step 5 — Conversions
|
|
89
|
+
|
|
90
|
+
When a transition also creates another resource, add a custom implementation on that transition with
|
|
91
|
+
a `postfixCoreOperations` hook that creates the target through `utils.servicesRegistry.create` in a
|
|
92
|
+
`transactionalCore` boundary — `backend-custom-operation`, Worked Example 2.
|
|
93
|
+
|
|
94
|
+
### Step 6 — Show the transitions as actions
|
|
95
|
+
|
|
96
|
+
The UI offers each operation as an action and hides it while its `enabledCondition` is false; show the
|
|
97
|
+
status read-only (`resource-ui-behavior`), never as an editable select.
|
|
98
|
+
|
|
99
|
+
## Worked Example
|
|
100
|
+
|
|
101
|
+
A quote's DRAFT → SENT → ACCEPTED / DECLINED lifecycle, frozen once sent, with what each line earns:
|
|
102
|
+
`references/quote-lifecycle-worked-example.md`.
|
|
103
|
+
|
|
104
|
+
## References
|
|
105
|
+
|
|
106
|
+
- `references/quote-lifecycle-worked-example.md` — the source-backed schema, relationship and configuration of a complete lifecycle.
|
|
107
|
+
- `references/commercial-documents.md` — what makes a quote, order or invoice trustworthy (number, money, lines, server total, freeze, PDF), routed to the skill that owns each part.
|
|
108
|
+
|
|
109
|
+
## Verification
|
|
110
|
+
|
|
111
|
+
- [ ] The status field is `.excludeFromUpdate()`.
|
|
112
|
+
- [ ] Every transition has `resourceOperationLike: UPDATE`, an empty `requestDto`, an `enabledCondition` and `authoritativeFields`.
|
|
113
|
+
- [ ] UPDATE has an `enabledCondition` when the resource has a locked or final state.
|
|
114
|
+
- [ ] A transition that creates another resource has a `transactionalCore` implementation.
|
|
115
|
+
|
|
116
|
+
### Grep invariants
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# the status field cannot be edited (the chain printed for each status enum must include excludeFromUpdate)
|
|
120
|
+
rg -n -A3 "status: z.enum" shared-lib/src/modules --glob '*.schemas.ts'
|
|
121
|
+
# every transition declares what it writes (count must equal the number of transition variants)
|
|
122
|
+
rg -c "authoritativeFields" shared-lib/src/modules --glob '*.resources-config.ts'
|
|
123
|
+
# per resources-config file, T = transitions (custom operations borrowing UPDATE)
|
|
124
|
+
rg -c "resourceOperationLike: CoreResourceOperation.UPDATE" shared-lib/src/modules --glob '*.resources-config.ts'
|
|
125
|
+
# every transition declares an EMPTY body: this count equals T (an absent requestDto inherits UPDATE's whole body)
|
|
126
|
+
rg -c "requestDto: z.object\(\{\}\)" shared-lib/src/modules --glob '*.resources-config.ts'
|
|
127
|
+
# every transition names its starting state: this count is T, plus 1 when UPDATE is frozen (the worked example: 3 + 1 = 4)
|
|
128
|
+
rg -c "enabledCondition" shared-lib/src/modules --glob '*.resources-config.ts'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Common Rationalizations
|
|
132
|
+
|
|
133
|
+
| Rationalization | Reality |
|
|
134
|
+
|---|---|
|
|
135
|
+
| "A status select on the edit form is simpler" | It lets any state jump to any other and stamps nothing. The engine can only refuse a move it sees as an operation. |
|
|
136
|
+
| "`enabledCondition` just hides the button" | The engine evaluates it on the backend before the operation runs and refuses the call. It is the guard. |
|
|
137
|
+
| "The prefix sets `status`, so I don't need `authoritativeFields`" | It works over HTTP, and silently writes nothing when an MCP tool or another service calls the transition with `status` already in its payload: the strict re-parse strips the excluded field. |
|
|
138
|
+
| "Store the next action so the list can show it" | It drifts from the records the moment either changes. Derive it in a view. |
|
|
139
|
+
|
|
140
|
+
## Red Flags
|
|
141
|
+
|
|
142
|
+
- A status field without `.excludeFromUpdate()` on a resource that has transitions (catch with the **status field cannot be edited** grep).
|
|
143
|
+
- A transition variant with no `authoritativeFields` (catch with the **declares what it writes** count).
|
|
144
|
+
- A transition that accepts a body, or declares none and so inherits UPDATE's (catch with the **EMPTY body** counts).
|
|
145
|
+
- A transition variant with no `enabledCondition`, such as an administrator's second variant (catch with the **starting state** count).
|
|
146
|
+
- A conversion written straight to another resource's repository instead of `servicesRegistry.create` (catch by reading the operation file against `backend-custom-operation` Worked Example 2).
|
|
147
|
+
|
|
148
|
+
## Related Skills
|
|
149
|
+
|
|
150
|
+
- `backend-custom-operation` — custom implementations, and the conversion recipe.
|
|
151
|
+
- `resource-config-wiring` — the rest of the resource configuration.
|
|
152
|
+
- `application-roles-authoring` — who may call each transition.
|
|
153
|
+
- `resource-ui-behavior` — the status shown read-only and the transitions as actions.
|