models

package
v0.0.0-...-0cc5bfb Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssigneeType

type AssigneeType string
const (
	AssigneeTypeIndividual AssigneeType = "individual"
	AssigneeTypeTeam       AssigneeType = "team"
)

type Company

type Company struct {
	ID          string       `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	Name        string       `gorm:"column:name;not null" json:"name,omitempty"`
	Code        string       `gorm:"column:company_code;not null" json:"company_code,omitempty"`
	CreatorID   string       `gorm:"column:creator_id;not null" json:"creator_id,omitempty"`
	Memberships []Membership `gorm:"foreignKey:CompanyID" json:"-"`
	CreatedAt   time.Time    `gorm:"column:created_at" json:"created_at,omitempty"`
	UpdatedAt   time.Time    `gorm:"column:updated_at" json:"updated_at,omitempty"`
}

type KeyResult

type KeyResult struct {
	ID           string                  `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	Title        string                  `gorm:"column:title;not null" json:"name,omitempty"`
	Description  string                  `gorm:"column:description;not null" json:"description,omitempty"`
	ObjectiveID  string                  `gorm:"column:objective_id;not null;index" json:"objective_id,omitempty"`
	MetricType   MetricType              `` /* 133-byte string literal not displayed */
	TargetValue  float64                 `gorm:"column:target_value;not null" json:"target_value"`
	CurrentValue float64                 `gorm:"column:current_value;" json:"current_value"`
	Progress     float64                 `gorm:"column:progress;default:0" json:"progress_percentage"`
	Status       KeyResultProgressStatus `` /* 146-byte string literal not displayed */
	AssigneeType AssigneeType            `gorm:"column:assignee_type;type:varchar(50);not null;default:'team'" json:"assignee_type,omitempty" validate:"assignee_type"`
	AssigneeID   string                  `gorm:"column:assignee_id;not null;index" json:"assignee_id,omitempty"`
	StartDate    time.Time               `gorm:"column:start_date; not null" json:"start_date,omitempty"`
	DueDate      time.Time               `gorm:"column:due_date; not null" json:"due_date,omitempty" validate:"due_date"`
	CreatedAt    time.Time               `gorm:"column:created_at;not null;default:current_timestamp" json:"created_at,omitempty"`
	UpdatedAt    time.Time               `gorm:"column:updated_at;not null;default:current_timestamp;autoUpdateTime" json:"updated_at,omitempty"`
}

func (*KeyResult) UpdateProgress

func (k *KeyResult) UpdateProgress()

func (*KeyResult) UpdateStatus

func (k *KeyResult) UpdateStatus()

type KeyResultProgressStatus

type KeyResultProgressStatus string
const (
	StatusNotStarted KeyResultProgressStatus = "not_started"
	StatusInProgress KeyResultProgressStatus = "on_track"
	StatusRisk       KeyResultProgressStatus = "at_risk"
	StatusBehind     KeyResultProgressStatus = "behind"
	StatusCompleted  KeyResultProgressStatus = "completed"
)

type Membership

type Membership struct {
	ID        string     `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	UserID    string     `gorm:"column:user_id;not null;index" json:"user_id,omitempty"`
	CompanyID string     `gorm:"column:company_id;not null;index" json:"company_id,omitempty"`
	Role      RoleType   `` /* 129-byte string literal not displayed */
	Status    StatusType `` /* 139-byte string literal not displayed */
	CreatedAt time.Time  `gorm:"column:created_at;not null;default:current_timestamp" json:"created_at,omitempty"`
	UpdatedAt time.Time  `gorm:"column:updated_at;not null;default:current_timestamp;autoUpdateTime" json:"updated_at,omitempty"`
}

Membership represents a user's membership in an organization or group

type MetricType

type MetricType string
const (
	MetricTypeNumeric    MetricType = "numeric"
	MetricTypePercentage MetricType = "percentage"
	MetricTypeBinary     MetricType = "binary"
	MetrictTypeCurrency  MetricType = "currency"
)

type RoleType

type RoleType string

RoleType defines the available membership roles

const (
	RoleAdmin  RoleType = "admin"
	RoleMember RoleType = "member"
	RoleViewer RoleType = "viewer"
)

type StatusType

type StatusType string

StatusType defines the available membership statuses

const (
	StatusActive    StatusType = "active"
	StatusInactive  StatusType = "inactive"
	StatusSuspended StatusType = "suspended"
)

type Team

type Team struct {
	ID          string    `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	Name        string    `gorm:"column:name;not null" json:"name,omitempty"`
	CompanyID   string    `gorm:"column:company_id;not null;index" json:"company_id,omitempty"`
	Description string    `gorm:"column:description;not null" json:"description,omitempty"`
	CreatedAt   time.Time `gorm:"column:created_at" json:"created_at,omitempty"`
	UpdatedAt   time.Time `gorm:"column:updated_at" json:"updated_at,omitempty"`
}

type TeamMember

type TeamMember struct {
	ID     string `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	UserID string `gorm:"column:user_id;not null;index" json:"user_id,omitempty"`
	TeamID string `gorm:"column:team_id;not null;index" json:"team_id,omitempty"`
}

type User

type User struct {
	ID         string    `gorm:"column:id;primaryKey;not null" json:"id,omitempty"`
	ProviderID string    `gorm:"column:provider_id;not null" json:"provider_id,omitempty"`
	FirstName  string    `gorm:"column:first_name;not null" json:"first_name,omitempty"`
	LastName   string    `gorm:"column:last_name;not null" json:"last_name,omitempty"`
	UserName   string    `gorm:"column:user_name;not null" json:"user_name,omitempty"`
	Email      string    `gorm:"column:email;unique;not null" json:"email,omitempty"`
	AvatarURL  string    `gorm:"column:avatar_url;unique;not null" json:"avatar_url,omitempty"`
	CreatedAt  time.Time `gorm:"column:created_at" json:"created_at,omitempty"`
	UpdatedAt  time.Time `gorm:"column:updated_at" json:"updated_at,omitempty"`
}

Jump to

Keyboard shortcuts

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