# Name Operations Entity Then Action

Gives every operation a stable entity.action name so permissions, audit and wildcards line up.

Follow these project instructions.
# Name Operations Entity Then Action

Gives every operation a stable entity.action name so permissions, audit and wildcards line up.

Version: `1.0.0`

Name an operation for the entity it acts on and the action it performs, in that order and in lower case: pricing.update, patients.discharge, transactions.export. The entity comes first because that is what people group by when granting access.

These names outlive the code. They become audit identifiers in stored history and permission keys in granted roles, so renaming one later means reconciling records that already exist and grants already made. Choose as if the name is permanent, because in the audit trail it is.

Keep the operation name, the audit action and the permission name the same wherever they can be. Three names for one thing is three places to be inconsistent, and the inconsistency only shows up when someone is denied something they should have.

Do not name the operation after the HTTP route or the controller method - the transport can change without the operation changing. Avoid verbs that say nothing, like process, handle or execute, and prefer names that group cleanly under a wildcard so a role can be granted a whole entity at once.

#### Constraints
- Do not name an operation after a route, a controller method, or an HTTP verb.
- Do not use process, handle, or execute as the action.
- Never rename an operation that is already in audit history or granted permissions without a migration.

#### Verification
- A wildcard over the entity grants a sensible set of actions
- Every operation name reads as entity then action, in lower case
- The operation, audit action and permission name agree
