ilscipio/scipio-erp

View on GitHub
applications/order/servicedef/services_shoppinglist.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
    <description>Order Services</description>
    <vendor>OFBiz</vendor>
    <version>1.0</version>

    <!-- Shopping List Services -->
    <service name="shoppingListInterface" engine="interface" location="" invoke="">
        <description>Shopping List Interface</description>
        <auto-attributes mode="IN" entity-name="ShoppingList" include="nonpk" optional="true"/>
        <attribute name="shippingMethodString" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createShoppingList" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="createShoppingList">
        <description>Create a shopping list entity</description>
        <implements service="createShoppingListRecurrence"/>
        <implements service="shoppingListInterface"/>
        <attribute name="shoppingListId" type="String" mode="OUT" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="OUT" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId (may be null) -->
    </service>
    <!-- SCIPIO: NOTE: Removed login requirement thanks to shoppingListAuthToken, for services that now verify it -->
    <service name="updateShoppingList" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="updateShoppingList">
        <description>Update a shopping list entity</description>
        <implements service="createShoppingListRecurrence"/>
        <implements service="shoppingListInterface"/>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
    </service>
    <service name="removeShoppingList" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="removeShoppingList">
        <description>Remove a shopping list entity</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
    </service>
    <service name="calculateShoppingListDeepTotalPrice" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="calculateShoppingListDeepTotalPrice">
        <description>Remove a shopping list entity</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="prodCatalogId" type="String" mode="IN" optional="false"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreGroupId" type="String" mode="IN" optional="true"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="currencyUomId" type="String" mode="IN" optional="true"/>
        <attribute name="autoUserLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
        <attribute name="totalPrice" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <service name="runShoppingListAutoReorder" engine="java" auth="true" use-transaction="false"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="createListReorders">
        <description>A service designed to be automatically run by job scheduler to create orders from auto-order shopping lists.
            This is done by looking for all auto-order shopping lists which are active
            comparing the lastOrderedDate and the defined recurrenceInfo with the time when the service is run.</description>
    </service>
    <service name="createShoppingListRecurrence" engine="java" auth="true"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="setShoppingListRecurrence">
        <description>Creates Recurrence Info For Auto-Reorder Lists</description>
        <attribute name="startDateTime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="endDateTime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="frequency" type="Integer" mode="IN" optional="true"/>
        <attribute name="intervalNumber" type="Integer" mode="IN" optional="true"/>
        <attribute name="recurrenceInfoId" type="String" mode="OUT" optional="true"/>
    </service>
    <service name="splitShipmentMethodString" engine="java" auth="false"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="splitShipmentMethodString">
        <description>Splits the shipping method string</description>
        <attribute name="shippingMethodString" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentMethodTypeId" type="String" mode="OUT" optional="true"/>
        <attribute name="carrierPartyId" type="String" mode="OUT" optional="true"/>
    </service>
    <service name="makeShoppingListFromOrder" engine="java" auth="true"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="makeListFromOrder">
        <description>Create/Update a shopping list from an order</description>
        <implements service="createShoppingListRecurrence"/>
        <attribute name="shoppingListTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="shoppingListId" type="String" mode="INOUT" optional="true"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="shoppingListItemInterface" engine="interface" location="" invoke="">
        <description>Interface of shopping list items</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="modifiedPrice" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="reservStart" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="reservLength" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="reservPersons" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="quantityPurchased" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="configId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createShoppingListItem" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="createShoppingListItem">
        <description>Create a shopping list item</description>
        <implements service="shoppingListItemInterface"/>
        <attribute name="shoppingListId" type="String" mode="INOUT" optional="true"/><!-- SCIPIO: Switched to INOUT because ECA may create a ShoppingList -->
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
        <attribute name="productStoreId" type="String" mode="INOUT" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListItemSeqId" type="String" mode="OUT" optional="false"/>
    </service>
    <!-- SCIPIO: NOTE: Removed login requirement thanks to shoppingListAuthToken, for services that now verify it -->
    <service name="updateShoppingListItem" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="updateShoppingListItem">
        <description>Update a shopping list item</description>
        <implements service="shoppingListItemInterface"/>
        <attribute name="shoppingListItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
    </service>
    <service name="removeShoppingListItem" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="removeShoppingListItem">
        <description>Remove a shopping list item</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
    </service>
    <service name="addSuggestionsToShoppingList" engine="simple" auth="true"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="addSuggestionsToShoppingList">
        <description>Add suggestions to a shopping list</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>
    <service name="addDistinctShoppingListItem" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml" invoke="addDistinctShoppingListItem">
        <description>Adds a shopping list item if one with the same productId does not exist</description>
        <implements service="shoppingListItemInterface"/>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true"/><!-- SCIPIO: Allows modification of lists without partyId -->
        <attribute name="productStoreId" type="String" mode="INOUT" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListItemSeqId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="autoDeleteAutoSaveShoppingListAlways" engine="java" auth="true" use-transaction="false"
             location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="autoDeleteAutoSaveShoppingList">
        <!-- SCIPIO: removed max-retry="3" and now manual transaction handling -->
        <description>
            Automatic delete auto save shopping list for anonymous users that are not updated in last 30 days.
            Default to 30 days unless no configuration is specified.
            SCIPIO: This service now also deletes expired regular anonymous wishlists by default.
        </description>
        <!-- SCIPIO: new options -->
        <attribute name="deleteAutoSaveList" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="deleteAnonWishList" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="sepTransBatch" type="Integer" mode="IN" optional="true" default-value="100">
            <description>The number of shopping lists to include in a deletion transaction (0 disables separate transactions)</description>
        </attribute>
    </service>

    <service name="autoDeleteAutoSaveShoppingList" engine="java" auth="true" use-transaction="false" semaphore="fail"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="autoDeleteAutoSaveShoppingList">
        <description>
            Automatic delete auto save shopping list for anonymous users that are not updated in last 30 days.
            Default to 30 days unless no configuration is specified.
            SCIPIO: This service now also deletes expired regular anonymous wishlists by default, and this
            version uses a semaphore.
        </description>
        <implements service="autoDeleteAutoSaveShoppingListAlways"/>
    </service>

    <service name="createShoppingListItemSurvey" default-entity-name="ShoppingListItemSurvey" engine="entity-auto" invoke="create" auth="true">
        <description>Create a ShoppingListItemSurvey Record</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteShoppingListItemSurvey" default-entity-name="ShoppingListItemSurvey" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a ShoppingListItemSurvey Record</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>

    <service name="createShoppingListType" default-entity-name="ShoppingListType" engine="entity-auto" invoke="create" auth="true">
        <description>Create a ShoppingListType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateShoppingListType" default-entity-name="ShoppingListType" engine="entity-auto" invoke="update" auth="true">
        <description>Update a ShoppingListType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteShoppingListType" default-entity-name="ShoppingListType" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a ShoppingListType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="convertAnonShoppingListToRegistered" engine="java" auth="true"
             location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="convertAnonShoppingListToRegistered">
        <description>Converts an anonymous/guest ShoppingList to a registered one (auth token switched with partyId) (SCIPIO)</description>
        <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
        <attribute name="shoppingListAuthToken" type="String" mode="IN" optional="true">
            <description>NOTE: Required if userLogin is non-admin</description>
        </attribute>
        <attribute name="targetUserLogin" type="GenericValue" mode="IN" optional="true"/>
    </service>
</services>