userteam

package
v1.0.0-alpha.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package userteam binds the user roster read: team memberships joined to the teams they point at.

Index

Constants

This section is empty.

Variables

View Source
var Schema = database.NewSchema(map[domain.UserTeamField]database.FieldBinding[domain.UserTeam]{
	domain.UserTeamFieldProjectID: {
		SQLName:  "m.project_id",
		Accessor: func(t *domain.UserTeam) any { return t.ProjectID },
		Coerce:   database.CoerceString,
	},
	domain.UserTeamFieldUserID: {
		SQLName:  "m.user_id",
		Accessor: func(t *domain.UserTeam) any { return t.UserID },
		Coerce:   database.CoerceString,
	},
	domain.UserTeamFieldTeamID: {
		SQLName:  "m.team_id",
		Accessor: func(t *domain.UserTeam) any { return t.TeamID },
		Coerce:   database.CoerceString,
	},
	domain.UserTeamFieldTeamName: {
		SQLName:  "t.name",
		Accessor: func(t *domain.UserTeam) any { return t.TeamName },
		Coerce:   database.CoerceString,
	},
	domain.UserTeamFieldStatus: {
		SQLName:  "m.status",
		Accessor: func(t *domain.UserTeam) any { return t.Status.String() },
		Coerce:   database.CoerceString,
	},
	domain.UserTeamFieldCreatedAt: {
		SQLName:  "m.created_at",
		Accessor: func(t *domain.UserTeam) any { return t.CreatedAt },
		Coerce:   database.CoerceTime,
	},
	domain.UserTeamFieldUpdatedAt: {
		SQLName:  "m.updated_at",
		Accessor: func(t *domain.UserTeam) any { return t.UpdatedAt },
		Coerce:   database.CoerceTime,
	},
})

Schema binds user-team list/filter/order fields for all dialects.

The SQL names are table-qualified because the read is a join and every dialect aliases the membership table `m` and the team table `t`: `project_id`, `status`, and `created_at` exist on both sides, so an unqualified name would be ambiguous.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL