Broadleaf Microservices
  • v1.0.0-latest-prod

Fulfillment Validation Checkout Workflow Activity

Overview

By default, this activity will validate that:

Tip
To disable the requirement for at least one fulfillment group to be present, use the property: broadleaf.cartoperation.validation.fulfillment.checkout.fulfillment-group-required=false

Additionally, more validation may apply to each fulfillment group of a specific type using the appropriate TypeFulfillmentGroupSubmitValidators.

Validators

FulfillmentGroupSubmitValidator

Overview

Performs validation for a fulfillment group. This mainly delegates to other validators that are able to validate with more specific conditions. These include

TypeFulfillmentGroupSubmitValidators

These validators handle validation for specific fulfillment types:

  • ShipTypeFulfillmentGroupSubmitValidator: Handles SHIP fulfillment groups

  • PickupTypeFulfillmentGroupSubmitValidator: Handles PICKUP fulfillment groups

  • VirtualTypeFulfillmentGroupSubmitValidator: Handles VIRTUAL fulfillment groups

    • Has no special requirements

FulfillmentAddressSubmitValidators

FulfillmentAddressSubmitValidators perform validation against the fulfillment groups' addresses as needed. By default, only one is configured: DefaultFulfillmentAddressSubmitValidator. It defines a valid address as having:

  • A non-empty full name

  • A non-empty email address

  • A non-empty address line 1

  • A non-empty city

  • A non-empty country

  • A non-empty state, province, region, or other subdivision

  • A non-empty postal code

  • A non-empty primary phone number

Tip
Out of box, there is no validation for FulfillmentOptions (e.g., standard, business, express) and fulfillment items. However, interfaces are provided so that custom implementations may be added without having to modify existing code.

FulfillmentItemSubmitValidators

Validate submitted fulfillment items of a fulfillment group. None are provided out-of-box.

FulfillmentOptionSubmitValidators

Validates the FulfillmentOption of a fulfillment group. None are provided out-of-box.

FulfillmentOption

A fulfillment option is used to hold information about a particular type of fulfillment implementation. Third-party fulfillment implementations should extend this to provide their own configuration options particular to that implementation. For instance, a UPS shipping calculator might want an admin user to be able to specify which type of UPS shipping this FulfillmentOption represents.

Options might include standard shipping, express, same-day, etc.

PricedFulfillmentOptionSubmitValidator

Note
Since 1.8.9-GA (Release Train 1.8.2-GA)

Validates that a PricedFulfillmentGroup is present on the FulfillmentGroup or each FulfillmentItem within the group. Can be enabled with broadleaf.cartoperation.validation.fulfillment.validator.priced-fulfillment-option.enabled=true and the hint PRICED_FULFILLMENT_OPTION.

PricedFulfillmentOption

A PricedFulfillmentOption is used to hold information about the price and type of fulfillment.

PricedFulfillmentOptions can apply to both FulfillmentGroups and FulfillmentItems, though not at the same time.

The "Service Level" of a PricedFulfillmentOption is the specific method of fulfillment, such as "STANDARD" or "EXPRESS".

Configuration

Base Properties

  • broadleaf.cartoperation.validation.fulfillment.validator.address.enabled: Enable or disable the out-of-box fulfillment address validator.

  • broadleaf.cartoperation.validation.fulfillment.validator.ship-type.enabled: Enable or disable the out-of-box SHIP typed fulfillment group validator.

  • broadleaf.cartoperation.validation.fulfillment.validator.pickup-type.enabled: Enable or disable the out-of-box PICKUP typed fulfillment group validator.

  • broadleaf.cartoperation.validation.fulfillment.validator.virtual-type.enabled: Enable or disable the out-of-box VIRTUAL typed fulfillment group validator.

  • broadleaf.cartoperation.validation.fulfillment.validator.fulfillment-group.enabled: Enable or disable the out-of-box fulfillment group validator.

Validation Hints

Many of the out of box fields can have their validation enabled or disabled with hints. Hints can be specified in the code or using a configuration file:

broadleaf:
  cartoperation:
    validation:
      fulfillment:
        checkout:
          hints:
            - EMAIL_NOT_REQUIRED
            - PRICING_NOT_REQUIRED
            - VALIDATE_FIRST_AND_LAST
            - PHONE_PRIMARY_NOT_REQUIRED
            - PRICED_FULFILLMENT_OPTION

There are:

Fulfillment Group Hints

  • ALLOW_NO_ITEMS: indicates that a fulfillment group with no items is still considered valid.

  • ALLOW_NO_OPTION: indicates the FulfillmentOption may be null and considered still valid.

  • PRICING_NOT_REQUIRED: indicates that the prices are not yet expected to be set on the fulfillment group.

  • SKIP_ITEM_VALIDATION: tells the validator to skip any validation regarding fulfillment items of the group.

  • SKIP_OPTION_VALIDATION: tells the validator to skip any validation of the FulfillmentOption of the group.

  • SKIP_TYPE_SPECIFIC_VALIDATION: tells the validator to skip performing any type specific validation normally performed by type-specific fulfillment group validators. See the section on "Fulfillment Group Type Validators".

  • PRICED_FULFILLMENT_OPTION: indicate that PricedFulfillmentOptions should be validated instead of FulfillmentOptions.

Fulfillment Group Type Hints

  • FORCE_ADDRESS_VALIDATION: tells the validator to force address validation regardless of whether the type this validator supports typically does fulfillment address validation.

  • SKIP_ADDRESS_VALIDATION: tells the validator to skip the address validation regardless of whether the type this validator supports typically does fulfillment address validation.

Fulfillment Group Address Hints

  • CITY_NOT_REQUIRED: tells the validator that the city name is not required.

  • COMPANY_NAME_REQUIRED: tells the validator that the company name is required.

  • COUNTY_REQUIRED: tells the validator that the county is required.

  • EMAIL_REQUIRED: tells the validator that the email address is required.

  • COUNTRY_NOT_REQUIRED: tells the validator that the country is not required.

  • STATE_PROVINCE_REGION_NOT_REQUIRED: tells the validator that the state/province/region is not required.

  • PHONE_PRIMARY_NOT_REQUIRED: tells the validator that the primary phone number is not required.

  • POSTAL_CODE_NOT_REQUIRED: tells the validator that the postal code is not required.

  • VALIDATE_FIRST_AND_LAST: tells the validator to validate the first and last name individually as opposed to the full name.