Skip to content

refactor: migrate API services to Moqui REST s1 endpoints - #358

Draft
kumar-kartikey-choudhary wants to merge 1 commit into
hotwax:mainfrom
kumar-kartikey-choudhary:migrate-scheduled-restock-to-moqui
Draft

refactor: migrate API services to Moqui REST s1 endpoints#358
kumar-kartikey-choudhary wants to merge 1 commit into
hotwax:mainfrom
kumar-kartikey-choudhary:migrate-scheduled-restock-to-moqui

Conversation

@kumar-kartikey-choudhary

Copy link
Copy Markdown

Draft PR: Refactor Import App Services to Moqui REST s1 Endpoints

📌 Context & Overview

This pull request initiates the migration of the Import App (import) from legacy /performFind and generic OFBiz endpoints to Moqui REST s1 resource endpoints.

The goal of this migration is to improve API response structures, standardise endpoint resource paths, and leverage Moqui's native REST s1 services.


🚀 Summary of Changes

1. Service Layer Migration (src/services/)

  • StockService.ts:

    • Migrated fetchJobInformation to GET /rest/s1/admin/serviceJobs.
    • Migrated scheduleJob to POST /rest/s1/admin/serviceJobs.
    • Standardized parameter mapping to use jobTypeEnumId and params (Axios GET query string).
  • UtilService.ts:

    • Migrated getFacilities to GET /rest/s1/admin/facilities.
    • Migrated fetchGoodIdentificationTypes to GET /rest/s1/oms/goodIdentificationTypes.
    • Migrated fetchShopifyShop to GET /rest/s1/admin/shopifyShops.
    • Migrated fetchProductStores to GET /rest/s1/admin/users/productStores.
    • Migrated fetchProductSelectorPref to GET /rest/s1/admin/productStores/{productStoreId}/settings.
    • Migrated fetchProducts Solr query to POST /rest/s1/admin/search/query.
  • UploadService.ts:

    • Updated createIncomingShipment to POST /rest/s1/poorti/createIncomingShipment.
  • UserService.ts:

    • Updated createFieldMapping and getFieldMappings to /rest/s1/admin/dataManagerMapping.

2. Vuex Store Layer Updates (src/store/modules/)

  • stock/actions.ts:
    • Updated fetchJobInformation and fetchDraftJob to parse Moqui REST response formats (serviceJobList array fallback).
    • Updated filter parameter keys from legacy systemJobEnumId to Moqui jobTypeEnumId.
  • util/actions.ts:
    • Updated fetchFacilities, fetchGoodIdentificationTypes, fetchProductStores, and fetchProductSelectorPref response parsing to handle Moqui REST response formats (settings, facilities, etc.).

3. Component Updates (src/views/)

  • ScheduledRestock.vue:
    • Refactored fetchShopifyShops call payload to align with updated UtilService.fetchShopifyShop parameters.

⚠️ Draft / Work in Progress Items

Note

This PR is currently marked as Draft for the following reasons:

  • Hardcoded Tokens / URLs: Temporary local baseURL (http://localhost:8080/rest/s1) and hardcoded tokens in services need to be replaced with dynamic authentication getters from @hotwax/oms-api / Vuex store.
  • Solr Query Integration: Verifying UtilService.fetchProducts integration with src/store/modules/product/actions.ts for Solr product identification filters.
  • Un-migrated Service Calls: Reviewing remaining /performFind calls in getFacilityLocations, getServiceStatusDesc, and fetchDataResource.

🧪 Testing & Verification Plan

  • Service Jobs List: Verify JOB_SCHEDULED_RSTK service job lookup loads properly in Scheduled Restock.
  • Facility & Product Store Dropdowns: Verify facilities and product store lists load successfully on view initialization.
  • Product Store Settings: Verify fetchProductSelectorPref correctly retrieves store settings without 404/filtering errors.
  • File Mapping: Test saving and retrieving Data Manager field mappings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant