account

package
v0.0.0-...-b7271af Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	ID        int64     `gorm:"id, primarykey, autoincrement" json:"-"`
	Number    int64     `json:"number"`
	ProjectID string    `json:"-"`
	Project   Project   `json:"-"`
	CreatedAt time.Time `json:"created"`
}

type CommitCohort

type CommitCohort struct {
	Number         int64     `json:"number_of_commit"`
	CommitDeadline time.Time `json:"commit_deadline"`
}

type Funding

type Funding struct {
	ID            int64     `gorm:"id, primarykey, autoincrement" json:"id"`
	UserID        int64     `json:"user_id"`
	User          User      `json:"user"`
	ProjectID     int64     `json:"project_id"`
	Project       Project   `json:"project"`
	Amount        int64     `json:"amount"`
	TransactionID uuid.UUID `json:"transaction_id" gorm:"type:uuid;default:uuid_generate_v4()"`
	UpdatedAt     time.Time `json:"-"`
	CreatedAt     time.Time `json:"created"`
}

type Project

type Project struct {
	ID               string         `gorm:"id, primarykey" json:"id"`
	ExternalID       string         `gorm:"index:idx_ext_id" json:"-"`
	URL              string         `gorm:"index:idx_url,unique" json:"url"`
	Name             string         `json:"name"`
	Type             int16          `json:"type"`
	CommitGoal       int64          `json:"commit_goal"`
	CommitTimeWindow int64          `json:"commit_time_window"`
	CommitDeadline   *time.Time     `gorm:"default:null" json:"-"`
	CurrentCohort    *CommitCohort  `gorm:"-:all" json:"current_cohort,omitempty"`
	UserID           int64          `json:"-"`
	User             User           `json:"-"`
	UpdatedAt        time.Time      `json:"-"`
	CreatedAt        time.Time      `json:"-"`
	DeletedAt        gorm.DeletedAt `gorm:"index" json:"-"`
}

func (*Project) BeforeCreate

func (p *Project) BeforeCreate(tx *gorm.DB) (err error)

type User

type User struct {
	ID         int64          `gorm:"id, primarykey, autoincrement" json:"-"`
	ExternalID string         `gorm:"index:idx_ext_id,unique" json:"-"`
	Email      string         `gorm:"unique" json:"email"`
	Name       string         `json:"name"`
	Avatar     string         `json:"avatar"`
	Projects   []Project      `json:"-"`
	UpdatedAt  time.Time      `json:"-"`
	CreatedAt  time.Time      `json:"-"`
	DeletedAt  gorm.DeletedAt `gorm:"index" json:"-"`
}

Jump to

Keyboard shortcuts

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