Self Checks
Description
The end_users.type field is currently written from several backend entry points using raw strings or invoke-source enum values. This makes the persisted values harder to audit and allows call sites to drift as new surfaces create end users.
Introduce a dedicated EndUserType enum for the persisted end_users.type values and update backend end-user creation paths to use it consistently.
Motivation
A dedicated enum makes the database contract explicit, keeps direct EndUser construction consistent across service API, web app, MCP, OpenAPI, and trigger paths, and prevents accidental reuse of unrelated invoke-source enums for persisted end-user type values.
Additional Context
Current production values include browser, service-api, service_api, mcp, and trigger. OpenAPI is also represented by current backend creation paths.
Self Checks
Description
The
end_users.typefield is currently written from several backend entry points using raw strings or invoke-source enum values. This makes the persisted values harder to audit and allows call sites to drift as new surfaces create end users.Introduce a dedicated
EndUserTypeenum for the persistedend_users.typevalues and update backend end-user creation paths to use it consistently.Motivation
A dedicated enum makes the database contract explicit, keeps direct
EndUserconstruction consistent across service API, web app, MCP, OpenAPI, and trigger paths, and prevents accidental reuse of unrelated invoke-source enums for persisted end-user type values.Additional Context
Current production values include browser, service-api, service_api, mcp, and trigger. OpenAPI is also represented by current backend creation paths.