Overview: With preferences complete we need to default the shipping preferences / comments to what the user has asked for. The database will decide what the preferences will be in a dedicated routine. The UI will need to call this routine for each bundle returned, and every time a new bundle is created either by merging or splitting bundles.
Processing:
Create a new method in the CommentsRepository named GetDefaults:
- Parameters:
- BILLTO.NBR – Sent in BaseParameters
- CUST.NBR – Ship To Customer Number selected from step one of the checkout.
- LTL.FLAG – Boolean saying if the bundle would be shipped via an LTL(Less than TruckLoad)
- Returns:
- CommentsCollection
In CheckoutShippingStepModel.InitiateStep
- Note: The default comments are not based on bundle information so we could get 2 hits to the database. We should have 2 collections we can pull from one for LTL True and one for LTL False.
- In the loop for each bundle,
- Check if the Default comment collection is initialized for the current bundle’s LTL flag. If that collection is not initialized, call to CommentsRepository.GetDefaults to initialize it.
- Set the current bundle’s BundleComments to the copy the default comment collection based on the LTL flag.