user.go
user.go - Overview
Defines the data structures for users, groups, invites, and password reset requests, including their database schema using bun
.
Detailed Documentation
Invite
- Purpose: Represents a user invite.
- Fields:
bun.BaseModel
: Embedded struct for Bun ORM base model.Identifiable
: Embedded struct (purpose unclear from the code).TimeAuditable
: Embedded struct (purpose unclear from the code).OrgID
: Organization ID.- Type:
string
- Description: Organization identifier, not null.
- Type:
Name
: Name of the invitee.- Type:
string
- Description: Invitee's name, not null.
- Type:
Email
: Email address of the invitee.- Type:
string
- Description: Invitee's email, not null and unique.
- Type:
Token
: Invite token.- Type:
string
- Description: Unique token for the invite, not null.
- Type:
Role
: Role to be assigned to the invitee.- Type:
string
- Description: Role of the invitee, not null.
- Type:
Group
- Purpose: Represents a user group.
- Fields:
bun.BaseModel
: Embedded struct for Bun ORM base model.TimeAuditable
: Embedded struct (purpose unclear from the code).OrgID
: Organization ID.- Type:
string
- Description: Organization identifier.
- Type:
ID
: Group ID.- Type:
string
- Description: Unique group identifier, primary key.
- Type:
Name
: Group name.- Type:
string
- Description: Group name, not null and unique.
- Type:
GettableUser
- Purpose: Represents a user with additional information like role and organization.
- Fields:
User
: EmbeddedUser
struct.Role
: User's role.- Type:
string
- Description: User's role within the organization.
- Type:
Organization
: User's organization.- Type:
string
- Description: User's organization.
- Type:
User
- Purpose: Represents a user.
- Fields:
bun.BaseModel
: Embedded struct for Bun ORM base model.TimeAuditable
: Embedded struct (purpose unclear from the code).ID
: User ID.- Type:
string
- Description: Unique user identifier, primary key.
- Type:
Name
: User's name.- Type:
string
- Description: User's name, not null.
- Type:
Email
: User's email address.- Type:
string
- Description: User's email, not null and unique.
- Type:
Password
: User's password.- Type:
string
- Description: User's password, not null, and excluded from JSON serialization.
- Type:
ProfilePictureURL
: URL of the user's profile picture.- Type:
string
- Description: URL for profile picture.
- Type:
GroupID
: Group ID.- Type:
string
- Description: Group identifier, not null.
- Type:
OrgID
: Organization ID.- Type:
string
- Description: Organization identifier, not null.
- Type:
ResetPasswordRequest
- Purpose: Represents a reset password request.
- Fields:
bun.BaseModel
: Embedded struct for Bun ORM base model.Identifiable
: Embedded struct (purpose unclear from the code).Token
: Reset password token.- Type:
string
- Description: Unique token for password reset, not null.
- Type:
UserID
: User ID.- Type:
string
- Description: User identifier for whom the reset is requested, not null.
- Type:
Code Examples
N/A
Include in Getting Started: NO