Documentation ¶
Index ¶
- Constants
- type Client
- type ClientData
- func (c *ClientData) ArchiveClient(clientId int, accountId int) error
- func (c *ClientData) CopyProjectsFromDateRanges(profileId int, accountId int, fromStart time.Time, fromEnd time.Time, ...) (bool, error)
- func (c *ClientData) CreateClient(newClient Client) (int, error)
- func (c *ClientData) CreateProject(newProject *Project) (int, error)
- func (c *ClientData) DeleteClient(clientId int, accountId int) error
- func (c *ClientData) DeleteProject(projectId int, accountId int) error
- func (c *ClientData) GetAllClients(accountId int, active bool) ([]*Client, error)
- func (c *ClientData) GetAllProjects(accountId int, active bool) ([]*Project, error)
- func (c *ClientData) GetClient(clientId int, accountId int) (*Client, error)
- func (c *ClientData) GetProject(projectId int, accountId int) (*Project, error)
- func (c *ClientData) RestoreClient(clientId int, accountId int) error
- func (c *ClientData) UpdateClient(updateData *Client) error
- func (c *ClientData) UpdateProject(updateProject *Project) error
- func (c *ClientData) UpdateProjectActive(projectId int, accountId int, active bool) error
- type ClientRequest
- type ClientResource
- func (c *ClientResource) ArchiveClient(clientId int, accountId int) *api.Error
- func (c *ClientResource) CopyProjectsFromDateRanges(profileId int, accountId int, fromStart time.Time, fromEnd time.Time, ...) ([]*timesheet.TimeEntry, *api.Error)
- func (c *ClientResource) CreateClient(accountId int, name string, address string) (*Client, *api.Error)
- func (c *ClientResource) CreateProject(newProject *Project) (*Project, *api.Error)
- func (c *ClientResource) DeleteClient(clientId int, accountId int) *api.Error
- func (c *ClientResource) DeleteProject(projectId int, accountId int) *api.Error
- func (c *ClientResource) GetAllClients(accountId int, active bool) ([]*Client, *api.Error)
- func (c *ClientResource) GetAllProjects(accountId int, active bool) ([]*Project, *api.Error)
- func (c *ClientResource) GetClient(clientId int, accountId int) (*Client, *api.Error)
- func (c *ClientResource) GetProject(projectId int, accountId int) (*Project, *api.Error)
- func (c *ClientResource) RestoreClient(clientId int, accountId int) *api.Error
- func (c *ClientResource) UpdateClient(updateClient *Client) *api.Error
- func (c *ClientResource) UpdateProject(updateProject *Project) *api.Error
- func (c *ClientResource) UpdateProjectActive(projectId int, accountId int, active bool) *api.Error
- type ClientResponse
- type ClientRouter
- type ClientService
- type ClientStore
- type Project
- type ProjectContainerRequest
- type ProjectIdRequest
- type ProjectRequest
- type ProjectResponse
- type ProjectTaskEntry
- type ProjectTaskResponse
- type StartAndEndDateRequest
- type TaskRequest
Constants ¶
View Source
const ( ClientNameMinLength = 1 ClientNameMaxLength = 64 ProjectNameMinLength = 1 ProjectNameMaxLength = 128 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientData ¶
type ClientData struct {
// contains filtered or unexported fields
}
ProfileData implements database operations for user profiles
func (*ClientData) ArchiveClient ¶
func (c *ClientData) ArchiveClient(clientId int, accountId int) error
func (*ClientData) CopyProjectsFromDateRanges ¶
func (c *ClientData) CopyProjectsFromDateRanges(profileId int, accountId int, fromStart time.Time, fromEnd time.Time, toStart time.Time, toEnd time.Time) (bool, error)
Copy projects and tasks for all the days between prior start and end dates into the new date range
func (*ClientData) CreateClient ¶
func (c *ClientData) CreateClient(newClient Client) (int, error)
func (*ClientData) CreateProject ¶
func (c *ClientData) CreateProject(newProject *Project) (int, error)
func (*ClientData) DeleteClient ¶
func (c *ClientData) DeleteClient(clientId int, accountId int) error
func (*ClientData) DeleteProject ¶
func (c *ClientData) DeleteProject(projectId int, accountId int) error
func (*ClientData) GetAllClients ¶
func (c *ClientData) GetAllClients(accountId int, active bool) ([]*Client, error)
func (*ClientData) GetAllProjects ¶
func (c *ClientData) GetAllProjects(accountId int, active bool) ([]*Project, error)
func (*ClientData) GetClient ¶
func (c *ClientData) GetClient(clientId int, accountId int) (*Client, error)
func (*ClientData) GetProject ¶
func (c *ClientData) GetProject(projectId int, accountId int) (*Project, error)
func (*ClientData) RestoreClient ¶
func (c *ClientData) RestoreClient(clientId int, accountId int) error
func (*ClientData) UpdateClient ¶
func (c *ClientData) UpdateClient(updateData *Client) error
func (*ClientData) UpdateProject ¶
func (c *ClientData) UpdateProject(updateProject *Project) error
func (*ClientData) UpdateProjectActive ¶
func (c *ClientData) UpdateProjectActive(projectId int, accountId int, active bool) error
type ClientRequest ¶
type ClientResource ¶
type ClientResource struct {
// contains filtered or unexported fields
}
func (*ClientResource) ArchiveClient ¶
func (c *ClientResource) ArchiveClient(clientId int, accountId int) *api.Error
func (*ClientResource) CopyProjectsFromDateRanges ¶
func (*ClientResource) CreateClient ¶
func (*ClientResource) CreateProject ¶
func (c *ClientResource) CreateProject(newProject *Project) (*Project, *api.Error)
func (*ClientResource) DeleteClient ¶
func (c *ClientResource) DeleteClient(clientId int, accountId int) *api.Error
func (*ClientResource) DeleteProject ¶
func (c *ClientResource) DeleteProject(projectId int, accountId int) *api.Error
func (*ClientResource) GetAllClients ¶
func (*ClientResource) GetAllProjects ¶
func (*ClientResource) GetProject ¶
func (*ClientResource) RestoreClient ¶
func (c *ClientResource) RestoreClient(clientId int, accountId int) *api.Error
func (*ClientResource) UpdateClient ¶
func (c *ClientResource) UpdateClient(updateClient *Client) *api.Error
func (*ClientResource) UpdateProject ¶
func (c *ClientResource) UpdateProject(updateProject *Project) *api.Error
func (*ClientResource) UpdateProjectActive ¶
type ClientResponse ¶
type ClientResponse struct { ClientId int `json:"id,omitempty"` Name string `json:"name"` Address string `json:"address,omitempty"` }
func NewClientResponse ¶
func NewClientResponse(clientData *Client) *ClientResponse
func NewClientsResponse ¶
func NewClientsResponse(clients []*Client) []*ClientResponse
type ClientRouter ¶
type ClientRouter struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(store ClientStore, timeStore timesheet.TimeStore, profileRouter *profile.ProfileRouter) *ClientRouter
Returns a configured authentication profileService
func (*ClientRouter) Router ¶
func (a *ClientRouter) Router() *chi.Mux
type ClientService ¶
type ClientService interface { GetClient(clientId int, accountId int) (*Client, *api.Error) GetAllClients(accountId int, active bool) ([]*Client, *api.Error) GetProject(projectId int, accountId int) (*Project, *api.Error) GetAllProjects(accountId int, active bool) ([]*Project, *api.Error) CreateClient(accountId int, name string, address string) (*Client, *api.Error) CreateProject(newProject *Project) (*Project, *api.Error) UpdateClient(updateClient *Client) *api.Error UpdateProject(updateProject *Project) *api.Error ArchiveClient(clientId int, accountId int) *api.Error RestoreClient(clientId int, accountId int) *api.Error UpdateProjectActive(projectId int, accountId int, active bool) *api.Error DeleteClient(clientId int, accountId int) *api.Error DeleteProject(projectId int, accountId int) *api.Error CopyProjectsFromDateRanges(profileId int, accountId int, fromStart time.Time, fromEnd time.Time, toStart time.Time, toEnd time.Time) ([]*timesheet.TimeEntry, *api.Error) }
func NewClientService ¶
func NewClientService(store ClientStore, timeStore timesheet.TimeStore) ClientService
type ClientStore ¶
type ClientStore interface { GetClient(clientId int, accountId int) (*Client, error) GetAllClients(accountId int, active bool) ([]*Client, error) GetProject(projectId int, accountId int) (*Project, error) GetAllProjects(accountId int, active bool) ([]*Project, error) CreateClient(client Client) (int, error) CreateProject(project *Project) (int, error) UpdateClient(client *Client) error UpdateProject(project *Project) error ArchiveClient(clientId int, accountId int) error RestoreClient(clientId int, accountId int) error UpdateProjectActive(projectId int, accountId int, active bool) error DeleteClient(clientId int, accountId int) error DeleteProject(projectId int, accountId int) error CopyProjectsFromDateRanges(profileId int, accountId int, fromStart time.Time, fromEnd time.Time, toStart time.Time, toEnd time.Time) (bool, error) }
func NewClientStore ¶
func NewClientStore(db *sqlx.DB) ClientStore
type Project ¶
type Project struct { Client ProjectId int `json:"-" db:"project_id"` ProjectName string `json:"-" db:"project_name"` Code sql.NullString `json:"-"` ProjectActive bool `json:"-" db:"project_active"` Tasks []task.ProjectTask `json:"-"` }
type ProjectContainerRequest ¶
type ProjectContainerRequest struct { Id int ClientId int Name string Tasks []TaskRequest }
type ProjectIdRequest ¶
type ProjectIdRequest struct {
ProjectId int
}
type ProjectRequest ¶
type ProjectResponse ¶
type ProjectResponse struct { ProjectId int `json:"id,omitempty"` ProjectName string `json:"name"` ProjectActive bool `json:"active"` ClientId int `json:"clientId,omitempty"` Code string `json:"code,omitempty"` ClientName string `json:"clientName,omitempty"` Tasks []ProjectTaskResponse `json:"tasks,omitempty"` }
func NewProjectResponse ¶
func NewProjectResponse(project *Project) *ProjectResponse
func NewProjectsResponse ¶
func NewProjectsResponse(projects []*Project) []*ProjectResponse
type ProjectTaskEntry ¶
type ProjectTaskResponse ¶
type ProjectTaskResponse struct { TaskId int `json:"id"` Name string `json:"name"` Rate float64 `json:"rate,omitempty"` Billable bool `json:"billable"` Active bool `json:"active"` }
func NewProjectTaskResponse ¶
func NewProjectTaskResponse(t *task.ProjectTask) ProjectTaskResponse
type StartAndEndDateRequest ¶
type TaskRequest ¶
Click to show internal directories.
Click to hide internal directories.