businesscalendar

package module
v0.5.62 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 11 Imported by: 3

README

business_calendar

El calendario institucional para el ecosistema Velty: cuándo está abierto el establecimiento y cuándo está cerrado, independientemente del horario de cualquier profesional.

Posee tres cosas:

  1. Horarios de atención (business_hours) — la ventana semanal de apertura, una fila por día de la semana.
  2. Feriados (holidays) — cierres fechados con un origen legal/administrativo, editables en tiempo de ejecución (un nuevo feriado aparece por ley; nadie recompila).
  3. Cierres (closures) — cierres fechados con un origen local (mantenimiento, un evento).

No posee la agenda de ningún profesional. appointment_booking posee eso y consume este módulo a través del contrato de solo lectura OpeningHours.

Reemplaza al archivado github.com/veltylabs/business_hours, cuya codificación de texto de hora de reloj ("HH:MM") se corrige aquí a 24h clock string (HH:MM) —la misma codificación que usa appointment_booking para los bloques de trabajo— y cuyos nombres de días en español prefijados han desaparecido (la traducción vive en la aplicación consumidora).

Inicio rápido

// En tiempo de despliegue, ejecutar las migraciones de esquema:
err := migrate.Migrate(conn, ddlCompiler)
if err != nil { /* ... */ }

// Al iniciar el proceso:
cal, err := businesscalendar.New(db, businesscalendar.Deps{
    IDs: idGenerator, // model.IDGenerator — requerido
    Publisher: broker, // events.Publisher — opcional; nil deshabilita la publicación
})
if err != nil { /* ... */ }

crud.Mount(reg, nil, nil, cal) // monta las operaciones que declara definition.go

bounds, err := cal.DayLimits(dateMidnightUTC)

New asume que el esquema de la base de datos (business_hours, holiday, closure) ya existe. La aplicación que despliega llama a migrate.Migrate(conn, compiler) una vez, en tiempo de despliegue. Esta migración utiliza ddl.Sync para crear las tablas que faltan y agregar nuevas columnas si el modelo fue actualizado, ver flujo: https://github.com/webtyp/ddl/blob/main/docs/diagrams/SYNC_FLOW.md.

Operaciones

Las declara definition.go (Allow y Rules); crud las monta. Una operación es router.Operation{Module: ModelName, Entity: <entidad>, Action: <acción>}.

Entidad Acciones Regla del módulo
business_hours create, read, update un día de la semana por fila; open_min < close_min; un día cerrado guarda 00:00–00:00
holiday create, read, delete una fecha por feriado (repetida → conflicto)
closure create, read, delete una fecha por cierre (repetida → conflicto)
day_detail (lectura) read con filtro {date} si el establecimiento está abierto esa fecha, entre qué minutos y por qué está cerrado

API: BankDayAfter(desde, días): día hábil bancario N días después (lunes a viernes sin feriados; el horario de la clínica no cuenta).

Nota: los listados cargan según declara su view.Page y buscan en el servidor.

Los tiempos se almacenan como 24h clock string (HH:MM); day_detail responde "si el establecimiento está abierto esta fecha y entre qué minutos".

OpeningHours

Un módulo vecino (como appointment_booking o room_layout) declara en su propio interfaces.go el contrato que necesita:

type OpeningHours interface {
    DayLimits(date time.Unix) (time.DayLimits, error)
    WeekdayLimits(dayOfWeek int) (time.DayLimits, error)
    ClosedDates(from, to time.Unix) (holidays, closures []string, err error)
}

*Module lo satisface estructuralmente. time.DayLimits lleva Open, OpenMin y CloseMin. Precedencia de resolución: Cierre local > Feriado > Regla semanal.

Eventos

Cada escritura exitosa publica EventCalendarChanged (business.calendar.changed) con un CalendarChangedPayload tipado que indica qué cambió, su rango de fechas afectado y Closed —la dirección. Closed es true solo cuando el cambio cierra el tiempo (un feriado agregado, horarios reducidos), que es la única dirección que puede invalidar una reserva existente.

Claves de traducción

Este módulo no renderiza ningún lenguaje humano codificado de forma rígida. Introduce estas claves canónicas en inglés, traducidas por la aplicación consumidora a través de webtyp.com/fmt/lang: Business hours, Holidays, Closures, Open, Closed, más los siete nombres de días de la semana de webtyp.com/date (date.WeekdayName).

View and demo

The module exports its own UI view, seed demo data, and executable WASM demo shell:

  • ui/ — exports ui.ID, ui.Label, and ui.Screens(caller router.Caller) []view.Screen.
  • seed/ — seed.Load(module) writes initial weekly business hours and Chilean holidays through domain service methods.
  • seed/demo.go — the runnable demo (seed.Demo()). Run webtyp at the repository root to launch it (in-browser, in-memory, no login).

Archivos clave

Archivo Rol
definition.go Definiciones de las entidades (Allow, Rules), errores, tópico/payload de eventos
definition_gen.go Generado por definitionc — no editar
checks.go, rows.go, store.go Reglas compartidas, lectura de filas y repositorios
rule_*.go Una regla de negocio por acción declarada
module.go Module, Deps, New, métodos de servicio, publicación de eventos
migrate/ Migración de esquema en tiempo de despliegue (Migrate)

| view.go | Tres presentadores (NewBusinessHoursView, NewHolidaysView, NewClosuresView) | | ui/ | Vista UI del módulo (ui.Screens(caller router.Caller) []view.Screen, ui.ID, ui.Label) | | seed/ | Datos semilla de demostración (seed.Load) | | tests/ | Pruebas de casos de uso, pruebas de ops, conformidad (sobre storage/mem + crud.LoopbackActingAs) |

Documentación


Este módulo forma parte de la colección de módulos de Velty Labs.

errores tipados (model.NotFound, model.Conflict, model.Invalid) que crud traduce al estado que corresponde; permisos por entidad (model.ResourceOf); claves foráneas declaradas.

Documentation

Index

Constants

View Source
const (
	ErrNotFound         model.NotFound = "business_calendar: record not found"
	ErrInvalidDay       model.Invalid  = "business_calendar: day_of_week must be 0..6"
	ErrInvalidWeekday   model.Invalid  = "business_calendar: day_of_week must be 0..6"
	ErrInvalidMinutes   model.Invalid  = "business_calendar: minutes must be 0..1439 and open_min < close_min"
	ErrDuplicateDate    model.Conflict = "business_calendar: a record already exists for that date"
	ErrCannotRead       model.Invalid  = "business_calendar: cannot read the request"
	ErrFieldNotEditable model.Invalid  = "business_calendar: that field cannot be changed"
	ErrDateRequired     model.Invalid  = "business_calendar: date is required"
)
View Source
const (
	CalendarKindBusinessHours = "BUSINESS_HOURS"
	CalendarKindHoliday       = "HOLIDAY"
	CalendarKindClosure       = "CLOSURE"
)
View Source
const ErrNegativeDays = model.Invalid("business_calendar: days must be zero or more")

ErrNegativeDays: BankDayAfter con días negativos.

View Source
const EventCalendarChanged = "business.calendar.changed"
View Source
const ModelName = "business_calendar"

ModelName is the module identity: Definition.Name.

Variables

View Source
var BusinessHoursModel = model.Definition{
	Name:  "business_hours",
	Allow: model.Create | model.Read | model.Update,
	Rules: model.Rules{Create: model.AddMyBusinessRule, Read: model.HaveNoBusinessRule, Update: model.AddMyBusinessRule},
	Fields: model.Fields{
		{Name: "id", Type: model.Text(), OmitEmpty: true, ServerOnly: true, DB: &model.FieldDB{PK: true}},
		{Name: "day_of_week", Type: input.Number(), Label: "Day of week", DB: &model.FieldDB{Unique: true}, Item: model.ItemLabel},
		{Name: "open_min", Type: input.Hour(), Label: "Opens at", OmitEmpty: true, Item: model.ItemDescription},
		{Name: "close_min", Type: input.Hour(), Label: "Closes at", OmitEmpty: true, Item: model.ItemDescription},
		{Name: "is_open", Type: input.Checkbox(), Label: "Open", Item: model.ItemDescription},
		{Name: "notes", Type: input.Textarea(), Label: "Notes", Item: model.ItemDescription},
		{Name: "updated_at", Type: model.NanoTime(), NotNull: true, ServerOnly: true},
	},
}
View Source
var BusinessHours_ = struct {
	Id        string
	DayOfWeek string
	OpenMin   string
	CloseMin  string
	IsOpen    string
	Notes     string
	UpdatedAt string
}{
	Id:        "id",
	DayOfWeek: "day_of_week",
	OpenMin:   "open_min",
	CloseMin:  "close_min",
	IsOpen:    "is_open",
	Notes:     "notes",
	UpdatedAt: "updated_at",
}
View Source
var ClosureModel = model.Definition{
	Name:  "closure",
	Allow: model.Create | model.Read | model.Delete,
	Rules: model.Rules{Create: model.AddMyBusinessRule, Read: model.HaveNoBusinessRule, Delete: model.AddMyBusinessRule},
	Fields: model.Fields{
		{Name: "id", Type: model.Text(), OmitEmpty: true, ServerOnly: true, DB: &model.FieldDB{PK: true}},
		{Name: "specific_date", Type: input.Number(), Label: "Date", NotNull: true, Item: model.ItemDescription},
		{Name: "reason", Type: input.Text(), Label: "Reason", NotNull: true, Item: model.ItemLabel},
		{Name: "updated_at", Type: model.NanoTime(), NotNull: true, ServerOnly: true},
	},
}
View Source
var Closure_ = struct {
	Id           string
	SpecificDate string
	Reason       string
	UpdatedAt    string
}{
	Id:           "id",
	SpecificDate: "specific_date",
	Reason:       "reason",
	UpdatedAt:    "updated_at",
}
View Source
var DayStatusModel = model.Definition{
	Name:  "day_detail",
	Wire:  true,
	Allow: model.Read,
	Rules: model.Rules{Read: model.AddMyBusinessRule},
	Fields: model.Fields{
		{Name: "date", Type: model.Int(), OmitEmpty: true},
		{Name: "open", Type: model.Bool(), OmitEmpty: true},
		{Name: "open_min", Type: model.Int(), OmitEmpty: true},
		{Name: "close_min", Type: model.Int(), OmitEmpty: true},
		{Name: "closed_by", Type: model.Text(), OmitEmpty: true},
	},
}
View Source
var Definition = model.ModuleDefinition{
	Name:     "business_calendar",
	Entities: []model.Definition{BusinessHoursModel, HolidayModel, ClosureModel, DayStatusModel},
}
View Source
var HolidayModel = model.Definition{
	Name:  "holiday",
	Allow: model.Create | model.Read | model.Delete,
	Rules: model.Rules{Create: model.AddMyBusinessRule, Read: model.HaveNoBusinessRule, Delete: model.AddMyBusinessRule},
	Fields: model.Fields{
		{Name: "id", Type: model.Text(), OmitEmpty: true, ServerOnly: true, DB: &model.FieldDB{PK: true}},
		{Name: "specific_date", Type: input.Number(), Label: "Date", NotNull: true, Item: model.ItemDescription},
		{Name: "name", Type: input.Text(), Label: "Name", NotNull: true, Item: model.ItemLabel},
		{Name: "notes", Type: input.Textarea(), Label: "Notes"},
		{Name: "updated_at", Type: model.NanoTime(), NotNull: true, ServerOnly: true},
	},
}
View Source
var Holiday_ = struct {
	Id           string
	SpecificDate string
	Name         string
	Notes        string
	UpdatedAt    string
}{
	Id:           "id",
	SpecificDate: "specific_date",
	Name:         "name",
	Notes:        "notes",
	UpdatedAt:    "updated_at",
}

Functions

func NewBusinessHoursView added in v0.0.2

func NewBusinessHoursView(caller router.Caller, opts ...view.Option) view.Presenter

func NewClosuresView added in v0.0.2

func NewClosuresView(caller router.Caller, opts ...view.Option) view.Presenter

func NewHolidaysView added in v0.0.2

func NewHolidaysView(caller router.Caller, opts ...view.Option) view.Presenter

Types

type BusinessHours added in v0.0.2

type BusinessHours struct {
	Id        string
	DayOfWeek int64
	OpenMin   string
	CloseMin  string
	IsOpen    bool
	Notes     string
	UpdatedAt time.Nano
}

func ReadOneBusinessHours added in v0.0.2

func ReadOneBusinessHours(qb *orm.QB, model *BusinessHours) (*BusinessHours, error)

func (*BusinessHours) Allow added in v0.5.62

func (*BusinessHours) Allow() model.Action

func (*BusinessHours) Create added in v0.5.62

func (p *BusinessHours) Create(a crud.CurrentUser, tx crud.Tx, m *Module) (crud.RuleAnswer, error)

func (*BusinessHours) DecodeFields added in v0.0.2

func (m *BusinessHours) DecodeFields(r model.FieldReader)

func (*BusinessHours) EncodeFields added in v0.0.2

func (m *BusinessHours) EncodeFields(w model.FieldWriter)

func (*BusinessHours) IsNil added in v0.0.2

func (m *BusinessHours) IsNil() bool

func (*BusinessHours) Item added in v0.0.2

func (m *BusinessHours) Item() model.Item

func (*BusinessHours) ModelName added in v0.0.2

func (m *BusinessHours) ModelName() string

func (*BusinessHours) Pointers added in v0.0.2

func (m *BusinessHours) Pointers() []any

func (*BusinessHours) Schema added in v0.0.2

func (m *BusinessHours) Schema() []model.Field

func (*BusinessHours) Update added in v0.5.62

func (next *BusinessHours) Update(a crud.CurrentUser, tx crud.Tx, old *BusinessHours, fields []string, m *Module) (crud.RuleAnswer, error)

func (*BusinessHours) Validate added in v0.0.2

func (m *BusinessHours) Validate(action byte) error

type BusinessHoursList added in v0.0.2

type BusinessHoursList []*BusinessHours

func ReadAllBusinessHours added in v0.0.2

func ReadAllBusinessHours(qb *orm.QB) (BusinessHoursList, error)

func (*BusinessHoursList) Allow added in v0.5.62

func (*BusinessHoursList) Allow() model.Action

func (*BusinessHoursList) Append added in v0.0.2

func (s *BusinessHoursList) Append() model.Fielder

func (*BusinessHoursList) At added in v0.0.2

func (*BusinessHoursList) DecodeFields added in v0.0.2

func (s *BusinessHoursList) DecodeFields(_ model.FieldReader)

func (*BusinessHoursList) EncodeFields added in v0.0.2

func (s *BusinessHoursList) EncodeFields(_ model.FieldWriter)

func (*BusinessHoursList) IsNil added in v0.0.2

func (s *BusinessHoursList) IsNil() bool

func (*BusinessHoursList) Len added in v0.0.2

func (s *BusinessHoursList) Len() int

type CalendarChangedPayload added in v0.0.2

type CalendarChangedPayload struct {
	FromDate int64
	ToDate   int64
	Kind     string
	Closed   bool
}

func (*CalendarChangedPayload) DecodeFields added in v0.0.2

func (p *CalendarChangedPayload) DecodeFields(r model.FieldReader)

func (*CalendarChangedPayload) EncodeFields added in v0.0.2

func (p *CalendarChangedPayload) EncodeFields(w model.FieldWriter)

func (*CalendarChangedPayload) IsNil added in v0.0.2

func (p *CalendarChangedPayload) IsNil() bool

type ClosedReason added in v0.0.2

type ClosedReason string
const (
	ClosedWeekly  ClosedReason = "WEEKLY"
	ClosedHoliday ClosedReason = "HOLIDAY"
	ClosedLocal   ClosedReason = "CLOSURE"
)

type Closure added in v0.0.2

type Closure struct {
	Id           string
	SpecificDate int64
	Reason       string
	UpdatedAt    time.Nano
}

func ReadOneClosure added in v0.0.2

func ReadOneClosure(qb *orm.QB, model *Closure) (*Closure, error)

func (*Closure) Allow added in v0.5.62

func (*Closure) Allow() model.Action

func (*Closure) Create added in v0.5.62

func (p *Closure) Create(a crud.CurrentUser, tx crud.Tx, m *Module) (crud.RuleAnswer, error)

func (*Closure) DecodeFields added in v0.0.2

func (m *Closure) DecodeFields(r model.FieldReader)

func (*Closure) Delete added in v0.5.62

func (p *Closure) Delete(a crud.CurrentUser, tx crud.Tx, m *Module) (crud.RuleAnswer, error)

func (*Closure) EncodeFields added in v0.0.2

func (m *Closure) EncodeFields(w model.FieldWriter)

func (*Closure) IsNil added in v0.0.2

func (m *Closure) IsNil() bool

func (*Closure) Item added in v0.0.2

func (m *Closure) Item() model.Item

func (*Closure) ModelName added in v0.0.2

func (m *Closure) ModelName() string

func (*Closure) Pointers added in v0.0.2

func (m *Closure) Pointers() []any

func (*Closure) Schema added in v0.0.2

func (m *Closure) Schema() []model.Field

func (*Closure) Validate added in v0.0.2

func (m *Closure) Validate(action byte) error

type ClosureList added in v0.0.2

type ClosureList []*Closure

func ReadAllClosure added in v0.0.2

func ReadAllClosure(qb *orm.QB) (ClosureList, error)

func (*ClosureList) Allow added in v0.5.62

func (*ClosureList) Allow() model.Action

func (*ClosureList) Append added in v0.0.2

func (s *ClosureList) Append() model.Fielder

func (*ClosureList) At added in v0.0.2

func (s *ClosureList) At(i int) model.Fielder

func (*ClosureList) DecodeFields added in v0.0.2

func (s *ClosureList) DecodeFields(_ model.FieldReader)

func (*ClosureList) EncodeFields added in v0.0.2

func (s *ClosureList) EncodeFields(_ model.FieldWriter)

func (*ClosureList) IsNil added in v0.0.2

func (s *ClosureList) IsNil() bool

func (*ClosureList) Len added in v0.0.2

func (s *ClosureList) Len() int

type DayDetail added in v0.0.4

type DayDetail struct {
	Limits   time.DayLimits
	ClosedBy ClosedReason
}

func (*DayDetail) EncodeFields added in v0.0.4

func (d *DayDetail) EncodeFields(w model.FieldWriter)

func (*DayDetail) IsNil added in v0.0.4

func (d *DayDetail) IsNil() bool

type DayStatus added in v0.5.62

type DayStatus struct {
	Date     int64
	Open     bool
	OpenMin  int64
	CloseMin int64
	ClosedBy string
}

func (*DayStatus) DecodeFields added in v0.5.62

func (m *DayStatus) DecodeFields(r model.FieldReader)

func (*DayStatus) EncodeFields added in v0.5.62

func (m *DayStatus) EncodeFields(w model.FieldWriter)

func (*DayStatus) IsNil added in v0.5.62

func (m *DayStatus) IsNil() bool

func (*DayStatus) ModelName added in v0.5.62

func (m *DayStatus) ModelName() string

func (*DayStatus) Pointers added in v0.5.62

func (m *DayStatus) Pointers() []any

func (*DayStatus) Read added in v0.5.62

func (p *DayStatus) Read(a crud.CurrentUser, filter *DayStatus, args crud.ReadArgs, m *Module) (model.ModelSlice, error)

func (*DayStatus) Schema added in v0.5.62

func (m *DayStatus) Schema() []model.Field

func (*DayStatus) Validate added in v0.5.62

func (m *DayStatus) Validate(action byte) error

func (*DayStatus) Wire added in v0.5.62

func (m *DayStatus) Wire() bool

type DayStatusList added in v0.5.62

type DayStatusList []*DayStatus

func (*DayStatusList) Append added in v0.5.62

func (s *DayStatusList) Append() model.Fielder

func (*DayStatusList) At added in v0.5.62

func (s *DayStatusList) At(i int) model.Fielder

func (*DayStatusList) DecodeFields added in v0.5.62

func (s *DayStatusList) DecodeFields(_ model.FieldReader)

func (*DayStatusList) EncodeFields added in v0.5.62

func (s *DayStatusList) EncodeFields(_ model.FieldWriter)

func (*DayStatusList) IsNil added in v0.5.62

func (s *DayStatusList) IsNil() bool

func (*DayStatusList) Len added in v0.5.62

func (s *DayStatusList) Len() int

type Deps added in v0.0.2

type Deps struct {
	IDs       model.IDGenerator
	Publisher events.Publisher
}

type Holiday added in v0.0.2

type Holiday struct {
	Id           string
	SpecificDate int64
	Name         string
	Notes        string
	UpdatedAt    time.Nano
}

func ReadOneHoliday added in v0.0.2

func ReadOneHoliday(qb *orm.QB, model *Holiday) (*Holiday, error)

func (*Holiday) Allow added in v0.5.62

func (*Holiday) Allow() model.Action

func (*Holiday) Create added in v0.5.62

func (p *Holiday) Create(a crud.CurrentUser, tx crud.Tx, m *Module) (crud.RuleAnswer, error)

func (*Holiday) DecodeFields added in v0.0.2

func (m *Holiday) DecodeFields(r model.FieldReader)

func (*Holiday) Delete added in v0.5.62

func (p *Holiday) Delete(a crud.CurrentUser, tx crud.Tx, m *Module) (crud.RuleAnswer, error)

func (*Holiday) EncodeFields added in v0.0.2

func (m *Holiday) EncodeFields(w model.FieldWriter)

func (*Holiday) IsNil added in v0.0.2

func (m *Holiday) IsNil() bool

func (*Holiday) Item added in v0.0.2

func (m *Holiday) Item() model.Item

func (*Holiday) ModelName added in v0.0.2

func (m *Holiday) ModelName() string

func (*Holiday) Pointers added in v0.0.2

func (m *Holiday) Pointers() []any

func (*Holiday) Schema added in v0.0.2

func (m *Holiday) Schema() []model.Field

func (*Holiday) Validate added in v0.0.2

func (m *Holiday) Validate(action byte) error

type HolidayList added in v0.0.2

type HolidayList []*Holiday

func ReadAllHoliday added in v0.0.2

func ReadAllHoliday(qb *orm.QB) (HolidayList, error)

func (*HolidayList) Allow added in v0.5.62

func (*HolidayList) Allow() model.Action

func (*HolidayList) Append added in v0.0.2

func (s *HolidayList) Append() model.Fielder

func (*HolidayList) At added in v0.0.2

func (s *HolidayList) At(i int) model.Fielder

func (*HolidayList) DecodeFields added in v0.0.2

func (s *HolidayList) DecodeFields(_ model.FieldReader)

func (*HolidayList) EncodeFields added in v0.0.2

func (s *HolidayList) EncodeFields(_ model.FieldWriter)

func (*HolidayList) IsNil added in v0.0.2

func (s *HolidayList) IsNil() bool

func (*HolidayList) Len added in v0.0.2

func (s *HolidayList) Len() int

type Module added in v0.0.2

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

func New

func New(db *orm.DB, deps Deps) (*Module, error)

func (*Module) AddClosure added in v0.0.2

func (m *Module) AddClosure(c Closure) error

func (*Module) AddHoliday added in v0.0.2

func (m *Module) AddHoliday(h Holiday) error

func (*Module) BankDayAfter added in v0.5.0

func (m *Module) BankDayAfter(from time.Unix, days int) (time.Unix, error)

BankDayAfter devuelve la medianoche UTC del día hábil bancario que está days días hábiles después de from. Día hábil bancario: lunes a viernes que no es feriado legal (Holiday). El horario y los cierres propios del establecimiento no cuentan. days == 0 devuelve el mismo día si es hábil, si no el siguiente hábil. Ejemplo: deposito, err := cal.BankDayAfter(cobradoEl, 2) // cobro del viernes con abono a 2 días → martes

func (*Module) ClosedDates added in v0.5.41

func (m *Module) ClosedDates(from, to time.Unix) (holidays, closures []string, err error)

func (*Module) DayLimits added in v0.5.41

func (m *Module) DayLimits(date time.Unix) (time.DayLimits, error)

func (*Module) Definition added in v0.5.62

func (m *Module) Definition() model.ModuleDefinition

Definition is the module's declaration (definition.go); crud.Mount compares it with what MountOperations mounted.

func (*Module) GetDayDetail added in v0.0.4

func (m *Module) GetDayDetail(date time.Unix) (DayDetail, error)

func (*Module) ListBusinessHours added in v0.0.2

func (m *Module) ListBusinessHours(after string, limit int64) ([]BusinessHours, error)

func (*Module) ListClosures added in v0.0.2

func (m *Module) ListClosures(from, to int64, search, after string, limit int64) ([]Closure, error)

func (*Module) ListHolidays added in v0.0.2

func (m *Module) ListHolidays(from, to int64, search, after string, limit int64) ([]Holiday, error)

func (*Module) ModelName added in v0.0.2

func (m *Module) ModelName() string

func (*Module) MountOperations added in v0.0.2

func (m *Module) MountOperations(reg crud.Registry)

MountOperations offers every entity of the module: the actions its model allows, with crud's validation and the rules written in rule_*.go.

func (*Module) RemoveClosure added in v0.0.2

func (m *Module) RemoveClosure(id string) error

func (*Module) RemoveHoliday added in v0.0.2

func (m *Module) RemoveHoliday(id string) error

func (*Module) StoreBusinessHours added in v0.5.62

func (m *Module) StoreBusinessHours() crud.Store

func (*Module) StoreClosure added in v0.5.62

func (m *Module) StoreClosure() crud.Store

func (*Module) StoreHoliday added in v0.5.62

func (m *Module) StoreHoliday() crud.Store

func (*Module) UpsertBusinessHours added in v0.0.2

func (m *Module) UpsertBusinessHours(h BusinessHours) error

func (*Module) WeekdayLimits added in v0.5.41

func (m *Module) WeekdayLimits(dayOfWeek int) (time.DayLimits, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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