package com.braintree.actions.consignment;

import de.hybris.platform.basecommerce.enums.ConsignmentStatus;
import de.hybris.platform.ordersplitting.model.ConsignmentModel;
import de.hybris.platform.ordersplitting.model.ConsignmentProcessModel;
import de.hybris.platform.processengine.action.AbstractProceduralAction;

public class BrainTreeCancelConsignmentAction extends AbstractProceduralAction<ConsignmentProcessModel> {

    @Override
    public void executeAction(final ConsignmentProcessModel process) {
        final ConsignmentModel consignment = process.getConsignment();
        if (consignment != null) {
            consignment.setStatus(ConsignmentStatus.CANCELLED);
            getModelService().save(consignment);
        }
    }

}
