diff --git a/src/components/Filters.vue b/src/components/Filters.vue index fe4a0e74..54620715 100644 --- a/src/components/Filters.vue +++ b/src/components/Filters.vue @@ -21,7 +21,9 @@ {{ translate("Type") }} {{ translate("All") }} - {{ description }} + + {{ type.description }} + diff --git a/src/components/ProductStorePopover.vue b/src/components/ProductStorePopover.vue index 51d5ad13..d4f60f11 100644 --- a/src/components/ProductStorePopover.vue +++ b/src/components/ProductStorePopover.vue @@ -196,4 +196,4 @@ export default defineComponent({ }; } }); - + \ No newline at end of file diff --git a/src/components/SelectProductStoreModal.vue b/src/components/SelectProductStoreModal.vue index c54ad6ea..9dd78e96 100644 --- a/src/components/SelectProductStoreModal.vue +++ b/src/components/SelectProductStoreModal.vue @@ -69,8 +69,8 @@ export default defineComponent({ }, computed: { ...mapGetters({ + productStores: 'util/getProductStores', facilityProductStores: 'facility/getFacilityProductStores', - productStores: 'util/getProductStores' }) }, props: ["facilityId", "selectedProductStores"], diff --git a/src/components/TimezoneModal.vue b/src/components/TimezoneModal.vue index 7363e67f..89156320 100644 --- a/src/components/TimezoneModal.vue +++ b/src/components/TimezoneModal.vue @@ -6,10 +6,10 @@ - {{ $t("Select time zone") }} + {{ translate("Select time zone") }} - + @@ -17,12 +17,12 @@
-

{{ $t("Fetching TimeZones")}}

+

{{ translate("Fetching TimeZones")}}

-

{{ $t("No time zone found")}}

+

{{ translate("No time zone found")}}

@@ -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", @@ -153,6 +154,7 @@ export default defineComponent({ return { closeOutline, saveOutline, + translate, store }; } diff --git a/src/locales/en.json b/src/locales/en.json index 23a525a5..76cb92ee 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -107,6 +127,7 @@ "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", @@ -114,6 +135,7 @@ "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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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" -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 273b9495..c2ad66d1 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -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' { @@ -68,6 +71,26 @@ const routes: Array = [ 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', diff --git a/src/services/FacilityService.ts b/src/services/FacilityService.ts index 94d624c4..9d80c162 100644 --- a/src/services/FacilityService.ts +++ b/src/services/FacilityService.ts @@ -150,7 +150,7 @@ const fetchFacilityOrderCounts = async(facilityId: string): Promise => { return facilityOrderCounts; } -const fetchFacilityContactDetails = async(payload: any): Promise => { +const fetchFacilityGroup = async (payload: any): Promise => { return api({ url: "performFind", method: "post", @@ -158,15 +158,15 @@ const fetchFacilityContactDetails = async(payload: any): Promise => { }); } -const addPartyToFacility = async (payload: any): Promise => { +const fetchFacilityContactDetails = async(payload: any): Promise => { return api({ - url: "service/addPartyToFacility", + url: "performFind", method: "post", data: payload }); } -const fetchFacilityGroup = async (payload: any): Promise => { +const getFacilityProductStores = async (payload: any): Promise => { return api({ url: "performFind", method: "POST", @@ -174,6 +174,18 @@ const fetchFacilityGroup = async (payload: any): Promise => { }) } + + +const addPartyToFacility = async (payload: any): Promise => { + return api({ + url: "service/addPartyToFacility", + method: "post", + data: payload + }); +} + + + const removePartyFromFacility = async (payload: any): Promise => { return api({ url: "service/removePartyFromFacility", @@ -182,15 +194,16 @@ const removePartyFromFacility = async (payload: any): Promise => { }); } -const fetchFacilityLocations = async(payload: any): Promise => { + +const updateProductStoreFacility = async (payload: any): Promise => { return api({ - url: "performFind", + url: "service/updateProductStoreFacility", method: "post", data: payload - }) + }); } -const getFacilityProductStores = async (payload: any): Promise => { +const fetchFacilityLocations = async(payload: any): Promise => { return api({ url: "performFind", method: "POST", @@ -198,6 +211,7 @@ const getFacilityProductStores = async (payload: any): Promise => { }) } + const addFacilityToGroup = async (payload: any): Promise => { return api({ url: "service/addFacilityToGroup", @@ -270,22 +284,23 @@ const updateFacilityToGroup = async (payload: any): Promise => { }) } -const updateFacilityPostalAddress = async (payload: any): Promise => { +const createFacility = async (payload: any): Promise => { return api({ - url: "service/updateFacilityPostalAddress", + url: "service/createFacility", method: "post", data: payload }) } -const updateProductStoreFacility = async (payload: any): Promise => { +const updateFacilityPostalAddress = async (payload: any): Promise => { return api({ - url: "service/updateProductStoreFacility", + url: "service/updateFacilityPostalAddress", method: "post", data: payload - }); + }) } + const fetchFacilityMappings = async (payload: any): Promise => { return api({ url: "performFind", @@ -352,28 +367,29 @@ const createEnumeration = async (payload: any): Promise => { 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, diff --git a/src/services/UserService.ts b/src/services/UserService.ts index be353c14..c4415b5c 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -136,8 +136,26 @@ const getUserProfile = async (token: any): Promise => { } } +const createFacilityUser = async (payload: any): Promise => { + return api({ + url: "service/createRelationship", + method: "post", + data: payload + }); +} + +const addPartyToFacility = async (payload: any): Promise => { + return api({ + url: "service/addPartyToFacility", + method: "post", + data: payload + }); +} + export const UserService = { + addPartyToFacility, login, + createFacilityUser, getAvailableTimeZones, getUserProfile, setUserTimeZone, diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index 0978745b..d9f7efd6 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -77,9 +77,9 @@ export const UtilService = { fetchExternalMappingTypes, fetchFacilityTypes, fetchLocationTypes, - fetchPartyRoles, fetchProductStores, fetchStates, - generateLatLong + generateLatLong, + fetchPartyRoles, } diff --git a/src/store/modules/facility/actions.ts b/src/store/modules/facility/actions.ts index d2552d12..8006cdd8 100644 --- a/src/store/modules/facility/actions.ts +++ b/src/store/modules/facility/actions.ts @@ -41,7 +41,7 @@ const actions: ActionTree = { const facilityGroupInformation = facilitiesGroupInformation[facility.facilityId] - if(facilityGroupInformation.length) { + if(facilityGroupInformation?.length) { facility.groupInformation = facilityGroupInformation facility.sellOnline = (facilityGroupInformation.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'FAC_GRP')) facility.useOMSFulfillment = (facilityGroupInformation.some((facilityGroup: any) => facilityGroup.facilityGroupId === 'OMS_FULFILLMENT')) @@ -209,6 +209,10 @@ const actions: ActionTree = { commit(types.FACILITY_CURRENT_UPDATED, facility); }, + updateCurrentFacility({ commit }, facility) { + commit(types.FACILITY_CURRENT_UPDATED, facility); + }, + async fetchFacilityContactDetails({ commit }, payload) { let postalAddress = {} as any const params = { diff --git a/src/store/modules/facility/mutations.ts b/src/store/modules/facility/mutations.ts index 85722a06..7ba8747c 100644 --- a/src/store/modules/facility/mutations.ts +++ b/src/store/modules/facility/mutations.ts @@ -13,6 +13,15 @@ const mutations: MutationTree = { [types.FACILITY_CURRENT_UPDATED](state, payload) { state.current = payload }, + [types.FACILITY_CURRENT_LOCATION_UPDATED](state, payload) { + state.current.locations = payload + }, + [types.FACILITY_POSTAL_ADDRESS_UPDATED](state, payload) { + state.current.postalAddress = payload + }, + [types.FACILITY_PRODUCT_STORES_UPDATED](state, payload) { + state.current.productStores = payload + }, [types.FACILITY_LOCATIONS_UPDATED](state, payload) { state.current.locations = payload }, diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index bf4937d6..f9ca6851 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -1,6 +1,8 @@ export default interface UtilState { facilityTypes: object; locationTypes: object; + countries: any[]; + states: any; externalMappingTypes: object; productStores: any[]; partyRoles: any[]; diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index e01a9630..ef957054 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -45,14 +45,14 @@ const actions: ActionTree = { viewSize: 100, noConditionFind: 'Y', entityName: 'FacilityType', - fieldList: ['facilityTypeId', 'description'] + fieldList: ['facilityTypeId', 'description', 'parentTypeId'] } as any try { const resp = await UtilService.fetchFacilityTypes(params) if (!hasError(resp)) { facilityTypes = resp.data.docs.reduce((facilityType: any, type: any) => { - facilityType[type.facilityTypeId] = type.description + facilityType[type.facilityTypeId] = { description: type.description, parentTypeId: type.parentTypeId } return facilityType }, {}) @@ -239,10 +239,12 @@ const actions: ActionTree = { clearUtilState({ commit }) { commit(types.UTIL_PRODUCT_STORES_UPDATED, []) - commit(types.UTIL_FACILITY_TYPES_UPDATED, {}) + commit(types.UTIL_FACILITY_TYPES_UPDATED, []) + commit(types.UTIL_COUNTRIES_UPDATED, []) + commit(types.UTIL_STATES_UPDATED, {}) commit(types.UTIL_LOCATION_TYPES_UPDATED, {}) commit(types.UTIL_EXTERNAL_MAPPING_TYPES_UPDATED, {}) - } + }, } export default actions; \ No newline at end of file diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index f202487d..450a72e1 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -12,6 +12,12 @@ const mutations: MutationTree = { [types.UTIL_LOCATION_TYPES_UPDATED](state, payload) { state.locationTypes = payload }, + [types.UTIL_COUNTRIES_UPDATED](state, payload) { + state.countries = payload + }, + [types.UTIL_STATES_UPDATED](state, payload) { + state.states[payload.countryGeoId] = payload.states + }, [types.UTIL_EXTERNAL_MAPPING_TYPES_UPDATED](state, payload) { state.externalMappingTypes = payload }, diff --git a/src/utils/index.ts b/src/utils/index.ts index 2ebc61d5..b0da7257 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -40,4 +40,10 @@ const copyToClipboard = async (value: string, text?: string) => { }); } -export { copyToClipboard, showToast } +const isValidPassword = (password : string) => { + // Regular expression pattern for a valid password + const passwordPattern = /^.*(?=.{5,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&*]).*$/; + return passwordPattern.test(password); +} + +export { copyToClipboard, isValidPassword, showToast } diff --git a/src/views/AddFacilityAddress.vue b/src/views/AddFacilityAddress.vue new file mode 100644 index 00000000..997f267a --- /dev/null +++ b/src/views/AddFacilityAddress.vue @@ -0,0 +1,255 @@ + + + + + \ No newline at end of file diff --git a/src/views/AddFacilityConfig.vue b/src/views/AddFacilityConfig.vue new file mode 100644 index 00000000..153c0e09 --- /dev/null +++ b/src/views/AddFacilityConfig.vue @@ -0,0 +1,444 @@ + + + + + \ No newline at end of file diff --git a/src/views/CreateFacility.vue b/src/views/CreateFacility.vue new file mode 100644 index 00000000..9e2b0981 --- /dev/null +++ b/src/views/CreateFacility.vue @@ -0,0 +1,208 @@ + + + + + \ No newline at end of file diff --git a/src/views/FindFacilities.vue b/src/views/FindFacilities.vue index 0c53f80a..fb8f836b 100644 --- a/src/views/FindFacilities.vue +++ b/src/views/FindFacilities.vue @@ -35,7 +35,9 @@ {{ translate("Type") }} {{ translate("All") }} - {{ description }} + + {{ type.description }} + @@ -46,7 +48,7 @@ -

{{ facility.facilityTypeId ? facilityTypes[facility.facilityTypeId] ? facilityTypes[facility.facilityTypeId] : facilityTypes.facilityTypeId : '' }}

+

{{ facility.facilityTypeId ? facilityTypes[facility.facilityTypeId] ? facilityTypes[facility.facilityTypeId].description : facilityTypes.facilityTypeId : '' }}

{{ facility.facilityName }}

{{ facility.facilityId }}

@@ -82,6 +84,20 @@ + + + + + + + + + + + + + +