models

package
v0.0.0-...-5d4c5b8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeys

type ApiKeys struct {
	ID        string    `gorm:"primaryKey"`        // Primary key as string
	ApiKey    string    `gorm:"unique;not null"`   // API key (unique and not null)
	Active    bool      `gorm:"default:true"`      // Default active status
	CreatedAt time.Time `gorm:"autoCreateTime"`    // Auto create time for API key
	UpdatedAt time.Time `gorm:"autoUpdateTime"`    // Auto update time for API key
	User      Users     `gorm:"foreignKey:UserID"` // Foreign key to Users
	UserID    string    `gorm:"not null"`          // User ID field (string type)
}

type Organizations

type Organizations struct {
	ID        string    `gorm:"primaryKey"`                // Primary key as string
	Name      string    `gorm:"not null"`                  // Organization name
	URL       string    `gorm:"not null"`                  // Organization URL
	Country   string    `gorm:"not null"`                  // Organization country
	Users     []Users   `gorm:"foreignKey:OrganizationID"` // Foreign key to Users
	CreatedAt time.Time `gorm:"autoCreateTime"`            // Auto create time for organization
	UpdatedAt time.Time `gorm:"autoUpdateTime"`            // Auto update time for organization
}

type Users

type Users struct {
	ID             string        `gorm:"primaryKey"`                // Primary key as string
	Email          string        `gorm:"unique"`                    // Unique email
	FirstName      string        `gorm:"not null"`                  // Not null field for first name
	LastName       string        `gorm:"not null"`                  // Not null field for last name
	DateOfBirth    time.Time     `gorm:"not null"`                  // Not null field for date of birth
	AvatarImage    []byte        `gorm:"type:bytea"`                // Avatar image as bytea type
	CreatedAt      time.Time     `gorm:"autoCreateTime"`            // Auto create time for the user
	UpdatedAt      time.Time     `gorm:"autoUpdateTime"`            // Auto update time for the user
	Organizations  Organizations `gorm:"foreignKey:OrganizationID"` // Foreign key to Organizations
	OrganizationID string        `gorm:"not null"`                  // Organization ID field (string type)
	Password       string        `gorm:"not null"`                  // User password
	Role           string        `gorm:"not null"`                  // User role
}

Jump to

Keyboard shortcuts

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