domaintype

package
v0.0.0-...-0f0028d Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(input interface{}, result interface{}) error

Decode is the custom Decode function for mapstructure with support for IntTime

Types

type AppConfig

type AppConfig struct {
	DatabaseFile        string
	MigrationFolderPath string
	IsTestingMode       bool
}

AppConfig stores settings to start a server.

type Appointment

type Appointment struct {
	ID         string
	LocationID string
	Location   Location
	StartTime  IntTime
	EndTime    IntTime
}

Appointment represents a time for customers to pick up their items.

func (Appointment) TableName

func (Appointment) TableName() string

TableName implements the Tabler interface in GORM to specify table name for the Appointment model

type AppointmentAction

type AppointmentAction struct {
	ID            string
	AppointmentID string
	Appointment   Appointment
	CustomerID    string
	Customer      Customer
	ActionType    AppointmentActionEnum
	CreatedAt     IntTime
}

AppointmentAction stores actions that have been performed for an appointment.

func (AppointmentAction) TableName

func (AppointmentAction) TableName() string

TableName implements the Tabler interface in GORM to specify table name for the AppointmentAction model

type AppointmentActionEnum

type AppointmentActionEnum int64

AppointmentActionEnum represents action types

const (
	Notified AppointmentActionEnum = iota
	Accepted
	CancelledByStore
	CancelledByCustomer
)

all possible actions for an appointment

func (AppointmentActionEnum) Scan

func (aat AppointmentActionEnum) Scan(value interface{}) error

Scan custom scanner

func (AppointmentActionEnum) Value

func (aat AppointmentActionEnum) Value() (driver.Value, error)

Value custom valuer

type Customer

type Customer struct {
	ID           string
	PhoneNumber  string
	FriendlyName string
}

Customer is the domain representation of a customer

func (Customer) TableName

func (Customer) TableName() string

TableName implements the Tabler interface in GORM to specify table name for the Customer model

type IntTime

type IntTime time.Time

IntTime is a trick to inject custom scanner and valuer methods.

func (*IntTime) Scan

func (it *IntTime) Scan(value interface{}) error

Scan custom scanner

func (IntTime) ToInt

func (it IntTime) ToInt() int

ToInt returns the unix time as int

func (IntTime) Value

func (it IntTime) Value() (driver.Value, error)

Value custom valuer

type Location

type Location struct {
	ID      string
	Address string
	Note    string
}

Location represents a location where an appointment can be scheduled.

func (Location) TableName

func (Location) TableName() string

TableName implements the Tabler interface in GORM to specify table name for the Location model

type Sms

type Sms struct {
	ID       string
	Customer Customer
	Body     string
}

Sms represents a message

Jump to

Keyboard shortcuts

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