Skip to content

[Refactor/Chore] Add persisted EndUser type enum #36944

@laipz8200

Description

@laipz8200

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions