Documentation ¶
Index ¶
- Constants
- func NewExcessWeightRiskManager(router services.MoveRouter) services.ExcessWeightRiskManager
- func NewOrderFetcher() services.OrderFetcher
- func NewOrderUpdater(moveRouter services.MoveRouter) services.OrderUpdater
- func ValidateOrder(order *models.Order, checks ...Validator) (result error)
- type OrdersTypeDetailIsPresentAfterSubmission
- type QueryOption
- type StringIsPresentAfterSubmission
- type Validator
Constants ¶
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
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 ¶
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 ¶
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.