mtoshipment

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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateRequiredDeliveryDate

func CalculateRequiredDeliveryDate(appCtx appcontext.AppContext, planner route.Planner, pickupAddress models.Address, destinationAddress models.Address, pickupDate time.Time, weight int) (*time.Time, error)

CalculateRequiredDeliveryDate function is used to get a distance calculation using the pickup and destination addresses. It then uses the value returned to make a fetch on the ghc_domestic_transit_times table and returns a required delivery date based on the max_days_transit_time.

func FindShipment

func FindShipment(appCtx appcontext.AppContext, shipmentID uuid.UUID, eagerAssociations ...string) (*models.MTOShipment, error)

func NewCustomerMTOShipmentUpdater

TODO: apply the subset of business logic validations that would be appropriate for the CUSTOMER

func NewMTOShipmentAddressUpdater

func NewMTOShipmentAddressUpdater(planner route.Planner, addressCreator services.AddressCreator, addressUpdater services.AddressUpdater) services.MTOShipmentAddressUpdater

NewMTOShipmentAddressUpdater updates the address for an MTO Shipment

func NewMTOShipmentCreatorV1

func NewMTOShipmentCreatorV1(builder createMTOShipmentQueryBuilder, fetcher services.Fetcher, moveRouter services.MoveRouter, addressCreator services.AddressCreator) services.MTOShipmentCreator

NewMTOShipmentCreatorV1 creates a new struct with the service dependencies This is utilized in Prime API V1

func NewMTOShipmentCreatorV2

func NewMTOShipmentCreatorV2(builder createMTOShipmentQueryBuilder, fetcher services.Fetcher, moveRouter services.MoveRouter, addressCreator services.AddressCreator) services.MTOShipmentCreator

NewMTOShipmentCreator creates a new struct with the service dependencies This is utilized in Prime API V2

func NewMTOShipmentFetcher

func NewMTOShipmentFetcher() services.MTOShipmentFetcher

NewMTOShipmentFetcher creates a new MTOShipmentFetcher struct that supports ListMTOShipments

func NewMTOShipmentStatusUpdater

func NewMTOShipmentStatusUpdater(builder UpdateMTOShipmentQueryBuilder, siCreator services.MTOServiceItemCreator, planner route.Planner) services.MTOShipmentStatusUpdater

NewMTOShipmentStatusUpdater creates a new MTO Shipment Status Updater

func NewMTOShipmentUpdater

NewMTOShipmentUpdater creates a new struct with the service dependencies

func NewPrimeMTOShipmentUpdater

TODO: apply the subset of business logic validations that would be appropriate for the PRIME

func NewPrimeShipmentDeleter

func NewPrimeShipmentDeleter(moveTaskOrderUpdater services.MoveTaskOrderUpdater) services.ShipmentDeleter

NewPrimeShipmentDeleter creates a new struct with the service dependencies

func NewShipmentApprover

func NewShipmentApprover(router services.ShipmentRouter, siCreator services.MTOServiceItemCreator, planner route.Planner) services.ShipmentApprover

NewShipmentApprover creates a new struct with the service dependencies

func NewShipmentBillableWeightCalculator

func NewShipmentBillableWeightCalculator() services.ShipmentBillableWeightCalculator

NewShipmentBillableWeightCalculator updates the address for an MTO Shipment

func NewShipmentCancellationRequester

func NewShipmentCancellationRequester(router services.ShipmentRouter) services.ShipmentCancellationRequester

NewShipmentCancellationRequester creates a new struct with the service dependencies

func NewShipmentDeleter

func NewShipmentDeleter(moveTaskOrderUpdater services.MoveTaskOrderUpdater) services.ShipmentDeleter

NewShipmentDeleter creates a new struct with the service dependencies

func NewShipmentDiversionApprover

func NewShipmentDiversionApprover(router services.ShipmentRouter) services.ShipmentDiversionApprover

NewShipmentDiversionApprover creates a new struct with the service dependencies

func NewShipmentDiversionRequester

func NewShipmentDiversionRequester(router services.ShipmentRouter) services.ShipmentDiversionRequester

NewShipmentDiversionRequester creates a new struct with the service dependencies

func NewShipmentRejecter

func NewShipmentRejecter(router services.ShipmentRouter) services.ShipmentRejecter

NewShipmentRejecter creates a new struct with the service dependencies

func NewShipmentReweighRequester

func NewShipmentReweighRequester() services.ShipmentReweighRequester

NewShipmentReweighRequester creates a new struct with the service dependencies

func NewShipmentRouter

func NewShipmentRouter() services.ShipmentRouter

NewShipmentRouter creates a new shipmentRouter service

func UpdateDestinationSITServiceItemsAddress

func UpdateDestinationSITServiceItemsAddress(appCtx appcontext.AppContext, shipment *models.MTOShipment) error

UpdateDestinationSITServiceItemsAddress updates destination SIT service items attached to a shipment this updates the final_destination_address to be the same as the shipment's destination_address

func UpdateDestinationSITServiceItemsSITDeliveryMiles

func UpdateDestinationSITServiceItemsSITDeliveryMiles(planner route.Planner, appCtx appcontext.AppContext, shipment *models.MTOShipment, newAddress *models.Address, TOOApprovalRequired bool) error

func UpdateOriginSITServiceItemSITDeliveryMiles

func UpdateOriginSITServiceItemSITDeliveryMiles(planner route.Planner, shipment *models.MTOShipment, newAddress *models.Address, oldAddress *models.Address, appCtx appcontext.AppContext) (*models.MTOServiceItems, error)

func UpdateSITServiceItemDestinationAddressToMTOShipmentAddress

func UpdateSITServiceItemDestinationAddressToMTOShipmentAddress(mtoServiceItems *models.MTOServiceItems, newAddress *models.Address, appCtx appcontext.AppContext) (*models.MTOServiceItems, error)

Types

type ConflictStatusError

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

ConflictStatusError returns an error for a conflict in status

func (ConflictStatusError) Error

func (e ConflictStatusError) Error() string

Error is the string representation of the error

type StaleIdentifierError

type StaleIdentifierError struct {
	StaleIdentifier string
}

StaleIdentifierError is used when optimistic locking determines that the identifier refers to stale data

func (StaleIdentifierError) Error

func (e StaleIdentifierError) Error() string

type UpdateMTOShipmentQueryBuilder

type UpdateMTOShipmentQueryBuilder interface {
	FetchOne(appCtx appcontext.AppContext, model interface{}, filters []services.QueryFilter) error
	CreateOne(appCtx appcontext.AppContext, model interface{}) (*validate.Errors, error)
	UpdateOne(appCtx appcontext.AppContext, model interface{}, eTag *string) (*validate.Errors, error)
	Count(appCtx appcontext.AppContext, model interface{}, filters []services.QueryFilter) (int, error)
	FetchMany(appCtx appcontext.AppContext, model interface{}, filters []services.QueryFilter, associations services.QueryAssociations, pagination services.Pagination, ordering services.QueryOrder) error
}

UpdateMTOShipmentQueryBuilder is the query builder for updating MTO Shipments

Jump to

Keyboard shortcuts

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