-
{state.globalMessage}
-
-
{
- dispatch({ type: "SNACKBAR", payload: { message: "" } });
- }}
- >
- Close
-
-
-
-
+
+
+ {toastStatus === "success" ? (
+
+
+
+ ) : toastStatus === "error" ? (
+
+
+
+ ) : toastStatus === "info" ? (
+
+
+
+ ) : toastStatus === "warning" ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ {globalMessage}
+ {/* M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22
+ 12C22 6.48 17.52 2 12 2ZM12 13C11.45 13 11 12.55 11 12V8C11 7.45 11.45
+ 7 12 7C12.55 7 13 7.45 13 8V12C13 12.55 12.55 13 12 13ZM13
+ 17H11V15H13V17Z"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52
+ 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 13C11.45 13 11 12.55 11
+ 12V8C11 7.45 11.45 7 12 7C12.55 7 13 7.45 13 8V12C13 12.55 12.55 13 12
+ 13ZM13 17H11V15H13V17Z" */}
+
+
+
{
+ dispatch({ type: "SNACKBAR", payload: { message: "" } });
+ }}
+ >
+
+
+
+
) : null;
};
diff --git a/src/context/Auth/AuthContext.jsx b/src/context/Auth/AuthContext.jsx
new file mode 100644
index 0000000..9bf5711
--- /dev/null
+++ b/src/context/Auth/AuthContext.jsx
@@ -0,0 +1,63 @@
+import React, { useReducer } from "react";
+import MkdSDK from "Utils/MkdSDK";
+
+const initialState = {
+ isAuthenticated: false,
+ user: null,
+ token: null,
+ role: null,
+};
+
+export const AuthContext = React.createContext(initialState);
+
+const reducer = (state, action) => {
+ switch (action.type) {
+ case "LOGIN":
+ //TODO
+ return {
+ ...state,
+ };
+ case "LOGOUT":
+ localStorage.clear();
+ return {
+ ...state,
+ isAuthenticated: false,
+ user: null,
+ };
+ default:
+ return state;
+ }
+};
+
+let sdk = new MkdSDK();
+
+export const tokenExpireError = (dispatch, errorMessage) => {
+ const role = localStorage.getItem("role");
+ if (errorMessage === "TOKEN_EXPIRED") {
+ dispatch({
+ type: "Logout",
+ });
+ window.location.href = "/" + role + "/login";
+ }
+};
+
+const AuthProvider = ({ children }) => {
+ const [state, dispatch] = useReducer(reducer, initialState);
+
+ React.useEffect(() => {
+ //TODO
+ }, []);
+
+ return (
+
+ {children}
+
+ );
+};
+
+export default AuthProvider;
diff --git a/src/context/Auth/index.js b/src/context/Auth/index.js
new file mode 100644
index 0000000..9357863
--- /dev/null
+++ b/src/context/Auth/index.js
@@ -0,0 +1,3 @@
+
+ export {default as AuthProvider,AuthContext, tokenExpireError} from "./AuthContext"
+
\ No newline at end of file
diff --git a/src/context/Global/GlobalActions.jsx b/src/context/Global/GlobalActions.jsx
new file mode 100644
index 0000000..8a74755
--- /dev/null
+++ b/src/context/Global/GlobalActions.jsx
@@ -0,0 +1,472 @@
+import { tokenExpireError } from "Context/Auth";
+
+import MkdSDK from "Utils/MkdSDK";
+
+import {
+ REQUEST_FAILED,
+ REQUEST_LOADING,
+ REQUEST_SUCCESS,
+ RequestItems,
+ SET_GLOBAL_PROPERTY,
+} from "./GlobalConstants";
+
+import { showToast } from "./GlobalContext";
+import TreeSDK from "Utils/TreeSDK";
+
+/**
+ * @param {any} dispatch - Global Dispatch
+ * @param {String | Number | Boolean | Object} data -
+ * @param {String} property - any propert name
+ */
+
+export const setGLobalProperty = (dispatch, data, property) => {
+ // console.log("property >>", property);
+ dispatch({
+ property,
+ type: SET_GLOBAL_PROPERTY,
+ payload: data,
+ });
+};
+
+/**
+ * @param {any} dispatch - Global Dispatch
+ * @param {boolean} data - true || false
+ * @param { String } item - string of the needed action
+ */
+
+export const setLoading = (dispatch, data, item, where) => {
+ // console.log("setLoading data >>", data, where);
+ dispatch({
+ item,
+ type: REQUEST_LOADING,
+ payload: data,
+ });
+};
+
+/**
+ * @param {any} dispatch - Global Dispatch
+ * @param {Array | any} data - any[]
+ * @param { String } item - string of the needed action
+ */
+
+export const dataSuccess = (dispatch, data, item) => {
+ dispatch({
+ item,
+ type: REQUEST_SUCCESS,
+ payload: data,
+ });
+};
+/**
+ * @param {any} dispatch - Global Dispatch
+ * @param {Array | any} data - any[]
+ * @param { String } item - string of the needed action
+ */
+
+export const dataFailure = (dispatch, data, item) => {
+ dispatch({
+ item,
+ type: REQUEST_FAILED,
+ payload: data,
+ });
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param {Number | String} id - id
+ * @param {String} method - method
+ * @param {String} join - join
+ * @param {String} state - any string to represent the context field, default is viewModel
+ */
+
+export const getSingleModel = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ id,
+ method = "GET",
+ join = null,
+ state = RequestItems?.viewModel
+) => {
+ const sdk = new MkdSDK();
+ console.log("table >>", table);
+ setLoading(globalDispatch, true, state);
+ try {
+ sdk.setTable(table.trim());
+ const result = await sdk.callRestAPI(
+ { id: Number(id), ...{ ...(join ? { join: join } : null) } },
+ method
+ );
+
+ if (!result?.error) {
+ dataSuccess(globalDispatch, { data: result?.model }, state);
+ }
+ setLoading(globalDispatch, false, state);
+ // showToast(globalDispatch, "Project Saved", 4000, "info");
+ return {
+ error: false,
+ data: result?.model,
+ message: result?.message ?? "Success",
+ };
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, state);
+ dataFailure(globalDispatch, { message, id }, state);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true, message };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param {Array[Number] | Array[String]} filter - list of filters
+ * @param { String } join - join table
+ */
+
+export const getMany = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ filter = [],
+ join = null
+) => {
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, RequestItems?.listModel);
+ try {
+ // const filters = ids.map((id) => computeFilter("id", "in", id));
+ const result = await tdk.getList(table, {
+ ...{
+ ...(join ? { join: join } : null),
+ ...(filter && filter?.length ? { filter: filter } : null),
+ },
+ });
+
+ if (!result?.error) {
+ dataSuccess(
+ globalDispatch,
+ { data: result?.list },
+ RequestItems?.listModel
+ );
+ }
+ setLoading(globalDispatch, false, RequestItems?.listModel);
+ return { error: false, data: result?.list };
+ // showToast(globalDispatch, "Project Saved", 4000, "info");
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, RequestItems?.listModel);
+ // dataFailure(globalDispatch, { message, id }, RequestItems?.listModel);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true, message };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param {Array[Number] | Array[String]} ids - list of ids
+ * @param { String } join - join table
+ */
+
+export const getManyByIds = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ ids,
+ join = null
+) => {
+ console.log("join >>", join);
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, RequestItems?.listModel);
+ try {
+ const result = await tdk.getList(table, {
+ ...{
+ ...(join ? { join: join } : null),
+ filter: [`id,in,${ids.join(",")}`],
+ },
+ });
+
+ if (!result?.error) {
+ dataSuccess(
+ globalDispatch,
+ { data: result?.list },
+ RequestItems?.listModel
+ );
+ }
+ setLoading(globalDispatch, false, RequestItems?.listModel);
+ return { error: result?.error, data: result?.list };
+ // showToast(globalDispatch, "Project Saved", 4000, "info");
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, RequestItems?.listModel);
+ dataFailure(globalDispatch, { message, id }, RequestItems?.listModel);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true, message };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param { Object } payload - data to create
+ */
+
+export const createRequest = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ payload
+) => {
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, RequestItems?.createModel);
+ try {
+ const result = await tdk.create(table, payload);
+
+ if (!result?.error) {
+ dataSuccess(
+ globalDispatch,
+ { message: result?.message },
+ RequestItems?.createModel
+ );
+ setLoading(globalDispatch, false, RequestItems?.createModel);
+ showToast(globalDispatch, result?.message, 4000, "success");
+ return { error: false, data: result?.data };
+ } else {
+ setLoading(globalDispatch, false, RequestItems?.createModel);
+ showToast(globalDispatch, result?.message, 4000, "error");
+ return { error: true };
+ }
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, RequestItems?.createModel);
+ dataFailure(globalDispatch, { message }, RequestItems?.createModel);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param {String | Number} id - item id
+ * @param { Object } payload - data to create
+ */
+
+export const updateRequest = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ id,
+ payload
+) => {
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, RequestItems?.updateModel);
+ try {
+ const result = await tdk.update(table, id, payload);
+
+ if (!result?.error) {
+ // dataSuccess(globalDispatch, { message: result?.message }, RequestItems?.updateModel);
+ setLoading(globalDispatch, false, RequestItems?.updateModel);
+ showToast(globalDispatch, result?.message, 4000, "success");
+ return { error: false };
+ } else {
+ setLoading(globalDispatch, false, RequestItems?.updateModel);
+ showToast(globalDispatch, result?.message, 4000, "error");
+ return { error: true };
+ }
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, RequestItems?.updateModel);
+ // dataFailure(globalDispatch, { message }, RequestItems?.updateModel);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * * @param {String | Number} id - item id
+ * @param { Object } payload - data to create
+ */
+
+export const deleteRequest = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ id,
+ payload
+) => {
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, RequestItems?.deleteModel);
+ try {
+ const result = await tdk.delete(table, id, payload);
+
+ if (!result?.error) {
+ dataSuccess(
+ globalDispatch,
+ { message: result?.message },
+ RequestItems?.deleteModel
+ );
+ setLoading(globalDispatch, false, RequestItems?.deleteModel);
+ showToast(globalDispatch, result?.message, 4000, "success");
+ return { error: false, data: result?.data };
+ } else {
+ setLoading(globalDispatch, false, RequestItems?.deleteModel);
+ showToast(globalDispatch, result?.message, 4000, "error");
+ return { error: true };
+ }
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, RequestItems?.deleteModel);
+ dataFailure(globalDispatch, { message }, RequestItems?.deleteModel);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true };
+ }
+};
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param {String} table - table model
+ * @param { Object } options - options are filter, join, size, direction and order query
+ * @param { string } state - an optional string use as the data retrieval state in place of table
+ * @param { Array } [options.filter=null] filter: []
+ * @param { String } [options.join=null] join: "table1,table2,table3" - joins another table
+ * @param { Number } [options.size=10] size number of items per page
+ * @param { String } [options.order=id] order by any field | default is the id field
+ * @param { String } [options.direction=desc] direction, desc or asc | desc is the default
+ */
+
+export const getList = async (
+ globalDispatch,
+ authDispatch,
+ table,
+ options = {},
+ state
+) => {
+ const tdk = new TreeSDK();
+ setLoading(globalDispatch, true, state ?? table);
+ try {
+ const result = await tdk.getList(table, options);
+
+ if (!result?.error) {
+ // dataSuccess(globalDispatch, { message: result?.message }, table);
+ setLoading(globalDispatch, false, state ?? table);
+ // showToast(globalDispatch, result?.message, 4000, "success");
+ return { error: false, data: result?.list };
+ } else {
+ setLoading(globalDispatch, false, state ?? table);
+ // showToast(globalDispatch, result?.message, 4000, "error");
+ return result;
+ }
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, state ?? table);
+ // dataFailure(globalDispatch, { message }, table);
+ // showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true, message };
+ }
+};
+
+/**
+ * @typedef {Object} CustomRequestOptions
+ * @property {String} endpoint - the api endpoint
+ * @property { any } payload - Request Data
+ * @property { String } method - Request Method GET | POST | PATCH | DELETE | PUT - default -> GET
+ */
+
+/**
+ * @param {any} globalDispatch - Global Dispatch
+ * @param {any} authDispatch - Auth Dispatch
+ * @param { CustomRequestOptions } options - payload data
+ * @param { String } state - a field in the global content to access the loading state
+ */
+
+export const customRequest = async (
+ globalDispatch,
+ authDispatch,
+ options = { endpoint: "", paylod: null, method: "GET" },
+ state = RequestItems.customRequest
+) => {
+ if (!options.endpoint) {
+ showToast(
+ globalDispatch,
+ "options.endpoint is a required field",
+ 4000,
+ "error"
+ );
+ return { error: true };
+ }
+ const sdk = new MkdSDK();
+ setLoading(globalDispatch, true, state);
+ try {
+ const result = await sdk.customRequest(
+ options?.endpoint,
+ options?.method,
+ options?.payload
+ );
+
+ if (!result?.error) {
+ // dataSuccess(globalDispatch, { message: result?.message }, state);
+ setLoading(globalDispatch, false, state);
+ showToast(globalDispatch, result?.message ?? "Success", 4000, "success");
+ return {
+ ...result,
+ error: false,
+ data: result?.data,
+ message: result?.message,
+ };
+ } else {
+ setLoading(globalDispatch, false, state);
+ showToast(
+ globalDispatch,
+ result?.message ?? "An Error Occurred",
+ 4000,
+ "error"
+ );
+ return {
+ ...result,
+ error: true,
+ validation: result?.validation,
+ message: result?.message,
+ };
+ }
+ } catch (error) {
+ const message = error?.response?.data?.message
+ ? error?.response?.data?.message
+ : error?.message;
+ setLoading(globalDispatch, false, state);
+ // dataFailure(globalDispatch, { message }, state);
+ showToast(globalDispatch, message, 4000, "error");
+ tokenExpireError(authDispatch, message);
+ return { error: true, message };
+ }
+};
diff --git a/src/context/Global/GlobalConstants.jsx b/src/context/Global/GlobalConstants.jsx
new file mode 100644
index 0000000..fcc6216
--- /dev/null
+++ b/src/context/Global/GlobalConstants.jsx
@@ -0,0 +1,17 @@
+export const REQUEST_LOADING = "REQUEST_LOADING";
+export const REQUEST_SUCCESS = "REQUEST_SUCCESS";
+export const REQUEST_FAILED = "REQUEST_FAILED";
+export const SET_GLOBAL_PROPERTY = "SET_GLOBAL_PROPERTY";
+
+const RequestItems = {
+ viewModel: "viewModel",
+ createModel: "createModel",
+ updateModel: "updateModel",
+ listModel: "listModel",
+ deleteModel: "deleteModel",
+ customRequest: "customRequest",
+};
+
+Object.freeze(RequestItems);
+
+export { RequestItems };
diff --git a/src/context/Global/GlobalContext.jsx b/src/context/Global/GlobalContext.jsx
new file mode 100644
index 0000000..ddb6194
--- /dev/null
+++ b/src/context/Global/GlobalContext.jsx
@@ -0,0 +1,151 @@
+import React, { useReducer } from "react";
+import {
+ REQUEST_FAILED,
+ REQUEST_LOADING,
+ REQUEST_SUCCESS,
+ SET_GLOBAL_PROPERTY,
+} from "./GlobalConstants";
+
+/**
+ * @typedef {Object} GlobalState
+ * @property {string} globalMessage - Toast Message.
+ * @property {"success"| "error" | "warning"} toastStatus - Toast State - "success" | "error" | "warning".
+ * @property {boolean} isOpen
+ * @property {string} path
+ */
+
+/**
+ * The Value of the Global State .
+ * @param {GlobalState} initialState
+ */
+
+const initialState = {
+ globalMessage: "",
+ toastStatus: "success",
+ isOpen: true,
+ path: "",
+};
+
+export const GlobalContext = React.createContext(initialState);
+
+const reducer = (state, action) => {
+ switch (action?.type) {
+ case "SNACKBAR":
+ return {
+ ...state,
+ globalMessage: action.payload.message,
+ toastStatus: action.payload.toastStatus,
+ };
+ case "SETPATH":
+ return {
+ ...state,
+ path: action.payload.path,
+ };
+ case "OPEN_SIDEBAR":
+ return {
+ ...state,
+ isOpen: action.payload.isOpen,
+ };
+ case SET_GLOBAL_PROPERTY:
+ if (action.property.includes(".")) {
+ const [prop, field] = action.property.split(".");
+ return {
+ ...state,
+ [prop]: { ...state[prop], [field]: action?.payload },
+ };
+ } else {
+ return {
+ ...state,
+ [action.property]: action?.payload,
+ };
+ }
+ case REQUEST_LOADING:
+ return {
+ ...state,
+ [action.item]: {
+ ...state[action?.item],
+ loading: action?.payload,
+ },
+ };
+ case REQUEST_SUCCESS:
+ return {
+ ...state,
+ [action.item]: {
+ ...state[action?.item],
+ ...action?.payload,
+ data: action?.payload?.data,
+ error: false,
+ success: true,
+ loading: false,
+ },
+ };
+ case REQUEST_FAILED:
+ return {
+ ...state,
+ [action.item]: {
+ ...state[action?.item],
+ ...action?.payload,
+ error: true,
+ success: false,
+ loading: false,
+ },
+ };
+ default:
+ return state;
+ }
+};
+
+/**
+ * @param {"success"| "error" | "warning"} toastStatus
+ * @param {any} dispatch
+ * @param {string} message
+ * @param {number} timeout
+ */
+
+export const showToast = (
+ dispatch,
+ message,
+ timeout = 3000,
+ toastStatus = "success"
+) => {
+ dispatch({
+ type: "SNACKBAR",
+ payload: {
+ message,
+ toastStatus,
+ },
+ });
+
+ setTimeout(() => {
+ dispatch({
+ type: "SNACKBAR",
+ payload: {
+ message: "",
+ },
+ });
+ }, timeout);
+};
+
+export const setGlobalProjectRow = (dispatch, data) => {
+ dispatch({
+ type: "SET_PROJECT_ROW",
+ payload: data,
+ });
+};
+
+const GlobalProvider = ({ children }) => {
+ const [state, dispatch] = useReducer(reducer, initialState);
+
+ return (
+
+ {children}
+
+ );
+};
+
+export default GlobalProvider;
diff --git a/src/context/Global/InitialGlobalStates.jsx b/src/context/Global/InitialGlobalStates.jsx
new file mode 100644
index 0000000..04dfb93
--- /dev/null
+++ b/src/context/Global/InitialGlobalStates.jsx
@@ -0,0 +1,12 @@
+/**
+ * @property {boolean} loading
+ * @property {boolean} success
+ * @property {boolean} error
+ * @property {Array} data
+ * */
+export const PropertyInitialState = {
+ loading: false,
+ success: false,
+ error: false,
+ data: [],
+};
diff --git a/src/context/Global/index.js b/src/context/Global/index.js
new file mode 100644
index 0000000..671dfb9
--- /dev/null
+++ b/src/context/Global/index.js
@@ -0,0 +1,28 @@
+export {
+ default as GlobalProvider,
+ GlobalContext,
+ showToast,
+ setGlobalProjectRow,
+} from "./GlobalContext";
+export { PropertyInitialState } from "./InitialGlobalStates";
+
+export {
+ setGLobalProperty,
+ setLoading,
+ getSingleModel,
+ getManyByIds,
+ createRequest,
+ updateRequest,
+ deleteRequest,
+ getList,
+ getMany,
+ customRequest,
+} from "./GlobalActions";
+
+export {
+ RequestItems,
+ REQUEST_FAILED,
+ REQUEST_LOADING,
+ REQUEST_SUCCESS,
+ SET_GLOBAL_PROPERTY,
+} from "./GlobalConstants";
diff --git a/src/main.jsx b/src/main.jsx
index 8767ff9..eccbab4 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -1,10 +1,11 @@
import React from "react";
-import { AuthContext } from "./authContext";
import { Routes, Route, Navigate } from "react-router-dom";
-import SnackBar from "./components/SnackBar";
-import AdminDashboardPage from "./pages/AdminDashboardPage";
-import AdminLoginPage from "./pages/AdminLoginPage";
-import NotFoundPage from "./pages/NotFoundPage";
+import SnackBar from "Components/SnackBar";
+import { AuthContext } from "Context/Auth";
+import AdminLoginPage from "Pages/AdminLoginPage";
+import NotFoundPage from "Pages/NotFoundPage";
+import AdminDashboardPage from "Pages/AdminDashboardPage";
+import AdminListReceipts from "Pages/AdminListReceipts";
function renderRoutes(role) {
switch (role) {
@@ -15,6 +16,11 @@ function renderRoutes(role) {
path="/admin/dashboard"
element={
}
>
+
}
+ >
);
break;
@@ -22,6 +28,7 @@ function renderRoutes(role) {
return (
}>
+
}>
);
diff --git a/src/mkd_logo.png b/src/mkd_logo.png
new file mode 100644
index 0000000..83b2786
Binary files /dev/null and b/src/mkd_logo.png differ
diff --git a/src/pages/AdminListReceipts.jsx b/src/pages/AdminListReceipts.jsx
new file mode 100644
index 0000000..f215b46
--- /dev/null
+++ b/src/pages/AdminListReceipts.jsx
@@ -0,0 +1,380 @@
+import React, { useRef, useState } from "react";
+import MkdSDK from "Utils/MkdSDK";
+import { useNavigate } from "react-router-dom";
+import { AuthContext, tokenExpireError } from "Context/Auth";
+import {
+ GlobalContext,
+ customRequest,
+ setGLobalProperty,
+} from "Context/Global";
+import { MkdListTableV2 } from "Components/MkdListTable";
+import { EditIcon2, TrashIcon } from "Assets/svgs";
+import { AiFillEye } from "react-icons/ai";
+import { operations } from "Components/MkdListTable/MkdListTableBindOperations";
+import { receiptData } from "Utils/data";
+
+let sdk = new MkdSDK();
+
+const columns = [
+ {
+ header: "Row",
+ accessor: "row",
+ },
+ {
+ header: "id",
+ accessor: "id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "create_at",
+ accessor: "create_at",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "update_at",
+ accessor: "update_at",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "customer",
+ accessor: "company_name",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ join: "user",
+ },
+ {
+ header: "user_id",
+ accessor: "user_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "division",
+ accessor: "division_name",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ join: "division",
+ },
+ {
+ header: "division_id",
+ accessor: "division_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "campaign",
+ accessor: "campaign_name",
+ join: "campaigns",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "campaign_id",
+ accessor: "campaign_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "reference",
+ accessor: "reference",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "purchase_order",
+ accessor: "purchase_order",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "carrier",
+ accessor: "carrier",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "tracking_number",
+ accessor: "tracking_number",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "transaction_id",
+ accessor: "transaction_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "bill_of_lading_number",
+ accessor: "bill_of_lading_number",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "status",
+ accessor: "receipt_status",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: true,
+ mappings: {
+ 0: "open",
+ 1: "closed",
+ },
+ },
+ {
+ header: "arrival_date",
+ accessor: "arrival_date",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "seal_number",
+ accessor: "seal_number",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "trailer_number",
+ accessor: "trailer_number",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "line_items",
+ accessor: "line_items",
+ isSorted: true,
+ list: true,
+ limit: 6,
+ listType: "json|object_array",
+ action: {
+ key: "sku",
+ operation: "list",
+ },
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "item_id",
+ accessor: "item_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "receipt_charges",
+ accessor: "receipt_charges",
+ isSorted: true,
+ list: true,
+ limit: 6,
+ listType: "json|object_array",
+ action: {
+ key: "total_charges",
+ operation: "add",
+ },
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "expected_date",
+ accessor: "expected_date",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "warehouse",
+ accessor: "warehouse",
+ join: "warehouse",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "warehouse_id",
+ accessor: "warehouse_id",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "notes",
+ accessor: "notes",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "labor_hours",
+ accessor: "labor_hours",
+ isSorted: true,
+ selected_column: true,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "attached_files",
+ accessor: "attached_files",
+ isSorted: true,
+ selected_column: false,
+ isSortedDesc: false,
+ mappingExist: false,
+ mappings: {},
+ },
+ {
+ header: "Action",
+ accessor: "",
+ },
+];
+
+const AdminListReceipts = () => {
+ // Ref
+ const refreshRef = useRef();
+
+ // Context
+ const { dispatch } = React.useContext(AuthContext);
+ const {
+ dispatch: globalDispatch,
+ state: { confirmRequest },
+ } = React.useContext(GlobalContext);
+
+ return (
+
+
navigate(`/admin/view-receipts/${ids[0]}`),
+ multiple: false,
+ locations: ["buttons", "dropdown"],
+ icon: ,
+ },
+ edit: {
+ show: true,
+ // action: (ids) => navigate(`/admin/edit-receipts/${ids[0]}`),
+ multiple: false,
+ locations: ["buttons", "dropdown"],
+ icon: ,
+ bind: {
+ column: "receipt_status",
+ action: "hide",
+ operator: operations.EQUAL,
+ ifValue: 1,
+ },
+ },
+ delete: {
+ show: true,
+ action: null,
+ multiple: false,
+ locations: ["buttons", "dropdown"],
+ icon: ,
+ bind: {
+ column: "receipt_status",
+ action: "hide",
+ operator: operations.EQUAL,
+ ifValue: 1,
+ },
+ },
+ add: {
+ show: false,
+ // action: () => navigate("/admin/add-receipts"),
+ multiple: true,
+ children: "+",
+ },
+ export: {
+ show: false,
+ action: null,
+ multiple: true,
+ showText: false,
+ className: "!p-0 !bg-white !border-0",
+ },
+ }}
+ actionPostion={[`buttons`]}
+ // allowEditing
+ refreshRef={refreshRef}
+ />
+
+ );
+};
+
+export default AdminListReceipts;
diff --git a/src/pages/AdminLoginPage.jsx b/src/pages/AdminLoginPage.jsx
index 3444470..f38d01f 100644
--- a/src/pages/AdminLoginPage.jsx
+++ b/src/pages/AdminLoginPage.jsx
@@ -1,10 +1,10 @@
import React from "react";
+import { useNavigate } from "react-router-dom";
import { useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
-import MkdSDK from "../utils/MkdSDK";
-import { useNavigate } from "react-router-dom";
-import { AuthContext } from "../authContext";
+import MkdSDK from "Utils/MkdSDK";
+import { AuthContext } from "Context/Auth";
const AdminLoginPage = () => {
const schema = yup
diff --git a/src/utils/TreeSDK.jsx b/src/utils/TreeSDK.jsx
new file mode 100644
index 0000000..f029818
--- /dev/null
+++ b/src/utils/TreeSDK.jsx
@@ -0,0 +1,418 @@
+import { empty } from "./utils";
+
+export default function TreeSDK() {
+ this._baseurl = "https://reacttask.mkdlabs.com";
+ this._project_id = "reacttask";
+ this._secret = "d9hedycyv6p7zw8xi34t9bmtsjsigy5t7";
+ this._table = "";
+
+ const raw = this._project_id + ":" + this._secret;
+ let base64Encode = btoa(raw);
+
+ this.updateXProject = function (projectId, secret) {
+ console.log(projectId, secret);
+ base64Encode = btoa(projectId + ":" + secret);
+ };
+ this.resetXPRoject = function () {
+ base64Encode = btoa(raw);
+ };
+
+ this.getHeader = function () {
+ return {
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ "x-project": base64Encode,
+ };
+ };
+
+ this.baseUrl = function () {
+ return this._baseurl;
+ };
+
+ this.getProjectId = function () {
+ return this._project_id;
+ };
+
+ this.treeBaseUrl = function () {
+ return this._baseurl + "/v4/api/records";
+ };
+
+ function getJoins(options = {}) {
+ let hasJoin = options.hasOwnProperty("join");
+ let joins = hasJoin && options.join !== undefined ? options.join : [];
+ if (hasJoin && typeof joins === "string") {
+ joins = joins.split(",");
+ } else if (hasJoin && typeof joins === "object" && !Array.isArray(joins)) {
+ joins = [];
+ }
+ console.log("joins >>", joins);
+ let joinQuery = "";
+ joins.forEach((join) => {
+ joinQuery += `join=${join}&`;
+ });
+ console.log("joinQuery >>", joinQuery);
+
+ return [hasJoin, joins, joinQuery];
+ }
+
+ function getOrdering(options) {
+ let order = options.order ? options.order : "id";
+ let direction = options.direction ? options.direction : "desc";
+
+ return `order=${order},${direction}&`;
+ }
+
+ function getFilters(options) {
+ let hasFilter = options.hasOwnProperty("filter");
+ let filters = options.filter;
+
+ let filterQuery = "";
+ if (hasFilter && Array.isArray(filters)) {
+ filters.forEach((filter) => {
+ filterQuery += `filter=${filter}&`;
+ });
+ }
+
+ return [hasFilter, filters, filterQuery];
+ }
+
+ /*
+ Returns one entry
+ @params table : string - name of table to fetch
+ @params id : number - id to fetch
+ @params options : object - optional parameters
+ options.join - Array or comma separated list of tables to join
+
+ let res = await (new TreeSDK).getOne('author', 1 {
+ join: ['book'],
+ });
+
+ */
+
+ this.getOne = async function (table, id, options = {}) {
+ if (empty(table) || empty(id)) throw new Error("table and id is required.");
+
+ let [hasJoin, joins, joinQuery] = getJoins(options);
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+
+ const getResult = await fetch(
+ this.treeBaseUrl() + `/${table}/${id}?${joinQuery}`,
+ {
+ method: "get",
+ headers: header,
+ }
+ );
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns one or more entries
+ @params table : string - name of table to fetch
+ @params ids : Array|string|number - array, comma separated list of ids or just a single id to fetch
+ @params options : object - optional parameters
+ options.join - Array or comma separated list of tables to join
+
+ let res = await (new TreeSDK).getMany('author', [1,2] {
+ join: ['book'],
+ });
+
+*/
+ this.getMany = async function (table, ids, options = {}) {
+ if (empty(table) || empty(ids))
+ throw new Error("table and id is required.");
+
+ let [hasJoin, joins, joinQuery] = getJoins(options);
+ let id = Array.isArray(ids) ? ids.join(",") : ids;
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+
+ const getResult = await fetch(
+ this.treeBaseUrl() + `/${table}/${id}?${joinQuery}`,
+ {
+ method: "get",
+ headers: header,
+ }
+ );
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns one or more entries with ordering and filters
+ @params table : string - name of table to fetch
+ @params options : object - optional parameters
+ options.join - Array or comma separated list of tables to join
+ options.filter -
+ options.order - field used to sort the result
+ options.direction - direction of result asc|desc
+ options.size - max number of entries
+
+ let res = await (new TreeSDK).getList('author', {
+ filter: ['id,gt,2'],
+ join: ['book']
+ });
+
+*/
+ this.getList = async function (table, options = {}) {
+ if (empty(table)) throw new Error("table and id is required.");
+ let [hasJoin, joins, joinQuery] = getJoins(options);
+ let [hasFilter, filters, filterQuery] = getFilters(options);
+ let orderQuery = getOrdering(options);
+ let sizeQuery = options.hasOwnProperty("size")
+ ? `size=${options.size}&`
+ : "";
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+
+ const getResult = await fetch(
+ this.treeBaseUrl() +
+ `/${table}?${joinQuery}${orderQuery}${sizeQuery}${filterQuery}`,
+ {
+ method: "get",
+ headers: header,
+ }
+ );
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns a paginated list of entries
+ @params table : string - name of table to fetch
+ @params options : object - optional parameters
+ options.join - Array or comma separated list of tables to join
+ options.filter -
+ options.order - field used to sort the result
+ options.direction - direction of result asc|desc
+ options.page - page number
+ options.size - max number of entries
+
+ let res = await (new TreeSDK).getPaginate('author', {
+ filter: ['id,gt,2'],
+ join: ['book']
+ });
+
+*/
+ this.getPaginate = async function (table, options = {}) {
+ if (empty(table)) throw new Error("table and id is required.");
+
+ let [hasJoin, joins, joinQuery] = getJoins(options);
+ let [hasFilter, filters, filterQuery] = getFilters(options);
+ let orderQuery = getOrdering(options);
+ console.table({ orderQuery, joinQuery, filterQuery });
+ let size = options.size ?? 20;
+ let pageQuery = options.hasOwnProperty("page")
+ ? `page=${options.page},${size}&`
+ : `page=1&`;
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+ const getResult = await fetch(
+ this.treeBaseUrl() +
+ `/${table}?${joinQuery}${orderQuery}${pageQuery}${filterQuery}`,
+ {
+ method: "get",
+ headers: header,
+ }
+ );
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns Creates a new entry
+ @params table : string - name of table to fetch
+ @params options : object - optional parameters
+
+
+ let res = await (new TreeSDK).create('author', {
+ name: 'authro name',
+ age: 23
+ });
+
+
+*/
+ this.create = async function (table, payload, options = {}) {
+ if (empty(table)) throw new Error("table and id is required.");
+
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+ const getResult = await fetch(this.treeBaseUrl() + `/${table}`, {
+ method: "post",
+ headers: header,
+ body: JSON.stringify(payload),
+ });
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns Updates an entry
+ @params table : string - name of table to update
+ @params id : number - id of table entry to update
+ @params payload : object - key value pair for values to update
+
+ let res = await (new TreeSDK).update('author', 2 {
+ name: 'updated author name',
+ });
+
+*/
+ this.update = async function (table, id, payload) {
+ if (empty(table) || empty(id)) throw new Error("table and id is required.");
+
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+ const getResult = await fetch(this.treeBaseUrl() + `/${table}/${id}`, {
+ method: "put",
+ headers: header,
+ body: JSON.stringify(payload),
+ });
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ this.updateWhere = async function (table, where, payload) {
+ if (empty(table) || empty(id)) throw new Error("table and id is required.");
+ if (Object.keys(where).length === 0)
+ throw new Error("condition is required.");
+
+ payload["updateCondition"] = where;
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+ const getResult = await fetch(this.treeBaseUrl() + `/${table}`, {
+ method: "put",
+ headers: header,
+ body: JSON.stringify(payload),
+ });
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ /*
+ Returns Delete an entry
+ @params table : string - name of table to delete from
+ @params id : number - id of table entry to delete
+
+ let res = await (new TreeSDK).delete('author', 2);
+*/
+ this.delete = async function (table, id, payload) {
+ if (empty(table) || empty(id)) throw new Error("table and id is required.");
+
+ const header = {
+ "Content-Type": "application/json",
+ "x-project": base64Encode,
+ Authorization: "Bearer " + localStorage.getItem("token"),
+ };
+ const getResult = await fetch(this.treeBaseUrl() + `/${table}/${id}`, {
+ method: "delete",
+ headers: header,
+ body: JSON.stringify(payload),
+ });
+ const json = await getResult.json();
+
+ if (getResult.status === 401) {
+ throw new Error(json.message);
+ }
+
+ if (getResult.status === 403) {
+ throw new Error(json.message);
+ }
+ return json;
+ };
+
+ return this;
+}
+/*
+
+cs contains string
+sw starts with
+ew ends with
+eq
+ equal
+Default when no operator is provided
+lt less than
+le less or equal
+ge greater or equal
+gt greater than
+bt between
+in in list
+is is null
+
+*/
diff --git a/src/utils/data.jsx b/src/utils/data.jsx
new file mode 100644
index 0000000..c6d4f8c
--- /dev/null
+++ b/src/utils/data.jsx
@@ -0,0 +1,1658 @@
+export const receiptData = [
+ {
+ id: 20,
+ create_at: "2024-06-18",
+ update_at: "2024-06-18T19:10:58.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "1gteyt3jbfduybuf",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "479518676787857",
+ campaign: "15",
+ campaign_id: 15,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-18",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"f043b4ac-3c2c-bad7-4529-c2e4f94f8189","category":"one_sheet","item_id":88,"sku":"1097","quantity":"5000","inventory_units_of_measure":{"id":44,"create_at":"2024-06-18","update_at":"2024-06-18T16:23:45.000Z","primary_unit_of_measure":"each","primary_upc":null,"item_id":88,"length":"11","width":"11","height":"11","weight":"25000","primary_units":"each"},"packaging_units":{"master_carton":null,"primary_units_per_package":null,"packaging_upc":null,"master_carton_length":null,"master_carton_width":null,"master_carton_height":null,"master_carton_weight":null,"master_carton_net_weight":null},"location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/010275745538images.jpeg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"d5647013-fcc3-87d6-a7fe-eb8633bb32c6","charge_classification":"Receiving","charge_category":"packaging","charge_name":"customer division","charge":"3","packaging_material_id":6,"quantity":50,"total_charges":150},{"id":"221f3265-6ee2-aebc-834b-a4e263b515e9","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"40","quantity":1.15,"total_charges":50}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/018147466850download.png"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: 15,
+ user_id: 43,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:39:00.000Z",
+ campaign_name: "Immaculate",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 19,
+ create_at: "2024-06-18",
+ update_at: "2024-06-18T16:58:19.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "1gteyt3jbfduybu",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "614546361648636",
+ campaign: "15",
+ campaign_id: 15,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-18",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"f0acf184-50ea-70d5-43c3-659717e7a262","category":"one_sheet","item_id":88,"sku":"1097","quantity":"5000","inventory_units_of_measure":{"weight":"25000","primary_units":"each","length":"11","width":"11","height":"11","id":44},"packaging_units":{"packaging_upc":null,"master_carton_length":null,"master_carton_width":null,"master_carton_height":null,"master_carton_weight":null,"master_carton_net_weight":null},"location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/010275745538images.jpeg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"17db3643-d6e6-9a93-df8f-0e67011c0679","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":50,"total_charges":"100"},{"id":"b62c6d99-f38f-ad36-79b8-96269ca67bb7","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"40","quantity":1,"total_charges":"40"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/026206207508download.jpeg"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: 15,
+ user_id: 43,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:39:00.000Z",
+ campaign_name: "Immaculate",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 18,
+ create_at: "2024-06-12",
+ update_at: "2024-06-12T18:42:19.000Z",
+ customer: "45",
+ user_id: 45,
+ division: {
+ id: 23,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:56:35.000Z",
+ division_name: "PUB",
+ user_id: 45,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: 1,
+ },
+ division_id: 23,
+ reference: "6122024DISNEY",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "573017820425498",
+ campaign: "17",
+ campaign_id: 17,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"4aa335dd-e605-c0c9-1939-f7b5fcc57b30","category":"one_sheet","item_id":81,"sku":"1089","quantity":"5000","weight":"1200","primary_units":"each","length":"28","width":"3","height":"3","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/08638683926861LlN%2Bd0DmL.jpg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"3916b105-4bff-eeb2-60e8-08c11b2b77c2","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":5,"total_charges":"10"},{"id":"dc9248e0-b4d4-3fcf-fae9-930265857749","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"1","quantity":1,"total_charges":"1"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 45,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Disney",
+ email: "disney@disney.com",
+ password: "$2a$10$QdrWtrcdXCETmUorOY9Lq.D92Dch2XpobpL1Ez6J39z4ooC/Rh1tu",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:55:52.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "219 Burbank Dr.",
+ state: "CA",
+ city: "Burbank",
+ country: "United States",
+ zip_code: "91745",
+ },
+ campaigns: {
+ id: 17,
+ user_id: 45,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:58:52.000Z",
+ campaign_name: "Inside Out 2",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 17,
+ create_at: "2024-06-12",
+ update_at: "2024-06-12T18:42:17.000Z",
+ customer: "45",
+ user_id: 45,
+ division: {
+ id: 23,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:56:35.000Z",
+ division_name: "PUB",
+ user_id: 45,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: 1,
+ },
+ division_id: 23,
+ reference: "6122024DISNEY",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "573017820425498",
+ campaign: "17",
+ campaign_id: 17,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"4aa335dd-e605-c0c9-1939-f7b5fcc57b30","category":"one_sheet","item_id":81,"sku":"1089","quantity":"5000","weight":"1200","primary_units":"each","length":"28","width":"3","height":"3","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/08638683926861LlN%2Bd0DmL.jpg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"3916b105-4bff-eeb2-60e8-08c11b2b77c2","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":5,"total_charges":"10"},{"id":"dc9248e0-b4d4-3fcf-fae9-930265857749","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"1","quantity":1,"total_charges":"1"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 45,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Disney",
+ email: "disney@disney.com",
+ password: "$2a$10$QdrWtrcdXCETmUorOY9Lq.D92Dch2XpobpL1Ez6J39z4ooC/Rh1tu",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:55:52.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "219 Burbank Dr.",
+ state: "CA",
+ city: "Burbank",
+ country: "United States",
+ zip_code: "91745",
+ },
+ campaigns: {
+ id: 17,
+ user_id: 45,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:58:52.000Z",
+ campaign_name: "Inside Out 2",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 16,
+ create_at: "2024-06-12",
+ update_at: "2024-06-12T18:42:16.000Z",
+ customer: "45",
+ user_id: 45,
+ division: {
+ id: 23,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:56:35.000Z",
+ division_name: "PUB",
+ user_id: 45,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: 1,
+ },
+ division_id: 23,
+ reference: "6122024DISNEY",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "573017820425498",
+ campaign: "17",
+ campaign_id: 17,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"4aa335dd-e605-c0c9-1939-f7b5fcc57b30","category":"one_sheet","item_id":81,"sku":"1089","quantity":"5000","weight":"1200","primary_units":"each","length":"28","width":"3","height":"3","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/08638683926861LlN%2Bd0DmL.jpg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"3916b105-4bff-eeb2-60e8-08c11b2b77c2","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":5,"total_charges":"10"},{"id":"dc9248e0-b4d4-3fcf-fae9-930265857749","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"1","quantity":1,"total_charges":"1"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 45,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Disney",
+ email: "disney@disney.com",
+ password: "$2a$10$QdrWtrcdXCETmUorOY9Lq.D92Dch2XpobpL1Ez6J39z4ooC/Rh1tu",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:55:52.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "219 Burbank Dr.",
+ state: "CA",
+ city: "Burbank",
+ country: "United States",
+ zip_code: "91745",
+ },
+ campaigns: {
+ id: 17,
+ user_id: 45,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:58:52.000Z",
+ campaign_name: "Inside Out 2",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 15,
+ create_at: "2024-06-12",
+ update_at: "2024-06-12T18:41:48.000Z",
+ customer: "45",
+ user_id: 45,
+ division: {
+ id: 23,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:56:35.000Z",
+ division_name: "PUB",
+ user_id: 45,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: 1,
+ },
+ division_id: 23,
+ reference: "6122024DISNEY",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "573017820425498",
+ campaign: "17",
+ campaign_id: 17,
+ bill_of_lading_number: null,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"4aa335dd-e605-c0c9-1939-f7b5fcc57b30","category":"one_sheet","item_id":81,"sku":"1089","quantity":"5000","weight":"1200","primary_units":"each","length":"28","width":"3","height":"3","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/08638683926861LlN%2Bd0DmL.jpg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"3916b105-4bff-eeb2-60e8-08c11b2b77c2","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":5,"total_charges":"10"},{"id":"dc9248e0-b4d4-3fcf-fae9-930265857749","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"1","quantity":1,"total_charges":"1"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 45,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Disney",
+ email: "disney@disney.com",
+ password: "$2a$10$QdrWtrcdXCETmUorOY9Lq.D92Dch2XpobpL1Ez6J39z4ooC/Rh1tu",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:55:52.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "219 Burbank Dr.",
+ state: "CA",
+ city: "Burbank",
+ country: "United States",
+ zip_code: "91745",
+ },
+ campaigns: {
+ id: 17,
+ user_id: 45,
+ create_at: "2024-06-10",
+ update_at: "2024-06-10T18:58:52.000Z",
+ campaign_name: "Inside Out 2",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 14,
+ create_at: "2024-06-11",
+ update_at: "2024-06-11T19:43:16.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "23423423423",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "561546367187429",
+ campaign: "15",
+ campaign_id: 15,
+ bill_of_lading_number: null,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"e638f603-8638-dd75-1f47-633469a8a211","category":"one_sheet","item_id":66,"sku":"1078","quantity":"123","weight":"220","primary_units":"each","length":"28","width":"3","height":"3","master_carton":"pallet","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/017133254835E1386_reduced.jpg"},{"id":"cf9bdde8-7623-32d5-525e-f09652130df0","category":"one_sheet","item_id":66,"sku":"1078","quantity":"20","weight":"123","primary_units":"each","length":"28","width":"3","height":"3","master_carton":null,"master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/010275745538images.jpeg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"8ecce625-ce61-f24e-274c-c320061b8d64","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0.65","quantity":1,"total_charges":"0.65"}]',
+ expected_date: "2024-06-11",
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: 15,
+ user_id: 43,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:39:00.000Z",
+ campaign_name: "Immaculate",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 13,
+ create_at: "2024-06-11",
+ update_at: "2024-06-11T19:42:56.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "23423423423",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "561546367187429",
+ campaign: "15",
+ campaign_id: 15,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-12",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"e638f603-8638-dd75-1f47-633469a8a211","category":"one_sheet","item_id":66,"sku":"1078","quantity":"123","weight":"220","primary_units":"each","length":"28","width":"3","height":"3","master_carton":"pallet","master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/017133254835E1386_reduced.jpg"},{"id":"cf9bdde8-7623-32d5-525e-f09652130df0","category":"one_sheet","item_id":66,"sku":"1078","quantity":"20","weight":"123","primary_units":"each","length":"28","width":"3","height":"3","master_carton":null,"master_carton_dim":"LengthxWidthxHeight","location":47,"receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/010275745538images.jpeg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"8ecce625-ce61-f24e-274c-c320061b8d64","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0.65","quantity":1,"total_charges":"0.65"}]',
+ expected_date: "2024-06-11",
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files: null,
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: 15,
+ user_id: 43,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:39:00.000Z",
+ campaign_name: "Immaculate",
+ current_campaign: 1,
+ status: 1,
+ },
+ },
+ {
+ id: 12,
+ create_at: "2024-06-01",
+ update_at: "2024-06-01T21:05:19.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "WC6124",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "223697355607790",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-06-01",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"c1f673bf-ce1b-d7eb-5725-3e3bc038f7f0","category":"one_sheet","item_id":"66","sku":"1078","quantity":"10000","weight":"2400","primary_units":"each","length":"28","width":"3","height":"3","master_carton":"each","master_carton_dim":"45","location":"43","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/001284178495compositor.jpg"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"c8d0ce61-1991-ef56-f403-a4178bf578df","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":1,"total_charges":"1"},{"id":"2ea78436-f6a9-d02a-526e-63d1f43c2702","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":2,"total_charges":"4"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/093126543085IMG_8514.jpg"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 11,
+ create_at: "2024-05-30",
+ update_at: "2024-05-30T22:56:09.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 21,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:13.000Z",
+ division_name: "PUB",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 21,
+ reference: "bsiknlnbdfbfbbi",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "611047266868010",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-05-30",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"0b8d21b3-0095-fe5b-9409-7a2bd2d0678e","category":"one_sheet","item_id":"55","sku":"1066","quantity":"5000","weight":"5","primary_units":"each","length":"28","width":"4","height":"4","master_carton":"each","master_carton_dim":"23x12x24","location":"36","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/038599375988maskable-icon-512x512.png"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"983c08c1-1b2c-eed8-4ddd-352ba51ccb15","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":7,"total_charges":"7"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/013920896158download.jpeg"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 10,
+ create_at: "2024-05-16",
+ update_at: "2024-05-16T20:33:17.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 20,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:03.000Z",
+ division_name: "ER",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 20,
+ reference: "WC51424Immaculate",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "888568289263516",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: null,
+ receipt_status: 0,
+ status: 1,
+ arrival_date: "2024-05-16",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"12f23a89-74f4-7578-e362-c7f175ad121c","category":"one_sheet","item_id":"57","sku":"1070","quantity":"400","weight":"400","primary_units":"each","length":"28","width":"4","height":"4","volume":"4456","master_carton":"4545","master_carton_dim":"4545","location":"42","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/094181223349Spiderman.JPG"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"96cdddea-f7f5-1484-1868-27351a1bd31c","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":0.5,"total_charges":"0.5"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: "fdggfdgfdgfdgf",
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/042867860428download.png"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 9,
+ create_at: "2024-05-16",
+ update_at: "2024-05-16T19:16:18.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 20,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:03.000Z",
+ division_name: "ER",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 20,
+ reference: "WC51624_TEST",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "768717187937809",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: null,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-05-16",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"9b617802-9a5e-9be6-6e6f-56b9df0ebb5b","category":"one_sheet","item_id":"57","sku":"1070","quantity":"500","weight":"100","primary_units":"each","length":"28","width":"4","height":"4","volume":"132","master_carton":"25","master_carton_dim":"5456","location":"41","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/094181223349Spiderman.JPG"},{"id":"06b48f60-d438-d761-9f7e-3c50a674739e","category":"one_sheet","item_id":"58","sku":"1072","quantity":"400","weight":"800","primary_units":"each","length":"2","width":"2","height":"2","volume":"45","master_carton":"45","master_carton_dim":"45","location":"43","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/019493931444download.png"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"7baa0bdd-57b8-9679-6ecc-1d72b032ae92","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":0.5,"total_charges":"0.5"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/031618087407download.png"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 8,
+ create_at: "2024-05-16",
+ update_at: "2024-05-16T18:28:24.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 20,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:03.000Z",
+ division_name: "ER",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 20,
+ reference: "WC51624_Babes",
+ purchase_order: null,
+ carrier: null,
+ tracking_number: null,
+ transaction_id: "578806120062846",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: null,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-05-16",
+ sku: null,
+ seal_number: null,
+ trailer_number: null,
+ line_items:
+ '[{"id":"6677fc04-52a5-9344-f068-23cc32529156","category":"one_sheet","item_id":"57","sku":"1070","quantity":"100","weight":"10","primary_units":"each","length":"28","width":"4","height":"4","volume":"10","master_carton":"50","master_carton_dim":"4","location":"43","receive_onto_hold":false,"photo":"https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/094181223349Spiderman.JPG"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"9c6e6cfb-1281-ad97-025d-62c81b2fe4e0","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":0.25,"total_charges":"0.25"}]',
+ expected_date: null,
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: null,
+ labor_hours: null,
+ attached_files:
+ '["https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/042796556033download.png"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 7,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:47:40.000Z",
+ customer: "43",
+ user_id: 43,
+ division: {
+ id: 20,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T16:38:03.000Z",
+ division_name: "ER",
+ user_id: 43,
+ status: 1,
+ billing: 1,
+ rate_card_id: 9,
+ freight_account_id: null,
+ },
+ division_id: 20,
+ reference: "WC51424Immaculate",
+ purchase_order: "465456",
+ carrier: "Courier - GIN",
+ tracking_number: 5445,
+ transaction_id: "182681078650093",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: 56544,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-05-10",
+ sku: null,
+ seal_number: 454,
+ trailer_number: 3545,
+ line_items:
+ '[{"id":"15807bd5-d8d1-0741-300f-22df1ef9fa7e","category":"one_sheet","item_id":"57","sku":"1070","quantity":"10000","weight":"0","primary_units":"0","length":"0","width":"0","height":"0","volume":"0","master_carton":"50","master_carton_dim":"448","location":"12","receive_onto_hold":false,"photo":"0"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"61c39568-0c4b-6830-a853-6f429bc7e0eb","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"0","quantity":1,"total_charges":"0"}]',
+ expected_date: "2024-05-10",
+ warehouse: {
+ id: 16,
+ status: 1,
+ create_at: "2024-04-30",
+ update_at: "2024-05-24T14:44:19.000Z",
+ warehouse: "QSM Fulfillment - Covina",
+ address: "1665 W INDUSTRIAL PARK ST",
+ phone: "6269670900",
+ state: "CA",
+ city: "COVINA",
+ zip_code: 91722,
+ default_warehouse: 1,
+ country: "US",
+ email: "william@qualitysignandmarquee.com",
+ },
+ warehouse_id: 16,
+ notes: "TS",
+ labor_hours: 1,
+ attached_files: '["0"]',
+ user: {
+ id: 43,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Neon",
+ email: "kim@neonrated.com",
+ password: "$2a$10$66WHkFkUYuy930WIOZteFuFYvuwjgo5hhBXjIACPs.WcNEmuM35JG",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-14",
+ update_at: "2024-05-16T17:59:27.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "12345 Number Lane",
+ state: "NY",
+ city: "New York",
+ country: "United States",
+ zip_code: "10001",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 6,
+ create_at: "2024-05-14",
+ update_at: "2024-05-14T15:36:13.000Z",
+ customer: "41",
+ user_id: 41,
+ division: {
+ id: 14,
+ create_at: "2024-05-07",
+ update_at: "2024-05-13T17:09:59.000Z",
+ division_name: "Another One",
+ user_id: 41,
+ status: 1,
+ billing: 1,
+ rate_card_id: 8,
+ freight_account_id: 1,
+ },
+ division_id: 14,
+ reference: "3454232343",
+ purchase_order: "235235",
+ carrier: "Fedx",
+ tracking_number: 3232432,
+ transaction_id: "234482890928080",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: 23432434,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-05-17",
+ sku: null,
+ seal_number: 54354345,
+ trailer_number: 234234234,
+ line_items:
+ '[{"id":"32da3041-3314-65b7-9ca6-d2859bc53226","category":"premium","item_id":"56","sku":"1068","quantity":"10","weight":"220","primary_units":"each","length":"20","width":"40","height":"60","volume":"280","master_carton":"234243","master_carton_dim":"234234","location":"18","receive_onto_hold":false,"photo":"0"}]',
+ item_id: null,
+ receipt_charges: null,
+ expected_date: "2024-05-15",
+ warehouse: {
+ id: 18,
+ status: 1,
+ create_at: "2024-05-01",
+ update_at: "2024-05-08T14:46:32.000Z",
+ warehouse: "far north",
+ address: "17939 Kieth Harrow Blvd",
+ phone: "+27478478478",
+ state: "TX",
+ city: "Houston",
+ zip_code: 77084,
+ default_warehouse: 0,
+ country: "Bangladesh",
+ email: null,
+ },
+ warehouse_id: 18,
+ notes: "Panda",
+ labor_hours: 14,
+ attached_files: '["0"]',
+ user: {
+ id: 41,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "Tests",
+ email: "test@name.coms",
+ password: "$2a$10$XthdkKyyT.bNyj4YosQZ/OcB..bSMKi.ndeqJt3jYUOtYZO.StkaO",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo: null,
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-05-07",
+ update_at: "2024-05-08T14:45:34.000Z",
+ company: null,
+ division: null,
+ dashboard_image: null,
+ avatar_image: null,
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: "Billings",
+ state: "Souths",
+ city: "Norths",
+ country: "Austria",
+ zip_code: "1234567",
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+ {
+ id: 5,
+ create_at: "2024-05-02",
+ update_at: "2024-05-02T17:35:09.000Z",
+ customer: "8",
+ user_id: 8,
+ division: {
+ id: 13,
+ create_at: "2024-05-02",
+ update_at: "2024-05-02T13:07:15.000Z",
+ division_name: "yaba division",
+ user_id: 8,
+ status: 1,
+ billing: 0,
+ rate_card_id: null,
+ freight_account_id: null,
+ },
+ division_id: 13,
+ reference: "bsiknlnbdfbfbbi",
+ purchase_order: "PO-764519120397392",
+ carrier: "Carrier",
+ tracking_number: 12345,
+ transaction_id: "764519120397392",
+ campaign: null,
+ campaign_id: null,
+ bill_of_lading_number: 5676778,
+ receipt_status: 1,
+ status: 1,
+ arrival_date: "2024-05-02",
+ sku: null,
+ seal_number: 233444,
+ trailer_number: 24354545,
+ line_items:
+ '[{"id":"a339a7d4-a5ba-60b7-cdbf-2c42fba82bec","category":"one_sheet","item_id":"52","sku":"1057","quantity":"50","weight":"22","primary_units":"carton","length":"2","width":"2","height":"3.5","volume":"5.3","master_carton":"master carton","master_carton_dim":"23","location":"8","receive_onto_hold":false,"photo":"0"},{"id":"91527db2-c453-08d1-5b92-8d5442810953","category":"one_sheet","item_id":"45","sku":"1055","quantity":"50","weight":"12","primary_units":"carton","length":"2","width":"2","height":"3","volume":"34","master_carton":"master carton","master_carton_dim":"12","location":"8","receive_onto_hold":false,"photo":"0"}]',
+ item_id: null,
+ receipt_charges:
+ '[{"id":"7c84c19b-b06d-fcbc-5ab8-07298ff0a762","charge_classification":"Receiving","charge_category":"labor","charge_name":"Hourly Labor","charge":"40","quantity":1,"total_charges":"40"},{"id":"2ca07773-d30c-a277-6ee9-b7f9d6287af5","charge_classification":"Receiving","charge_category":"packaging","charge_name":"Tri-Tube (One Sheet 1-5)","charge":"2","quantity":2,"total_charges":"4"}]',
+ expected_date: "2024-05-02",
+ warehouse: {
+ id: 18,
+ status: 1,
+ create_at: "2024-05-01",
+ update_at: "2024-05-08T14:46:32.000Z",
+ warehouse: "far north",
+ address: "17939 Kieth Harrow Blvd",
+ phone: "+27478478478",
+ state: "TX",
+ city: "Houston",
+ zip_code: 77084,
+ default_warehouse: 0,
+ country: "Bangladesh",
+ email: null,
+ },
+ warehouse_id: 18,
+ notes: "note",
+ labor_hours: 3,
+ attached_files:
+ '["0","0","https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/005759743714download.jpeg","https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/016524207558ab_test_image.jpeg"]',
+ user: {
+ id: 8,
+ user_id: 0,
+ oauth: null,
+ role: "user",
+ first_name: "",
+ last_name: "",
+ company_name: "pave technologies",
+ email: "possiblebj@gmail.com",
+ password: "$2a$10$A5mE.oCRAYFMGWm.Cwg56.IT/sM.0Z0LzoXb4pvReIhLW5SZGdWfa",
+ type: 0,
+ verify: 1,
+ is_company: 1,
+ phone: null,
+ photo:
+ "https://s3.us-east-2.amazonaws.com/com.mkdlabs.images/baas/qualitysign/049895914467maskable-icon-512x512.png",
+ refer: null,
+ stripe_uid: null,
+ paypal_uid: null,
+ two_factor_authentication: null,
+ status: 1,
+ create_at: "2024-02-23",
+ update_at: "2024-03-08T14:29:20.000Z",
+ company: "",
+ division: "",
+ dashboard_image: "",
+ avatar_image: "",
+ company_permission: null,
+ company_roles: null,
+ company_id: null,
+ division_id: null,
+ address: null,
+ state: null,
+ city: null,
+ country: null,
+ zip_code: null,
+ },
+ campaigns: {
+ id: null,
+ user_id: null,
+ create_at: null,
+ update_at: null,
+ campaign_name: null,
+ current_campaign: null,
+ status: null,
+ },
+ },
+];
diff --git a/src/utils/utils.jsx b/src/utils/utils.jsx
index 2057632..240193f 100644
--- a/src/utils/utils.jsx
+++ b/src/utils/utils.jsx
@@ -1,3 +1,17 @@
+import {
+ CircleCheckMarkIcon,
+ CircleDollarIcon,
+ ExCircleIcon,
+ PendingIcon,
+ SubmittedIcon,
+ VoidedIcon,
+} from "Assets/svgs";
+
+export const optionTypes = {
+ STATIC: "static",
+ DROPDOWN: "dropdown",
+};
+
export function classNames(...classes) {
return classes.filter(Boolean).join(" ");
}
@@ -9,3 +23,158 @@ export const getNonNullValue = (value) => {
return undefined;
}
};
+
+export function empty(value) {
+ return (
+ value === "" ||
+ value === null ||
+ value === undefined ||
+ value === "undefined"
+ );
+}
+
+/**
+ * @typedef {Object} StringCaserOptions
+ * @property {"space" | String} separator - define what separates each word, undefined returns no separation - passing "space" separates the words by a space
+ * @property {"uppercase" | "lowercase" | "capitalize" | "camelCase" | "PascalCase"} casetype - text case type, uppercase, lowercase of capitalized | default is lowercase
+ */
+/**
+ *
+ * @param {String} string - text to convert
+ * @param {StringCaserOptions} options - options
+ * @param {Array} exclude - special characters to retain
+ * @returns String
+ */
+export const StringCaser = (string, options, exclude = []) => {
+ if (!string) return null;
+ if (typeof string !== "string") return null;
+ const removedSpecialCharacters = exclude.length
+ ? string.replace(new RegExp(`[^a-zA-Z0-9${exclude.join("")}]`, "g"), " ")
+ : string.replace(/[^a-zA-Z0-9]/g, " ");
+ let casedText = [];
+ const splitWords = removedSpecialCharacters.split(" ").filter(Boolean);
+
+ if (options?.casetype === "capitalize") {
+ casedText = splitWords.map(
+ (/** @type {string} */ dt) =>
+ `${dt[0].toUpperCase()}${dt.substring(1).toLowerCase()} `
+ );
+ }
+ if (options?.casetype === "uppercase") {
+ casedText = splitWords.map((/** @type {string} */ dt) => dt.toUpperCase());
+ }
+ if (options?.casetype === "lowercase") {
+ casedText = splitWords.map((/** @type {string} */ dt) => dt.toLowerCase());
+ }
+ if (options?.casetype === "camelCase") {
+ casedText = splitWords.map((/** @type {string} */ dt, index) =>
+ index === 0
+ ? dt.toLowerCase()
+ : `${dt[0].toUpperCase()}${dt.substring(1)} `
+ );
+ }
+ if (options?.casetype === "PascalCase") {
+ casedText = splitWords.map(
+ (/** @type {string} */ dt) => `${dt[0].toUpperCase()}${dt.substring(1)}`
+ );
+ }
+
+ if (options?.separator) {
+ if (options?.separator === "space") {
+ return casedText.join(" ");
+ } else {
+ return casedText.join(options?.separator);
+ }
+ } else {
+ return casedText.join("");
+ }
+};
+
+export const mappingValues = {
+ submitted: (
+ <>
+
submitted
+ >
+ ),
+ pending: (
+ <>
+
pending
+ >
+ ),
+ completed: (
+ <>
+
completed
+ >
+ ),
+ cancelled: (
+ <>
+
cancelled
+ >
+ ),
+ Voided: (
+ <>
+
Voided
+ >
+ ),
+ deleted: (
+ <>
+
Deleted
+ >
+ ),
+ false: (
+ <>
+
false
+ >
+ ),
+ active: (
+ <>
+
Active
+ >
+ ),
+ inactive: (
+ <>
+
Inactive
+ >
+ ),
+ closed: (
+ <>
+
Closed
+ >
+ ),
+ open: (
+ <>
+
Open
+ >
+ ),
+ true: (
+ <>
+
true
+ >
+ ),
+ "not held": (
+ <>
+
Not Held
+ >
+ ),
+ held: (
+ <>
+
Held
+ >
+ ),
+ approved: (
+ <>
+
approved
+ >
+ ),
+ charged: (
+ <>
+
Charge Added
+ >
+ ),
+};
+
+export function truncate(text, length = null) {}
+
+export function processList(value, options, globalDispatch, authDispatch) {
+ // TO DO
+}
diff --git a/vite.config.js b/vite.config.js
index b1b5f91..726e60e 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,7 +1,24 @@
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
+// import fs from "fs";
+import path from "path";
+import { fileURLToPath } from "url";
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+
+const dirname = path.dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [react()]
-})
+ plugins: [react()],
+ resolve: {
+ alias: {
+ Components: path.resolve(dirname, "./src/components"),
+ Pages: path.resolve(dirname, "./src/pages"),
+ Utils: path.resolve(dirname, "./src/utils"),
+ Assets: path.resolve(dirname, "./src/assets"),
+ Context: path.resolve(dirname, "./src/context"),
+ Routes: path.resolve(dirname, "./src/routes"),
+ Hooks: path.resolve(dirname, "./src/hooks"),
+ Src: path.resolve(dirname, "./src"),
+ },
+ },
+});