Documentation ¶
Index ¶
- func CalculateRequiredDeliveryDate(appCtx appcontext.AppContext, planner route.Planner, ...) (*time.Time, error)
- func FindShipment(appCtx appcontext.AppContext, shipmentID uuid.UUID, ...) (*models.MTOShipment, error)
- func NewCustomerMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, ...) services.MTOShipmentUpdater
- func NewMTOShipmentAddressUpdater(planner route.Planner, addressCreator services.AddressCreator, ...) services.MTOShipmentAddressUpdater
- func NewMTOShipmentCreatorV1(builder createMTOShipmentQueryBuilder, fetcher services.Fetcher, ...) services.MTOShipmentCreator
- func NewMTOShipmentCreatorV2(builder createMTOShipmentQueryBuilder, fetcher services.Fetcher, ...) services.MTOShipmentCreator
- func NewMTOShipmentFetcher() services.MTOShipmentFetcher
- func NewMTOShipmentStatusUpdater(builder UpdateMTOShipmentQueryBuilder, ...) services.MTOShipmentStatusUpdater
- func NewMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, ...) services.MTOShipmentUpdater
- func NewOfficeMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, ...) services.MTOShipmentUpdater
- func NewPrimeMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, ...) services.MTOShipmentUpdater
- func NewPrimeShipmentDeleter(moveTaskOrderUpdater services.MoveTaskOrderUpdater) services.ShipmentDeleter
- func NewShipmentApprover(router services.ShipmentRouter, siCreator services.MTOServiceItemCreator, ...) services.ShipmentApprover
- func NewShipmentBillableWeightCalculator() services.ShipmentBillableWeightCalculator
- func NewShipmentCancellationRequester(router services.ShipmentRouter, moveRouter services.MoveRouter) services.ShipmentCancellationRequester
- func NewShipmentDeleter(moveTaskOrderUpdater services.MoveTaskOrderUpdater, ...) services.ShipmentDeleter
- func NewShipmentDiversionApprover(router services.ShipmentRouter, moveRouter services.MoveRouter) services.ShipmentDiversionApprover
- func NewShipmentDiversionRequester(router services.ShipmentRouter) services.ShipmentDiversionRequester
- func NewShipmentRejecter(router services.ShipmentRouter) services.ShipmentRejecter
- func NewShipmentReweighRequester() services.ShipmentReweighRequester
- func NewShipmentRouter() services.ShipmentRouter
- func UpdateDestinationSITServiceItemsAddress(appCtx appcontext.AppContext, shipment *models.MTOShipment) error
- func UpdateDestinationSITServiceItemsSITDeliveryMiles(planner route.Planner, appCtx appcontext.AppContext, ...) error
- func UpdateOriginSITServiceItemSITDeliveryMiles(planner route.Planner, shipment *models.MTOShipment, ...) (*models.MTOServiceItems, error)
- func UpdateSITServiceItemDestinationAddressToMTOShipmentAddress(mtoServiceItems *models.MTOServiceItems, newAddress *models.Address, ...) (*models.MTOServiceItems, error)
- type ConflictStatusError
- type StaleIdentifierError
- type UpdateMTOShipmentQueryBuilder
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 ¶
func NewCustomerMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, planner route.Planner, moveRouter services.MoveRouter, moveWeights services.MoveWeights, sender notifications.NotificationSender, recalculator services.PaymentRequestShipmentRecalculator, addressUpdater services.AddressUpdater, addressCreator services.AddressCreator) services.MTOShipmentUpdater
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 ¶
func NewMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, planner route.Planner, moveRouter services.MoveRouter, moveWeights services.MoveWeights, sender notifications.NotificationSender, recalculator services.PaymentRequestShipmentRecalculator, addressUpdater services.AddressUpdater, addressCreator services.AddressCreator) services.MTOShipmentUpdater
NewMTOShipmentUpdater creates a new struct with the service dependencies
func NewOfficeMTOShipmentUpdater ¶
func NewOfficeMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, planner route.Planner, moveRouter services.MoveRouter, moveWeights services.MoveWeights, sender notifications.NotificationSender, recalculator services.PaymentRequestShipmentRecalculator, addressUpdater services.AddressUpdater, addressCreator services.AddressCreator) services.MTOShipmentUpdater
func NewPrimeMTOShipmentUpdater ¶
func NewPrimeMTOShipmentUpdater(builder UpdateMTOShipmentQueryBuilder, _ services.Fetcher, planner route.Planner, moveRouter services.MoveRouter, moveWeights services.MoveWeights, sender notifications.NotificationSender, recalculator services.PaymentRequestShipmentRecalculator, addressUpdater services.AddressUpdater, addressCreator services.AddressCreator) services.MTOShipmentUpdater
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, moveWeights services.MoveWeights) 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, moveRouter services.MoveRouter) services.ShipmentCancellationRequester
NewShipmentCancellationRequester creates a new struct with the service dependencies
func NewShipmentDeleter ¶
func NewShipmentDeleter(moveTaskOrderUpdater services.MoveTaskOrderUpdater, moveRouter services.MoveRouter) services.ShipmentDeleter
NewShipmentDeleter creates a new struct with the service dependencies
func NewShipmentDiversionApprover ¶
func NewShipmentDiversionApprover(router services.ShipmentRouter, moveRouter services.MoveRouter) 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
Source Files ¶
- mto_shipment_address_updater.go
- mto_shipment_creator.go
- mto_shipment_fetcher.go
- mto_shipment_updater.go
- rules.go
- shipment_approver.go
- shipment_billable_weight.go
- shipment_cancellation_requester.go
- shipment_deleter.go
- shipment_diversion_approver.go
- shipment_diversion_requester.go
- shipment_rejecter.go
- shipment_reweigh_requester.go
- shipment_router.go
- validation.go