gogmagog/models/plan.go
2020-12-29 18:20:28 -06:00

27 lines
585 B
Go

package models
import (
"time"
)
// Plan represents a single day's agenda of actions.
type Plan struct {
PlanID int64
PlanDate time.Time
}
// Plans returns all plans in the model.
func (m *Model) Plans() ([]*Plan, error) {
return m.SelectPlans()
}
// Plan returns a single plan from the store by plan_id.
func (m *Model) Plan(id int) (*Plan, error) {
return m.SelectPlanByID(id)
}
// AddPlan inserts a given plan into the store, returning the generated PlanID. The provided PlanID is ignored.
func (m *Model) AddPlan(plan *Plan) (int, error) {
return m.InsertPlan(plan)
}