testmodels

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestModels

func GetTestModels() []interface{}

GetTestModels returns a list of all test model instances

func RegisterTestModels

func RegisterTestModels(registry *modelregistry.DefaultModelRegistry)

RegisterTestModels registers all test models with the provided registry

Types

type Comment

type Comment struct {
	ID        string    `json:"id" gorm:"primaryKey;type:string"`
	TaskID    string    `json:"task_id" gorm:"type:string"`
	AuthorID  string    `json:"author_id" gorm:"type:string"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// Relations
	Task   ProjectTask `json:"task,omitempty" gorm:"foreignKey:TaskID;references:ID"`
	Author Employee    `json:"author,omitempty" gorm:"foreignKey:AuthorID;references:ID"`
}

Comment represents a comment on a task

func (Comment) TableName

func (Comment) TableName() string

type Department

type Department struct {
	ID          string    `json:"id" gorm:"primaryKey;type:string"`
	Name        string    `json:"name"`
	Code        string    `json:"code" gorm:"uniqueIndex"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	// Relations
	Employees []Employee `json:"employees,omitempty" gorm:"foreignKey:DepartmentID;references:ID"`
	Projects  []Project  `json:"projects,omitempty" gorm:"many2many:department_projects;"`
}

Department represents a company department

func (Department) TableName

func (Department) TableName() string

type Document

type Document struct {
	ID          string    `json:"id" gorm:"primaryKey;type:string"`
	Name        string    `json:"name"`
	Type        string    `json:"type"`
	ContentType string    `json:"content_type"`
	Size        int64     `json:"size"`
	Path        string    `json:"path"`
	OwnerID     string    `json:"owner_id" gorm:"type:string"`
	ProjectID   *string   `json:"project_id" gorm:"type:string"`
	Status      string    `json:"status"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	// Relations
	Owner   Employee `json:"owner,omitempty" gorm:"foreignKey:OwnerID;references:ID"`
	Project *Project `json:"project,omitempty" gorm:"foreignKey:ProjectID;references:ID"`
}

Document represents any document in the system

func (Document) TableName

func (Document) TableName() string

type Employee

type Employee struct {
	ID           string    `json:"id" gorm:"primaryKey;type:string"`
	FirstName    string    `json:"first_name"`
	LastName     string    `json:"last_name"`
	Email        string    `json:"email" gorm:"uniqueIndex"`
	Title        string    `json:"title"`
	DepartmentID string    `json:"department_id" gorm:"type:string"`
	ManagerID    *string   `json:"manager_id" gorm:"type:string"`
	HireDate     time.Time `json:"hire_date"`
	Status       string    `json:"status"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`

	// Relations
	Department *Department `json:"department,omitempty" gorm:"foreignKey:DepartmentID;references:ID"`
	Manager    *Employee   `json:"manager,omitempty" gorm:"foreignKey:ManagerID;references:ID"`
	Reports    []Employee  `json:"reports,omitempty" gorm:"foreignKey:ManagerID;references:ID"`
	Projects   []Project   `json:"projects,omitempty" gorm:"many2many:employee_projects;"`
	Documents  []Document  `json:"documents,omitempty" gorm:"foreignKey:OwnerID;references:ID"`
}

Employee represents a company employee

func (Employee) TableName

func (Employee) TableName() string

type Project

type Project struct {
	ID          string    `json:"id" gorm:"primaryKey;type:string"`
	Name        string    `json:"name"`
	Code        string    `json:"code" gorm:"uniqueIndex"`
	Description string    `json:"description"`
	Status      string    `json:"status"`
	StartDate   time.Time `json:"start_date"`
	EndDate     time.Time `json:"end_date"`
	Budget      float64   `json:"budget"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	// Relations
	Departments []Department  `json:"departments,omitempty" gorm:"many2many:department_projects;"`
	Employees   []Employee    `json:"employees,omitempty" gorm:"many2many:employee_projects;"`
	Tasks       []ProjectTask `json:"tasks,omitempty" gorm:"foreignKey:ProjectID;references:ID"`
	Documents   []Document    `json:"documents,omitempty" gorm:"foreignKey:ProjectID;references:ID"`
}

Project represents a company project

func (Project) TableName

func (Project) TableName() string

type ProjectTask

type ProjectTask struct {
	ID          string    `json:"id" gorm:"primaryKey;type:string"`
	ProjectID   string    `json:"project_id" gorm:"type:string"`
	AssigneeID  string    `json:"assignee_id" gorm:"type:string"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Status      string    `json:"status"`
	Priority    int       `json:"priority"`
	DueDate     time.Time `json:"due_date"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`

	// Relations
	Project  Project   `json:"project,omitempty" gorm:"foreignKey:ProjectID;references:ID"`
	Assignee Employee  `json:"assignee,omitempty" gorm:"foreignKey:AssigneeID;references:ID"`
	Comments []Comment `json:"comments,omitempty" gorm:"foreignKey:TaskID;references:ID"`
}

ProjectTask represents a task within a project

func (ProjectTask) TableName

func (ProjectTask) TableName() string

Jump to

Keyboard shortcuts

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