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

Implemented: flow to create facility #29

Merged
merged 9 commits into from
Nov 28, 2023
4 changes: 3 additions & 1 deletion src/components/Filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<ion-label>{{ translate("Type") }}</ion-label>
<ion-select interface="popover" v-model="query.facilityTypeId" @ionChange="updateQuery()">
<ion-select-option value="">{{ translate("All") }}</ion-select-option>
<ion-select-option :value="facilityType" :key="facilityType" v-for="(description, facilityType) in facilityTypes">{{ description }}</ion-select-option>
<ion-select-option :value="facilityTypeId" :key="facilityTypeId" v-for="(type, facilityTypeId) in facilityTypes">
{{ type.description }}
</ion-select-option>
</ion-select>
</ion-item>
</ion-list>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductStorePopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@ export default defineComponent({
};
}
});
</script>
</script>
2 changes: 1 addition & 1 deletion src/components/SelectProductStoreModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default defineComponent({
},
computed: {
...mapGetters({
productStores: 'util/getProductStores',
facilityProductStores: 'facility/getFacilityProductStores',
productStores: 'util/getProductStores'
})
},
props: ["facilityId", "selectedProductStores"],
Expand Down
10 changes: 6 additions & 4 deletions src/components/TimezoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
<ion-icon :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ $t("Select time zone") }}</ion-title>
<ion-title>{{ translate("Select time zone") }}</ion-title>
</ion-toolbar>
<ion-toolbar>
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="$t('Search time zones')" v-model="queryString" @keyup.enter="queryString = $event.target.value; findTimeZone()" @keydown="preventSpecialCharacters($event)" />
<ion-searchbar @ionFocus="selectSearchBarText($event)" :placeholder="translate('Search time zones')" v-model="queryString" @keyup.enter="queryString = $event.target.value; findTimeZone()" @keydown="preventSpecialCharacters($event)" />
</ion-toolbar>
</ion-header>

<ion-content class="ion-padding">
<form @keyup.enter="setUserTimeZone">
<div class="empty-state" v-if="isLoading">
<ion-spinner name="crescent" />
<p>{{ $t("Fetching TimeZones")}}</p>
<p>{{ translate("Fetching TimeZones")}}</p>
</div>

<!-- Empty state -->
<div class="empty-state" v-else-if="filteredTimeZones.length === 0">
<p>{{ $t("No time zone found")}}</p>
<p>{{ translate("No time zone found")}}</p>
</div>

<!-- Timezones -->
Expand Down Expand Up @@ -74,6 +74,7 @@ import { UserService } from "@/services/UserService";
import { hasError } from '@/adapter'
import { DateTime } from 'luxon';
import logger from "@/logger";
import { translate } from "@hotwax/dxp-components";

export default defineComponent({
name: "TimeZoneModal",
Expand Down Expand Up @@ -153,6 +154,7 @@ export default defineComponent({
return {
closeOutline,
saveOutline,
translate,
store
};
}
Expand Down
32 changes: 30 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"Add": "Add",
"Add address later": "Add address later",
"Add locations to facility": "Add locations to facility",
"Add staff member to facility": "Add staff member to facility",
"Add Store": "Add Store",
"Add Store Address": "Add Store Address",
"Add Store Configuration": "Add Store Configuration",
"Add timings": "Add timings",
"Address": "Address",
"Address line 1": "Address line 1",
Expand All @@ -25,8 +29,11 @@
"City": "City",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Closing Time": "Closing Time",
"Configure settings later": "Configure settings later",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"Consumed Order Limit": "Consumed Order Limit",
"Create login credentials": "Create login credentials",
"Create store": "Create store",
"Custom": "Custom",
"Custom fulfillment capacity": "Custom fulfillment capacity",
"Custom mapping": "Custom mapping",
Expand All @@ -38,10 +45,14 @@
"Filters": "Filters",
"Edit": "Edit",
"Edit location": "Edit location",
"External ID": "External ID",
"External mapping created successfully": "External mapping created successfully",
"External mapping updated successfully": "External mapping updated successfully",
"External mappings": "External mappings",
"Facilities": "Facilities",
"Facility address created successfully.": "Facility address created successfully.",
"Facility created successfully.": "Facility created successfully.",
"Facility configurations created successfully.": "Facility configurations created successfully.",
"Facility": "Facility",
"Facility address updated successfully.": "Facility address updated successfully.",
"Facility details": "Facility details",
Expand All @@ -51,12 +62,19 @@
"Facility location removed successfully": "Facility location removed successfully",
"Facility location updated successfully": "Facility location updated successfully",
"Facility name": "Facility name",
"Facility name is required.": "Facility name is required.",
"Facility Management": "Facility Management",
"Failed to add some product stores to the facility.": "Failed to add some product stores to the facility.",
"Failed to create external mapping": "Failed to create external mapping",
"Failed to create facility.": "Failed to create facility.",
"Failed to create facility address.": "Failed to create facility address.",
"Failed to create facility location": "Failed to create facility location",
"Failed to create shopify mapping": "Failed to create shopify mapping",
"Failed to fetch facility information": "Failed to fetch facility information",
"Failed to find the facility locations": "Failed to find the facility locations",
"Failed to generate latitude and longitude.": "Failed to generate latitude and longitude.",
"Failed to make product store as primary.": "Failed to make product store as primary.",
"Failed to create facility login credentials.": "Failed to create facility login credentials.",
"Failed to generate latitude & Longitude.": "Failed to generate latitude & Longitude.",
"Failed to make product store primary.": "Failed to make product store primary.",
"Failed to remove facility location": "Failed to remove facility location",
Expand All @@ -71,6 +89,7 @@
"Failed to update fulfillment capacity for ": "Failed to update fulfillment capacity for {facilityName}",
"Failed to update fulfillment setting": "Failed to update fulfillment setting",
"Failed to update shopify mapping": "Failed to update shopify mapping",
"Failed to update some fulfillment settings.": "Failed to update some fulfillment settings.",
"Failed to update some product stores": "Failed to update some product stores",
"Failed to update some role(s).": "Failed to update some role(s).",
"Fetching TimeZones": "Fetching TimeZones",
Expand All @@ -86,6 +105,7 @@
"Go to OMS": "Go to OMS",
"Groups": "Groups",
"Identification": "Identification",
"Internal ID": "Internal ID",
"Instance Url": "Instance Url",
"Language": "Language",
"Latitude": "Latitude",
Expand All @@ -107,13 +127,15 @@
"Mapping Name": "Mapping Name",
"Map facility to an external system": "Map facility to an external system",
"Monday": "Monday",
"Name": "Name",
"Netsuite": "Netsuite",
"No Capacity": "No Capacity",
"No capacity": "No capacity",
"No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.": "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.",
"No facilities found": "No facilities found",
"No fulfillment capacity": "No fulfillment capacity",
"No party found": "No party found",
"No product stores added.": "No product stores added.",
"No records found": "No records found",
"No time zone found": "No time zone found",
"OMS": "OMS",
Expand All @@ -133,6 +155,7 @@
"Please contact the administrator.": "Please contact the administrator.",
"Please enter a valid value": "Please enter a valid value",
"Please fill all the required fields": "Please fill all the required fields",
"Please provide a password.": "Please provide a password.",
"Primary": "Primary",
"primary store": "primary store",
"Product Store": "Product Store",
Expand All @@ -149,9 +172,13 @@
"Role(s) updated successfully.": "Role(s) updated successfully.",
"Saturday": "Saturday",
"Save": "Save",
"Save address": "Save address",
"Save configurations": "Save configurations",
"Section": "Section",
"section": "section",
"Select": "Select",
"Select country": "Select country",
"Select state": "Select state",
"Search facilities": "Search facilities",
"Search time zones": "Search time zones",
"Select time": "Select time",
Expand All @@ -164,6 +191,7 @@
"sequence": "sequence",
"Settings": "Settings",
"Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.",
"Setup Store": "Setup Store",
"Shopify": "Shopify",
"Shopify facility": "Shopify facility",
"Shopify location": "Shopify location",
Expand Down Expand Up @@ -194,7 +222,7 @@
"Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.": "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.",
"Unlimited fulfillment capacity": "Unlimited fulfillment capacity",
"Unlimited orders": "Unlimited orders",
"Unlink":"Unlink",
"Unlink": "Unlink",
"Update days to ship": "Update days to ship",
"Username": "Username",
"Uses native fulfillment app": "Uses native fulfillment app",
Expand All @@ -203,4 +231,4 @@
"Wednesday": "Wednesday",
"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.",
"Zipcode": "Zipcode"
}
}
23 changes: 23 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { loader } from '@/utils/user';
import FacilityManagement from '@/views/FacilityManagement.vue'
import Settings from '@/views/Settings.vue';
import FindFacilities from '@/views/FindFacilities.vue';
import CreateFacility from '@/views/CreateFacility.vue';
import AddFacilityAddress from '@/views/AddFacilityAddress.vue';
import AddFacilityConfig from '@/views/AddFacilityConfig.vue';

// Defining types for the meta values
declare module 'vue-router' {
Expand Down Expand Up @@ -68,6 +71,26 @@ const routes: Array<RouteRecordRaw> = [
props: true,
beforeEnter: authGuard
},
{
path: "/create-facility",
name: "Create Facility",
component: CreateFacility,
beforeEnter: authGuard
},
{
path: "/add-facility-address/:facilityId",
name: "Add Facility Address",
component: AddFacilityAddress,
props: true,
beforeEnter: authGuard
},
{
path: "/add-facility-config/:facilityId",
name: "Add Facility Config",
component: AddFacilityConfig,
props: true,
beforeEnter: authGuard
},
{
path: '/settings',
name: 'Settings',
Expand Down
56 changes: 36 additions & 20 deletions src/services/FacilityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,30 +150,42 @@ const fetchFacilityOrderCounts = async(facilityId: string): Promise<any> => {
return facilityOrderCounts;
}

const fetchFacilityContactDetails = async(payload: any): Promise <any> => {
const fetchFacilityGroup = async (payload: any): Promise<any> => {
return api({
url: "performFind",
method: "post",
data: payload
});
}

const addPartyToFacility = async (payload: any): Promise <any> => {
const fetchFacilityContactDetails = async(payload: any): Promise <any> => {
return api({
url: "service/addPartyToFacility",
url: "performFind",
method: "post",
data: payload
});
}

const fetchFacilityGroup = async (payload: any): Promise<any> => {
const getFacilityProductStores = async (payload: any): Promise<any> => {
return api({
url: "performFind",
method: "POST",
data: payload
})
}



const addPartyToFacility = async (payload: any): Promise <any> => {
return api({
url: "service/addPartyToFacility",
method: "post",
data: payload
});
}



const removePartyFromFacility = async (payload: any): Promise <any> => {
return api({
url: "service/removePartyFromFacility",
Expand All @@ -182,22 +194,24 @@ const removePartyFromFacility = async (payload: any): Promise <any> => {
});
}

const fetchFacilityLocations = async(payload: any): Promise<any> => {

const updateProductStoreFacility = async (payload: any): Promise <any> => {
return api({
url: "performFind",
url: "service/updateProductStoreFacility",
method: "post",
data: payload
})
});
}

const getFacilityProductStores = async (payload: any): Promise<any> => {
const fetchFacilityLocations = async(payload: any): Promise<any> => {
return api({
url: "performFind",
method: "POST",
data: payload
})
}


const addFacilityToGroup = async (payload: any): Promise<any> => {
return api({
url: "service/addFacilityToGroup",
Expand Down Expand Up @@ -270,22 +284,23 @@ const updateFacilityToGroup = async (payload: any): Promise<any> => {
})
}

const updateFacilityPostalAddress = async (payload: any): Promise<any> => {
const createFacility = async (payload: any): Promise<any> => {
return api({
url: "service/updateFacilityPostalAddress",
url: "service/createFacility",
method: "post",
data: payload
})
}

const updateProductStoreFacility = async (payload: any): Promise <any> => {
const updateFacilityPostalAddress = async (payload: any): Promise<any> => {
return api({
url: "service/updateProductStoreFacility",
url: "service/updateFacilityPostalAddress",
method: "post",
data: payload
});
})
}


const fetchFacilityMappings = async (payload: any): Promise<any> => {
return api({
url: "performFind",
Expand Down Expand Up @@ -352,28 +367,29 @@ const createEnumeration = async (payload: any): Promise<any> => {

export const FacilityService = {
addFacilityToGroup,
createFacilityGroup,
createFacility,
createFacilityLocation,
addPartyToFacility,
createEnumeration,
createFacilityLocation,
createFacilityGroup,
createFacilityIdentification,
createFacilityPostalAddress,
createProductStoreFacility,
createShopifyShopLocation,
deleteFacilityLocation,
fetchFacilityGroup,
fetchFacilityLocations,
fetchFacilityContactDetails,
createShopifyShopLocation,
deleteShopifyShopLocation,
fetchFacilities,
fetchFacilitiesOrderCount,
fetchFacilityContactDetails,
fetchFacilityGroupInformation,
fetchFacilityGroup,
fetchFacilityLocations,
fetchFacilityMappings,
fetchFacilityOrderCounts,
fetchFacilityPrimaryMember,
getFacilityProductStores,
fetchShopifyFacilityMappings,
getFacilityParties,
getFacilityProductStores,
getPartyRoleAndPartyDetails,
removePartyFromFacility,
updateFacility,
Expand Down
Loading
Loading