database

package
v0.0.0-...-d3af658 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseIO

func DatabaseIO(query string) (*sql.Rows, error)

func GetInternationalStatus

func GetInternationalStatus(employee *Employee, worker *WorkdayWorkerTimeData) error

func GetRecentEmployeePunches

func GetRecentEmployeePunches(employee *Employee) (int, error)

func GetTimeSheet

func GetTimeSheet(byuID string, employeeData *Employee) error

------------------------------------------------------------------------------------------------------Workday custom API start------------------------------------------------------------ gets time data from workday custom API

func GetWorkerInfo

func GetWorkerInfo(byuid string, employee *Employee) error

func MapEmployeeTimeData

func MapEmployeeTimeData(employee *Employee, worker *WorkdayWorkerTimeData) (err error)

func ReturnCurrentPayPeriod

func ReturnCurrentPayPeriod() (start, end time.Time)

func ReturnCurrentWeek

func ReturnCurrentWeek() (time.Time, time.Time)

Types

type Employee

type Employee struct {
	Employee_Name        string           `json:"employee_name"`
	Worker_ID            string           `json:"worker_id"`
	International_Status string           `json:"international_status"`
	Total_Week_Hours     string           `json:"total_week_hours"`
	Total_Period_Hours   string           `json:"total_period_hours"`
	PositionsList        []string         `json:"positions_list"`
	Time_Entry_Codes     []TimeEntryCodes `json:"time_entry_codes"`
	Positions            []Position       `json:"positions"`
	Period_Punches       []PeriodPunches  `json:"period_punches"`
	Period_Blocks        []PeriodBlocks   `json:"period_blocks"`
}

type PeriodBlocks

type PeriodBlocks struct {
	Position_Number                string `json:"position_number"`
	Business_Title                 string `json:"business_title"`
	Time_Clock_Event_Date_Time_IN  string `json:"time_clock_event_date_time_in"`
	Time_Clock_Event_Date_Time_OUT string `json:"time_clock_event_date_time_out"`
	Length                         string `json:"length"`
	ReferenceID                    string `json:"reference_id"`
	Reported_Date                  string `json:"reported_date"`
}

time blocks - may have matched

type PeriodPunches

type PeriodPunches struct {
	Position_Number            string `json:"position_number"`
	Business_Title             string `json:"business_title"`
	Clock_Event_Type           string `json:"clock_event_type"`
	Time_Clock_Event_Date_Time string `json:"time_clock_event_date_time"`
}

Punches not related to a time block

type Position

type Position struct {
	Position_Number             string `json:"position_number"`
	Primary_Position            string `json:"primary_position"`
	Business_Title              string `json:"business_title"`
	Position_Total_Week_Hours   string `json:"position_total_week_hours"`
	Position_Total_Period_Hours string `json:"position_total_period_hours"`
	Clocked_In                  string `json:"clocked_in"`
}

type Punch

type Punch struct {
	Worker_ID                  string    `json:"worker_id"`
	Position_Number            string    `json:"position_number"`
	Clock_Event_Type           string    `json:"clock_event_type"`
	Time_Entry_Code            string    `json:"time_entry_code"`
	Comment                    string    `json:"comment"`
	Time_Clock_Event_Date_Time time.Time `json:"time_clock_event_date_time"`
}

func GetEmployeePunchesInTCD

func GetEmployeePunchesInTCD(workerID string) ([]Punch, error)

type PunchResponse

type PunchResponse struct {
	Writen_To_TCD    string `json:"written_to_tcd"`
	Punch_Time       string `json:"punch_time"`
	Clock_Event_Type string `json:"clock_event_type"`
	Hostname         string `json:"hostname"`
}

func WritePunch

func WritePunch(punch Punch) (PunchResponse, error)

type TCD_Employee

type TCD_Employee struct {
	Worker_ID       string `json:"employee_id"`
	BYU_ID          string `json:"byu_id"`
	Last_Updated    string `json:"last_updated"`
	Employee_Name   string `json:"employee_name"`
	Time_Code_Group string `json:"time_code_group"`
	Positions       string `json:"positions"`
}

type TimeEntryCodes

type TimeEntryCodes struct {
	Backend_ID   string `json:"backend_id"`
	Display_Name string `json:"frontend_name"`
	Sort_Order   int    `json:"sort_order"`
}

func MapTimeCodes

func MapTimeCodes(timeCodes []string) ([]TimeEntryCodes, error)

type WorkdayEmployeeTimeReport

type WorkdayEmployeeTimeReport struct {
	Report_Entry []WorkdayWorkerTimeData `json:"Report_Entry"`
}

JSON from workday custom API

type WorkdayTimeBlocks

type WorkdayTimeBlocks struct {
	Reported_Date string `json:"reported_date"`
	Hours         string `json:"hours"`
	Time_Type     string `json:"time_type"`
	Reference_ID  string `json:"reference_id"`
	Position      string `json:"position"`
	In_Time       string `json:"in_time"`
	Out_Time      string `json:"out_time"`
}

type WorkdayTimeEvents

type WorkdayTimeEvents struct {
	Clock_Event_Time string `json:"time"`             //`json:"clock_event_time"`
	Clock_Event_Type string `json:"event_type"`       //`json:"clock_event_type"`
	Position_Ref_ID  string `json:"tce_position"`     //`json:"position_ref_id"`
	Timeblock_Ref_ID string `json:"timeblock_ref_id"` //`json:"timeblock_ref_id"`
}

type WorkdayWorkerTimeData

type WorkdayWorkerTimeData struct {
	Worker_ID            string              `json:"employee_id"`
	Time_Code_Groups     string              `json:"time_code_group"`
	International_Status string              `json:"intl_student"`
	Time_Blocks          []WorkdayTimeBlocks `json:"time_blocks"`
	Time_Clock_Events    []WorkdayTimeEvents `json:"time_clock_events"`
}

Jump to

Keyboard shortcuts

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