feat: support tickets between accounts and platform admins
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 7m0s
ci / test (pull_request) Successful in 12m1s
ci / build (pull_request) Successful in 18m14s
ci / image (pull_request) Successful in 5m9s

Accounts open tickets under Support and admins answer them under Admin →
Support tickets.

- A ticket is open while it waits for the admins and answered while it
  waits for the account. Either side can close or reopen it, and a reply
  reopens it.
- The admins are mailed about new tickets and replies, and the account
  about answers.
- A ticket can name the active organization and point at a monitor,
  notification channel, alert group, status page or incident in it.
  Each must be something the account can read.
- Next to the conversation, admins see the account at a glance: state,
  sign-in, organizations with their limits and usage, and open tickets.
- Admins switch support off and limit how many tickets an account has
  open at once.
- Suspended accounts and those yet to accept the terms reach support too;
  a suspended account opens one ticket.
- Tickets are part of the account export and are deleted with the
  account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-24 18:01:50 +01:00
1 parent 9fc3c6b050
commit f3d402705e
25 files changed
+5296 -451

No files matched your search

+24
View File
@@ -22,6 +22,8 @@ type Querier interface {
AddMonitorAlertGroup(ctx context.Context, arg AddMonitorAlertGroupParams) (int64, error)
AddMonitorRegion(ctx context.Context, arg AddMonitorRegionParams) error
AddStatusPageMonitor(ctx context.Context, arg AddStatusPageMonitorParams) error
AddSupportMessage(ctx context.Context, arg AddSupportMessageParams) (SupportMessage, error)
AdminEmails(ctx context.Context) ([]string, error)
// System scope: organizations with their usage, limit overrides and owner,
// matching search in name, slug or owner email; newest first, a page from a
// keyset cursor.
@@ -50,10 +52,12 @@ type Querier interface {
ClearStatusPageGroups(ctx context.Context, pageID uuid.UUID) error
ClearStatusPageMonitors(ctx context.Context, pageID uuid.UUID) error
CountMonitors(ctx context.Context, orgID uuid.UUID) (int64, error)
CountOpenSupportTickets(ctx context.Context, userID uuid.UUID) (int64, error)
CountOwnedOrgs(ctx context.Context, userID uuid.UUID) (int64, error)
CountOwners(ctx context.Context, orgID uuid.UUID) (int64, error)
CountRoleAssignments(ctx context.Context, roleID uuid.UUID) (int64, error)
CountStatusPages(ctx context.Context, orgID uuid.UUID) (int64, error)
CountSupportTicketsSince(ctx context.Context, arg CountSupportTicketsSinceParams) (int64, error)
CountUnusedRecoveryCodes(ctx context.Context, userID uuid.UUID) (int64, error)
// Ways the account can sign in besides platform identities.
CountUserSignIns(ctx context.Context, id uuid.UUID) (int32, error)
@@ -77,6 +81,7 @@ type Querier interface {
CreateSSOProvider(ctx context.Context, arg CreateSSOProviderParams) (SsoProvider, error)
CreateStatusPage(ctx context.Context, arg CreateStatusPageParams) (StatusPage, error)
CreateStatusPageGroup(ctx context.Context, arg CreateStatusPageGroupParams) (StatusPageGroup, error)
CreateSupportTicket(ctx context.Context, arg CreateSupportTicketParams) (SupportTicket, error)
CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
DailyBuckets(ctx context.Context, arg DailyBucketsParams) ([]DailyBucketsRow, error)
DailyBucketsForMonitors(ctx context.Context, arg DailyBucketsForMonitorsParams) ([]DailyBucketsForMonitorsRow, error)
@@ -160,6 +165,7 @@ type Querier interface {
GetRole(ctx context.Context, id uuid.UUID) (Role, error)
GetSSOProvider(ctx context.Context, id uuid.UUID) (SsoProvider, error)
GetStatusPage(ctx context.Context, id uuid.UUID) (StatusPage, error)
GetSupportTicket(ctx context.Context, id uuid.UUID) (GetSupportTicketRow, error)
GetUser(ctx context.Context, id uuid.UUID) (User, error)
GetUserByEmail(ctx context.Context, email string) (User, error)
// System scope: the monitor a ping token belongs to.
@@ -234,9 +240,14 @@ type Querier interface {
ListSSOProviders(ctx context.Context) ([]SsoProvider, error)
ListStatusPageGroups(ctx context.Context, pageID uuid.UUID) ([]StatusPageGroup, error)
ListStatusPages(ctx context.Context) ([]StatusPage, error)
// Every account's tickets for the admins, those waiting for them first.
ListSupportTickets(ctx context.Context, status *string) ([]ListSupportTicketsRow, error)
ListUserIdentitiesInOrg(ctx context.Context, userID uuid.UUID) ([]ListUserIdentitiesInOrgRow, error)
ListUserOrgs(ctx context.Context, userID uuid.UUID) ([]ListUserOrgsRow, error)
ListUserPlatformIdentities(ctx context.Context, userID uuid.UUID) ([]ListUserPlatformIdentitiesRow, error)
// The tickets row-level security lets the account see, newest activity
// first.
ListUserSupportTickets(ctx context.Context, userID uuid.UUID) ([]SupportTicket, error)
// Row-level security limits this to platform regions and the scope's org;
// the org's own regions come first.
ListVisibleRegions(ctx context.Context) ([]Region, error)
@@ -333,6 +344,7 @@ type Querier interface {
// Changing the domain drops a previous verification.
SetStatusPageDomain(ctx context.Context, arg SetStatusPageDomainParams) (StatusPage, error)
SetStatusPageMonitorGroup(ctx context.Context, arg SetStatusPageMonitorGroupParams) error
SetSupportTicketStatus(ctx context.Context, arg SetSupportTicketStatusParams) (int64, error)
SetUserAdmin(ctx context.Context, arg SetUserAdminParams) (int64, error)
SetUserLocale(ctx context.Context, arg SetUserLocaleParams) error
SetUserOrgLimit(ctx context.Context, arg SetUserOrgLimitParams) (SetUserOrgLimitRow, error)
@@ -346,6 +358,18 @@ type Querier interface {
StorageGet(ctx context.Context, arg StorageGetParams) (StorageGetRow, error)
StorageList(ctx context.Context, arg StorageListParams) ([]StorageListRow, error)
StoragePut(ctx context.Context, arg StoragePutParams) error
SupportMessages(ctx context.Context, ticketID uuid.UUID) ([]SupportMessagesRow, error)
SupportOptionsAlertGroups(ctx context.Context, orgID uuid.UUID) ([]SupportOptionsAlertGroupsRow, error)
SupportOptionsChannels(ctx context.Context, orgID uuid.UUID) ([]SupportOptionsChannelsRow, error)
SupportOptionsIncidents(ctx context.Context, orgID uuid.UUID) ([]SupportOptionsIncidentsRow, error)
SupportOptionsMonitors(ctx context.Context, orgID uuid.UUID) ([]SupportOptionsMonitorsRow, error)
SupportOptionsStatusPages(ctx context.Context, orgID uuid.UUID) ([]SupportOptionsStatusPagesRow, error)
// Whether everything a new ticket points at belongs to org; run in the
// organization's scope so only what the account may see counts.
SupportReferencesExist(ctx context.Context, arg SupportReferencesExistParams) (*bool, error)
// The names of what a ticket points at, for showing it.
SupportTicketReferences(ctx context.Context, id uuid.UUID) (SupportTicketReferencesRow, error)
SupportTicketStatus(ctx context.Context, id uuid.UUID) (string, error)
SuspendOrg(ctx context.Context, arg SuspendOrgParams) (SuspendOrgRow, error)
SuspendStatusPage(ctx context.Context, arg SuspendStatusPageParams) (SuspendStatusPageRow, error)
SuspendUser(ctx context.Context, arg SuspendUserParams) (SuspendUserRow, error)