Skip to content

Commit

Permalink
Merge pull request #137 from hotwax/k2maan-#85zt0m4qc-2
Browse files Browse the repository at this point in the history
Implemented: details page for pre-order catalog (#85zt0m4qc)
  • Loading branch information
adityasharma7 authored Jun 23, 2023
2 parents d5da956 + 9437ab1 commit c3d7979
Show file tree
Hide file tree
Showing 33 changed files with 1,832 additions and 125 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ VUE_APP_ORDER_FILTERS=["orderTypeId: SALES_ORDER", "facilityId:PRE_ORDER_PARKING
VUE_APP_BASE_URL=
VUE_APP_ORDER_IN_BRKRNG_FILTERS=["orderTypeId: SALES_ORDER", "facilityId: _NA_", "orderStatusId: ORDER_APPROVED", "!orderItemStatusId: ITEM_CANCELLED" ]
VUE_APP_PERMISSION_ID=
VUE_APP_ALIAS=
VUE_APP_ALIAS=
VUE_APP_CTGRY_AND_BRKRNG_JOB=["JOB_REL_PREODR_CAT", "JOB_BKR_ORD", "JOB_RLS_ORD_DTE"]
67 changes: 65 additions & 2 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"Active jobs": "Active jobs",
"Active purchase order": "Active purchase order",
"Added to pre-order category on, against PO but not listed on all stores" : "Added to pre-order category on {fromDate}, against PO #{POID} but not listed on all stores",
"All": "All",
"App": "App",
"Are you sure you want to update the promise date for these orders?": "Are you sure you want to update the promise date for these orders?",
"Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to {timeZoneId}?",
"ATP": "ATP",
"Auto": "Auto",
"Auto releasing": "Auto releasing",
"Available": "Available",
"Available to promise": "Available to promise",
"A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores sellling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.": "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores sellling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.",
"Background jobs": "Background jobs",
Expand All @@ -15,27 +19,38 @@
"eCom Store": "eCom Store",
"Cancel": "Cancel",
"Cancel item": "Cancel item",
"Cancel job": "Cancel job",
"Cancel orders": "Cancel orders",
"Catalog": "Catalog",
"Category": "Category",
"Category and brokering jobs": "Category and brokering jobs",
"Change": "Change",
"Change time zone": "Change time zone",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Color": "Color",
"Colors": "Colors",
"Configuration updated": "Configuration updated",
"Confirm": "Confirm",
"Copied": "{text} Copied",
"Corresponding sales orders": "Corresponding sales orders",
"Custom": "Custom",
"Deselect": "Deselect",
"Deselect items": "Deselect items",
"Deselect the selected order items": "Deselect the {count} selected order items",
"disabled": "disabled",
"Dismiss": "Dismiss",
"Don't cancel": "Don't cancel",
"Edit promise date": "Edit promise date",
"Edit shipping date": "Edit shipping date",
"Eligible": "Eligible",
"Enter a product name, style name, SKU, UPCA or external ID.": "Enter a product name, style name, SKU, UPCA or external ID.",
"Enter an order ID, product name, style name, SKU, customer name, UPCA or external ID": "Enter an order ID, product name, style name, SKU, customer name, UPCA or external ID",
"Excluded ATP": "Excluded ATP",
"from date": "from date",
"Failed to update configuration": "Failed to update configuration",
"Go to OMS": "Go to OMS",
"History": "History",
"Hold pre-order physical inventory": "Hold pre-order physical inventory",
"How are orders released?": "How are orders released?",
"in brokering": "in brokering",
"in stock": "in stock",
Expand All @@ -49,58 +64,93 @@
"Items queued for release successfully": "Items queued for release successfully",
"Items queued to update promise date successfully": "Items queued to update promise date successfully",
"Jobs": "Jobs",
"Last active purchase order": "Last active purchase order",
"Listed": "Listed",
"Listed at": "Listed at {listingTime}",
"Listed on stores(s)": "Listed on {count} store(s)",
"Listing at": "Listing at {listingTime}",
"Listing data not available": "Listing data not available",
"Listed on all stores": "Listed on all stores",
"Listing failed at": "Listing failed at {listingTime}",
"Loading": "Loading",
"Login": "Login",
"Logout": "Logout",
"Loyalty status": "Loyalty status",
"Never in any category": "Never in any category",
"No pending job found": "No pending job found",
"No": "No",
"No job found": "No job found",
"No jobs found": "No jobs found",
"No jobs have run yet": "No jobs have run yet",
"No products found": "No products found",
"No results found": "No results found",
"No time zone found": "No time zone found",
"No warehouses found": "No warehouses found",
"No shop listings found": "No shop listings found",
"Not eligible for accepting but currently added in category": "Not eligible for accepting {category}s but currently added in {category} category",
"Not listed": "Not listed",
"Not listed on store(s)": "Not listed on {count} store(s)",
"Not listed on any stores": "Not listed on any stores",
"None": "None",
"OMS": "OMS",
"OMS instance": "OMS instance",
"Online ATP": "Online ATP",
"Online ATP calculation": "Online ATP calculation",
"Only orders with promise date": "Only orders with promise date",
"Only orders without promise date": "Only orders without promise date",
"on PO": "on PO",
"Ordered after": "Ordered after",
"Ordered before": " Ordered before",
"Order placed on": "Order placed on",
"Ordered": "Ordered",
"Orders": "Orders",
"orders": "orders",
"Orders are released from oldest to newest. Use the Date filter to identify orders taken before a certain date.": "Orders are released from oldest to newest. Use the Date filter to identify orders taken before a certain date.",
"Order brokering": "Order brokering",
"Out of stock": "Out of stock",
"Password": "Password",
"Pieces": "Pieces",
"pieces preordered": "pieces preordered",
"PO": "PO",
"PO #": "PO # {pOId}",
"PO ATP": "PO ATP",
"preorder": "preorder",
"pre-order": "pre-order",
"Pre-order": "Pre-order",
"Preorder Management": "Preorder Management",
"preorders": "preorders",
"Presell computation": "Presell computation",
"Presell eligibility": "Presell eligibility",
"preorders will be automatically brokered and assigned for fulfillment.": "{count} preorders will be automatically brokered and assigned for fulfillment.",
"preorder items will be released to the warehouse you have selected.": "{count} preorder items will be released to the warehouse you have selected.",
"preorders will be cancelled. This action cannot be undone.": "{count} preorders will be cancelled. This action cannot be undone.",
"Products": "Products",
"Product details": "Product details",
"Product cannot be pre-sold because it does not have active purchase orders": "Product cannot be pre-sold because it does not have active purchase orders",
"Product has been accepting from against PO #": "Product has been accepting {category}s from {fromDate} against PO #${POID}",
"Product is eligible for but not added to the category": "Product is eligible for {category}s but not added to the {category} category",
"Product is currently in stock and cannot accept": "Product is currently in stock and cannot accept {category}s",
"Product has no active purchase order to be eligible for accepting": "Product has no active purchase order to be eligible for accepting {category}s",
"Product Store": "Product Store",
"Promised after": "Promised after",
"Promised before": "Promised before",
"Promise date": "Promise date",
"Promised date": "Promised date",
"Product not found": "Product not found",
"Purchase orders": "Purchase orders",
"Purchase order and online ATP calculation": "Purchase order and online ATP calculation",
"Quantity on hand": "Quantity on hand",
"Release": "Release",
"Release item": "Release item",
"Release orders": "Release orders",
"Release preorder to a warehouse": "Release preorder to a warehouse",
"Release preorders to a warehouse": "Release preorders to a warehouse",
"Release to a warehouse": "Release to a warehouse",
"Removed from category": "Removed from category",
"Removed from category on because there is no active PO but still listed on stores": "Removed from {category} category on {changeDatetime} because there is no active PO but still listed on {listedCount} stores",
"Reserve inventory": "Reserve inventory",
"Run now": "Run now",
"Save": "Save",
"Schedule in every 15 minutes": "Schedule in every 15 minutes",
"Search products": "Search products",
"Search time zones": "Search time zones",
"Search warehouses": "Search warehouses",
Expand All @@ -109,16 +159,25 @@
"Select item": "Select item",
"Select store": "Select store",
"Selected variant not available": "Selected variant not available",
"Selected variant not available. Reseting to first variant.": "Selected variant not available. Reseting to first variant.",
"Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.": "Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.",
"Select time zone": "Select time zone",
"Service has been scheduled": "Service has been scheduled",
"Settings": "Settings",
"Ships from date": "Ships from date",
"Shop": "Shop {index}",
"Shop listing status": "Shop listing status",
"Shopify Config": "Shopify Config",
"Shopify listing": "Shopify listing",
"Size": "Size",
"Sizes": "Sizes",
"sku selected": "sku selected",
"Something went wrong": "Something went wrong",
"Something went wrong, could not fetch": "Something went wrong, could not fetch {data}",
"Sorry, your username or password is incorrect. Please try again.": "Sorry, your username or password is incorrect. Please try again.",
"Sort by": "Sort by",
"Stopped accepting from as there is no active PO": "Stopped accepting {category}s from {changeDatetime} as there is no active PO",
"The job is currently in progress. Are you sure that you want to cancel this job?": "The job is currently in progress. Are you sure that you want to cancel this job?",
"Store": "Store",
"The order count in product cards will be updated based on the filters you select.": "The order count in product cards will be updated based on the filters you select.",
"The timezone you select is used to ensure automations you schedule are always accurate to the time you select.": "The timezone you select is used to ensure automations you schedule are always accurate to the time you select.",
Expand All @@ -133,10 +192,14 @@
"thru date": "thru date",
"Timezone": "Timezone",
"Time zone updated successfully": "Time zone updated successfully",
"Total PO ATP": "Total PO ATP",
"Total PO items": "Total PO items",
"Update promise date": "Update promise date",
"Update time zone": "Update time zone",
"Username": "Username",
"variant": "variant",
"variants": "variants",
"Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu."
"With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues": "With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues",
"Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu.",
"Yes": "Yes"
}
8 changes: 4 additions & 4 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import Login from '../views/login.vue'
import Products from '../views/products.vue'
import Productdetails from '../views/product-details.vue'
import CatalogProductdetails from '../views/catalog-product-details.vue'
import ProductDetails from '../views/product-details.vue'
import CatalogProductDetails from '../views/catalog-product-details.vue'
import Orders from '../views/orders.vue'
import Catalog from '../views/catalog.vue'
import Settings from '../views/settings.vue'
Expand Down Expand Up @@ -47,7 +47,7 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/product-details/:id',
name: 'Product-details',
component: Productdetails,
component: ProductDetails,
beforeEnter: authGuard
},
{
Expand All @@ -65,7 +65,7 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/catalog-product-details/:productId/:variantId',
name: 'Catalog-product-details',
component: CatalogProductdetails,
component: CatalogProductDetails,
beforeEnter: authGuard
},
{
Expand Down
12 changes: 6 additions & 6 deletions src/services/FacilityService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { api } from '@/adapter';

const findFacility = async (payload: any): Promise <any> => {
const findFacility = async (payload: any): Promise<any> => {
return api({
url: "facilities",
method: "post",
data: payload,
cache: true
});
url: "facilities",
method: "post",
data: payload,
cache: true
});
}
export const FacilityService = {
findFacility,
Expand Down
84 changes: 83 additions & 1 deletion src/services/JobService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,94 @@ const fetchJobInformation = async (payload: any): Promise<any> => {
});
}

const cancelJob = async (jobId: any): Promise<any> => {
return await api({
url: "service/cancelScheduledJob",
method: "post",
data: { jobId }
});
}

const runJobNow = async (job: any): Promise <any> => {
const payload = {
'JOB_NAME': job.jobName,
'SERVICE_NAME': job.serviceName,
'SERVICE_COUNT': '0',
'SERVICE_TEMP_EXPR': job.jobStatus,
'jobFields': {
'productStoreId': job.productStoreId,
'systemJobEnumId': job.systemJobEnumId,
'tempExprId': job.jobStatus, // Need to remove this as we are passing frequency in SERVICE_TEMP_EXPR, currently kept it for backward compatibility
'parentJobId': job.parentJobId,
'recurrenceTimeZone': store.state.user.current.userTimeZone,
},
'statusId': "SERVICE_PENDING",
'systemJobEnumId': job.systemJobEnumId
} as any

// checking if the runtimeData has productStoreId, and if present then adding it on root level
job?.runtimeData?.productStoreId?.length >= 0 && (payload['productStoreId'] = job.productStoreId)
job?.priority && (payload['SERVICE_PRIORITY'] = job.priority.toString())
job?.sinceId && (payload['sinceId'] = job.sinceId)

// assigning '' (empty string) to all the runtimeData properties whose value is "null"
job.runtimeData && Object.keys(job.runtimeData).map((key: any) => {
if (job.runtimeData[key] === 'null') job.runtimeData[key] = ''
})

return await api({
url: "scheduleService",
method: "post",
data: { ...job.runtimeData, ...payload }
});
}

const scheduleJob = async (payload: any): Promise<any> => {
const params = {
'JOB_NAME': payload.job.jobName,
'SERVICE_NAME': payload.job.serviceName,
'SERVICE_COUNT': '0',
'SERVICE_TEMP_EXPR': payload.frequency,
'SERVICE_RUN_AS_SYSTEM': 'Y',
'jobFields': {
'productStoreId': store.state.user.currentEComStore.productStoreId,
'systemJobEnumId': payload.job.systemJobEnumId,
'tempExprId': payload.frequency, // Need to remove this as we are passing frequency in SERVICE_TEMP_EXPR, currently kept it for backward compatibility
'maxRecurrenceCount': '-1',
'parentJobId': payload.job.parentJobId,
'runAsUser': 'system', //default system, but empty in run now. TODO Need to remove this as we are using SERVICE_RUN_AS_SYSTEM, currently kept it for backward compatibility
'recurrenceTimeZone': store.state.user.current.userTimeZone
},
'statusId': "SERVICE_PENDING",
'systemJobEnumId': payload.job.systemJobEnumId
} as any

// checking if the runtimeData has productStoreId, and if present then adding it on root level
payload.job?.runtimeData?.productStoreId?.length >= 0 && (params['productStoreId'] = store.state.user.currentEComStore.productStoreId)
payload.job?.priority && (params['SERVICE_PRIORITY'] = payload.job.priority.toString())
payload.runTime && (params['SERVICE_TIME'] = payload.runTime.toString())

// assigning '' (empty string) to all the runtimeData properties whose value is "null"
payload.job.runtimeData && Object.keys(payload.job.runtimeData).map((key: any) => {
if (payload.job.runtimeData[key] === 'null') payload.job.runtimeData[key] = ''
})

return await api({
url: "scheduleService",
method: "post",
data: { ...payload.job.runtimeData, ...params }
});
}

export const JobService = {
cancelJob,
fetchBackgroundJobs,
fetchJobLogs,
fetchJobs,
fetchJobInformation,
pollJobs,
prepareFetchJobsQuery,
prepareFetchLogsQuery,
fetchJobInformation
scheduleJob,
runJobNow
}
Loading

0 comments on commit c3d7979

Please sign in to comment.