repository

package
v0.0.0-...-3462dce Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

type Day struct {
	ID     string    `json:"id,omitempty" bson:"_id"`
	Events []Event   `json:"events"`
	Date   time.Time `json:"date"`
	UserID string    `json:"user,omitempty"`
}

func (*Day) PrepareReceived

func (d *Day) PrepareReceived()

func (*Day) PrepareToSend

func (d *Day) PrepareToSend()

type DaySearchForm

type DaySearchForm struct {
	UserID  string
	From    time.Time
	To      time.Time
	UserIDs []string
}

type DayStore

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

func CreateDayStore

func CreateDayStore(database *mongo.Database, uuidProvider utils.UuidProvider) *DayStore

func (*DayStore) Create

func (t *DayStore) Create(day Day) (*mongo.InsertOneResult, error)

func (*DayStore) FindByDate

func (t *DayStore) FindByDate(date time.Time, userID string) (Day, error)

func (*DayStore) FindByDateRange

func (t *DayStore) FindByDateRange(from time.Time, to time.Time, userID string) ([]Day, error)

func (*DayStore) FindByEventID

func (t *DayStore) FindByEventID(eventID string, userID string) (Day, error)

func (*DayStore) GetUsedNames

func (t *DayStore) GetUsedNames(userID string, tagID string, from time.Time, to time.Time) ([]string, error)

func (*DayStore) Search

func (t *DayStore) Search(form DaySearchForm) ([]Day, error)

func (*DayStore) Update

func (t *DayStore) Update(day Day) (Day, error)

type Event

type Event struct {
	ID        string    `json:"id,omitempty" bson:"_id"`
	Name      string    `json:"name" validate:"required,max=256"`
	Start     time.Time `json:"start" validate:"required"`
	End       time.Time `json:"end" validate:"required"`
	TagID     string    `json:"tag" validate:"required,max=36"`
	ProjectID string    `json:"project" validate:"max=36"`
	Timed     bool      `json:"timed" validate:"required"`
}

func (*Event) Copy

func (e *Event) Copy() Event

func (*Event) IsValid

func (e *Event) IsValid() []error

func (*Event) PrepareReceived

func (e *Event) PrepareReceived()

func (*Event) PrepareToSend

func (e *Event) PrepareToSend()

type Project

type Project struct {
	ID          string     `json:"id,omitempty" bson:"_id"`
	Name        string     `json:"name" validate:"required,max=256"`
	Description string     `json:"description" validate:"required,max=256"`
	Users       []string   `json:"users"`
	Start       *time.Time `json:"start,omitempty" bson:"start,omitempty"`
	End         *time.Time `json:"end,omitempty" bson:"end,omitempty"`
}

func (*Project) IsValid

func (t *Project) IsValid() []error

func (*Project) PrepareReceived

func (t *Project) PrepareReceived()

func (*Project) PrepareToSend

func (t *Project) PrepareToSend()

type ProjectSearchForm

type ProjectSearchForm struct {
	Name        string
	Description string
	Users       []string
}

type ProjectStore

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

func CreateProjectStore

func CreateProjectStore(database *mongo.Database, uuidProvider utils.UuidProvider) *ProjectStore

func (*ProjectStore) Create

func (t *ProjectStore) Create(record Project) (*mongo.InsertOneResult, error)

func (*ProjectStore) Delete

func (t *ProjectStore) Delete(projectID string) error

func (*ProjectStore) FindAllActiveProjectsByUser

func (t *ProjectStore) FindAllActiveProjectsByUser(userID string) (Projects, error)

func (*ProjectStore) FindAllProjectsByUser

func (t *ProjectStore) FindAllProjectsByUser(userID string) ([]Project, error)

func (*ProjectStore) GetProjectByID

func (t *ProjectStore) GetProjectByID(projectID string) (Project, error)

func (*ProjectStore) Search

func (t *ProjectStore) Search(form ProjectSearchForm) ([]Project, error)

func (*ProjectStore) Update

func (t *ProjectStore) Update(project Project) (string, error)

type Projects

type Projects []Project

func (Projects) GetIDs

func (p Projects) GetIDs() []string

func (Projects) HasID

func (p Projects) HasID(projectID string) bool

type Settings

type Settings struct {
	TimeRange TimeRange `json:"timeRange" validate:"required"`
	UserID    string    `json:"user,omitempty" bson:"user"`
}

func CreateDefaultSettings

func CreateDefaultSettings() Settings

func (*Settings) IsValid

func (s *Settings) IsValid() []error

func (*Settings) PrepareReceived

func (s *Settings) PrepareReceived()

func (*Settings) PrepareToSend

func (s *Settings) PrepareToSend()

type SettingsStore

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

func CreateSettingsStore

func CreateSettingsStore(database *mongo.Database) *SettingsStore

func (*SettingsStore) CreateOrUpdate

func (s *SettingsStore) CreateOrUpdate(settings Settings) error

func (*SettingsStore) FindByUser

func (s *SettingsStore) FindByUser(userID string) (*Settings, error)

type Tag

type Tag struct {
	ID          string `json:"id,omitempty" bson:"_id"`
	Name        string `json:"name" validate:"required,max=256"`
	Description string `json:"description" validate:"max=256"`
	Color       string `json:"color" validate:"required,max=16"`
	ParentID    string `json:"parent,omitempty" validate:"max=36" bson:"parent,omitempty"`
	ProjectID   string `json:"project,omitempty" validate:"max=36" bson:"project,omitempty"`
	Basic       bool   `json:"basic"`
}

func (*Tag) IsValid

func (t *Tag) IsValid() []error

func (*Tag) PrepareReceivedBaseTag

func (t *Tag) PrepareReceivedBaseTag()

func (*Tag) PrepareReceivedProjectTag

func (t *Tag) PrepareReceivedProjectTag()

func (*Tag) PrepareToSend

func (t *Tag) PrepareToSend()

type TagStore

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

func CreateTagStore

func CreateTagStore(database *mongo.Database, uuidProvider utils.UuidProvider) *TagStore

func (*TagStore) Create

func (t *TagStore) Create(tag Tag) (*mongo.InsertOneResult, error)

func (*TagStore) Delete

func (t *TagStore) Delete(tagID string) error

func (*TagStore) DeleteBaseTag

func (t *TagStore) DeleteBaseTag(tagID string) error

func (*TagStore) DeleteByProjectID

func (t *TagStore) DeleteByProjectID(tagID string, projectIDs []string) error

func (*TagStore) FindAll

func (t *TagStore) FindAll() ([]Tag, error)

func (*TagStore) FindAllActive

func (t *TagStore) FindAllActive() ([]Tag, error)

func (*TagStore) FindAllBaseAndProjectActiveTags

func (t *TagStore) FindAllBaseAndProjectActiveTags(projectIDs []string) ([]Tag, error)

func (*TagStore) Update

func (t *TagStore) Update(tag Tag) (string, error)

func (*TagStore) UpdateBaseTag

func (t *TagStore) UpdateBaseTag(tag Tag) (string, error)

type TimeRange

type TimeRange struct {
	Min int8 `json:"min" validate:"required,min=0,max=24"`
	Max int8 `json:"max" validate:"required,min=0,max=24"`
}

Jump to

Keyboard shortcuts

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