order

package
v0.0.0-...-c407d37 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const RFC3339Micro = "2006-01-02T15:04:05.999999Z07:00"

Since timestamps in a postgres DB are stored with at the microsecond precision, we want to ensure that we are checking all timestamps up until that point to prevent moves from not showing up If we only checked values to the second mark, moves towards the end of the day (post 23:59:59 but before 00:00:00) would be lost and not properly show up in the associated filter

Variables

This section is empty.

Functions

func NewExcessWeightRiskManager

func NewExcessWeightRiskManager(router services.MoveRouter) services.ExcessWeightRiskManager

NewExcessWeightRiskManager creates a new struct with the service dependencies

func NewOrderFetcher

func NewOrderFetcher() services.OrderFetcher

NewOrderFetcher creates a new struct with the service dependencies

func NewOrderUpdater

func NewOrderUpdater(moveRouter services.MoveRouter) services.OrderUpdater

NewOrderUpdater creates a new struct with the service dependencies

func ValidateOrder

func ValidateOrder(order *models.Order, checks ...Validator) (result error)

ValidateOrder accepts a range of validator functions and runs each one

Types

type OrdersTypeDetailIsPresentAfterSubmission

type OrdersTypeDetailIsPresentAfterSubmission struct {
	Name  string
	Field *internalmessages.OrdersTypeDetail
}

OrdersTypeDetailIsPresentAfterSubmission validates that orders type field is present

func (*OrdersTypeDetailIsPresentAfterSubmission) IsValid

func (validate *OrdersTypeDetailIsPresentAfterSubmission) IsValid(errors *validate.Errors)

IsValid adds an error if the string value is blank.

type QueryOption

type QueryOption func(*pop.Query)

QueryOption defines the type for the functional arguments used for private functions in OrderFetcher

type StringIsPresentAfterSubmission

type StringIsPresentAfterSubmission struct {
	Name  string
	Field *string
}

StringIsPresentAfterSubmission checks presence of fields after an order has been submitted This validation only applies when a TOO is updating orders.

func (*StringIsPresentAfterSubmission) IsValid

func (validate *StringIsPresentAfterSubmission) IsValid(errors *validate.Errors)

IsValid adds an error if the field is blank

type Validator

type Validator interface {
	Validate(order *models.Order) error
}

Validator is the interface for the various validations we might want to define.

func CheckRequiredFields

func CheckRequiredFields() Validator

CheckRequiredFields ensures the presence of certain order fields before a TOO can approve a move or update an order.

Jump to

Keyboard shortcuts

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