Package org.broadleafcommerce.core.offer.domain

Examples of org.broadleafcommerce.core.offer.domain.OfferImpl$Presentation$Tab


public class OfferDataProvider {

    @DataProvider(name = "offerDataProvider")
    public static Object[][] provideBasicOffer(){
        List<Offer> allOffers = new ArrayList<Offer>();
        OfferImpl o = new OfferImpl();
        o.setDiscountType(OfferDiscountType.AMOUNT_OFF);
        o.setValue(new BigDecimal("5.00"));
        o.setName("Some test offer");
        o.setPriority(100);
        o.setStackable(true);
        o.setStartDate(SystemTime.asDate());
        o.setEndDate(new Date(SystemTime.asMillis()+100000000));
        o.setApplyDiscountToMarkedItems(false);
        o.setTargetSystem("WEB");
        o.setType(OfferType.ORDER_ITEM);
        o.setAppliesToOrderRules(
                "package org.broadleafcommerce.core.offer.service;"+
                "import org.broadleafcommerce.core.offer.domain.Offer;"+
                "import org.broadleafcommerce.core.order.domain.Order;"+
                "import org.broadleafcommerce.core.order.domain.OrderItem;"+
                "import org.broadleafcommerce.type.OfferType;"+
                "import java.util.List;"+
                "global List orderItems;"+
                "global List offerPackages;"+
                "rule \"Offer 1 Rule\" "+
                "salience 100"+
                "when "+
                "  orderItem : OrderItem(sku == 1) "+
                "  "+
                " then"+
                "   System.err.println(\"applying offer 1\");"+
                "   orderItem.addRulesCandidateOffer"+
        "end");

        allOffers.add(o);
        o = new OfferImpl();
        o.setDiscountType(OfferDiscountType.AMOUNT_OFF);
        o.setValue(new BigDecimal("5.00"));
        o.setName("Second test offer");
        o.setPriority(100);
        o.setStackable(false);
        o.setStartDate(SystemTime.asDate());
        o.setEndDate(new Date(SystemTime.asMillis()+100000000));
        o.setApplyDiscountToMarkedItems(false);
        o.setTargetSystem("WEB");
        o.setType(OfferType.FULFILLMENT_GROUP);
        o.setAppliesToOrderRules(
                "package org.broadleafcommerce.core.offer.service;"+
                "import org.broadleafcommerce.core.offer.domain.Offer;"+
                "import org.broadleafcommerce.core.order.domain.Order;"+
                "import org.broadleafcommerce.core.order.domain.OrderItem;"+
                "import org.broadleafcommerce.type.OfferType;"+
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.core.offer.domain.OfferImpl$Presentation$Tab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.