Skip to content

CAP-PFM-ELG-001Author a readable eligibility rule

Markdown

CAP-PFM-ELG-001

Author a readable eligibility rule

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleEligibility, Responsibilities and AttentionRevision1

Read atservices-platform ad3f6a65react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Staff reuse a rule through its permanent readable key.Validation identifies problems before the expression is relied on.A sentence explains the authored expression.
Surfaces
consoleapi
Intent sources
services-platform:docs/milestones/plans/PLAT-M11-plan.md#2. Scopeservices-platform:docs/milestones/plans/PLAT-M11-plan.md#A5services-platform:docs/milestones/plans/PLAT-M11-plan.md#D6services-platform:docs/proposals/eligibility/17-decision-register.md#D-11services-platform:docs/proposals/eligibility/17-decision-register.md#D-27

Controls

21 controls apply, from the corpus control catalogue.

TC-AVL-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-003 TC-PI-005 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
platform.eligibility.writeapitenant
platform.eligibility.readapitenant
platform.eligibility.publishservicetenant

Business Rules

15 rules, 15 to be proved before approval. A rule's product intent is derived from its origin: 15 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
A readable key identifies the rule from creation, uses lowercase letters and digits separated by single underscores, begins with a letter and contains no more than 63 characters, while creation refuses reserved route names and the system key prefix.
✓ member_in_good_standing✗ Member-In-Good-Standing
validationapi, service, databasetest
services-platform:modules/eligibility/tests/integration/services/persistence/definitions.integration.spec.js#refuses an id that is not a configuration id, before anything is written
02must prove
Confirmed
Within a workspace each rule key is unique, while separate workspaces can choose the same key.
invariantservice, databasetest
services-platform:modules/eligibility/tests/integration/services/persistence/definitions.integration.spec.js#refuses a second definition with the same id (key) in the tenant, naming it
03must prove
Confirmed
Rule keys are permanent, and an update that supplies a key is rejected.
invariantapi, servicetest
services-platform:modules/eligibility/tests/e2e/eligibility-definitions.e2e.spec.js#refuses an edit that names the key, which never changes, 400
04must prove
Confirmed
Saving retains a draft with validation problems and returns their codes and its readable summary, but errors prevent publication.
policyservicetest
services-platform:modules/eligibility/tests/e2e/eligibility-definitions.e2e.spec.js#answers the draft’s problem, saved rather than refused
05must prove
Confirmed
Each rule has one replaceable draft; supplying an outdated draft version rejects a save, while omitting the version overwrites the current draft.
origin: services-platform:docs/milestones/plans/PLAT-M11-plan.md#Appendix A. Behaviours that stand as built unless Andrew objects
lifecycleservice, databasetest
06must prove
Confirmed
Creation without an expression leaves the rule without a version; supplying an expression creates its first draft version.
lifecycleservicetest
services-platform:modules/eligibility/tests/integration/services/model/authoring.integration.spec.js#creates a definition without a draft when the request carries no expression
07must prove
Confirmed
Validation identifies unavailable rule references and cycles, unsupported facts, absent workspace custom fields and a primary subject whose kind conflicts with the rule.
validationservicetest
08must prove
Confirmed
Parameter declarations require ordered minimum and maximum bounds and a default compatible with the declared type, bounds and available options.
validationservicetest
09must prove
Confirmed
Rules allow at most 200 conditions and groups, depth eight, 50 children per group, 20 references and three reference levels; readable summaries stop at 4,000 characters.
validationservicetest
10must prove
Confirmed
Readable summaries use available labels for roles, choices, organizations and custom fields, retaining the underlying reference when its label cannot be resolved.
calculationservicetest
11must prove
Confirmed
Sharing a previously private rule requires authority to publish rules.
permissionapi, servicetest
services-platform:modules/eligibility/tests/e2e/eligibility-definitions.e2e.spec.js#refuses a writer without the publish permission the promotion of a private definition, 403
12must prove
Confirmed
An unspecified duplication source uses the latest published expression, then the draft, or copies a bare rule; explicitly requesting an absent source is rejected, and copied expressions start as a workspace-owned first draft.
lifecycleserviceobserved
13must prove
Confirmed
Character limits are 1,000 for a change note or portal message, 200 for a name and 2,000 for a description, with no more than 20 tags per rule.
validationapi, service, databasetest
14must prove
Confirmed
An archived rule must be restored before another draft can be saved.
lifecycleservicetest
15must prove
Confirmed
Creation and duplication accept the readable identity or its legacy key alias, which must agree when supplied together; absence or conflict is refused, and responses expose the same value under both names.
validationapitest

Scenarios

IdGivenWhenThenProvenance
01A director drafts a qualification expression containing an unknown condition.They save and attempt publication.The saved work retains its problem and the release fails with that problem identified.test
services-platform:modules/eligibility/tests/e2e/eligibility-definitions.e2e.spec.js#refuses the publish while the problem exists, 400, naming it
02A product-specific expression remains private.A writer without release authority attempts to share it.Sharing fails for that writer and succeeds for a publish-authorized user.test

Edge Cases

IdGivenWhenThenProvenance
03Two colleagues have read the same draft.Both save, with the later request omitting its version.The later request replaces the earlier draft without a warning under the approved current behavior.test

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.