Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5 api get cycle count for given identifier #13

Merged
merged 3 commits into from
Jun 24, 2024
Merged
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
35 changes: 35 additions & 0 deletions service/co/hotwax/cycleCount/InventoryCountServices.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/service-definition-3.xsd">

<service verb="create" noun="InvCountImportStatus" type="entity-auto">
<description>Service to create an Inventory Count Import Status history.</description>
<in-parameters><auto-parameters entity-name="co.hotwax.warehouse.InvCountImportStatus" include="all"/></in-parameters>
</service>

<service verb="create" noun="InventoryCountImport">
<description>Service to create an Inventory Count Import and status history.</description>
<in-parameters>
<auto-parameters entity-name="co.hotwax.warehouse.InventoryCountImport" include="nonpk">
<exclude field-name="uploadedByUserLogin"/>
<exclude field-name="createdDate"/>
<exclude field-name="lastUpdatedStamp"/>
</auto-parameters>
</in-parameters>
<out-parameters>
<auto-parameters entity-name="co.hotwax.warehouse.InventoryCountImportView" include="all"/>
</out-parameters>
<actions>
<entity-make-value entity-name="co.hotwax.warehouse.InventoryCountImport" value-field="countImport" map="context"/>
<entity-sequenced-id-primary value-field="countImport"/>
<set field="countImport.uploadedByUserLogin" from="ec.user.userId"/>
<entity-create value-field="countImport"/>

<if condition="context.statusId">
<set field="nowDate" from="ec.user.nowTimestamp"/>
<service-call name="create#InvCountImportStatus" in-map="[statusId:context.statusId, inventoryCountImportId:countImport.inventoryCountImportId, statusDate:nowDate, changeByUserLoginId:countImport.uploadedByUserLogin]"/>
</if>
<entity-find-one entity-name="co.hotwax.warehouse.InventoryCountImportView" value-field="countImportView"/>
<script>context.putAll(countImportView.getMap())</script>
</actions>
</service>
</services>
8 changes: 8 additions & 0 deletions service/inventorycount.rest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@

<!-- Inventory Cycle Count API:
** GET /inventory-cycle-count/cycleCounts - get all inventory cycle count import, use filters like status, facility, createdDate
** POST /inventory-cycle-count/cycleCounts - create new inventory cycle count import
-->
<resource name="cycleCounts">
<method type="get"><entity name="co.hotwax.warehouse.InventoryCountImportView" operation="list"/></method>
<method type="post"><service name="co.hotwax.cycleCount.InventoryCountServices.create#InventoryCountImport"/></method>
<!-- Inventory Cycle Count API:
** GET /inventory-cycle-count/cycleCounts/{inventoryCountImportId} - get inventory cycle count import
-->
<id name="inventoryCountImportId">
<method type="get"><entity name="co.hotwax.warehouse.InventoryCountImportView" operation="one"/></method>
</id>
</resource>
</resource>