api

package
v0.0.0-...-c550501 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateStringToTime

func DateStringToTime(date string) (time.Time, error)

DateStringToTime converts a qbis datetime string ( /Date(1520809200000)/ ) to a time

func GetDateForDateTime

func GetDateForDateTime(date time.Time) (time.Time, error)

GetDateForDateTime returns the timestamp of the "date"-datetimes used in qbis. Assumes qbis respects local users TZ. QBis represents dates as datetimes with the time set to 00:00:00. They seem to use the local timezone for this. On the wire the datetime is serialized in UTC - this can be confusing because the date of the datetime can change.

func TimeToDateString

func TimeToDateString(t time.Time) string

TimeToDateString returns the a string representing the time in qbis format

func TimeToISODateString

func TimeToISODateString(t time.Time) string

TimeToISODateString formats timestamp like javascript

Types

type ActivityBase

type ActivityBase struct {
	ActivityActive bool   `json:"ActivityActive"`
	ActivityID     int    `json:"ActivityId"`
	ActivityName   string `json:"ActivityName"`
	Days           []struct {
		DayID            int    `json:"DayId"`
		DayDate          string `json:"DayDate"`
		DayMinutes       int    `json:"DayMinutes"`
		DayDays          int    `json:"DayDays"`
		Notes            string `json:"Notes"`
		Delete           bool   `json:"Delete"`
		Locked           bool   `json:"Locked"`
		IsReadOnly       bool   `json:"IsReadOnly"`
		IsPrefilled      bool   `json:"IsPrefilled"`
		AllowEmptyFromTo bool   `json:"AllowEmptyFromTo"`
		LunchOffset      int    `json:"LunchOffset"`
		DayFromMinutes   int    `json:"DayFromMinutes"`
		DayToMinutes     int    `json:"DayToMinutes"`
	} `json:"Days"`
	EmployeeID int      `json:"EmployeeId"`
	Factor     float64  `json:"Factor"`
	IsNewRow   bool     `json:"IsNewRow"`
	IsReadOnly bool     `json:"IsReadOnly"`
	Tooltip    []string `json:"Tooltip"`
}

ActivityBase contains fields common between SalaryTimeBase, SalaryActivity, ProjectActivity

type ActivityOverviewBase

type ActivityOverviewBase struct {
	DisplayName string `json:"DisplayName"`
	Properties  []struct {
		TextIdentifier string `json:"TextIdentifier"`
		Value          string `json:"Value"`
		UnitIdentifier string `json:"UnitIdentifier"`
	} `json:"Properties"`
}

ActivityOverviewBase see full comment for details // Example of Properties [

{
	// activityHours seems to be the total activity budget (allocations for multiple people)
	TextIdentifier:	"activityHours",
	Value	"0",
	UnitIdentifier	"unitHours"
},
{
	// Allocated hours seems to be the current employees allocated budget hours
	TextIdentifier	"allocatedHours",
	Value	"0",
	UnitIdentifier	"unitHours"
},
{
	// Allocated hours seems to be Spent hours. Not sure if these are only for the employee or everyone
	TextIdentifier	"registeredHours",
	Value	"3,25",
	UnitIdentifier	"unitHours"
},
{
	TextIdentifier:	"startDate",
	Value:	"31<sup>st</sup> Oct 2017",
	UnitIdentifier:	"unitEmpty"
},
{
	TextIdentifier:	"endDate",
	Value:	"2<sup>nd</sup> Dec 2022",
	UnitIdentifier:	"unitEmpty"
}

]

ActivityOverviewBase contains fields common between SalaryActivityOverview and ProjectActivityOverview

type Client

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

Client implements a Qbis client

func New

func New(url string) *Client

New constructs a new Client

func (*Client) GetProjectActivity

func (c *Client) GetProjectActivity(employee string, activityID int, from time.Time, to time.Time) (*ProjectTime, error)

GetProjectActivity ...

func (*Client) GetProjectActivityList

func (c *Client) GetProjectActivityList(employee string, projectID int, from time.Time, to time.Time) ([]ProjectActivityListItem, error)

GetProjectActivityList returns a slice of activities for the given project id

func (*Client) GetProjectActivityOverview

func (c *Client) GetProjectActivityOverview(employee string, activityID int, from time.Time, to time.Time) (*ProjectActivityOverview, error)

GetProjectActivityOverview ..

func (*Client) GetProjects

func (c *Client) GetProjects(employee string, from time.Time, to time.Time) ([]ProjectCompany, error)

GetProjects ....

func (*Client) GetSalaryActivity

func (c *Client) GetSalaryActivity(employee string, activityID int, from time.Time, to time.Time) (*SalaryTime, error)

GetSalaryActivity returns the full details of the SalaryActivity for the employee

func (*Client) GetSalaryActivityOverview

func (c *Client) GetSalaryActivityOverview(employee string, activityID int, from time.Time, to time.Time) (*SalaryActivityOverview, error)

GetSalaryActivityOverview ..

func (*Client) GetTimesheet

func (c *Client) GetTimesheet(employee string, from time.Time, to time.Time) (*TimesheetData, error)

GetTimesheet returns a timesheet for an employee spanning the two dates

func (Client) GetUserEmployeeID

func (c Client) GetUserEmployeeID() (string, error)

GetUserEmployeeID returns the string representation of the logged in users employee id

func (*Client) Login

func (c *Client) Login(company string, user string, password string) error

Login to Qbis

func (*Client) SaveProjectTime

func (c *Client) SaveProjectTime(time EmployeeProjectTime) (*SaveProjectTimeResponse, error)

SaveProjectTime saves the matrix with hours spent on project activities

func (*Client) SaveSalaryTime

func (c *Client) SaveSalaryTime(time EmployeeSalaryTime) (*SaveSalaryTimeResponse, error)

SaveSalaryTime saves the matrix with hours of overtime, sickleave, timebank etc.

func (*Client) SaveWorkingTime

func (c *Client) SaveWorkingTime(time EmployeeWorkingTime) (*SaveWorkingTimeResponse, error)

SaveWorkingTime saves the matrix with hours spent working

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(client *http.Client) *Client

WithHTTPClient sets the http.Client to be used by the qbis client

type DaySetting

type DaySetting struct {
	DayComment                            interface{} `json:"DayComment"`
	DayDate                               string      `json:"DayDate"`
	DayNameString                         string      `json:"DayNameString"`
	DisabledTooltipProjectTime            string      `json:"DisabledTooltipProjectTime"`
	DisabledTooltipSalaryTime             string      `json:"DisabledTooltipSalaryTime"`
	DisabledTooltipWorkingTime            string      `json:"DisabledTooltipWorkingTime"`
	HasDayComment                         bool        `json:"HasDayComment"`
	HasLunchPolicy                        bool        `json:"HasLunchPolicy"`
	HasSchedule                           bool        `json:"HasSchedule"`
	HideDay                               bool        `json:"HideDay"`
	IsAllowedToRegisterWorkingTimeFromWeb bool        `json:"IsAllowedToRegisterWorkingTimeFromWeb"`
	IsDisabledProjectTime                 bool        `json:"IsDisabledProjectTime"`
	IsDisabledSalaryTime                  bool        `json:"IsDisabledSalaryTime"`
	IsDisabledWorkingTime                 bool        `json:"IsDisabledWorkingTime"`
	IsEmployeeInactive                    bool        `json:"IsEmployeeInactive"`
	IsHoliday                             bool        `json:"IsHoliday"`
	IsMonthClosedProjectTime              bool        `json:"IsMonthClosedProjectTime"`
	IsMonthClosedWorkingTime              bool        `json:"IsMonthClosedWorkingTime"`
	IsOutsideEmploymentPeriod             bool        `json:"IsOutsideEmploymentPeriod"`
	IsReadOnlyProjectTime                 bool        `json:"IsReadOnlyProjectTime"`
	IsReadOnlySalaryTime                  bool        `json:"IsReadOnlySalaryTime"`
	IsReadOnlyWorkingTime                 bool        `json:"IsReadOnlyWorkingTime"`
	IsSaved                               bool        `json:"IsSaved"`
	IsScheduleHourOnly                    bool        `json:"IsScheduleHourOnly"`
	IsToday                               bool        `json:"IsToday"`
	IsWeekSaved                           bool        `json:"IsWeekSaved"`
	IsWorkingDay                          bool        `json:"IsWorkingDay"`
	LunchMaximum                          int         `json:"LunchMaximum"`
	LunchMinimum                          int         `json:"LunchMinimum"`
	MonthName                             string      `json:"MonthName"`
	MySchedule                            ScheduleDay `json:"MySchedule"`
	WeekStatus                            int         `json:"WeekStatus"`
}

DaySetting is included in TimesheetData for every day of the week

type EmployeeProjectTime

type EmployeeProjectTime struct {
	EmployeeID string        `json:"employeeId"`
	FromDate   string        `json:"fromDate"`
	List       []ProjectTime `json:"list"`
	ToDate     string        `json:"toDate"`
}

EmployeeProjectTime represents time spent by employee on project activities

type EmployeeSalaryTime

type EmployeeSalaryTime struct {
	EmployeeID        string             `json:"employeeId"`
	FromDate          string             `json:"fromDate"`
	ToDate            string             `json:"toDate"`
	SalaryTime        []SalaryTimeBase   `json:"salaryTime"`
	WorkingTime       []WorkingTimeBase  `json:"workingTime"`
	WorkingTimeBreaks []WorkingTimeBreak `json:"workingTimeBreaks"`
}

EmployeeSalaryTime struct represents the payload used when saving the matrix containing overtime, sick-time etc.

type EmployeeWorkingTime

type EmployeeWorkingTime struct {
	Days       []WorkingTimeBase `json:"days"`
	EmployeeID string            `json:"employeeId"`
	FromDate   string            `json:"fromDate"`
	ToDate     string            `json:"toDate"`
}

EmployeeWorkingTime represents time spent by employee working. This is the matrix containing arrival, departure and lunch time

type Project

type Project struct {
	Code string `json:"Code"`
	ID   int    `json:"ID"`
	Name string `json:"Name"`
}

Project represents a qbis project that activities are tied to

type ProjectActivityListItem

type ProjectActivityListItem struct {
	Factor     string `json:"Factor"`
	FactorLock bool   `json:"FactorLock"`
	ID         int    `json:"ID"`
	Name       string `json:"Name"`
	ReadOnly   bool   `json:"ReadOnly"`
}

ProjectActivityListItem is a category of work that belongs to a project

type ProjectActivityOverview

type ProjectActivityOverview struct {
	ActivityOverviewBase
	CompanyProjectDisplayName string `json:"CompanyProjectDisplayName"`
	Details                   string `json:"Details"`
}

ProjectActivityOverview represents the data shown in the overlay when you are entering time in the ui (see comment for details!)

func (ProjectActivityOverview) BudgetMinutes

func (a ProjectActivityOverview) BudgetMinutes() (uint, error)

BudgetMinutes returns the budget for the employee on the activity (in minutes)

func (ProjectActivityOverview) SpentMinutes

func (a ProjectActivityOverview) SpentMinutes() (uint, error)

SpentMinutes returns the number of minutes registred by the employee on the activity

func (ProjectActivityOverview) TotalBudgetMinutes

func (a ProjectActivityOverview) TotalBudgetMinutes() (uint, error)

TotalBudgetMinutes returns the total budget for all employees on the activity (in minutes)

type ProjectCompany

type ProjectCompany struct {
	CompanyID   int       `json:"CompanyID"`
	CompanyName string    `json:"CompanyName"`
	Projects    []Project `json:"Projects"`
}

ProjectCompany contains a company and it's projetcs

type ProjectTime

type ProjectTime struct {
	ProjectTimeBase
	Days []struct {
		DayDate                   string      `json:"DayDate"`
		DayID                     int         `json:"DayId"`
		DayMinutes                int         `json:"DayMinutes"`
		DayTime                   string      `json:"DayTime"`
		ExternalNotes             string      `json:"ExternalNotes"`
		InternalNotes             string      `json:"InternalNotes"`
		IsInvoiced                bool        `json:"IsInvoiced"`
		IsOutsideActivityDateSpan bool        `json:"IsOutsideActivityDateSpan"`
		IsReadOnly                bool        `json:"IsReadOnly"`
		IsStaffLedgerRegistration bool        `json:"IsStaffLedgerRegistration"`
		ProjectTimeApprovedBy     interface{} `json:"ProjectTimeApprovedBy"`
		ProjectTimeApprovedByID   int         `json:"ProjectTimeApprovedById"`
		ReadOnlyColor             string      `json:"ReadOnlyColor"`
	} `json:"Days"`
}

ProjectTime ...

type ProjectTimeBase

type ProjectTimeBase struct {
	ActivityBase
	ActivityComplete            bool   `json:"ActivityComplete"`
	ActivityDateSpanString      string `json:"ActivityDateSpanString"`
	ActivitySalary              bool   `json:"ActivitySalary"`
	Autofill                    bool   `json:"Autofill"`
	CustomerFullName            string `json:"CustomerFullName"`
	CustomerName                string `json:"CustomerName"`
	CustomerProjectActivityName string `json:"CustomerProjectActivityName"`
	EndDate                     string `json:"EndDate"`
	FixedPrice                  bool   `json:"FixedPrice"`
	FromServiceRequest          bool   `json:"FromServiceRequest"`
	IsDeleteable                bool   `json:"IsDeleteable"`
	IsFixedPriceFactor          bool   `json:"IsFixedPriceFactor"`
	IsProjectTimeApproved       bool   `json:"IsProjectTimeApproved"`
	IsReadOnlyFactor            bool   `json:"IsReadOnlyFactor"`
	IsVisibleFactor             bool   `json:"IsVisibleFactor"`
	LockFactor                  bool   `json:"LockFactor"`
	PhaseName                   string `json:"PhaseName"`
	ProjectFullName             string `json:"ProjectFullName"`
	ProjectName                 string `json:"ProjectName"`
	ProjectTimeApprovedBy       string `json:"ProjectTimeApprovedBy"`
	ReadOnlyColor               string `json:"ReadOnlyColor"`
	ReadOnlyFactorColor         string `json:"ReadOnlyFactorColor"`
	StartDate                   string `json:"StartDate"`
	Week                        string `json:"Week"`
	YearWeek                    int    `json:"YearWeek"`
}

ProjectTimeBase ...

type SalaryActivityOverview

type SalaryActivityOverview struct {
	ActivityOverviewBase
	ShowInMyTime bool `json:"ShowInMyTime"`
}

SalaryActivityOverview ...

func (SalaryActivityOverview) BudgetMinutes

func (a SalaryActivityOverview) BudgetMinutes() (uint, error)

BudgetMinutes returns the budget for the employee on the activity (in minutes)

func (SalaryActivityOverview) SpentMinutes

func (a SalaryActivityOverview) SpentMinutes() (uint, error)

SpentMinutes returns the number of minutes registred by the employee on the activity

func (SalaryActivityOverview) TotalBudgetMinutes

func (a SalaryActivityOverview) TotalBudgetMinutes() (uint, error)

TotalBudgetMinutes returns the total budget for all employees on the activity (in minutes)

type SalaryTime

type SalaryTime struct {
	SalaryTimeBase
	MyScheduleDays []ScheduleDay `json:"MyScheduleDays"`
}

SalaryTime contained in TimesheetData

type SalaryTimeBase

type SalaryTimeBase struct {
	ActivityBase
	AllowNegative                 bool   `json:"AllowNegative"`
	AllowPositive                 bool   `json:"AllowPositive"`
	AutoFill                      int    `json:"AutoFill"`
	CalculationUnit               int    `json:"CalculationUnit"`
	DisplayFormat                 int    `json:"DisplayFormat"`
	HasParentGroupActivity        bool   `json:"HasParentGroupActivity"`
	IsDefault                     bool   `json:"IsDefault"`
	IsDeletable                   bool   `json:"IsDeletable"`
	IsHoursWorkedIntervalActivity bool   `json:"IsHoursWorkedIntervalActivity"`
	IsIntervalActivity            bool   `json:"IsIntervalActivity"`
	Locked                        bool   `json:"Locked"`
	LowerLimit                    int    `json:"LowerLimit"`
	ParentGroupActivityID         int    `json:"ParentGroupActivityId"`
	PresentationUnit              string `json:"PresentationUnit"`
	ShowErrorMessage              bool   `json:"ShowErrorMessage"`
	ShowWarningMessage            bool   `json:"ShowWarningMessage"`
	SpecifyClockTimes             bool   `json:"SpecifyClockTimes"`
	Type                          int    `json:"Type"`
	UpperLimit                    int    `json:"UpperLimit"`
}

SalaryTimeBase is used as input to save SalaryTime SalaryTime activities seem to be activities like any other except they are special SalaryTime defines the classification of your work, eg. if you were on leave, sick, or overtime. The activities have different types. I am guessing that type 3 cancels out scheduled time? Eg. scheduled 8 hours + -8 hours komp = 0 hours worked. Komptid is set as default and it will automatically adjust when your working time is adjusted A Negative Type 0 will reduce your scheduled working time by that amount. A Positive of Type 0 requires you to have increased your working time by that amount.

type SaveProjectTimeResponse

type SaveProjectTimeResponse struct {
	DuplicatedActivitiesError string        `json:"duplicatedActivitiesError"`
	LimitErrorResults         []interface{} `json:"limitErrorResults"`
	LimitWarningResults       []interface{} `json:"limitWarningResults"`
	WasSaved                  bool          `json:"wasSaved"`
}

SaveProjectTimeResponse represents the response object when saving ProjectTime

type SaveSalaryTimeResponse

type SaveSalaryTimeResponse struct {
	FromToValidationResult  string        `json:"fromToValidationResult"`
	InvalidFullDaysError    string        `json:"invalidFullDaysError"`
	InvalidPartialDaysError string        `json:"invalidPartialDaysError"`
	LimitErrorResults       []interface{} `json:"limitErrorResults"`
	LimitWarningResults     []interface{} `json:"limitWarningResults"`
	ResetWarning            string        `json:"resetWarning"`
	WasSaved                bool          `json:"wasSaved"`
}

SaveSalaryTimeResponse represents the object returned on attempted save of SalaryTime

type SaveWorkingTimeResponse

type SaveWorkingTimeResponse struct {
	Saved string `json:"saved"`
}

SaveWorkingTimeResponse ...

type ScheduleDay

type ScheduleDay struct {
	Activities               []interface{} `json:"Activities"`
	Arrive                   string        `json:"Arrive"`
	DayDate                  string        `json:"DayDate"`
	HasScheduleArriveOrLeave bool          `json:"HasScheduleArriveOrLeave"`
	Leave                    string        `json:"Leave"`
	LunchFrom                string        `json:"LunchFrom"`
	LunchMinutes             int           `json:"LunchMinutes"`
	LunchTo                  string        `json:"LunchTo"`
	OverridePublicHolidays   bool          `json:"OverridePublicHolidays"`
	PrefillTime              bool          `json:"PrefillTime"`
	ScheduleEmployeeFrom     string        `json:"ScheduleEmployeeFrom"`
	ScheduleEmployeeTo       string        `json:"ScheduleEmployeeTo"`
	SkipDeviationValidation  bool          `json:"SkipDeviationValidation"`
	TotalMinutes             int           `json:"TotalMinutes"`
	Tracking                 int           `json:"Tracking"`
}

ScheduleDay contains schedule information for a day

type TimesheetData

type TimesheetData struct {
	ActionButtonOptionslist []struct {
		Action           string `json:"Action"`
		Active           bool   `json:"Active"`
		Bold             bool   `json:"Bold"`
		Disabled         bool   `json:"Disabled"`
		GetAsJSONString  string `json:"GetAsJsonString"`
		Icon             string `json:"Icon"`
		Key              string `json:"Key"`
		LineAfter        bool   `json:"LineAfter"`
		MobileRestricted bool   `json:"MobileRestricted"`
		Parameters       string `json:"Parameters"`
		Title            string `json:"Title"`
	} `json:"actionButtonOptionslist"`
	DaySettings            []DaySetting  `json:"daySettings"`
	ListOfProjectTime      []ProjectTime `json:"listOfProjectTime"`
	ListOfSalaryActivities []struct {
		Key   int    `json:"Key"`
		Value string `json:"Value"`
	} `json:"listOfSalaryActivities"`
	ListOfSalaryTime   []SalaryTime  `json:"listOfSalaryTime"`
	PublicHolidaysList []interface{} `json:"publicHolidaysList"`
	SummaryData        struct {
		BillableTime struct {
			ChargeableHours         int         `json:"ChargeableHours"`
			ChartChargeableHours    int         `json:"ChartChargeableHours"`
			ChartNonChargeableHours int         `json:"ChartNonChargeableHours"`
			ChartPercentage         int         `json:"ChartPercentage"`
			ChartTargetHours        int         `json:"ChartTargetHours"`
			Name                    interface{} `json:"Name"`
			PotentialHours          int         `json:"PotentialHours"`
			TargetHours             int         `json:"TargetHours"`
			TargetPercentage        interface{} `json:"TargetPercentage"`
		} `json:"BillableTime"`
		HasSchedule       bool    `json:"HasSchedule"`
		ScheduledHours    float64 `json:"ScheduledHours"`
		ScheduledTime     string  `json:"ScheduledTime"`
		ShowBillableChart bool    `json:"ShowBillableChart"`
		ShowProgressChart bool    `json:"ShowProgressChart"`
		ShowWorkedHours   bool    `json:"ShowWorkedHours"`
		WeekStatus        int     `json:"WeekStatus"`
		WorkedHours       float64 `json:"WorkedHours"`
		WorkedTime        string  `json:"WorkedTime"`
	} `json:"summaryData"`
	TimeSettings struct {
		AllowTimeManagers                     bool `json:"allowTimeManagers"`
		DepManagerID                          int  `json:"depManagerId"`
		IgnoreProjectActivityFactorValidation bool `json:"ignoreProjectActivityFactorValidation"`
		IsActive                              bool `json:"isActive"`
		IsShowSchedule                        bool `json:"isShowSchedule"`
		IsUsingHrSchedules                    bool `json:"isUsingHrSchedules"`
		ManagerID                             int  `json:"managerId"`
		ModulePermission                      int  `json:"modulePermission"`
		ProjectModuleAccess                   bool `json:"projectModuleAccess"`
		ProjectactivityAccess                 bool `json:"projectactivityAccess"`
		SalarytimeAccess                      bool `json:"salarytimeAccess"`
		ShowActionLocation                    bool `json:"showActionLocation"`
		WorkingtimeAccess                     bool `json:"workingtimeAccess"`
	} `json:"timeSettings"`
	WeekHistoryList []struct {
		ChangeDateString string `json:"ChangeDateString"`
		ChangedBy        string `json:"ChangedBy"`
		ChangedDate      string `json:"ChangedDate"`
		Message          string `json:"Message"`
		Status           int    `json:"Status"`
	} `json:"weekHistoryList"`
	WorkingTimeBreakList []WorkingTimeBreak `json:"workingTimeBreakList"`
	WorkingTimeDays      []WorkingTime      `json:"workingTimeDays"`
}

TimesheetData contains data about the week

type TimesheetDataOld

type TimesheetDataOld struct {
	ActionButtonOptionslist []struct {
		Action           string `json:"Action"`
		Active           bool   `json:"Active"`
		Bold             bool   `json:"Bold"`
		Disabled         bool   `json:"Disabled"`
		GetAsJSONString  string `json:"GetAsJsonString"`
		Icon             string `json:"Icon"`
		LineAfter        bool   `json:"LineAfter"`
		MobileRestricted bool   `json:"MobileRestricted"`
		Parameters       string `json:"Parameters"`
		Title            string `json:"Title"`
	} `json:"actionButtonOptionslist"`
	DaySettings            []DaySetting  `json:"daySettings"`
	ListOfProjectTime      []ProjectTime `json:"listOfProjectTime"`
	ListOfSalaryActivities []struct {
		Key   int    `json:"Key"`
		Value string `json:"Value"`
	} `json:"listOfSalaryActivities"`
	ListOfSalaryTime   []SalaryTime  `json:"listOfSalaryTime"`
	PublicHolidaysList []interface{} `json:"publicHolidaysList"`
	SummaryData        struct {
		BillableTime struct {
			ChargeableHours         int         `json:"ChargeableHours"`
			ChartChargeableHours    int         `json:"ChartChargeableHours"`
			ChartNonChargeableHours int         `json:"ChartNonChargeableHours"`
			ChartPercentage         int         `json:"ChartPercentage"`
			ChartTargetHours        int         `json:"ChartTargetHours"`
			Name                    interface{} `json:"Name"`
			PotentialHours          int         `json:"PotentialHours"`
			TargetHours             int         `json:"TargetHours"`
			TargetPercentage        interface{} `json:"TargetPercentage"`
		} `json:"BillableTime"`
		HasSchedule       bool    `json:"HasSchedule"`
		ScheduledHours    float64 `json:"ScheduledHours"`
		ScheduledTime     string  `json:"ScheduledTime"`
		ShowBillableChart bool    `json:"ShowBillableChart"`
		ShowProgressChart bool    `json:"ShowProgressChart"`
		ShowWorkedHours   bool    `json:"ShowWorkedHours"`
		WeekStatus        int     `json:"WeekStatus"`
		WorkedHours       float64 `json:"WorkedHours"`
		WorkedTime        string  `json:"WorkedTime"`
	} `json:"summaryData"`
	TimeSettings struct {
		AllowTimeManagers     bool `json:"allowTimeManagers"`
		DepManagerID          int  `json:"depManagerId"`
		IsActive              bool `json:"isActive"`
		IsShowSchedule        bool `json:"isShowSchedule"`
		IsUsingHrSchedules    bool `json:"isUsingHrSchedules"`
		ManagerID             int  `json:"managerId"`
		ModulePermission      int  `json:"modulePermission"`
		ProjectModuleAccess   bool `json:"projectModuleAccess"`
		ProjectactivityAccess bool `json:"projectactivityAccess"`
		SalarytimeAccess      bool `json:"salarytimeAccess"`
		ShowActionLocation    bool `json:"showActionLocation"`
		WorkingtimeAccess     bool `json:"workingtimeAccess"`
	} `json:"timeSettings"`
	WeekHistoryList []struct {
		ChangeDateString string `json:"ChangeDateString"`
		ChangedBy        string `json:"ChangedBy"`
		ChangedDate      string `json:"ChangedDate"`
		Message          string `json:"Message"`
		Status           int    `json:"Status"`
	} `json:"weekHistoryList"`
	WorkingTimeDays []WorkingTime `json:"workingTimeDays"`
}

TimesheetDataOld contains data about the week

type WorkingTime

type WorkingTime struct {
	WorkingTimeBase
	ScheduleDay ScheduleDay `json:"ScheduleDay"`
}

WorkingTime ...

type WorkingTimeBase

type WorkingTimeBase struct {
	Arrive int `json:"Arrive"`
	Breaks []struct {
		BreakDate        string `json:"BreakDate"`
		BreakFromMinutes int    `json:"BreakFromMinutes"`
		BreakID          int    `json:"BreakId"`
		BreakToMinutes   int    `json:"BreakToMinutes"`
		EmployeeID       int    `json:"EmployeeId"`
		Source           int    `json:"Source"`
	} `json:"Breaks"`
	DayDate                    string `json:"DayDate"`
	DayName                    string `json:"DayName"`
	HasSchedule                bool   `json:"HasSchedule"`
	ID                         int    `json:"ID"`
	IsModified                 bool   `json:"IsModified"`
	IsMonthClosed              bool   `json:"IsMonthClosed"`
	IsOutsideJoinAndLeaveDates bool   `json:"IsOutsideJoinAndLeaveDates"`
	IsPublicHoliday            bool   `json:"IsPublicHoliday"`
	IsSaved                    bool   `json:"IsSaved"`
	IsScheduleHourOnly         bool   `json:"IsScheduleHourOnly"`
	IsToday                    bool   `json:"IsToday"`
	Leave                      int    `json:"Leave"`
	Locked                     bool   `json:"Locked"`
	Lunch                      int    `json:"Lunch"`
	NextDay                    string `json:"NextDay"`
	Overmidnight               bool   `json:"Overmidnight"`
	OverridePublicHolidays     bool   `json:"OverridePublicHolidays"`
	PrefillSpecifiedBreak      bool   `json:"PrefillSpecifiedBreak"`
	ScheduledHours             int    `json:"ScheduledHours"`
	Total                      int    `json:"Total"`
}

WorkingTimeBase the base working time struct is embedded in another struct in TimesheetData. Also used as input to save data

type WorkingTimeBreak

type WorkingTimeBreak struct {
	Days []struct {
		BreakDate        string `json:"BreakDate"`
		BreakFromMinutes int    `json:"BreakFromMinutes"`
		BreakID          int    `json:"BreakId"`
		BreakToMinutes   int    `json:"BreakToMinutes"`
		EmployeeID       int    `json:"EmployeeId"`
		Source           int    `json:"Source"`
	} `json:"Days"`
	IsNewRow bool `json:"IsNewRow"`
}

WorkingTimeBreak is read in timesheet and used in Save salary time

Jump to

Keyboard shortcuts

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