Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion component.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/moqui-conf-2.1.xsd"
name="moqui-tutorial" version="1.0.0">
<depends-on name="mantle"/>
<depends-on name="mantle-udm"/>
<depends-on name="mantle-usl"/>
</component>
51 changes: 51 additions & 0 deletions service/order.rest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/rest-api-3.xsd"
name="order" displayName="Order Actions API" version="2.0.0">
<resource name="orders" require-authentication="anonymous-all">
<!-- <method type="get"><entity name="mantle.order.OrderHeader" operation="list"/></method>-->
<method type="get"><service name="tutorial.order.OrderServices.get#OrderHeadersByStatus"/></method>

<resource name="person" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#FemalePersons"/></method>
</resource>

<resource name="person2" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#Persons"/></method>
</resource>

<resource name="order1" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#LatestOrder"/></method>
</resource>

<resource name="order2" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#Order"/></method>
</resource>

<resource name="order3" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderHeaders"/></method>
</resource>

<resource name="order4" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderItems"/></method>
</resource>

<resource name="order5" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderParts"/></method>
</resource>

<resource name="order6" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderPartData"/></method>
</resource>

<resource name="order7" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderPartsCount"/></method>
</resource>

<resource name="order8" require-authentication="anonymous-all">
<method type="get"><service name="tutorial.order.OrderServices.get#OrderPartsInfo"/></method>
</resource>

</resource>



</resource>
151 changes: 151 additions & 0 deletions service/tutorial/order/OrderServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,159 @@
<entity-find entity-name="mantle.order.OrderHeader" list="ordersList">
<econdition field-name="statusId"/>
</entity-find>
<!-- The ordersList will be returned as the output. -->
</actions>
</service>

<service verb="get" noun="FemalePersons">
<description>
Find all Person records for all females.
</description>
<out-parameters>
<parameter name="personsList"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.party.Person" list="personsList">
<econdition field-name="gender" value="female"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="Persons">
<description>
List the Person details with MarsMarried marital status.
</description>
<out-parameters>
<parameter name="personsList"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.party.Person" list="personsList">
<econdition field-name="maritalStatusEnumId" value="MarsMarried"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="LatestOrder">
<description>
Find all Order Header records so that the latest placed order appears at the top.
</description>
<out-parameters>
<parameter name="ordersList"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderHeader" list="ordersList">
<order-by field-name="-statusId"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="Order">
<description>
Service to get OrderHeader records based on the given OrderId.
</description>
<in-parameters>
<parameter name="orderId" default-value="OrderApproved">
</parameter>
</in-parameters>
<out-parameters>
<parameter name="orderDetails"/>
</out-parameters>
<actions>
<!-- Find OrderHeader records -->
<entity-find entity-name="mantle.order.OrderHeader" list="orderDetails">
<econdition field-name="orderId"/>
</entity-find>
<!-- The ordersList will be returned as the output. -->
</actions>
</service>

<service verb="get" noun="OrderHeaders" >
<description>
Find all Order Header records with the grandTotal greater than 50.
</description>
<out-parameters>
<parameter name="orderHeaderDetails"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderHeader" list="orderHeaderDetails">
<econdition field-name="grandTotal" operator="greater" value="50"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="OrderItems">
<description>
List all Order Item details for the order with orderId, 100102 and orderPartSeqId, 01.
</description>
<out-parameters>
<parameter name="orderItemDetails"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderItem" list="orderItemDetails">
<econdition field-name="orderId" value="100102"/>
<econdition field-name="orderPartSeqId" value="01"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="OrderParts">
<description>
Find all Order Parts with partTotal less than equals to 20.
</description>
<out-parameters>
<parameter name="orderPartDetails"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderPart" list="orderPartDetails">
<econdition field-name="partTotal" operator="less-equals" value="20"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="OrderPartData">
<description>
Find all Order Part records assigned to the facility with ZIRET_WH value
</description>
<out-parameters>
<parameter name="orderPartDetails"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderPart" list="orderPartDetails">
<econdition field-name="facilityId" value="ZIRET_WH"/>
<select-field field-name="orderId"/>
<select-field field-name="facilityId"/>
<select-field field-name="partName"/>
<select-field field-name="customerPartyId"/>
</entity-find>
</actions>
</service>

<service verb="get" noun="OrderPartsCount">
<description>
Find the count of order parts for the customerPartyId, “CustJqp”.
</description>
<out-parameters>
<parameter name="orderPartsCount"/>
</out-parameters>
<actions>
<entity-find-count entity-name="mantle.order.OrderPart" count-field="orderPartsCount" >
<econdition field-name="customerPartyId" value="CustJqp"/>
</entity-find-count>
</actions>
</service>

<service verb="get" noun="OrderPartsInfo">
<description>
Find all unique Order Parts with shipmentMethodEnumId value as “ShtMthGround” and facilityId as “ZIRET_WH”.
</description>
<out-parameters>
<parameter name="orderPartsList"/>
</out-parameters>
<actions>
<entity-find entity-name="mantle.order.OrderPart" list="orderPartsList" >
<econdition field-name="facilityId" value="ZIRET_WH"/>
<econdition field-name="shipmentMethodEnumId" value="ShtMthGround"/>
</entity-find>
</actions>
</service>
</services>