models

package
v0.0.0-...-f8ef4e5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCommitment

func DeleteCommitment(db *sqlx.DB, ID *uuid.UUID) error

DeleteCommitment deletes a single commitment using the commitment ID

func DeleteLeave

func DeleteLeave(db *sqlx.DB, ID *uuid.UUID) error

DeleteLeave deletes a single leave using the leave ID

func DeleteProject

func DeleteProject(db *sqlx.DB, projectID *uuid.UUID) error

Types

type Commitment

type Commitment struct {
	ID             uuid.UUID `json:"id"`
	EmployeeID     uuid.UUID `json:"employee_id" db:"employee_id"`
	EmployeeName   string    `json:"employee_name" db:"employee_name"`
	TimeperiodID   uuid.UUID `json:"timeperiod_id" db:"timeperiod_id"`
	TimeperiodName string    `json:"timeperiod_name" db:"timeperiod_name"`
	ProjectID      uuid.UUID `json:"project_id" db:"project_id"`
	ProjectName    string    `json:"project_name" db:"project_name"`
	Days           int       `json:"days"`
	Cost           float32   `json:"cost"`
}

Commitment is a number of days for a single employee, timeperiod, and project

func CreateCommitment

func CreateCommitment(db *sqlx.DB, commitment *Commitment) (*Commitment, error)

func GetCommitment

func GetCommitment(db *sqlx.DB, ID *uuid.UUID) (*Commitment, error)

func ListCommitments

func ListCommitments(db *sqlx.DB) ([]Commitment, error)

type Employee

type Employee struct {
	ID                     uuid.UUID `json:"id"`
	Name                   string    `json:"name"`
	Rate                   float32   `json:"rate"`
	AvailabilityMultiplier float32   `json:"availability_multiplier" db:"availability_multiplier"`
}

func ListEmployees

func ListEmployees(db *sqlx.DB) ([]Employee, error)

type Leave

type Leave struct {
	ID             uuid.UUID `json:"id"`
	EmployeeID     uuid.UUID `json:"employee_id" db:"employee_id"`
	EmployeeName   string    `json:"employee_name" db:"employee_name"`
	TimeperiodID   uuid.UUID `json:"timeperiod_id" db:"timeperiod_id"`
	TimeperiodName string    `json:"timeperiod_name" db:"timeperiod_name"`
	Days           int       `json:"days"`
}

Leave is a number of days for a single employee, timeperiod, and project

func CreateLeave

func CreateLeave(db *sqlx.DB, leave *Leave) (*Leave, error)

func GetLeave

func GetLeave(db *sqlx.DB, ID *uuid.UUID) (*Leave, error)

func ListLeave

func ListLeave(db *sqlx.DB) ([]Leave, error)

type Project

type Project struct {
	ID                 uuid.UUID  `json:"id"`
	Name               string     `json:"name"`
	Funding            *float32   `json:"funding,omitempty"`
	FundsRemaining     *float32   `json:"funds_remaining" db:"funds_remaining"`
	LatestRealityCheck *time.Time `json:"latest_reality_check" db:"latest_reality_check"`
	FeedbackEnabled    *bool      `json:"feedback_enabled,omitempty" db:"feedback_enabled"`
}

func CreateProject

func CreateProject(db *sqlx.DB, p *Project) (*Project, error)

func ListFeedbackProjects

func ListFeedbackProjects(db *sqlx.DB) ([]Project, error)

func ListProjects

func ListProjects(db *sqlx.DB) ([]Project, error)

func UpdateProject

func UpdateProject(db *sqlx.DB, p *Project) (*Project, error)

type ProjectFundingUpdate

type ProjectFundingUpdate struct {
	ID           uuid.UUID `json:"id"`
	ProjectID    uuid.UUID `json:"project_id" db:"project_id"`
	TimeperiodID uuid.UUID `json:"timeperiod_id" db:"timeperiod_id"`
	Total        float32   `json:"total" db:"total"`
}

func UpdateProjectFunding

func UpdateProjectFunding(db *sqlx.DB, u *ProjectFundingUpdate) (*ProjectFundingUpdate, error)

type Timeperiod

type Timeperiod struct {
	ID       uuid.UUID `json:"id"`
	Name     string    `json:"name"`
	End      time.Time `json:"timeperiod_end" db:"timeperiod_end"`
	Workdays int       `json:"workdays"`
}

func ListTimeperiods

func ListTimeperiods(db *sqlx.DB) ([]Timeperiod, error)

Jump to

Keyboard shortcuts

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