model

package
v0.0.0-...-78411ff Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package model provides data structures for the Glass Factory APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillableStatus

type BillableStatus int

BillableStatus represents the billable status in time reports

const (
	// Unknown represents undefined values
	Unknown BillableStatus = iota
	// Billable represents billable hours
	Billable
	// NonBillable represents non-billable hours
	NonBillable // Non Billable
	// NewBusiness represents new business hours
	NewBusiness // New Business
)

func (BillableStatus) MarshalJSON

func (i BillableStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (BillableStatus) String

func (i BillableStatus) String() string

func (*BillableStatus) UnmarshalJSON

func (i *BillableStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Client

type Client struct {
	ID         int       `json:"id"`
	Name       string    `json:"name"`
	ArchivedAt time.Time `json:"archived_at,omitempty"`
	OwnerID    int       `json:"owner_id"`
	OfficeID   int       `json:"office_id"`
}

Client represents client details in Glass Factory

func (*Client) IsArchived

func (c *Client) IsArchived() bool

IsArchived returns true if archive date has been defined

type ClientCollection

type ClientCollection struct {
	// contains filtered or unexported fields
}

ClientCollection represents unique set of clients

func NewClientCollection

func NewClientCollection() *ClientCollection

NewClientCollection is used for creating ClientCollection

func (*ClientCollection) Add

func (c *ClientCollection) Add(client *Client)

Add a client to the collection

func (*ClientCollection) All

func (c *ClientCollection) All() []*Client

All returns all clients from the collection

func (*ClientCollection) Count

func (c *ClientCollection) Count() int

Count returns number of clients in the collection

func (*ClientCollection) Filter

func (c *ClientCollection) Filter(f func(*Client) bool) *ClientCollection

Filter returns a new collection that contains clients matching the predicate

func (*ClientCollection) Get

func (c *ClientCollection) Get(id int) (*Client, bool)

Get returns a single client from the collection, if found

func (*ClientCollection) Take

func (c *ClientCollection) Take() *Client

Take returns a client from the collection

func (*ClientCollection) WithOffice

func (c *ClientCollection) WithOffice(officeID int) *ClientCollection

WithOffice returns a new collection with clients matching the office ID

type Member

type Member struct {
	ID         int           `json:"id"`
	Name       string        `json:"name"`
	Email      string        `json:"email"`
	JoinedAt   dateutil.Date `json:"joined_at,omitempty"`
	ArchivedAt dateutil.Date `json:"archived_at,omitempty"`
	Freelancer bool          `json:"freelancer"`
	RoleID     int           `json:"role_id"`
	Capacity   float64       `json:"capacity"`
	Archived   bool          `json:"archived"`
	OfficeID   int           `json:"office_id"`
	Avatar     *MemberAvatar `json:"avatar"`
}

Member represents staff member details in Glass Factory

type MemberAvatar

type MemberAvatar struct {
	URL string `json:"url"`
}

MemberAvatar is a URL to avatar image file

type MemberCollection

type MemberCollection struct {
	// contains filtered or unexported fields
}

MemberCollection represents unique set of members

func NewMemberCollection

func NewMemberCollection() *MemberCollection

NewMemberCollection is used for creating MemberCollection

func (*MemberCollection) Add

func (c *MemberCollection) Add(member *Member)

Add a member to the collection

func (*MemberCollection) All

func (c *MemberCollection) All() []*Member

All returns all members from the collection

func (*MemberCollection) Count

func (c *MemberCollection) Count() int

Count returns number of members in the collection

func (*MemberCollection) Filter

func (c *MemberCollection) Filter(f func(*Member) bool) *MemberCollection

Filter returns a new collection that contains members matching the predicate

func (*MemberCollection) Get

func (c *MemberCollection) Get(id int) (*Member, bool)

Get returns a single member from the collection, if found

func (*MemberCollection) Take

func (c *MemberCollection) Take() *Member

Take returns a member from the collection

func (*MemberCollection) WithEmail

func (c *MemberCollection) WithEmail(email string) *MemberCollection

WithEmail returns a new collection with members matching the email

func (*MemberCollection) WithOffice

func (c *MemberCollection) WithOffice(officeID int) *MemberCollection

WithOffice returns a new collection with members matching the office ID

func (*MemberCollection) WithRole

func (c *MemberCollection) WithRole(roleID int) *MemberCollection

WithRole returns a new collection with members matching the role ID

type MemberTimeReport

type MemberTimeReport struct {
	UserID     int           `json:"user_id"`
	Date       dateutil.Date `json:"date"`
	Planned    float64       `json:"planned"`
	Actual     float64       `json:"time"`
	ClientID   int           `json:"client_id,omitempty"`
	ProjectID  int           `json:"project_id,omitempty"`
	JobID      string        `json:"job_id,omitempty"`
	ActivityID int           `json:"activity_id,omitempty"`
	RoleID     int           `json:"role_id,omitempty"`
	Client     *Client
	Project    *Project
}

MemberTimeReport represents a single team member time report entry

type Project

type Project struct {
	ID                int               `json:"id"`
	Name              string            `json:"name"`
	Archived          bool              `json:"archived,omitempty"`
	ManagerID         int               `json:"manager_id"`
	URL               string            `json:"url,omitempty"`
	OfficeID          int               `json:"office_id"`
	ClientID          int               `json:"client_id"`
	JobID             string            `json:"job_id"`
	CreatedAt         dateutil.DateTime `json:"created_at,omitempty"`
	ClosedAt          dateutil.Date     `json:"closed_at,omitempty"`
	BillableStatus    BillableStatus    `json:"billable_status"`
	Probability       float64           `json:"probability"`
	Closed            bool              `json:"closed,omitempty"`
	ProbabilityState  string            `json:"probability_state"`
	EnableGeneralTime bool              `json:"enable_general_time,omitempty"`
	Pricing           *ProjectPricing   `json:"pricing"`
}

Project represents an internal or client project in Glass Factory

type ProjectCollection

type ProjectCollection struct {
	// contains filtered or unexported fields
}

ProjectCollection represents unique set of projects

func NewProjectCollection

func NewProjectCollection() *ProjectCollection

NewProjectCollection is used for creating ProjectCollection

func (*ProjectCollection) Add

func (c *ProjectCollection) Add(project *Project)

Add a project to the collection

func (*ProjectCollection) All

func (c *ProjectCollection) All() []*Project

All returns all projects from the collection

func (*ProjectCollection) Count

func (c *ProjectCollection) Count() int

Count returns number of projects in the collection

func (*ProjectCollection) Filter

func (c *ProjectCollection) Filter(f func(*Project) bool) *ProjectCollection

Filter returns a new collection that contains projects matching the predicate

func (*ProjectCollection) Get

func (c *ProjectCollection) Get(id int) (*Project, bool)

Get returns a single project from the collection, if found

func (*ProjectCollection) Take

func (c *ProjectCollection) Take() *Project

Take returns a project from the collection

func (*ProjectCollection) WithClient

func (c *ProjectCollection) WithClient(clientID int) *ProjectCollection

WithClient returns a new collection with projects matching the client ID

func (*ProjectCollection) WithJob

func (c *ProjectCollection) WithJob(jobID string) *ProjectCollection

WithJob returns a new collection with projects matching the job ID

func (*ProjectCollection) WithManager

func (c *ProjectCollection) WithManager(managerID int) *ProjectCollection

WithManager returns a new collection with projects matching the manager ID

func (*ProjectCollection) WithOffice

func (c *ProjectCollection) WithOffice(officeID int) *ProjectCollection

WithOffice returns a new collection with projects matching the office ID

type ProjectPricing

type ProjectPricing struct {
	Strategy  string  `json:"strategy"`
	RatesType string  `json:"rates_type"`
	Budget    float64 `json:"budget"`
	Currency  string  `json:"currency"`
}

ProjectPricing contains pricing data for a project

Jump to

Keyboard shortcuts

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