ppmshipment

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

Documentation

Index

Constants

View Source
const (
	// EagerPreloadAssociationShipment is the name of the association for the shipment
	EagerPreloadAssociationShipment = "Shipment"
	// EagerPreloadAssociationServiceMember is the name of the association for the service member
	EagerPreloadAssociationServiceMember = "Shipment.MoveTaskOrder.Orders.ServiceMember"
	// EagerPreloadAssociationWeightTickets is the name of the association for the weight tickets
	EagerPreloadAssociationWeightTickets = "WeightTickets"
	// EagerPreloadAssociationProgearWeightTickets is the name of the association for the pro-gear weight tickets
	EagerPreloadAssociationProgearWeightTickets = "ProgearWeightTickets"
	// EagerPreloadAssociationMovingExpenses is the name of the association for the moving expenses
	EagerPreloadAssociationMovingExpenses = "MovingExpenses"
	// EagerPreloadAssociationW2Address is the name of the association for the W2 address
	EagerPreloadAssociationW2Address = "W2Address"
	// EagerPreloadAssociationAOAPacket is the name of the association for the AOA packet
	EagerPreloadAssociationAOAPacket = "AOAPacket"
	// EagerPreloadAssociationPaymentPacket is the name of the association for the payment packet
	EagerPreloadAssociationPaymentPacket = "PaymentPacket"
	// EagerPreloadAssociationPickupAddress is the name of the association for the Pickup address
	EagerPreloadAssociationPickupAddress = "PickupAddress"
	// EagerPreloadAssociationSecondaryPickupAddress is the name of the association for the Secondary Pickup address
	EagerPreloadAssociationSecondaryPickupAddress = "SecondaryPickupAddress"
	// EagerPreloadAssociationDestinationAddress is the name of the association for the Destination address
	EagerPreloadAssociationDestinationAddress = "DestinationAddress"
	// EagerPreloadAssociationSecondaryDestinationAddress is the name of the association for the Secondary Destination address
	EagerPreloadAssociationSecondaryDestinationAddress = "SecondaryDestinationAddress"
)

These are helper constants for requesting eager preload associations

View Source
const (
	// PostLoadAssociationSignedCertification is the name of the association for the signed certification
	PostLoadAssociationSignedCertification = "SignedCertification"
	// PostLoadAssociationWeightTicketUploads is the name of the association for the weight ticket uploads
	PostLoadAssociationWeightTicketUploads = "WeightTicketUploads"
	// PostLoadAssociationProgearWeightTicketUploads is the name of the association for the pro-gear weight ticket uploads
	PostLoadAssociationProgearWeightTicketUploads = "ProgearWeightTicketUploads"
	// PostLoadAssociationMovingExpenseUploads is the name of the association for the moving expense uploads
	PostLoadAssociationMovingExpenseUploads = "MovingExpenseUploads"
	// PostLoadAssociationUploadedOrders is the name of the association for the orders uploaded by the service member
	PostLoadAssociationUploadedOrders = "UploadedOrders"
)

These are helper constants for requesting post load associations, meaning associations that can't be eager pre-loaded due to bugs in pop

Variables

View Source
var PPMShipmentUpdaterChecks = []ppmShipmentValidator{
	checkShipmentType(),
	checkShipmentID(),
	checkPPMShipmentID(),
	checkRequiredFields(),
	checkAdvanceAmountRequested(),
}

Functions

func BaseServiceItems

func BaseServiceItems(mtoShipmentID uuid.UUID) []models.MTOServiceItem

baseServiceItems returns a list of the MTOServiceItems that makeup the price of the estimated incentive. These are the same non-accesorial service items that get auto-created and approved when the TOO approves an HHG shipment.

func CalculateSITCost

func CalculateSITCost(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, error)

func FetchPPMShipmentFromMTOShipmentID

func FetchPPMShipmentFromMTOShipmentID(appCtx appcontext.AppContext, mtoShipmentID uuid.UUID) (*models.PPMShipment, error)

func FindPPMShipment

func FindPPMShipment(appCtx appcontext.AppContext, id uuid.UUID) (*models.PPMShipment, error)

FindPPMShipment returns a PPMShipment with associations by ID

func FindPPMShipmentAndWeightTickets

func FindPPMShipmentAndWeightTickets(appCtx appcontext.AppContext, id uuid.UUID) (*models.PPMShipment, error)

func FindPPMShipmentByMTOID

func FindPPMShipmentByMTOID(appCtx appcontext.AppContext, mtoID uuid.UUID) (*models.PPMShipment, error)

func FindPPMShipmentWithDocument

func FindPPMShipmentWithDocument(appCtx appcontext.AppContext, ppmShipmentID uuid.UUID, documentID uuid.UUID) error

func GetListOfAllPostloadAssociations

func GetListOfAllPostloadAssociations() []string

GetListOfAllPostloadAssociations returns all associations for a PPMShipment that can't be eagerly preloaded due to bugs in pop

func GetListOfAllPreloadAssociations

func GetListOfAllPreloadAssociations() []string

GetListOfAllPreloadAssociations returns all associations for a PPMShipment that can be eagerly preloaded for ease of use.

func IsPrimeCounseledPPM

func IsPrimeCounseledPPM(appCtx appcontext.AppContext, mtoShipmentID uuid.UUID) (bool, error)

returns true if moves orders are from a location that does not provide service counseling

func MapPPMShipmentEstimatedFields

func MapPPMShipmentEstimatedFields(ppmShipment models.PPMShipment) models.MTOShipment

mapPPMShipmentEstimatedFields remaps our PPMShipment specific information into the fields where the service param lookups expect to find them on the MTOShipment model. This is only in-memory and shouldn't get saved to the database.

func MapPPMShipmentFinalFields

func MapPPMShipmentFinalFields(ppmShipment models.PPMShipment, totalWeight unit.Pound) models.MTOShipment

mapPPMShipmentFinalFields remaps our PPMShipment specific information into the fields where the service param lookups expect to find them on the MTOShipment model. This is only in-memory and shouldn't get saved to the database.

func NewAOAPacketCreator

func NewAOAPacketCreator(
	sswPPMGenerator services.SSWPPMGenerator,
	sswPPMComputer services.SSWPPMComputer,
	primeDownloadMoveUploadPDFGenerator services.PrimeDownloadMoveUploadPDFGenerator,
	userUploader *uploader.UserUploader,
	pdfGenerator *paperwork.Generator,
) services.AOAPacketCreator

NewAOAPacketCreator creates a new AOAPacketCreator with all of its dependencies

func NewEstimatePPM

func NewEstimatePPM(planner route.Planner, paymentRequestHelper paymentrequesthelper.Helper) services.PPMEstimator

NewEstimatePPM returns the estimatePPM (pass in checkRequiredFields() and checkEstimatedWeight)

func NewPPMDocumentFetcher

func NewPPMDocumentFetcher() services.PPMDocumentFetcher

NewPPMDocumentFetcher creates a new struct

func NewPPMShipmentCreator

func NewPPMShipmentCreator(estimator services.PPMEstimator, addressCreator services.AddressCreator) services.PPMShipmentCreator

NewPPMShipmentCreator creates a new struct with the service dependencies

func NewPPMShipmentFetcher

func NewPPMShipmentFetcher() services.PPMShipmentFetcher

NewPPMShipmentFetcher creates a new PPMShipmentFetcher

func NewPPMShipmentNewSubmitter

func NewPPMShipmentNewSubmitter(
	ppmShipmentFetcher services.PPMShipmentFetcher,
	signedCertificationCreator services.SignedCertificationCreator,
	ppmShipmentRouter services.PPMShipmentRouter,
) services.PPMShipmentNewSubmitter

NewPPMShipmentNewSubmitter creates a new ppmShipmentNewSubmitter

func NewPPMShipmentReviewDocuments

func NewPPMShipmentReviewDocuments(
	ppmShipmentRouter services.PPMShipmentRouter,
) services.PPMShipmentReviewDocuments

NewPPMShipmentReviewDocuments creates a new ppmShipmentReviewDocuments

func NewPPMShipmentRouter

func NewPPMShipmentRouter(shipmentRouter services.ShipmentRouter) services.PPMShipmentRouter

NewPPMShipmentRouter creates a new ppmShipmentRouter

func NewPPMShipmentUpdatedSubmitter

func NewPPMShipmentUpdatedSubmitter(
	signedCertificationUpdater services.SignedCertificationUpdater,
	ppmShipmentRouter services.PPMShipmentRouter,
) services.PPMShipmentUpdatedSubmitter

NewPPMShipmentUpdatedSubmitter creates a new ppmShipmentUpdatedSubmitter

func NewPPMShipmentUpdater

func NewPPMShipmentUpdater(ppmEstimator services.PPMEstimator, addressCreator services.AddressCreator, addressUpdater services.AddressUpdater) services.PPMShipmentUpdater

func NewPaymentPacketCreator

func NewPaymentPacketCreator(
	ppmShipmentFetcher services.PPMShipmentFetcher,
	pdfGenerator *paperwork.Generator,
	aoaPacketCreator services.AOAPacketCreator,
) services.PaymentPacketCreator

NewPaymentPacketCreator creates a new PaymentPacketCreator with all of its dependencies

func StorageServiceItems

func StorageServiceItems(mtoShipmentID uuid.UUID, locationType models.SITLocationType, additionalDaysInSIT int) []models.MTOServiceItem

func SumWeightTickets

func SumWeightTickets(ppmShipment, newPPMShipment models.PPMShipment) (originalTotalWeight, newTotalWeight unit.Pound)

SumWeightTickets return the total weight of all weightTickets associated with a PPMShipment, returns 0 if there is no valid weight

Types

This section is empty.

Jump to

Keyboard shortcuts

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