bamboohr

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const BambooDateLayout = "2006-01-02"

Variables

This section is empty.

Functions

func NewServer

func NewServer(emplReq EmployeeRequest, client *http.Client, log zerolog.Logger) *mux.Router

NewServer implements new BambooHR limited data exporter

func WhoIsOut

func WhoIsOut(ctx context.Context, client *http.Client, param WhoIsOutRequest) (map[string][]Period, error)

WhoIsOut retrieves list of employees who are currently marked as out

Types

type Auth

type Auth struct {
	// APIKey see https://documentation.bamboohr.com/docs#section-authentication
	APIKey string `validate:"required"`
	// Subdomain is BambooHR customer identifier
	// If you access BambooHR at https://mycompany.bamboohr.com, then the subdomain is "mycompany"
	Subdomain string `validate:"required"`
	// Base is API URL, nil for default
	BaseURL *url.URL
}

Auth is API server auth parameters

func (Auth) RequestURL

func (a Auth) RequestURL(rel string) *url.URL

type Employee

type Employee struct {
	ID         json.Number `json:"bamboo_id" mapstructure:"id"`
	Email      string      `json:"id" mapstructure:"workEmail"`
	Department string      `json:"department" mapstructure:"department"`
	Divison    string      `json:"division" mapstructure:"division"`
	Status     string      `json:"status" mapstructure:"status"`
	FirstName  string      `json:"first_name" mapstructure:"firstName"`
	LastName   string      `json:"last_name" mapstructure:"lastName"`
	Country    string      `json:"country" mapstructure:"country"`
	State      string      `json:"state" mapstructure:"state"`
}

Employee represents BambooHR employee record

func GetAllEmployees

func GetAllEmployees(ctx context.Context, client *http.Client, param EmployeeRequest) ([]Employee, error)

GetAllEmployees returns full list of employees in active status

func GetAvailableEmployees

func GetAvailableEmployees(ctx context.Context, client *http.Client, param EmployeeRequest) ([]Employee, error)

GetAvailableEmployees only returns employees that are marked as active and are not on vacation or absense leave

type EmployeeRequest

type EmployeeRequest struct {
	Auth
	Location *time.Location
}

EmployeeRequest requests employees

func (EmployeeRequest) RequestURL

func (req EmployeeRequest) RequestURL() *url.URL

type Period

type Period struct {
	Start time.Time
	End   time.Time
}

type WhoIsOutRequest

type WhoIsOutRequest struct {
	Auth
	// Location is required as BambooHR only returns date, and it must be converted into timestamp
	// Timezone is an installation specific setting that does not seem to be available via API
	// but may only be accessed from the BambooHR Admin UI
	Location   *time.Location
	Start, End time.Time
}

func (WhoIsOutRequest) RequestURL

func (req WhoIsOutRequest) RequestURL() *url.URL

Jump to

Keyboard shortcuts

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