storemw-core-client 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.js +1 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -0
- package/dist/lib/ApiService.js +2 -1
- package/dist/lib/ApiService.js.map +1 -0
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/queryParams.js +1 -0
- package/dist/lib/queryParams.js.map +1 -0
- package/dist/services/account/AccountService.d.ts +2 -2
- package/dist/services/account/AccountService.js +3 -2
- package/dist/services/account/AccountService.js.map +1 -0
- package/dist/services/auth/AuthService.d.ts +1 -1
- package/dist/services/auth/AuthService.js +2 -1
- package/dist/services/auth/AuthService.js.map +1 -0
- package/dist/services/branch/BranchService.d.ts +2 -2
- package/dist/services/branch/BranchService.js +3 -2
- package/dist/services/branch/BranchService.js.map +1 -0
- package/dist/services/business/BusinessService.d.ts +2 -2
- package/dist/services/business/BusinessService.js +3 -2
- package/dist/services/business/BusinessService.js.map +1 -0
- package/dist/services/document/DocumentService.d.ts +2 -2
- package/dist/services/document/DocumentService.js +4 -3
- package/dist/services/document/DocumentService.js.map +1 -0
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/injection_field/InjectionFieldService.d.ts +2 -2
- package/dist/services/injection_field/InjectionFieldService.js +3 -2
- package/dist/services/injection_field/InjectionFieldService.js.map +1 -0
- package/dist/services/inventory/InventoryService.d.ts +2 -2
- package/dist/services/inventory/InventoryService.js +3 -2
- package/dist/services/inventory/InventoryService.js.map +1 -0
- package/dist/services/item/ItemService.d.ts +2 -2
- package/dist/services/item/ItemService.js +3 -2
- package/dist/services/item/ItemService.js.map +1 -0
- package/dist/services/location/LocationService.d.ts +2 -2
- package/dist/services/location/LocationService.js +3 -2
- package/dist/services/location/LocationService.js.map +1 -0
- package/dist/services/logistic/LogisticService.d.ts +2 -2
- package/dist/services/logistic/LogisticService.js +3 -2
- package/dist/services/logistic/LogisticService.js.map +1 -0
- package/dist/services/permission/PermissionService.d.ts +1 -1
- package/dist/services/permission/PermissionService.js +2 -1
- package/dist/services/permission/PermissionService.js.map +1 -0
- package/dist/services/permission/config/custom/adminPermission.js +1 -0
- package/dist/services/permission/config/custom/adminPermission.js.map +1 -0
- package/dist/services/permission/config/custom/config.js +1 -0
- package/dist/services/permission/config/custom/config.js.map +1 -0
- package/dist/services/permission/config/default/adminPermission.js +1 -0
- package/dist/services/permission/config/default/adminPermission.js.map +1 -0
- package/dist/services/permission/config/default/agentPermission.js +1 -0
- package/dist/services/permission/config/default/agentPermission.js.map +1 -0
- package/dist/services/permission/config/default/customerPermission.js +1 -0
- package/dist/services/permission/config/default/customerPermission.js.map +1 -0
- package/dist/services/permission/config/default/driverPermission.js +1 -0
- package/dist/services/permission/config/default/driverPermission.js.map +1 -0
- package/dist/services/permission/config/default/workerPermission.js +1 -0
- package/dist/services/permission/config/default/workerPermission.js.map +1 -0
- package/dist/services/rate/RateService.d.ts +2 -2
- package/dist/services/rate/RateService.js +3 -2
- package/dist/services/rate/RateService.js.map +1 -0
- package/dist/services/region/RegionService.d.ts +2 -2
- package/dist/services/region/RegionService.js +3 -2
- package/dist/services/region/RegionService.js.map +1 -0
- package/dist/services/repository/RepositoryService.d.ts +2 -2
- package/dist/services/repository/RepositoryService.js +3 -2
- package/dist/services/repository/RepositoryService.js.map +1 -0
- package/dist/services/transaction/TransactionService.d.ts +2 -2
- package/dist/services/transaction/TransactionService.js +3 -2
- package/dist/services/transaction/TransactionService.js.map +1 -0
- package/dist/services/user/BranchUserService.d.ts +2 -2
- package/dist/services/user/BranchUserService.js +3 -2
- package/dist/services/user/BranchUserService.js.map +1 -0
- package/dist/services/user/UserRoleService.d.ts +2 -2
- package/dist/services/user/UserRoleService.js +4 -3
- package/dist/services/user/UserRoleService.js.map +1 -0
- package/dist/services/user/UserService.d.ts +2 -2
- package/dist/services/user/UserService.js +3 -2
- package/dist/services/user/UserService.js.map +1 -0
- package/dist/services/wallet/WalletService.d.ts +2 -2
- package/dist/services/wallet/WalletService.js +3 -2
- package/dist/services/wallet/WalletService.js.map +1 -0
- package/dist/utils/dateUtils.js +1 -0
- package/dist/utils/dateUtils.js.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +33 -32
- package/.gitattributes +0 -2
- package/src/config/config.ts +0 -15
- package/src/config/env.ts +0 -18
- package/src/config/index.ts +0 -2
- package/src/index.ts +0 -41
- package/src/lib/ApiService.ts +0 -170
- package/src/lib/index.ts +0 -5
- package/src/lib/queryParams.ts +0 -162
- package/src/services/account/AccountService.ts +0 -232
- package/src/services/auth/AuthService.ts +0 -125
- package/src/services/branch/BranchService.ts +0 -330
- package/src/services/business/BusinessService.ts +0 -277
- package/src/services/document/DocumentService.ts +0 -1471
- package/src/services/index.ts +0 -73
- package/src/services/injection_field/InjectionFieldService.ts +0 -483
- package/src/services/inventory/InventoryService.ts +0 -314
- package/src/services/item/ItemService.ts +0 -707
- package/src/services/location/LocationService.ts +0 -505
- package/src/services/logistic/LogisticService.ts +0 -285
- package/src/services/permission/PermissionService.ts +0 -1069
- package/src/services/permission/config/custom/adminPermission.ts +0 -19
- package/src/services/permission/config/custom/config.ts +0 -39
- package/src/services/permission/config/default/adminPermission.ts +0 -129
- package/src/services/permission/config/default/agentPermission.ts +0 -42
- package/src/services/permission/config/default/customerPermission.ts +0 -9
- package/src/services/permission/config/default/driverPermission.ts +0 -4
- package/src/services/permission/config/default/workerPermission.ts +0 -25
- package/src/services/rate/RateService.ts +0 -570
- package/src/services/region/RegionService.ts +0 -353
- package/src/services/repository/RepositoryService.ts +0 -437
- package/src/services/transaction/TransactionService.ts +0 -404
- package/src/services/user/BranchUserService.ts +0 -381
- package/src/services/user/UserRoleService.ts +0 -342
- package/src/services/user/UserService.ts +0 -807
- package/src/services/wallet/WalletService.ts +0 -300
- package/src/utils/dateUtils.ts +0 -26
- package/src/utils/index.ts +0 -2
- package/tsconfig.json +0 -119
package/dist/config/config.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;AAKA,gDAAgD;AAChD,IAAI,aAAa,GAAc;IAC3B,OAAO,EAAE,EAAE;CACd,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,SAAoB,EAAE,EAAE;IACjD,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,SAAS,EAAE,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEK,MAAM,YAAY,GAAG,GAAc,EAAE,CAAC,aAAa,CAAC;AAA9C,QAAA,YAAY,gBAAkC","sourcesContent":["export interface ApiConfig {\n baseURL: string;\n token?: string;\n}\n\n// Shared default config (global runtime memory)\nlet defaultConfig: ApiConfig = {\n baseURL: \"\",\n};\n\nexport const setApiConfig = (newConfig: ApiConfig) => {\n defaultConfig = { ...defaultConfig, ...newConfig };\n};\n\nexport const getApiConfig = (): ApiConfig => defaultConfig;\n"]}
|
package/dist/config/env.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":";;;AAAA,yBAAuB;AAEV,QAAA,GAAG,GAAG;IACf,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa;IAE/C,sBAAsB;IACtB,YAAY,EACR,OAAO,CAAC,GAAG,CAAC,wBAAwB;QACpC,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,OAAO,CAAC,GAAG,CAAC,YAAY;QACxB,EAAE;IAEN,yBAAyB;IACzB,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE;IAEtC,sCAAsC;IACtC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM;CACtC,CAAC","sourcesContent":["import \"dotenv/config\";\n\nexport const env = {\n NODE_ENV: process.env.NODE_ENV ?? \"development\",\n\n // 👇 the API endpoint\n API_BASE_URL:\n process.env.NEXT_PUBLIC_API_BASE_URL ??\n process.env.VITE_API_BASE_URL ??\n process.env.API_BASE_URL ??\n \"\",\n\n // 👇 optional auth token\n API_TOKEN: process.env.API_TOKEN ?? \"\",\n\n // 👇 you can add more if needed later\n DEBUG: process.env.DEBUG === \"true\",\n};\n"]}
|
package/dist/config/index.js
CHANGED
|
@@ -6,3 +6,4 @@ Object.defineProperty(exports, "env", { enumerable: true, get: function () { ret
|
|
|
6
6
|
var config_1 = require("./config");
|
|
7
7
|
Object.defineProperty(exports, "getApiConfig", { enumerable: true, get: function () { return config_1.getApiConfig; } });
|
|
8
8
|
Object.defineProperty(exports, "setApiConfig", { enumerable: true, get: function () { return config_1.setApiConfig; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,6BAA2B;AAAlB,0FAAA,GAAG,OAAA;AACZ,mCAAqD;AAA5C,sGAAA,YAAY,OAAA;AAAE,sGAAA,YAAY,OAAA","sourcesContent":["export { env } from \"./env\"\nexport { getApiConfig, setApiConfig } from \"./config\""]}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const services_1 = require("
|
|
4
|
-
const config_1 = require("
|
|
3
|
+
const services_1 = require("./services");
|
|
4
|
+
const config_1 = require("./config");
|
|
5
5
|
// set the api config from env
|
|
6
6
|
(0, config_1.setApiConfig)({
|
|
7
7
|
baseURL: config_1.env.API_BASE_URL,
|
|
@@ -30,3 +30,4 @@ const testAuthToken = async () => {
|
|
|
30
30
|
console.error(`error`, error);
|
|
31
31
|
}
|
|
32
32
|
})();
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAGmB;AAEnB,qCAA4C;AAE5C,8BAA8B;AAC9B,IAAA,qBAAY,EAAC;IACT,OAAO,EAAE,YAAG,CAAC,YAAY;IACzB,KAAK,EAAE,EAAE;CACZ,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;IAC7B,MAAM,WAAW,GAAG,IAAA,sBAAW,EAAC,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC,CAAA;IACpE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,QAAQ,EAAE,UAAU;KACvB,CAAC,CAAA;IACF,OAAO,QAAQ,CAAA;AACnB,CAAC,CAAA;AAED,qCAAqC;AACrC,+EAA+E;AAC/E,4FAA4F;AAC5F,OAAO;AACP,IAAI;AAEJ,CAAC,KAAK,IAAI,EAAE;IAER,IAAI,CAAC;QACD,wBAAwB;QACxB,MAAM,QAAQ,GAAG,MAAM,aAAa,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACjC,CAAC;AAEL,CAAC,CAAC,EAAE,CAAC","sourcesContent":["import {\n AuthService,\n LocationService,\n} from \"@/services\"\n\nimport { setApiConfig, env } from \"@/config\"\n\n// set the api config from env\nsetApiConfig({\n baseURL: env.API_BASE_URL,\n token: \"\"\n})\n\nconst testAuthToken = async () => {\n const authService = AuthService({ authTargetType: \"administrator\" })\n const response = await authService.authLogin({\n username: \"masteradmin2\",\n password: \"abc12345\"\n })\n return response\n}\n\n// const testLocation = async () => {\n// const locationService = LocationService({ customToken: \"sdfdsfds\" })\n// await locationService.get({ id: 23432, dataTypes: [], locationType: \"location\" })\n// \n// }\n\n(async () => {\n\n try {\n // await testLocation();\n const response = await testAuthToken();\n console.log('response', response)\n } catch (error) {\n console.error(`error`, error)\n }\n\n})();\n\n\n"]}
|
package/dist/lib/ApiService.js
CHANGED
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.ApiService = void 0;
|
|
37
37
|
const axios_1 = __importStar(require("axios"));
|
|
38
38
|
// import { EnvService, /* SessionService */ } from '.'; // Adjust path as needed
|
|
39
|
-
const config_1 = require("
|
|
39
|
+
const config_1 = require("../config");
|
|
40
40
|
// You can inject token later if needed (via a setter or directly)
|
|
41
41
|
let accessToken = '';
|
|
42
42
|
const createAxiosInstance = (endpointUrl) => {
|
|
@@ -141,3 +141,4 @@ const ApiService = (props) => {
|
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
143
|
exports.ApiService = ApiService;
|
|
144
|
+
//# sourceMappingURL=ApiService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiService.js","sourceRoot":"","sources":["../../src/lib/ApiService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAG5C,iFAAiF;AAEjF,qCAAwC;AAqBxC,kEAAkE;AAClE,IAAI,WAAW,GAAW,EAAE,CAAC;AAE7B,MAAM,mBAAmB,GAAG,CAAC,WAAmB,EAAuB,EAAE;IACrE,wBAAwB;IACxB,4BAA4B;IAC5B,sBAAsB;IACtB,MAAM;IAEN,IAAI,WAAW,GAAG,eAAK,CAAC,MAAM,CAAC;QAC3B,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,KAAK;KACjB,CAAC,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,CAAC;IAC7C,CAAC,CAAA;IAED,MAAM,gBAAgB,GAAG,CAAC,QAAuB,EAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAA;IAEtF,MAAM,eAAe,GAAG,CAAC,QAAoC,EAAW,EAAE,CACtE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAEnC,MAAM,QAAQ,GAAG,CAAC,MAAe,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,MAAM;QACN,OAAO;KACV,CAAC,CAAA;IAEF,MAAM,UAAU,GAAG,CAAC,MAAe,EAAE,OAAO,GAAG,EAAE,EAAE,IAAU,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM;QACN,OAAO;QACP,IAAI;KACP,CAAC,CAAA;IAEF,OAAO;QACH,mBAAmB;QACnB,gBAAgB;QAChB,QAAQ;QACR,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,QAAQ;QACR,UAAU;KACb,CAAA;AACL,CAAC,CAAC;AAzHW,QAAA,UAAU,cAyHrB","sourcesContent":["import axios, { isAxiosError } from \"axios\";\nimport type { AxiosResponse, AxiosInstance, AxiosRequestConfig } from \"axios\";\n\n// import { EnvService, /* SessionService */ } from '.'; // Adjust path as needed\n\nimport { getApiConfig } from \"@/config\";\n\ntype ApiResponse = {\n status: boolean;\n message: string;\n data?: any;\n}\n\ntype ApiError = {\n message: string;\n}\n\ntype AxiosInstanceParams = {\n axiosClient: AxiosInstance,\n cancelToken: any\n}\n\nexport type ApiServiceType = {\n customToken?: string, // custom jwt token\n}\n\n// You can inject token later if needed (via a setter or directly)\nlet accessToken: string = '';\n\nconst createAxiosInstance = (endpointUrl: string): AxiosInstanceParams => {\n // return axios.create({\n // baseURL: endpointUrl,\n // timeout: 30000,\n // });\n\n let axiosClient = axios.create({\n baseURL: endpointUrl,\n timeout: 30000,\n });\n\n let cancelToken = axios.CancelToken\n\n return {\n axiosClient,\n cancelToken\n }\n}\n\nexport const ApiService = (props?: ApiServiceType) => {\n\n const customToken = props?.customToken\n\n // const { baseURL } = EnvService(); // always read fresh env if needed\n const { baseURL } = getApiConfig()\n\n const {\n axiosClient,\n // cancelToken,\n } = createAxiosInstance(baseURL)\n\n const setToken = (token: string) => {\n accessToken = token;\n }\n\n const getAuthorization = (): string => {\n return accessToken ? `Bearer ${accessToken}` : '';\n }\n\n const makeCall = async ({\n url,\n payload,\n method,\n sessionAuthentication = true\n }: {\n url: string;\n payload?: any;\n method: 'get' | 'post' | 'put' | 'delete';\n sessionAuthentication?: boolean; // skip to check the session for headers\n }): Promise<ApiResponse> => {\n\n if (customToken) { // if option to use customToken\n setToken(customToken)\n } else {\n if (sessionAuthentication) {\n // const { getSession } = SessionService()\n\n // const session = await getSession()\n\n // if (session?.token) {\n // setToken(session?.token)\n // }\n }\n }\n\n\n // const client = createAxiosInstance(baseURL);\n const client = axiosClient\n\n // console.log('accessToken', accessToken)\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n ...(accessToken ? { Authorization: getAuthorization() } : {}),\n };\n\n const config: AxiosRequestConfig = {\n method,\n url,\n headers,\n ...(method.toLowerCase() !== 'get' ? { data: payload } : {}),\n };\n\n // console.log('[Axios Call]', baseURL, url, method, JSON.stringify(payload));\n\n try {\n const response = await client.request<ApiResponse>(config);\n return parseResponse(response);\n } catch (error: unknown) {\n if (isAxiosError<ApiError>(error)) {\n const message =\n error.response?.data?.message || error.message || 'Network error';\n\n // console.log('error', error)\n throw getError(false, message);\n }\n throw getError(false, `${(error as any)?.message || 'Unknown error'}`);\n }\n }\n\n const parseResponse = (response: AxiosResponse<ApiResponse>) => {\n if (!isRequestSuccess(response)) {\n throw getError(false, 'Server failed to respond properly');\n }\n\n if (!isResultSuccess(response)) {\n throw getError(false, response?.data?.message || 'API returned an error');\n }\n\n const { status, message, data } = response.data;\n return getSuccess(status, message, data);\n }\n\n const isRequestSuccess = (response: AxiosResponse): boolean => response.status === 200\n\n const isResultSuccess = (response: AxiosResponse<ApiResponse>): boolean =>\n Boolean(response?.data?.status)\n\n const getError = (status: boolean, message = '') => ({\n status,\n message,\n })\n\n const getSuccess = (status: boolean, message = '', data?: any) => ({\n status,\n message,\n data,\n })\n\n return {\n createAxiosInstance,\n getAuthorization,\n setToken,\n makeCall,\n parseResponse,\n isRequestSuccess,\n isResultSuccess,\n getError,\n getSuccess\n }\n};\n"]}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ApiService } from './ApiService';
|
|
2
2
|
export type { ApiServiceType } from "./ApiService";
|
|
3
|
-
export { filterOperatorTypes, buildApiGetUrl, buildApiListUrl
|
|
3
|
+
export { filterOperatorTypes, buildApiGetUrl, buildApiListUrl } from './queryParams';
|
|
4
|
+
export type { BuildApiListParamsProps, BuildApiGetParamsProps } from "./queryParams";
|
|
4
5
|
export type { FilterItem } from './queryParams';
|
package/dist/lib/index.js
CHANGED
|
@@ -7,3 +7,4 @@ var queryParams_1 = require("./queryParams");
|
|
|
7
7
|
Object.defineProperty(exports, "filterOperatorTypes", { enumerable: true, get: function () { return queryParams_1.filterOperatorTypes; } });
|
|
8
8
|
Object.defineProperty(exports, "buildApiGetUrl", { enumerable: true, get: function () { return queryParams_1.buildApiGetUrl; } });
|
|
9
9
|
Object.defineProperty(exports, "buildApiListUrl", { enumerable: true, get: function () { return queryParams_1.buildApiListUrl; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAGnB,6CAAqF;AAA5E,kHAAA,mBAAmB,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA","sourcesContent":["export { ApiService } from './ApiService';\nexport type { ApiServiceType } from \"./ApiService\"\n\nexport { filterOperatorTypes, buildApiGetUrl, buildApiListUrl } from './queryParams';\nexport type { BuildApiListParamsProps, BuildApiGetParamsProps } from \"./queryParams\"\nexport type { FilterItem } from './queryParams';"]}
|
package/dist/lib/queryParams.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../src/lib/queryParams.ts"],"names":[],"mappings":";;;AAyDA,0CA8DC;AAED,wCAwCC;AAjKY,QAAA,gBAAgB,GAAG;IAC5B,EAAE,EAAE,GAAG;IACP,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,aAAa;IACtB,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,iBAAiB;IAC9B,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,MAAM;IACpB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,MAAM;IACpB,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,cAAc;IAC1B,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,QAAQ;CACZ,CAAC;AAEE,QAAA,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACjF,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IACf,OAAO,GAAG,CAAC;AACf,CAAC,EAAE,EAA4B,CAAC,CAAC;AAgCjC,SAAgB,eAAe,CAC3B,QAAgB,EAChB,KAA8B;IAI9B,IAAI,OAAO,GAAU,EAAE,CAAC;IAExB,MAAM,EACF,KAAK,EACL,MAAM,EACN,WAAW;IACX,YAAY;IACZ,SAAS,EACT,SAAS,EACT,SAAS,GAAG,EAAE,EACd,YAAY,GAAG,EAAE,GACpB,GAAG,KAAK,CAAC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CAAC;IACrD,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAgB,cAAc,CAC1B,QAAgB,EAChB,KAA6B;IAI7B,2BAA2B;IAE3B,MAAM;IACF,SAAS;IACT,UAAU;IACV,eAAe;IACf,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS,GAAG,EAAE;IACd,qBAAqB;MACxB,GAAG,KAAK,CAAC;IAEV,kCAAkC;IAClC,2CAA2C;IAE3C,UAAU;IACV,qCAAqC;IACrC,uCAAuC;IAEvC,sBAAsB;IACtB,+BAA+B;IAC/B,wDAAwD;IACxD,IAAI;IAEJ,YAAY;IACZ,IAAI,GAAG,GAAG,GAAG,QAAQ,GAAG,CAAC;IACzB,0EAA0E;IAE1E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,IAAI,aAAa,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;IACpD,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["export const _operatorSymbols = {\n eq: \"=\",\n startsWith: \"_%\",\n endsWith: \"%_\",\n contains: \"%\",\n containsOr: \"%||\",\n anyOf: \"where_in\",\n anyOfOr: \"or_where_in\",\n excludeOf: \"where_not_in\",\n excludeOfOr: \"or_where_not_in\",\n moreThanEq: \">=\",\n moreThanEqOr: \">=||\",\n lessThanEq: \"<=\",\n lessThanEqOr: \"<=||\",\n notEq: \"!=\",\n eqOr: \"=||\",\n havingInOr: \"or_having_in\",\n isNull: \"null\",\n isNotNull: \"null!=\",\n isNullOr: \"null||\",\n} as const;\n\nexport const filterOperatorTypes = Object.keys(_operatorSymbols).reduce((acc, key) => {\n acc[key] = key;\n return acc;\n}, {} as Record<string, string>);\n\nexport type FilterOperator = keyof typeof filterOperatorTypes;\n\nexport type FilterItem = {\n name: string;\n // operator: keyof typeof _operatorSymbols;\n operator: FilterOperator,\n value?: any;\n group?: string;\n}\n\n// export type SortInfo = {\n// id: string;\n// dir: 1 | -1;\n// }\n\nexport type BuildApiListParamsProps = {\n limit?: number;\n offset?: number;\n filterValue?: FilterItem[];\n // sortInfo?: SortInfo;\n sortField?: string;\n sortOrder?: \"asc\" | \"desc\";\n dataTypes?: string[];\n extraFilters?: any[]; // e.g. location filters\n}\n\nexport type BuildApiGetParamsProps = {\n dataTypes?: string[];\n}\n\nexport function buildApiListUrl(\n endpoint: string,\n props: BuildApiListParamsProps,\n // operatorSymbols: Record<string, string>\n): string {\n\n let filters: any[] = [];\n\n const {\n limit,\n offset,\n filterValue,\n // sortInfo,\n sortField,\n sortOrder,\n dataTypes = [],\n extraFilters = [],\n } = props;\n\n // Process filters\n if (filterValue) {\n for (const filter of filterValue) {\n if (\n filter.value !== undefined ||\n filter.operator === \"isNull\" ||\n filter.operator === \"isNotNull\" ||\n filter.operator === \"isNullOr\"\n ) {\n const line: any = {\n field: filter.name,\n operator: _operatorSymbols[filter.operator as keyof typeof _operatorSymbols],\n value: filter.value,\n };\n\n if (filter.group) line.group = filter.group;\n\n filters.push(line);\n }\n }\n }\n\n // Add any extra filters passed in\n filters = [...filters, ...extraFilters];\n\n // Sorting\n let sortfield = sortField ?? \"id\";\n let sortorder = sortOrder ?? \"desc\";\n\n // if (sortInfo?.id) {\n // sortfield = sortInfo.id;\n // sortorder = sortInfo.dir === -1 ? \"desc\" : \"asc\";\n // }\n\n // Build URL\n let url = `${endpoint}?limit=${limit}&offset=${offset}&sortfield=${sortfield}&sortorder=${sortorder}`;\n url += `&filters=${JSON.stringify(filters.length > 0 ? filters : [])}`;\n\n if (dataTypes.length > 0) {\n url += `&datatypes=${JSON.stringify(dataTypes)}`;\n }\n\n return url;\n}\n\nexport function buildApiGetUrl(\n endpoint: string,\n props: BuildApiGetParamsProps,\n // operatorSymbols: Record<string, string>\n): string {\n\n // let filters: any[] = [];\n\n const {\n // limit,\n // offset,\n // filterValue,\n // // sortInfo,\n // sortField,\n // sortOrder,\n dataTypes = [],\n // extraFilters = [],\n } = props;\n\n // Add any extra filters passed in\n // filters = [...filters, ...extraFilters];\n\n // Sorting\n // let sortfield = sortField ?? \"id\";\n // let sortorder = sortOrder ?? \"desc\";\n\n // if (sortInfo?.id) {\n // sortfield = sortInfo.id;\n // sortorder = sortInfo.dir === -1 ? \"desc\" : \"asc\";\n // }\n\n // Build URL\n let url = `${endpoint}?`;\n // url += `&filters=${JSON.stringify(filters.length > 0 ? filters : [])}`;\n\n if (dataTypes.length > 0) {\n url += `datatypes=${JSON.stringify(dataTypes)}`;\n }\n\n return url;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiServiceType } from '
|
|
2
|
-
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '
|
|
1
|
+
import { ApiServiceType } from '../../lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '../../lib';
|
|
3
3
|
export declare const accountTypes: {
|
|
4
4
|
readonly account: "account";
|
|
5
5
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AccountService = exports.accountTargetTypes = exports.accountTypes = void 0;
|
|
4
|
-
const lib_1 = require("
|
|
5
|
-
const lib_2 = require("
|
|
4
|
+
const lib_1 = require("../../lib");
|
|
5
|
+
const lib_2 = require("../../lib");
|
|
6
6
|
exports.accountTypes = {
|
|
7
7
|
account: "account",
|
|
8
8
|
};
|
|
@@ -117,3 +117,4 @@ const AccountService = (props) => {
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
exports.AccountService = AccountService;
|
|
120
|
+
//# sourceMappingURL=AccountService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountService.js","sourceRoot":"","sources":["../../../src/services/account/AccountService.ts"],"names":[],"mappings":";;;AAAA,+BAAmD;AAEnD,+BAMe;AAEF,QAAA,YAAY,GAAG;IACxB,OAAO,EAAE,SAAS;CACZ,CAAA;AAE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AAI;IAEJ,kGAAkG;IAElG,oFAAoF;IAEpF,4CAA4C;IAC5C,mBAAmB;IACnB,6BAA6B;IAC7B,cAAc;IAEd,2BAA2B;IAE3B,IAAI;IAEJ,OAAO;QACH,QAAQ;QACR,GAAG;QACH,UAAU;QACV,MAAM;QACN,UAAU;QACV,eAAe;KAClB,CAAC;AACN,CAAC,CAAA;AA3IY,QAAA,cAAc,kBA2I1B","sourcesContent":["import { ApiService, ApiServiceType } from '@/lib';\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const accountTypes = {\n account: \"account\",\n} as const\n\nexport const accountTargetTypes = {\n account: \"account\",\n} as const\n\nexport type AccountType = typeof accountTypes[keyof typeof accountTypes]\nexport type AccountTargetType = typeof accountTargetTypes[keyof typeof accountTargetTypes]\nexport type AccountTargetKey = keyof typeof accountTargetTypes\n\nexport type AccountServiceProps = ApiServiceType & {\n accountTargetType?: AccountTargetType\n accountType?: AccountType\n};\n\nexport type ListAccountProps = BuildApiListParamsProps & {\n accountType?: AccountType\n}\n\nexport type GetAccountProps = BuildApiGetParamsProps & {\n id: number | string\n accountType?: AccountType\n}\n\n// export type CreateAccountProps = {\n// accountTargetType?: AccountTargetType\n// accountType?: AccountType\n// data:\n// // for Account\n// {\n\n// }\n// }\n\nexport type UpdateAccountProps = {\n id: number\n accountTargetType?: AccountTargetType\n accountType?: AccountType\n data:\n // for Business\n {\n account: {\n name: string\n businessId: number\n }\n }\n}\n\nexport type RemoveAccountProps = {\n accountTargetType?: AccountTargetType\n ids: number[]\n}\n\nexport type GetDataTypeAccountProps = {\n accountType?: AccountType\n}\n\n// const getCreatePayload = (accountType: AccountType, data: CreateAccountProps[\"data\"]) => {\n\n// if (accountType === \"account\") {\n// return {\n\n// }\n// }\n\n// }\n\nconst getUpdatePayload = (accountType: AccountType, data: UpdateAccountProps[\"data\"]) => {\n\n if (accountType === \"account\" && \"account\" in data) {\n return {\n account: {\n name: data.account.name,\n business_id: data.account.businessId\n }\n }\n }\n\n}\n\nexport const AccountService = (props?: AccountServiceProps) => {\n\n const { accountType = \"account\", accountTargetType, ...rest } = props ?? {};\n\n const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const endpoint1 = \"account\";\n\n const get = async (props: GetAccountProps) => {\n\n const { id, accountType: overrideAccountType } = props;\n\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideAccountType || accountType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n\n }\n\n // const create = async ({ data, accountType: overrideAccountType, accountTargetType: overrideAccountTargetType }: CreateAccountProps) => {\n\n\n // let payload: any = {}\n\n // if (overrideAccountType) {\n // payload = getCreatePayload(overrideAccountType, data)\n // }\n\n // let url = `${endpoint1}`;\n\n // let postData = {\n // scope: {\n // target: overrideAccountTargetType || accountTargetType,\n // action: \"\",\n // },\n // payload\n // }\n\n // const response = await makeCall({\n // url,\n // method: \"post\",\n // payload: postData\n // });\n\n // return response;\n\n\n // }\n\n const update = async ({ id, data, accountType: overrideAccountType, accountTargetType: overrideAccountTargetType }: UpdateAccountProps) => {\n\n\n let url = `${endpoint1}/${id}`\n\n // let payload: any = {}\n\n // if (overrideAccountType) {\n // payload = getUpdatePayload(overrideAccountType, data)\n // }\n\n let _accountType = overrideAccountType || accountType\n\n let payload: any = getUpdatePayload(_accountType, data)\n\n const postData = {\n scope: {\n target: overrideAccountTargetType || accountTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n\n }\n\n // const remove = async ({ ids, accountTargetType: overrideAccountTargetType }: RemoveAccountProps) => {\n\n\n // let url = `${endpoint2}/delete`\n\n // const postData = {\n // scope: {\n // target: overrideAccountTargetType || accountTargetType,\n // },\n // payload: {\n // ids\n // }\n // }\n\n // const response = await makeCall({\n // url,\n // method: \"post\",\n // payload: postData\n // });\n\n // return response;\n\n // }\n\n // const getDataTypes = async ({ accountType: overrideAccountType }: GetDataTypeAccountProps) => {\n\n // let url = `${endpoint1}/data_types/${overrideAccountType || accountType}`\n\n // const response = await makeCall({\n // url,\n // method: \"get\",\n // });\n\n // return response;\n\n // }\n\n return {\n // list,\n get,\n // create,\n update,\n // remove,\n // getDataTypes\n };\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthService = exports.authTargetTypes = exports.routeTypes = void 0;
|
|
4
|
-
const lib_1 = require("
|
|
4
|
+
const lib_1 = require("../../lib");
|
|
5
5
|
exports.routeTypes = {
|
|
6
6
|
admin: "admin",
|
|
7
7
|
retail: "retail", // retail
|
|
@@ -74,3 +74,4 @@ const AuthService = (props) => {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
exports.AuthService = AuthService;
|
|
77
|
+
//# sourceMappingURL=AuthService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../../src/services/auth/AuthService.ts"],"names":[],"mappings":";;;AAAA,+BAAmD;AAEtC,QAAA,UAAU,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ,EAAE,SAAS;IAC3B,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAA;AAEG,QAAA,eAAe,GAAG;IAC3B,KAAK,EAAE,eAAe;IACtB,sBAAsB;IACtB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,aAAa,EAAE,SAAS;IACrC,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IACh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B,EAAE,OAAO;iBAC5B;aACJ;SACJ,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC;YAC5B,GAAG;YACH,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,QAAQ;SACpB,CAAC,CAAC;IAEP,CAAC,CAAA;IAED,OAAO;QACH,SAAS;QACT,cAAc;KACjB,CAAC;AACN,CAAC,CAAA;AAnEY,QAAA,WAAW,eAmEvB","sourcesContent":["import { ApiService, ApiServiceType } from '@/lib';\n\nexport const routeTypes = {\n admin: \"admin\",\n retail: \"retail\", // retail\n workstation: \"workstation\",\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\nexport const authTargetTypes = {\n admin: \"administrator\",\n // retail: \"retailer\",\n retailer: \"retail\",\n workstation: \"workstation\", // worker\n customer: \"customer\",\n member: \"member\",\n public: \"public\",\n driver: \"driver\",\n console: \"console\"\n} as const\n\n// Step 2: Infer the value type (e.g., \"administrator\" | \"retailer\" | ...)\nexport type AuthTargetType = typeof authTargetTypes[keyof typeof authTargetTypes]\n\n// Optional: keyof helper to get \"admin\" | \"retail\" | ...\n// export type AuthTargetKey = keyof typeof authTargetTypes\n\n// Step 3: Define route mapping\n// export const authTargetSystemRouteTypes: Record<AuthTargetType, string> = {\n// [authTargetTypes.admin]: routeTypes.admin,\n// [authTargetTypes.retail]: routeTypes.retail,\n// [authTargetTypes.workstation]: routeTypes.workstation,\n// [authTargetTypes.customer]: routeTypes.customer,\n// [authTargetTypes.member]: routeTypes.member,\n// [authTargetTypes.driver]: routeTypes.driver,\n// }\n\nexport type AuthServiceProps = ApiServiceType & {\n authTargetType: AuthTargetType\n}\n\nexport type AuthLoginProps = {\n authTargetType?: AuthTargetType,\n username: string;\n password: string\n};\n\ntype confirmPasswordProps = {\n current: string\n password: string\n confirm: string\n}\n\nexport const AuthService = (props?: AuthServiceProps) => {\n\n const { authTargetType, customToken } = props ?? {}\n\n const { makeCall } = ApiService(customToken ? { customToken } : {})\n\n const endpoint1 = \"auth/\";\n\n const authLogin = async (props: AuthLoginProps) => {\n\n\n const { authTargetType: overrideAuthTargetType, username, password } = props\n\n const url = `${endpoint1}token`;\n\n const postData = {\n scope: {\n target: overrideAuthTargetType || authTargetType,\n action: \"\",\n },\n payload: {\n account_id: \"1\",\n username,\n password\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const changePassword = async ({ current, password, confirm }: confirmPasswordProps) => {\n\n\n const url = `${endpoint1}`;\n\n const postData = {\n scope: {\n target: \"change_password\"\n },\n payload: {\n auth: {\n current_password: current,\n new_password: password,\n confirm_password: confirm\n }\n }\n }\n\n const response = await makeCall({\n url,\n method: 'put',\n payload: postData\n });\n\n }\n\n return {\n authLogin,\n changePassword\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiServiceType } from '
|
|
2
|
-
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '
|
|
1
|
+
import { ApiServiceType } from '../../lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '../../lib';
|
|
3
3
|
export declare const branchTypes: {
|
|
4
4
|
readonly customer: "customer";
|
|
5
5
|
readonly retailer: "retailer";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BranchService = exports.branchTargetTypes = exports.branchTypes = void 0;
|
|
4
|
-
const lib_1 = require("
|
|
5
|
-
const lib_2 = require("
|
|
4
|
+
const lib_1 = require("../../lib");
|
|
5
|
+
const lib_2 = require("../../lib");
|
|
6
6
|
exports.branchTypes = {
|
|
7
7
|
customer: "customer",
|
|
8
8
|
retailer: "retailer",
|
|
@@ -160,3 +160,4 @@ const BranchService = (props) => {
|
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
162
|
exports.BranchService = BranchService;
|
|
163
|
+
//# sourceMappingURL=BranchService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AK;SAChB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,OAAO;QACH,IAAI;QACJ,GAAG;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;KACf,CAAC;AACN,CAAC,CAAA;AAtJY,QAAA,aAAa,iBAsJzB","sourcesContent":["import { ApiService, ApiServiceType } from '@/lib';\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const branchTypes = {\n customer: \"customer\",\n retailer: \"retailer\",\n} as const\n\nexport const branchTargetTypes = {\n customer: \"customer\",\n retailer: \"retailer\",\n} as const\n\nexport type BranchType = typeof branchTypes[keyof typeof branchTypes] // keyof typeof branchTypes\nexport type BranchTargetType = typeof branchTargetTypes[keyof typeof branchTargetTypes]\nexport type BranchTargetKey = keyof typeof branchTargetTypes\n\nexport type BranchServiceProps = ApiServiceType & {\n branchTargetType?: BranchTargetType\n branchType?: BranchType\n};\n\nexport type ListBranchProps = BuildApiListParamsProps & {\n branchType?: BranchType\n}\n\nexport type GetBranchProps = BuildApiGetParamsProps & {\n id: number | string\n branchType: BranchType\n}\n\ntype Branch = {\n branchName: string\n branchCode: string\n branchContact: string\n branchEmail: string\n type: \"branch_shipping\" | \"branch_billing\"\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n remark: string\n picName: string\n picContact: string\n picEmail: string\n isHq: boolean\n status: boolean\n}\n\nexport type CreateBranchProps = {\n userId: number\n branchTargetType?: BranchTargetType\n branchType?: BranchType\n // data: BranchCustomer | BranchRetailer\n data:\n // branch customer\n {\n customerBranch: {\n branch: Branch,\n props: {\n marking: string\n }\n }\n } |\n // branch retail\n {\n retailBranch: {\n branch: Branch,\n props: {\n marking: string\n }\n }\n }\n}\n\nexport type UpdateBranchProps = {\n userId: number\n branchId: number\n branchTargetType?: BranchTargetType\n branchType?: BranchType\n // data: BranchCustomer | BranchRetailer\n data:\n // branch customer\n {\n customerBranch: {\n branch: Branch,\n props: {\n marking: string\n }\n }\n } |\n // branch retail\n {\n retailBranch: {\n branch: Branch,\n props: {\n marking: string\n }\n }\n }\n}\n\nexport type RemoveBranchProps = {\n branchTargetType?: BranchTargetType\n ids: number[]\n}\n\nexport type GetDataTypeBranchProps = {\n branchType?: BranchType\n}\n\nconst getCreatePayload = (branchType: BranchType, data: CreateBranchProps[\"data\"]) => {\n\n if (branchType === \"customer\" && \"customerBranch\" in data) {\n\n return {\n branch: {\n branch_name: data.customerBranch.branch.branchName,\n branch_code: data.customerBranch.branch.branchCode,\n branch_contact: data.customerBranch.branch.branchContact,\n branch_email: data.customerBranch.branch.branchEmail,\n address_1: data.customerBranch.branch.address1,\n address_2: data.customerBranch.branch.address2,\n country_id: data.customerBranch.branch.countryId,\n state_id: data.customerBranch.branch.stateId,\n area_id: data.customerBranch.branch.areaId,\n pic_name: data.customerBranch.branch.picName,\n pic_contact: data.customerBranch.branch.picContact,\n pic_email: data.customerBranch.branch.picEmail,\n is_hq: data.customerBranch.branch.isHq === true ? 1 : 0,\n status: data.customerBranch.branch.status === true ? 1 : 0,\n },\n props: {\n marking: data.customerBranch.props?.marking ?? \"\",\n }\n }\n }\n\n if (branchType === \"retailer\" && \"retailBranch\" in data) {\n\n return {\n branch: {\n branch_name: data.retailBranch.branch.branchName,\n branch_code: data.retailBranch.branch.branchCode,\n branch_contact: data.retailBranch.branch.branchContact,\n branch_email: data.retailBranch.branch.branchEmail,\n address_1: data.retailBranch.branch.address1,\n address_2: data.retailBranch.branch.address2,\n country_id: data.retailBranch.branch.countryId,\n state_id: data.retailBranch.branch.stateId,\n area_id: data.retailBranch.branch.areaId,\n pic_name: data.retailBranch.branch.picName,\n pic_contact: data.retailBranch.branch.picContact,\n pic_email: data.retailBranch.branch.picEmail,\n is_hq: data.retailBranch.branch.isHq === true ? 1 : 0,\n status: data.retailBranch.branch.status === true ? 1 : 0,\n },\n props: {\n marking: data.retailBranch.props?.marking ?? \"\",\n }\n }\n\n }\n\n}\n\nconst getUpdatePayload = (branchType: BranchType, data: UpdateBranchProps[\"data\"]) => {\n return getCreatePayload(branchType, data)\n}\n\nexport const BranchService = (props?: BranchServiceProps) => {\n\n const { branchType = \"customer\", branchTargetType, ...rest } = props ?? {};\n\n const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const endpoint1 = \"user/branch\";\n const endpoint2 = \"user/branches\"\n\n const list = async (props: ListBranchProps) => {\n\n const { branchType: overrideBranchType } = props;\n\n\n const url = buildApiListUrl(\n `${endpoint2}/${overrideBranchType || branchType}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n\n }\n\n const get = async (props: GetBranchProps) => {\n\n const { id, branchType: overrideBranchType } = props;\n\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideBranchType || branchType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n\n }\n\n const create = async ({ data, userId, branchType: overrideBranchType, branchTargetType: overrideBranchTargetType }: CreateBranchProps) => {\n\n let _branchType = overrideBranchType || branchType\n\n let payload: any = getCreatePayload(_branchType, data)\n\n let url = `${endpoint1}/${userId}`;\n\n let postData = {\n scope: {\n target: overrideBranchTargetType || branchTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n\n }\n\n const update = async ({ userId, branchId, data, branchType: overrideBranchType, branchTargetType: overrideBranchTargetType }: UpdateBranchProps) => {\n\n let url = `${endpoint1}/${userId}/${branchId}`\n\n let _branchType = overrideBranchType || branchType\n\n let payload: any = getUpdatePayload(_branchType, data)\n\n const postData = {\n scope: {\n target: overrideBranchTargetType || branchTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n }\n\n const remove = async ({ ids, branchTargetType: overrideBranchTargetType }: RemoveBranchProps) => {\n\n let url = `${endpoint2}/delete`\n\n const postData = {\n scope: {\n target: overrideBranchTargetType || branchTargetType,\n },\n payload: {\n ids\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const getDataTypes = async ({ branchType: overrideBranchType }: GetDataTypeBranchProps) => {\n\n let url = `${endpoint2}/data_types/${overrideBranchType || branchType}`\n\n const response = await makeCall({\n url,\n method: \"get\",\n });\n\n return response;\n\n }\n\n return {\n list,\n get,\n create,\n update,\n remove,\n getDataTypes\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiServiceType } from '
|
|
2
|
-
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '
|
|
1
|
+
import { ApiServiceType } from '../../lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '../../lib';
|
|
3
3
|
export declare const businessTypes: {
|
|
4
4
|
readonly business: "business";
|
|
5
5
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BusinessService = exports.businessTargetTypes = exports.businessTypes = void 0;
|
|
4
|
-
const lib_1 = require("
|
|
5
|
-
const lib_2 = require("
|
|
4
|
+
const lib_1 = require("../../lib");
|
|
5
|
+
const lib_2 = require("../../lib");
|
|
6
6
|
exports.businessTypes = {
|
|
7
7
|
business: "business",
|
|
8
8
|
};
|
|
@@ -151,3 +151,4 @@ const BusinessService = (props) => {
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
exports.BusinessService = BusinessService;
|
|
154
|
+
//# sourceMappingURL=BusinessService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BusinessService.js","sourceRoot":"","sources":["../../../src/services/business/BusinessService.ts"],"names":[],"mappings":";;;AAAA,+BAAmD;AAEnD,+BAMe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GAAG,SAAS,eAAe,oBAAoB,IAAI,YAAY,EAAE,CAAA;QAE3E,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC;YAC5B,GAAG;YACH,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,OAAO;QACH,IAAI;QACJ,GAAG;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;KACf,CAAC;AACN,CAAC,CAAA;AArJY,QAAA,eAAe,mBAqJ3B","sourcesContent":["import { ApiService, ApiServiceType } from '@/lib';\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const businessTypes = {\n business: \"business\",\n} as const\n\nexport const businessTargetTypes = {\n business: \"business\",\n} as const\n\nexport type BusinessType = typeof businessTypes[keyof typeof businessTypes]\nexport type BusinessTargetType = typeof businessTargetTypes[keyof typeof businessTargetTypes]\nexport type BusinessTargetKey = keyof typeof businessTargetTypes\n\nexport type BusinessServiceProps = ApiServiceType & {\n businessTargetType?: BusinessTargetType\n businessType?: BusinessType\n};\n\nexport type ListBusinessProps = BuildApiListParamsProps & {\n businessType?: BusinessType\n}\n\nexport type GetBusinessProps = BuildApiGetParamsProps & {\n id: number | string\n businessType?: BusinessType\n}\n\ntype Business = {\n companyName: string\n idNumber: string\n website: string\n email: string\n companyContact: string\n address1: string\n address2: string\n countryId: number\n stateId: number\n areaId: number\n postcode: string\n status: boolean\n}\n\nexport type CreateBusinessProps = {\n businessTargetType?: BusinessTargetType\n businessType?: BusinessType\n data:\n // for Business\n {\n business: Business\n }\n}\n\nexport type UpdateBusinessProps = {\n id: number\n businessTargetType?: BusinessTargetType\n businessType?: BusinessType\n data:\n // for Business\n {\n business: Business\n }\n}\n\nexport type RemoveBusinessProps = {\n businessTargetType?: BusinessTargetType\n ids: number[]\n}\n\nexport type GetDataTypeBusinessProps = {\n businessType?: BusinessType\n}\n\nconst getCreatePayload = (businessType: BusinessType, data: CreateBusinessProps[\"data\"]) => {\n\n if (businessType === \"business\") {\n return {\n business: {\n company_name: data.business.companyName,\n id_number: data.business.idNumber,\n website: data.business.website,\n email: data.business.email,\n company_contact: data.business.companyContact,\n address_1: data.business.address1,\n address_2: data.business.address2,\n country_id: data.business.countryId,\n state_id: data.business.stateId,\n area_id: data.business.areaId,\n postcode: data.business.postcode,\n status: (data.business.status === true) ? 1 : 0\n }\n }\n }\n\n}\n\nconst getUpdatePayload = (businessType: BusinessType, data: UpdateBusinessProps[\"data\"]) => {\n\n if (businessType === \"business\") {\n return {\n business: {\n company_name: data.business.companyName,\n id_number: data.business.idNumber,\n website: data.business.website,\n email: data.business.email,\n company_contact: data.business.companyContact,\n address_1: data.business.address1,\n address_2: data.business.address2,\n country_id: data.business.countryId,\n state_id: data.business.stateId,\n area_id: data.business.areaId,\n postcode: data.business.postcode,\n status: (data.business.status === true) ? 1 : 0\n }\n }\n }\n\n}\n\nexport const BusinessService = (props?: BusinessServiceProps) => {\n\n const { businessType, businessTargetType, ...rest } = props ?? {};\n\n const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const endpoint1 = \"business\";\n const endpoint2 = \"businesses\"\n\n const list = async (props: ListBusinessProps) => {\n\n const { businessType: overrideBusinessType } = props;\n\n const url = buildApiListUrl(\n `${endpoint2}/${overrideBusinessType || businessType}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const get = async (props: GetBusinessProps) => {\n\n const { id, businessType: overrideBusinessType } = props;\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideBusinessType || businessType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const create = async ({ data, businessType: overrideBusinessType, businessTargetType: overrideBusinessTargetType }: CreateBusinessProps) => {\n\n let payload: any = {}\n\n if (overrideBusinessType) {\n payload = getCreatePayload(overrideBusinessType, data)\n }\n\n let url = `${endpoint1}`;\n\n let postData = {\n scope: {\n target: overrideBusinessTargetType || businessTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const update = async ({ id, data, businessType: overrideBusinessType, businessTargetType: overrideBusinessTargetType }: UpdateBusinessProps) => {\n\n let url = `${endpoint1}/${id}`\n\n let payload: any = {}\n\n if (overrideBusinessType) {\n payload = getUpdatePayload(overrideBusinessType, data)\n }\n\n const postData = {\n scope: {\n target: overrideBusinessTargetType || businessTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n }\n\n const remove = async ({ ids, businessTargetType: overrideBusinessTargetType }: RemoveBusinessProps) => {\n\n let url = `${endpoint2}/delete`\n\n const postData = {\n scope: {\n target: overrideBusinessTargetType || businessTargetType,\n },\n payload: {\n ids\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const getDataTypes = async ({ businessType: overrideBusinessType }: GetDataTypeBusinessProps) => {\n\n let url = `${endpoint1}/data_types/${overrideBusinessType || businessType}`\n\n const response = await makeCall({\n url,\n method: \"get\",\n });\n\n return response;\n\n }\n\n return {\n list,\n get,\n create,\n update,\n remove,\n getDataTypes\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiServiceType } from '
|
|
2
|
-
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '
|
|
1
|
+
import { ApiServiceType } from '../../lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '../../lib';
|
|
3
3
|
export declare const documentTypes: {
|
|
4
4
|
/** sales */
|
|
5
5
|
readonly profomaSale: "proforma_sales";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentService = exports.documentTypes = void 0;
|
|
4
|
-
const lib_1 = require("
|
|
5
|
-
const utils_1 = require("
|
|
6
|
-
const lib_2 = require("
|
|
4
|
+
const lib_1 = require("../../lib");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const lib_2 = require("../../lib");
|
|
7
7
|
exports.documentTypes = {
|
|
8
8
|
/** sales */
|
|
9
9
|
profomaSale: "proforma_sales",
|
|
@@ -613,3 +613,4 @@ const DocumentService = (props) => {
|
|
|
613
613
|
};
|
|
614
614
|
};
|
|
615
615
|
exports.DocumentService = DocumentService;
|
|
616
|
+
//# sourceMappingURL=DocumentService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentService.js","sourceRoot":"","sources":["../../../src/services/document/DocumentService.ts"],"names":[],"mappings":";;;AAAA,+BAAmD;AAEnD,mCAAkC;AAElC,+BAMe;AAEF,QAAA,aAAa,GAAG;IACzB,YAAY;IACZ,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,OAAO;IACnB,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;IACvB,eAAe,EAAE,mBAAmB;IACpC,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE,sBAAsB;IAC3C,OAAO,EAAE,UAAU;IACnB,6CAA6C;IAC7C,eAAe;IACf,aAAa,EAAE,UAAU;IACzB,cAAc,EAAE,iBAAiB;IACjC,eAAe,EAAE,kBAAkB;IACnC,gBAAgB;IAChB,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;IAC3B,6BAA6B;IAC7B,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;IACvB,cAAc,EAAE,iBAAiB;IACjC,SAAS,EAAE,YAAY;IACvB,cAAc,EA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EAAE,KAAK;SAChB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAEpB,CAAC,CAAA;IAED,OAAO;QACH,IAAI;QACJ,GAAG;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;KACf,CAAC;AACN,CAAC,CAAA;AAhJY,QAAA,eAAe,mBAgJ3B","sourcesContent":["import { ApiService, ApiServiceType } from '@/lib';\n\nimport { _, dayjs } from \"@/utils\"\n\nimport {\n buildApiListUrl,\n BuildApiListParamsProps,\n buildApiGetUrl,\n BuildApiGetParamsProps,\n filterOperatorTypes\n} from '@/lib';\n\nexport const documentTypes = {\n /** sales */\n profomaSale: \"proforma_sales\",\n salesOrder: \"sales\",\n proformaSales: \"proforma_sales\",\n cashSales: \"cash_sales\",\n retailCashSales: \"retail_cash_sales\",\n deliveryOrder: \"delivery\",\n replacementDelivery: \"replacement_delivery\",\n invoice: \"invoices\",\n // retailPrescription: \"retail_prescription\",\n /** purchase */\n purchaseOrder: \"purchase\",\n purchaseReturn: \"purchase_return\",\n purchaseInvoice: \"purchase_invoice\",\n /** warehouse */\n packingOrder: \"packing_order\",\n itemPicking: \"item_picking\",\n itemReceive: \"item_receive\",\n // itemReturn: \"item_return\",\n itemTransfer: \"item_transfer\",\n itemRepack: \"item_repack\",\n itemRelocate: \"item_relocate\",\n itemTransform: \"item_transform\",\n itemIssue: \"item_issue\",\n itemAdjustment: \"item_adjustment\",\n stockTake: \"stock_take\",\n transferReturn: \"transfer_return\",\n transferRequisition: \"transfer_requisition\",\n pickOrder: \"pick_order\",\n /** logistic */\n tripOrder: \"trip\",\n /** Accounting */\n salesInvoice: \"sales_invoice\",\n salesCreditNote: \"sales_credit_note\",\n salesDebitNote: \"sales_debit_note\",\n} as const\n\nexport type DocumentType = typeof documentTypes[keyof typeof documentTypes]\nexport type DocumentTargetType = typeof documentTypes[keyof typeof documentTypes]\nexport type DocumentTargetKey = keyof typeof documentTypes\n\nexport type DocumentServiceProps = ApiServiceType & {\n documentTargetType?: DocumentTargetType\n documentType?: DocumentType\n};\n\nexport type ListDocumentProps = BuildApiListParamsProps & {\n documentType: DocumentType\n}\n\nexport type GetDocumentProps = BuildApiGetParamsProps & {\n id: number | string\n documentType: DocumentType\n}\n\ntype Document = {\n docNumber?: string\n docDate: string\n remark: string\n}\n\ntype OverrideProfile = {\n profileName: string\n address1: string\n address2: string\n postcode: string\n contact: string\n email: string\n area: string\n countryId: number\n stateId: number\n}\n\ntype Adjustment = {\n type: \"tax\" | \"discount\", // Adjustment Type\n referId?: string\n description: string\n adjustmentAmount: number\n adjustmentPercentage: number\n}\n\ntype Dependency = {\n scope: \"document\" | \"document_item\",\n target: DocumentTargetType,\n targetId: number,\n type: \"reference\" | \"bind\" /* bind / reference */\n}\n\ntype Item = {\n itemId: number\n code: string\n name: string\n description: string\n qty: number\n uomName: string\n uomId: number,\n price: number\n}\n\ntype Payment = {\n paymentType: string\n paymentDate: string\n paymentAction: string\n bankName: string\n bankAccountNo: string\n bankAccountName: string\n receiveAmount: number\n paymentReference: string\n paymentPostDate: string\n}\n\ntype Amount = {\n requireCollectAmount: number\n collectionAmount: number\n}\n\n// type DocumentSalesOrder = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// },\n// shippingBranch: {\n// branchId: number,\n// override?: OverrideProfile\n// },\n// billingBranch: {\n// branchId: number,\n// override?: OverrideProfile\n// }\n// },\n// props: {\n// locationId: number\n// },\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentProformaSales = {\n// document: Document,\n// profiles: {\n// retailer: {\n// userId: number\n// },\n// shippingBranch: {\n// branchId: number,\n// override?: OverrideProfile\n// },\n// billingBranch: {\n// branchId: number,\n// override?: OverrideProfile\n// }\n// },\n// props?: {\n// locationId: number\n// },\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentCashSales = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// },\n// shippingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// },\n// billingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// }\n// },\n// props: {\n// locationId: number,\n// distributionLocationId: number[]\n// },\n// payment: Payment,\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentRetailCashSales = {\n// document: Document,\n// profiles: {\n// member: {\n// userId: number\n// }\n// },\n// props: {\n// locationId: number,\n// retailOutletId: number\n// },\n// payment: Payment,\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentDelivery = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// },\n// shippingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// },\n// billingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// }\n// },\n// props: {\n// locationId: number,\n// distributionLocationId: number\n// doAlternativeNo: string\n// soId: number\n// containerId: number\n// trackingNo: number\n// },\n// status: {\n// isPaymentCollect: boolean\n// }\n// payment: Payment,\n// amounts: Amount,\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentReplacementDelivery = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// },\n// shippingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// },\n// billingBranch: {\n// branchId: number,\n// // override?: OverrideProfile\n// }\n// },\n// props: {\n// locationId: number,\n// distributionLocationId: number\n// collectionRemark: string\n// },\n// status: {\n// isPaymentCollect: boolean\n// }\n// dependencies?: Dependency[]\n// amounts: Amount,\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentSalesInvoice = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// },\n// billingBranch: {\n// branchId: number,\n// override?: OverrideProfile\n// }\n// },\n// props?: {\n// locationId: number\n// },\n// dependencies?: Dependency[],\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentSalesDebitNote = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// }\n// },\n// props?: {\n// locationId: number\n// },\n// dependencies?: Dependency[],\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\n// type DocumentSalesCreditNote = {\n// document: Document,\n// profiles: {\n// customer: {\n// userId: number\n// }\n// },\n// props?: {\n// locationId: number\n// },\n// dependencies?: Dependency[],\n// adjustments?: Adjustment[],\n// items: Item[]\n// }\n\nexport type CreateDocumentProps = {\n documentTargetType?: DocumentTargetType\n documentType?: DocumentType\n data:\n // sales order\n {\n salesOrder: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props: {\n locationId: number\n },\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // proforma sales\n {\n proformaSales: {\n document: Document,\n profiles: {\n retailer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props?: {\n locationId: number\n },\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // cash sales\n {\n cashSales: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number[]\n },\n payment: Payment,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // retail cash sales\n {\n retailCashSales: {\n document: Document,\n profiles: {\n member: {\n userId: number\n }\n },\n props: {\n locationId: number,\n retailOutletId: number\n },\n payment: Payment,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // delivery order\n {\n deliveryOrder: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number\n doAlternativeNo: string\n soId: number\n containerId: number\n trackingNo: number\n },\n status: {\n isPaymentCollect: boolean\n }\n payment: Payment,\n amounts: Amount,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // replacement delivery\n {\n replacementDelivery: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number\n collectionRemark: string\n },\n status: {\n isPaymentCollect: boolean\n }\n dependencies?: Dependency[]\n amounts: Amount,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // trip order\n {\n tripOrder: {\n document: Document,\n profiles: {\n driver: {\n userId: number\n }\n },\n status: {\n isConfirm: boolean\n },\n props: {\n locationId: number,\n referenceNo: string,\n logisticId: number\n },\n documents: {\n documentId: number,\n documentDocId: number,\n remark: string,\n sequence: number\n }[]\n }\n } |\n // sales invoice\n {\n salesInvoice: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // sales debit note\n {\n salesDebitNote: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // sales credit note\n {\n salesCreditNote: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n }\n}\n\nexport type UpdateDocumentProps = {\n id: number\n documentTargetType?: DocumentTargetType\n documentType?: DocumentType\n data:\n // sales order\n {\n salesOrder: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props: {\n locationId: number\n },\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // proforma sales\n {\n proformaSales: {\n document: Document,\n profiles: {\n retailer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props?: {\n locationId: number\n },\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // cash sales\n {\n cashSales: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number[]\n },\n payment: Payment,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // retail cash sales\n {\n retailCashSales: {\n document: Document,\n profiles: {\n member: {\n userId: number\n }\n },\n props: {\n locationId: number,\n retailOutletId: number\n },\n payment: Payment,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // delivery order\n {\n deliveryOrder: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number\n doAlternativeNo: string\n soId: number\n containerId: number\n trackingNo: number\n },\n status: {\n isPaymentCollect: boolean\n }\n payment: Payment,\n amounts: Amount,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // replacement delivery\n {\n replacementDelivery: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n shippingBranch: {\n branchId: number,\n // override?: OverrideProfile\n },\n billingBranch: {\n branchId: number,\n // override?: OverrideProfile\n }\n },\n props: {\n locationId: number,\n distributionLocationId: number\n collectionRemark: string\n },\n status: {\n isPaymentCollect: boolean\n }\n dependencies?: Dependency[]\n amounts: Amount,\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // trip order\n {\n tripOrder: {\n document: Document,\n profiles: {\n driver: {\n userId: number\n }\n },\n status: {\n isConfirm: boolean\n },\n props: {\n locationId: number,\n referenceNo: string,\n logisticId: number\n },\n documents: {\n documentId: number,\n documentDocId: number,\n remark: string,\n sequence: number\n }[]\n }\n } |\n // sales invoice\n {\n salesInvoice: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n },\n billingBranch: {\n branchId: number,\n override?: OverrideProfile\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // sales debit note\n {\n salesDebitNote: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n } |\n // sales credit note\n {\n salesCreditNote: {\n document: Document,\n profiles: {\n customer: {\n userId: number\n }\n },\n props?: {\n locationId: number\n },\n dependencies?: Dependency[],\n adjustments?: Adjustment[],\n items: Item[]\n }\n }\n}\n\nexport type RemoveDocumentProps = {\n documentTargetType?: DocumentTargetType\n ids: number[]\n}\n\nexport type GetDataTypeDocumentProps = {\n documentType?: DocumentType\n}\n\nconst getCreatePayload = (documentType: DocumentType, data: CreateDocumentProps[\"data\"]) => {\n\n if (documentType === \"sales\" && \"salesOrder\" in data) {\n\n return {\n document: {\n ...(data.salesOrder.document.docNumber && { doc_number: data.salesOrder.document.docNumber }),\n doc_date: dayjs(data.salesOrder.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.salesOrder.document.remark\n },\n profiles: {\n customer: {\n user_id: data.salesOrder.profiles.customer.userId\n },\n shipping_address: {\n branch_id: data.salesOrder.profiles.shippingBranch.branchId,\n ...(data.salesOrder.profiles.shippingBranch?.override && {\n override: {\n profile_name: data.salesOrder.profiles.shippingBranch.override.profileName,\n address_1: data.salesOrder.profiles.shippingBranch.override.address1,\n address_2: data.salesOrder.profiles.shippingBranch.override.address2,\n postcode: data.salesOrder.profiles.shippingBranch.override.postcode,\n contact: data.salesOrder.profiles.shippingBranch.override.contact,\n email: data.salesOrder.profiles.shippingBranch.override.email,\n area: data.salesOrder.profiles.shippingBranch.override.area,\n country_id: data.salesOrder.profiles.shippingBranch.override.countryId,\n state_id: data.salesOrder.profiles.shippingBranch.override.stateId\n }\n })\n },\n billing_branch: {\n branch_id: data.salesOrder.profiles.billingBranch.branchId,\n ...(data.salesOrder.profiles.billingBranch?.override && {\n override: {\n profile_name: data.salesOrder.profiles.billingBranch.override.profileName,\n address_1: data.salesOrder.profiles.billingBranch.override.address1,\n address_2: data.salesOrder.profiles.billingBranch.override.address2,\n postcode: data.salesOrder.profiles.billingBranch.override.postcode,\n contact: data.salesOrder.profiles.billingBranch.override.contact,\n email: data.salesOrder.profiles.billingBranch.override.email,\n area: data.salesOrder.profiles.billingBranch.override.area,\n country_id: data.salesOrder.profiles.billingBranch.override.countryId,\n state_id: data.salesOrder.profiles.billingBranch.override.stateId\n }\n })\n }\n },\n props: {\n ...(data.salesOrder.props?.locationId && { location_id: data.salesOrder.props?.locationId })\n },\n adjustments: data.salesOrder.adjustments && data.salesOrder.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n items: data.salesOrder.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"proforma_sales\" && \"proformaSales\" in data) {\n\n return {\n document: {\n ...(data.proformaSales.document.docNumber && { doc_number: data.proformaSales.document.docNumber }),\n doc_date: dayjs(data.proformaSales.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.proformaSales.document.remark\n },\n profiles: {\n retailer: {\n user_id: data.proformaSales.profiles.retailer.userId\n },\n shipping_address: {\n branch_id: data.proformaSales.profiles.shippingBranch.branchId\n },\n billing_branch: {\n branch_id: data.proformaSales.profiles.billingBranch.branchId\n }\n },\n props: {\n ...(data.proformaSales.props?.locationId && { location_id: data.proformaSales.props?.locationId })\n },\n adjustments: data.proformaSales.adjustments && data.proformaSales.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n items: data.proformaSales.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"cash_sales\" && \"cashSales\" in data) {\n\n return {\n document: {\n ...(data.cashSales.document.docNumber && { doc_number: data.cashSales.document.docNumber }),\n doc_date: dayjs(data.cashSales.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.cashSales.document.remark\n },\n profiles: {\n customer: {\n user_id: data.cashSales.profiles.customer.userId\n },\n shipping_address: {\n branch_id: data.cashSales.profiles.shippingBranch.branchId\n },\n billing_branch: {\n branch_id: data.cashSales.profiles.billingBranch.branchId,\n }\n },\n props: {\n ...(data.cashSales.props?.locationId && { location_id: data.cashSales.props?.locationId }),\n distribution_location_id: data.cashSales.props?.distributionLocationId ?? \"\"\n },\n payment: {\n payment_type: data.cashSales.payment.paymentType,\n payment_date: data.cashSales.payment.paymentDate,\n payment_action: data.cashSales.payment.paymentAction,\n bank_name: data.cashSales.payment.bankName,\n bank_account_no: data.cashSales.payment.bankAccountNo,\n bank_account_name: data.cashSales.payment.bankAccountName,\n receive_amount: _.round(data.cashSales.payment.receiveAmount, 2),\n payment_reference: data.cashSales.payment.paymentReference,\n payment_post_date: data.cashSales.payment.paymentPostDate\n },\n adjustments: data.cashSales.adjustments && data.cashSales.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n items: data.cashSales.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"retail_cash_sales\" && \"retailCashSales\" in data) {\n\n return {\n document: {\n ...(data.retailCashSales.document.docNumber && { doc_number: data.retailCashSales.document.docNumber }),\n doc_date: dayjs(data.retailCashSales.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.retailCashSales.document.remark\n },\n profiles: {\n member: {\n user_id: data.retailCashSales.profiles.member.userId\n }\n },\n props: {\n ...(data.retailCashSales.props?.locationId && { location_id: data.retailCashSales.props?.locationId }),\n retail_outlet_id: data.retailCashSales?.props?.retailOutletId ?? \"\"\n },\n payment: {\n payment_type: data.retailCashSales.payment.paymentType,\n payment_date: data.retailCashSales.payment.paymentDate,\n payment_action: data.retailCashSales.payment.paymentAction,\n bank_name: data.retailCashSales.payment.bankName,\n bank_account_no: data.retailCashSales.payment.bankAccountNo,\n bank_account_name: data.retailCashSales.payment.bankAccountName,\n receive_amount: _.round(data.retailCashSales.payment.receiveAmount, 2),\n payment_reference: data.retailCashSales.payment.paymentReference,\n payment_post_date: data.retailCashSales.payment.paymentPostDate\n },\n adjustments: data.retailCashSales.adjustments && data.retailCashSales.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n items: data.retailCashSales.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"delivery\" && \"deliveryOrder\" in data) {\n\n return {\n document: {\n ...(data.deliveryOrder.document.docNumber && { doc_number: data.deliveryOrder.document.docNumber }),\n doc_date: dayjs(data.deliveryOrder.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.deliveryOrder.document.remark\n },\n profiles: {\n customer: {\n user_id: data.deliveryOrder.profiles.customer.userId\n },\n shipping_address: {\n branch_id: data.deliveryOrder.profiles.shippingBranch.branchId\n },\n billing_branch: {\n branch_id: data.deliveryOrder.profiles.billingBranch.branchId,\n }\n },\n props: {\n ...(data.deliveryOrder.props?.locationId && { location_id: data.deliveryOrder.props?.locationId }),\n distribution_location_id: data.deliveryOrder.props?.distributionLocationId ?? \"\",\n do_alternative_no: data.deliveryOrder.props?.doAlternativeNo ?? \"\",\n so_id: data.deliveryOrder.props?.soId ?? \"\",\n container_id: data.deliveryOrder.props?.containerId ?? \"\",\n tracking_no: data.deliveryOrder.props?.trackingNo ?? \"\"\n },\n status: {\n is_payment_collect: data.deliveryOrder.status.isPaymentCollect === true ? 1 : 0\n },\n adjustments: data.deliveryOrder.adjustments && data.deliveryOrder.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n amounts: {\n require_collect_amount: data.deliveryOrder.amounts.requireCollectAmount,\n collection_amount: data.deliveryOrder.amounts.collectionAmount,\n },\n items: data.deliveryOrder.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"replacement_delivery\" && \"replacementDelivery\" in data) {\n\n return {\n document: {\n ...(data.replacementDelivery.document.docNumber && { doc_number: data.replacementDelivery.document.docNumber }),\n doc_date: dayjs(data.replacementDelivery.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.replacementDelivery.document.remark\n },\n profiles: {\n customer: {\n user_id: data.replacementDelivery.profiles.customer.userId\n },\n shipping_address: {\n branch_id: data.replacementDelivery.profiles.shippingBranch.branchId\n },\n billing_branch: {\n branch_id: data.replacementDelivery.profiles.billingBranch.branchId,\n }\n },\n props: {\n ...(data.replacementDelivery.props?.locationId && { location_id: data.replacementDelivery.props?.locationId }),\n distribution_location_id: data.replacementDelivery.props?.distributionLocationId ?? \"\",\n collection_remark: data.replacementDelivery.props?.collectionRemark ?? \"\"\n },\n status: {\n is_payment_collect: data.replacementDelivery.status.isPaymentCollect === true ? 1 : 0\n },\n adjustments: data.replacementDelivery.adjustments && data.replacementDelivery.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n dependencies: data.replacementDelivery.dependencies && data.replacementDelivery.dependencies.map((i: Dependency) => ({\n scope: i.scope,\n target: i.target,\n target_id: i.targetId,\n type: i.type\n })),\n amounts: {\n require_collect_amount: data.replacementDelivery.amounts.requireCollectAmount,\n collection_amount: data.replacementDelivery.amounts.collectionAmount,\n },\n items: data.replacementDelivery.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"trip\" && \"tripOrder\" in data) {\n\n return {\n document: {\n ...(data.tripOrder.document.docNumber && { doc_number: data.tripOrder.document.docNumber }),\n doc_date: dayjs(data.tripOrder.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.tripOrder.document.remark\n },\n profiles: {\n ...(data?.tripOrder?.profiles?.driver?.userId ? { driver: { user_id: data.tripOrder.profiles.driver.userId } } : {}),\n props: {\n location_id: data.tripOrder.props.locationId,\n reference_no: data.tripOrder.props.referenceNo,\n ...(data?.tripOrder?.props?.logisticId ? { logistic_id: data.tripOrder.props.logisticId } : {})\n },\n status: {\n confirm: data.tripOrder.status.isConfirm === true ? 1 : 0\n },\n docs: data.tripOrder.documents.map((i) => ({\n document_id: i.documentId,\n document_doc_id: i.documentDocId,\n doc_remark: i.remark,\n props: {\n sequence: i.sequence\n }\n }))\n\n }\n }\n }\n\n if (documentType === \"sales_invoice\" && \"salesInvoice\" in data) {\n\n return {\n document: {\n ...(data.salesInvoice.document.docNumber && { doc_number: data.salesInvoice.document.docNumber }),\n doc_date: dayjs(data.salesInvoice.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.salesInvoice.document.remark\n },\n profiles: {\n customer: {\n user_id: data.salesInvoice.profiles.customer.userId\n },\n billing_branch: {\n branch_id: data.salesInvoice.profiles.billingBranch.branchId,\n }\n },\n props: {\n ...(data.salesInvoice.props?.locationId && { location_id: data.salesInvoice.props?.locationId }),\n },\n adjustments: data.salesInvoice.adjustments && data.salesInvoice.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n dependencies: data.salesInvoice.dependencies && data.salesInvoice.dependencies.map((i: Dependency) => ({\n scope: i.scope,\n target: i.target,\n target_id: i.targetId,\n type: i.type\n })),\n items: data.salesInvoice.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"sales_credit_note\" && \"salesCreditNote\" in data) {\n\n return {\n document: {\n ...(data.salesCreditNote.document.docNumber && { doc_number: data.salesCreditNote.document.docNumber }),\n doc_date: dayjs(data.salesCreditNote.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.salesCreditNote.document.remark\n },\n profiles: {\n customer: {\n user_id: data.salesCreditNote.profiles.customer.userId\n },\n // billing_branch: {\n // branch_id: data.salesCreditNote.profiles.billingBranch.branchId,\n // }\n },\n props: {\n ...(data.salesCreditNote.props?.locationId && { location_id: data.salesCreditNote.props?.locationId }),\n },\n adjustments: data.salesCreditNote.adjustments && data.salesCreditNote.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n dependencies: data.salesCreditNote.dependencies && data.salesCreditNote.dependencies.map((i: Dependency) => ({\n scope: i.scope,\n target: i.target,\n target_id: i.targetId,\n type: i.type\n })),\n items: data.salesCreditNote.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n if (documentType === \"sales_debit_note\" && \"salesDebitNote\" in data) {\n\n return {\n document: {\n ...(data.salesDebitNote.document.docNumber && { doc_number: data.salesDebitNote.document.docNumber }),\n doc_date: dayjs(data.salesDebitNote.document.docDate).format(\"YYYY-MM-DD\"),\n doc_remark: data.salesDebitNote.document.remark\n },\n profiles: {\n customer: {\n user_id: data.salesDebitNote.profiles.customer.userId\n },\n // billing_branch: {\n // ...data.salesDebitNote.profiles.billingBranch,\n // branch_id: data.salesDebitNote.profiles.billingBranch.branchId,\n // }\n },\n props: {\n ...(data.salesDebitNote.props?.locationId && { location_id: data.salesDebitNote.props?.locationId }),\n },\n adjustments: data.salesDebitNote.adjustments && data.salesDebitNote.adjustments.map((i: Adjustment) => ({\n type: i.type,\n refer_id: i?.referId,\n description: i.description,\n adjustment_amount: i.adjustmentAmount,\n adjustment_percentage: i.adjustmentPercentage\n })),\n dependencies: data.salesDebitNote.dependencies && data.salesDebitNote.dependencies.map((i: Dependency) => ({\n scope: i.scope,\n target: i.target,\n target_id: i.targetId,\n type: i.type\n })),\n items: data.salesDebitNote.items.map((i: Item) => ({\n id: i.itemId,\n code: i.code,\n name: i.name,\n description: i.description,\n qty: i.qty,\n uom_lbl: i.uomName,\n uom_id: i.uomId,\n price: _.round(i.price, 2)\n }))\n\n }\n }\n\n}\n\nconst getUpdatePayload = (documentType: DocumentType, data: UpdateDocumentProps[\"data\"]) => {\n return getCreatePayload(documentType, data)\n}\n\nexport const DocumentService = (props?: DocumentServiceProps) => {\n\n const { documentType = \"sales\", documentTargetType, ...rest } = props ?? {}\n\n const { makeCall } = ApiService(rest?.customToken ? { customToken: rest.customToken } : {})\n\n const endpoint1 = \"document\";\n const endpoint2 = \"documents\"\n\n const list = async (props: ListDocumentProps) => {\n\n const { documentType: overrideDocumentType } = props;\n\n const url = buildApiListUrl(\n `${endpoint2}/${overrideDocumentType || documentType}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n }\n\n const get = async (props: GetDocumentProps) => {\n\n const { id, documentType: overrideDocumentType } = props;\n\n const url = buildApiGetUrl(\n `${endpoint1}/${overrideDocumentType || documentType}/${id}`,\n props\n );\n\n const response = await makeCall({\n url,\n method: \"get\",\n payload: {},\n // configuration\n });\n\n return response;\n\n }\n\n const create = async ({ data, documentType: overrideDocumentType, documentTargetType: overrideDocumentTargetType }: CreateDocumentProps) => {\n\n let url = `${endpoint1}`;\n\n let _documentType = overrideDocumentType || documentType\n\n let payload: any = getCreatePayload(_documentType, data)\n\n let postData = {\n scope: {\n target: overrideDocumentTargetType || documentTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const update = async ({ id, data, documentType: overrideDocumentType, documentTargetType: overrideDocumentTargetType }: UpdateDocumentProps) => {\n\n let url = `${endpoint1}/${id}`\n\n let _documentType = overrideDocumentType || documentType\n\n let payload: any = getUpdatePayload(_documentType, data)\n\n const postData = {\n scope: {\n target: overrideDocumentTargetType || documentTargetType,\n action: \"\",\n },\n payload\n }\n\n const response = await makeCall({\n url,\n method: \"put\",\n payload: postData\n });\n\n return response;\n\n }\n\n const remove = async ({ ids, documentTargetType: overrideDocumentTargetType }: RemoveDocumentProps) => {\n\n let url = `${endpoint2}/delete`\n\n const postData = {\n scope: {\n target: overrideDocumentTargetType || documentTargetType,\n },\n payload: {\n ids\n }\n }\n\n const response = await makeCall({\n url,\n method: \"post\",\n payload: postData\n });\n\n return response;\n\n }\n\n const getDataTypes = async ({ documentType: overrideDocumentType }: GetDataTypeDocumentProps) => {\n\n let url = `${endpoint2}/data_types/${overrideDocumentType || documentType}`\n\n const response = await makeCall({\n url,\n method: \"get\",\n });\n\n return response;\n\n }\n\n return {\n list,\n get,\n create,\n update,\n remove,\n getDataTypes\n };\n}\n"]}
|
package/dist/services/index.js
CHANGED
|
@@ -95,3 +95,4 @@ Object.defineProperty(exports, "permissionFunctionActionTypes", { enumerable: tr
|
|
|
95
95
|
// export type { BuildApiListParamsProps, BuildApiGetParamsProps } from "../utils/buildApiParams";
|
|
96
96
|
// export { AutocountDocumentService, AutocountDocumentTypes } from './AutocountDocumentService';
|
|
97
97
|
// export type { AutocountDocumentServiceCreateProps, AutocountDocumentServiceCancelProps, AutocountDocumentServiceListProps, AutocountDocumentServiceGetProps, AutocountDocumentType } from './AutocountDocumentService';
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;AAAA,2DAA2E;AAAlE,0GAAA,WAAW,OAAA;AAAE,8GAAA,eAAe,OAAA;AAGrC,2DAAsF;AAA7E,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAAE,8GAAA,eAAe,OAAA;AAGhD,mEAA8F;AAArF,kHAAA,eAAe,OAAA;AAAE,4GAAA,SAAS,OAAA;AAAE,kHAAA,eAAe,OAAA;AAGpD,uEAA8G;AAArG,sHAAA,iBAAiB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAAE,0HAAA,qBAAqB,OAAA;AAGlE,iEAAgG;AAAvF,8GAAA,aAAa,OAAA;AAAE,4GAAA,WAAW,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAGtD,uEAAqF;AAA5E,kHAAA,eAAe,OAAA;AAAE,gHAAA,aAAa,OAAA;AAGvC,2DAAsF;AAA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AiB,OAAA;AAAE,oHAAA,eAAe,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAAE,0HAAA,qBAAqB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAAE,kIAAA,6BAA6B,OAAA;AAGhJ,qDAAqD;AACrD,sDAAsD;AACtD,0FAA0F;AAC1F,gEAAgE;AAEhE,2EAA2E;AAC3E,mFAAmF;AAEnF,sEAAsE;AACtE,yDAAyD;AAEzD,qDAAqD;AACrD,iDAAiD;AAEjD,iEAAiE;AACjE,kGAAkG;AAElG,iGAAiG;AACjG,0NAA0N","sourcesContent":["export { AuthService, authTargetTypes } from '@/services/auth/AuthService';\nexport type { AuthLoginProps, AuthTargetType } from '@/services/auth/AuthService'\n\nexport { UserService, userTypes, userTargetTypes } from '@/services/user/UserService';\nexport type { UserServiceProps, UserType, ListUserProps, GetUserProps, CreateUserProps, UpdateUserProps, RemoveUserProps } from '@/services/user/UserService';\n\nexport { UserRoleService, roleTypes, roleTargetTypes } from '@/services/user/UserRoleService';\nexport type { UserRoleServiceProps, RoleType, ListRoleProps, GetRoleProps, CreateRoleProps, UpdateRoleProps, RemoveRoleProps, UpdateRolePermissionProps } from '@/services/user/UserRoleService';\n\nexport { BranchUserService, branchUserTypes, branchUserTargetTypes } from '@/services/user/BranchUserService';\nexport type { BranchUserServiceProps, BranchUserType, ListBranchUserProps, GetBranchUserProps, CreateBranchUserProps, UpdateBranchUserProps, RemoveBranchUserProps } from '@/services/user/BranchUserService';\n\nexport { BranchService, branchTypes, branchTargetTypes } from '@/services/branch/BranchService';\nexport type { BranchServiceProps, BranchType, ListBranchProps, GetBranchProps, CreateBranchProps, UpdateBranchProps, RemoveBranchProps } from '@/services/branch/BranchService';\n\nexport { DocumentService, documentTypes } from '@/services/document/DocumentService';\nexport type { DocumentServiceProps, DocumentType, ListDocumentProps, GetDocumentProps, CreateDocumentProps, UpdateDocumentProps, RemoveDocumentProps } from '@/services/document/DocumentService';\n\nexport { ItemService, itemTypes, itemTargetTypes } from '@/services/item/ItemService';\nexport type { ItemServiceProps, ItemType, ListItemProps, GetItemProps, CreateItemProps, UpdateItemProps, RemoveItemProps, CreateMultipleItemProps, CreateMultipleItemPropsProps } from '@/services/item/ItemService';\n\nexport { InjectionFieldService, injectionFieldMap, injectionFieldScopeTypes, injectionFieldDataTypes, getInjectionFieldsPayload } from '@/services/injection_field/InjectionFieldService';\nexport type { InjectionFieldServiceProps, InjectionField, InjectionFieldScopeType, StrictInjectionField, ListInjectionFieldProps, GetInjectionFieldProps, CreateInjectionFieldProps, RemoveInjectionFieldProps, UpdateInjectionFieldValuesProps } from '@/services/injection_field/InjectionFieldService';\n\nexport { LocationService, locationTypes, locationTargetTypes } from '@/services/location/LocationService';\nexport type { LocationServiceProps, LocationType, ListLocationProps, GetLocationProps, CreateLocationProps, UpdateLocationProps, RemoveLocationProps } from '@/services/location/LocationService';\n\nexport { RegionService, regionTypes, regionTargetTypes } from '@/services/region/RegionService';\nexport type { RegionServiceProps, RegionType, ListRegionProps, GetRegionProps, CreateRegionProps, UpdateRegionProps, RemoveRegionProps } from '@/services/region/RegionService';\n\nexport { RateService, rateTypes, rateTargetTypes, rateCalculationTypes } from '@/services/rate/RateService';\nexport type { RateServiceProps, RateType, ListRateProps, GetRateProps, CreateRateProps, UpdateRateProps, RemoveRateProps, RemoveRateItemProps, CalculateRateProps } from '@/services/rate/RateService';\n\nexport { WalletService, walletTypes, walletTargetTypes, walletCurrencyTypes } from '@/services/wallet/WalletService';\nexport type { WalletServiceProps, WalletType, ListWalletProps, GetWalletProps, CreateWalletProps, UpdateWalletProps, RemoveWalletProps } from '@/services/wallet/WalletService';\n\nexport { TransactionService, transactionTypes, transactionTargetTypes, transactionActionTypes } from '@/services/transaction/TransactionService';\nexport type { TransactionServiceProps, TransactionType, ListTransactionProps, GetTransactionProps, CreateTransactionProps, UpdateStatusTransactionProps } from '@/services/transaction/TransactionService';\n\nexport { BusinessService, businessTypes, businessTargetTypes } from '@/services/business/BusinessService';\nexport type { BusinessServiceProps, BusinessType, ListBusinessProps, GetBusinessProps, CreateBusinessProps, UpdateBusinessProps, RemoveBusinessProps } from '@/services/business/BusinessService';\n\nexport { LogisticService, logisticTypes, logisticTargetTypes, transportTypes } from '@/services/logistic/LogisticService';\nexport type { LogisticServiceProps, LogisticType, ListLogisticProps, GetLogisticProps, CreateLogisticProps, UpdateLogisticProps, RemoveLogisticProps } from '@/services/logistic/LogisticService';\n\nexport { AccountService, accountTypes, accountTargetTypes } from '@/services/account/AccountService';\nexport type { AccountServiceProps, AccountType, ListAccountProps, GetAccountProps, UpdateAccountProps } from '@/services/account/AccountService';\n\nexport { RepositoryService, repositoryTypes, repositoryTargetTypes } from '@/services/repository/RepositoryService'\nexport type { RepositoryServiceProps, RepositoryType, ListRepositoryProps, GetRepositoryProps, CreateRepositoryProps, UpdateRepositoryProps, RemoveRepositoryProps } from '@/services/repository/RepositoryService'\n\nexport { PermissionService, permissionTypes, permissionScopeTypes, permissionModuleTypes, permissionFunctionTypes, permissionFunctionActionTypes } from '@/services/permission/PermissionService';\nexport type { PermissionServiceProps, CheckPermissionAllowProps, PermissionScopeType, PermissionFunctionType, PermissionFunctionActionType } from '@/services/permission/PermissionService';\n\n// export { SessionService } from './SessionService';\n// export { StorageService } from '../StorageService';\n// export { UserService, userTypes, targetTypes as userTargetTypes } from './UserService';\n// export type { UserType, UserTargetType } from \"./UserService\"\n\n// export { AccountingActivityService } from './AccountingActivityService';\n// export type { AccountingActivityModuleType } from './AccountingActivityService';\n\n// export { DocumentService, documentTypes } from './DocumentService';\n// export type { DocumentType } from './DocumentService';\n\n// export { MarkingService } from './MarkingService';\n// export { AgentService } from './AgentService';\n\n// export { filterOperatorTypes } from \"../utils/buildApiParams\";\n// export type { BuildApiListParamsProps, BuildApiGetParamsProps } from \"../utils/buildApiParams\";\n\n// export { AutocountDocumentService, AutocountDocumentTypes } from './AutocountDocumentService';\n// export type { AutocountDocumentServiceCreateProps, AutocountDocumentServiceCancelProps, AutocountDocumentServiceListProps, AutocountDocumentServiceGetProps, AutocountDocumentType } from './AutocountDocumentService';"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiServiceType } from '
|
|
2
|
-
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '
|
|
1
|
+
import { ApiServiceType } from '../../lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '../../lib';
|
|
3
3
|
export type InjectionFieldDataTypeValueMap = {
|
|
4
4
|
id: number;
|
|
5
5
|
text: string;
|