tracking

package
v0.0.366 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteIDKey    = "route_id"
	VehicleIDKey  = "vehicle_id"
	EmployeeIDKey = "employee_id"
	TimestampKey  = "timestamp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Comp

type Comp struct{}

type Core

type Core struct {
	// INFO: The owner is the employer.
	owner.Owner   `bson:",inline" validate:"recurse"`
	latlon.LatLon `bson:",inline" validate:"recurse"`
	RouteID       *contract.ID `json:"route_id" validate:"nnpt,nz"`
	VehicleID     *contract.ID `json:"vehicle_id" validate:"nnpt,nz"`
	EmployeeID    *contract.ID `json:"employee_id" validate:"nnpt,nz"`
	Timestamp     *date.Date   `json:"timestamp" validate:"nnpt,nz"`
}

func ApplyCore

func ApplyCore(c *Core, modifiers ...CoreOption) Core

func (*Core) GetEmployeeID

func (c *Core) GetEmployeeID() contract.ID

func (*Core) GetRouteID

func (c *Core) GetRouteID() contract.ID

func (*Core) GetTimestamp

func (c *Core) GetTimestamp() date.Date

func (*Core) GetVehicleID

func (c *Core) GetVehicleID() contract.ID

func (*Core) SetEmployeeID

func (c *Core) SetEmployeeID(x contract.ID)

func (*Core) SetRouteID

func (c *Core) SetRouteID(x contract.ID)

func (*Core) SetTimestamp

func (c *Core) SetTimestamp(x date.Date)

func (*Core) SetVehicleID

func (c *Core) SetVehicleID(x contract.ID)

type CoreOption

type CoreOption = contracti.CoreOption[Core]

func WithEmployeeID

func WithEmployeeID(x contract.ID) CoreOption

func WithLatLon

func WithLatLon(x latlon.LatLon) CoreOption

func WithOwner

func WithOwner(x owner.Owner) CoreOption

func WithRouteID

func WithRouteID(x contract.ID) CoreOption

func WithTimestamp

func WithTimestamp(x date.Date) CoreOption

func WithVehicleID

func WithVehicleID(x contract.ID) CoreOption

type Meta

type Meta struct {
	common.Common `bson:",inline" validate:"recurse"`
}

func ApplyMeta

func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta

type MetaOption

type MetaOption = contract.MetaOption[Meta]

func WithCommon

func WithCommon(x common.Common) MetaOption

type Tracking

type Tracking struct {
	Meta `bson:",inline" validate:"recurse"`
	Comp `bson:",inline" validate:"recurse"`
	Core `bson:",inline" validate:"recurse"`
}

Tracking represents the GPS-based trail of an employee linked to a specific route & vehicle.

func Mock

func Mock(o owner.Owner) *Tracking

func New

func New(m Meta, cr Core) *Tracking

func (*Tracking) Scope added in v0.0.317

func (r *Tracking) Scope() contract.Scope

Jump to

Keyboard shortcuts

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