@fctc/interface-logic 4.2.4 → 4.2.5

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/hooks.mjs CHANGED
@@ -5062,32 +5062,6 @@ function useViewService() {
5062
5062
  },
5063
5063
  [env]
5064
5064
  );
5065
- const addEntity = useCallback10(
5066
- ({
5067
- model,
5068
- values,
5069
- xNode,
5070
- service,
5071
- isCreateEndpoint = false
5072
- }) => {
5073
- const jsonData = {
5074
- model,
5075
- values
5076
- };
5077
- return env?.requests.post(
5078
- isCreateEndpoint ? "/create" /* CREATE_PATH */ : "/call" /* CALL_PATH */,
5079
- jsonData,
5080
- {
5081
- headers: {
5082
- "Content-Type": "application/json",
5083
- ...xNode ? { "X-Node": xNode } : {}
5084
- }
5085
- },
5086
- service
5087
- );
5088
- },
5089
- [env]
5090
- );
5091
5065
  const getList = useCallback10(
5092
5066
  ({
5093
5067
  model,
@@ -5842,7 +5816,6 @@ function useViewService() {
5842
5816
  manageOnChange,
5843
5817
  getOrderLine,
5844
5818
  getProductImage,
5845
- addEntity,
5846
5819
  checkPayment,
5847
5820
  handleCloseSession,
5848
5821
  handleClosingDetailSession,
@@ -5921,6 +5894,48 @@ function useDashboardService() {
5921
5894
  return { readGroup, getDataChart };
5922
5895
  }
5923
5896
 
5897
+ // src/services/pos-service/add-entity.ts
5898
+ import { useCallback as useCallback12 } from "react";
5899
+ var addEntityService = (env) => {
5900
+ const addEntity = useCallback12(
5901
+ ({
5902
+ model,
5903
+ values,
5904
+ xNode,
5905
+ service,
5906
+ isCreateEndpoint = false
5907
+ }) => {
5908
+ const jsonData = {
5909
+ model,
5910
+ values
5911
+ };
5912
+ return env?.requests.post(
5913
+ isCreateEndpoint ? "/create" /* CREATE_PATH */ : "/call" /* CALL_PATH */,
5914
+ jsonData,
5915
+ {
5916
+ headers: {
5917
+ "Content-Type": "application/json",
5918
+ ...xNode ? { "X-Node": xNode } : {}
5919
+ }
5920
+ },
5921
+ service
5922
+ );
5923
+ },
5924
+ [env]
5925
+ );
5926
+ return {
5927
+ addEntity
5928
+ };
5929
+ };
5930
+
5931
+ // src/services/pos-service/index.ts
5932
+ var usePosService = () => {
5933
+ const { env } = useEnv();
5934
+ return {
5935
+ addEntity: addEntityService(env).addEntity
5936
+ };
5937
+ };
5938
+
5924
5939
  // src/hooks/auth/use-forgot-password.ts
5925
5940
  var useForgotPassword = () => {
5926
5941
  const { forgotPassword } = useAuthService();
@@ -6790,9 +6805,9 @@ var BaseModel = class {
6790
6805
  };
6791
6806
 
6792
6807
  // src/hooks/model/use-model.ts
6793
- import { useCallback as useCallback12 } from "react";
6808
+ import { useCallback as useCallback13 } from "react";
6794
6809
  var useModel = () => {
6795
- const initModel = useCallback12((modelData) => {
6810
+ const initModel = useCallback13((modelData) => {
6796
6811
  switch (modelData?.name) {
6797
6812
  default:
6798
6813
  return new BaseModel(modelData);
@@ -7802,35 +7817,11 @@ var useGetProductImage = () => {
7802
7817
  };
7803
7818
  var use_get_product_image_default = useGetProductImage;
7804
7819
 
7805
- // src/hooks/view/use-add-entity.ts
7806
- import { useMutation as useMutation66 } from "@tanstack/react-query";
7807
- var useAddEntity = () => {
7808
- const { addEntity } = useViewService();
7809
- return useMutation66({
7810
- mutationFn: ({
7811
- model,
7812
- values,
7813
- xNode,
7814
- service,
7815
- isCreateEndpoint = false
7816
- }) => {
7817
- return addEntity({
7818
- model,
7819
- values,
7820
- xNode,
7821
- service,
7822
- isCreateEndpoint
7823
- });
7824
- }
7825
- });
7826
- };
7827
- var use_add_entity_default = useAddEntity;
7828
-
7829
7820
  // src/hooks/view/use-check-payment.ts
7830
- import { useMutation as useMutation67 } from "@tanstack/react-query";
7821
+ import { useMutation as useMutation66 } from "@tanstack/react-query";
7831
7822
  var useCheckPayment = () => {
7832
7823
  const { checkPayment } = useViewService();
7833
- return useMutation67({
7824
+ return useMutation66({
7834
7825
  mutationFn: ({
7835
7826
  model,
7836
7827
  ids,
@@ -7851,10 +7842,10 @@ var useCheckPayment = () => {
7851
7842
  var use_check_payment_default = useCheckPayment;
7852
7843
 
7853
7844
  // src/hooks/view/use-handle-close-session.ts
7854
- import { useMutation as useMutation68 } from "@tanstack/react-query";
7845
+ import { useMutation as useMutation67 } from "@tanstack/react-query";
7855
7846
  var useHandleCloseSession = () => {
7856
7847
  const { handleCloseSession } = useViewService();
7857
- return useMutation68({
7848
+ return useMutation67({
7858
7849
  mutationFn: ({
7859
7850
  model,
7860
7851
  ids,
@@ -7875,10 +7866,10 @@ var useHandleCloseSession = () => {
7875
7866
  var use_handle_close_session_default = useHandleCloseSession;
7876
7867
 
7877
7868
  // src/hooks/view/use-handle-closing-detail-session.ts
7878
- import { useMutation as useMutation69 } from "@tanstack/react-query";
7869
+ import { useMutation as useMutation68 } from "@tanstack/react-query";
7879
7870
  var useHandleClosingDetailSession = () => {
7880
7871
  const { handleClosingDetailSession } = useViewService();
7881
- return useMutation69({
7872
+ return useMutation68({
7882
7873
  mutationFn: ({
7883
7874
  model,
7884
7875
  ids,
@@ -7901,10 +7892,10 @@ var useHandleClosingDetailSession = () => {
7901
7892
  var use_handle_closing_detail_session_default = useHandleClosingDetailSession;
7902
7893
 
7903
7894
  // src/hooks/view/use-create-pos-config.ts
7904
- import { useMutation as useMutation70 } from "@tanstack/react-query";
7895
+ import { useMutation as useMutation69 } from "@tanstack/react-query";
7905
7896
  var useCreatePosConfig = () => {
7906
7897
  const { createPosConfig } = useViewService();
7907
- return useMutation70({
7898
+ return useMutation69({
7908
7899
  mutationFn: ({
7909
7900
  model,
7910
7901
  name,
@@ -7925,10 +7916,10 @@ var useCreatePosConfig = () => {
7925
7916
  var use_create_pos_config_default = useCreatePosConfig;
7926
7917
 
7927
7918
  // src/hooks/view/use-search-journal.ts
7928
- import { useMutation as useMutation71 } from "@tanstack/react-query";
7919
+ import { useMutation as useMutation70 } from "@tanstack/react-query";
7929
7920
  var useSearchJournal = () => {
7930
7921
  const { searchJournal } = useViewService();
7931
- return useMutation71({
7922
+ return useMutation70({
7932
7923
  mutationFn: ({
7933
7924
  model,
7934
7925
  method,
@@ -7951,10 +7942,10 @@ var useSearchJournal = () => {
7951
7942
  var use_search_journal_default = useSearchJournal;
7952
7943
 
7953
7944
  // src/hooks/view/useGetPreparaionDisplayData.ts
7954
- import { useMutation as useMutation72 } from "@tanstack/react-query";
7945
+ import { useMutation as useMutation71 } from "@tanstack/react-query";
7955
7946
  var useGetPreparationDisplayData = () => {
7956
7947
  const { getPreparationDisplayData } = useViewService();
7957
- return useMutation72({
7948
+ return useMutation71({
7958
7949
  mutationFn: ({
7959
7950
  ids,
7960
7951
  service,
@@ -7973,10 +7964,10 @@ var useGetPreparationDisplayData = () => {
7973
7964
  var useGetPreparaionDisplayData_default = useGetPreparationDisplayData;
7974
7965
 
7975
7966
  // src/hooks/view/useChangeOrderPreparaionState.ts
7976
- import { useMutation as useMutation73 } from "@tanstack/react-query";
7967
+ import { useMutation as useMutation72 } from "@tanstack/react-query";
7977
7968
  var useChangeOrderPreparationState = () => {
7978
7969
  const { changeOrderPreparaionState } = useViewService();
7979
- return useMutation73({
7970
+ return useMutation72({
7980
7971
  mutationFn: ({
7981
7972
  orderId,
7982
7973
  stageId,
@@ -7997,10 +7988,10 @@ var useChangeOrderPreparationState = () => {
7997
7988
  var useChangeOrderPreparaionState_default = useChangeOrderPreparationState;
7998
7989
 
7999
7990
  // src/hooks/view/use-update-order-status.ts
8000
- import { useMutation as useMutation74 } from "@tanstack/react-query";
7991
+ import { useMutation as useMutation73 } from "@tanstack/react-query";
8001
7992
  var useUpdateOrderStatus = () => {
8002
7993
  const { updateOrderStatus } = useViewService();
8003
- return useMutation74({
7994
+ return useMutation73({
8004
7995
  mutationFn: ({
8005
7996
  orderId,
8006
7997
  state,
@@ -8019,10 +8010,10 @@ var useUpdateOrderStatus = () => {
8019
8010
  var use_update_order_status_default = useUpdateOrderStatus;
8020
8011
 
8021
8012
  // src/hooks/view/use-process-order.ts
8022
- import { useMutation as useMutation75 } from "@tanstack/react-query";
8013
+ import { useMutation as useMutation74 } from "@tanstack/react-query";
8023
8014
  var useProcessOrder = () => {
8024
8015
  const { processOrder } = useViewService();
8025
- return useMutation75({
8016
+ return useMutation74({
8026
8017
  mutationFn: ({
8027
8018
  orderId,
8028
8019
  xNode,
@@ -8037,10 +8028,10 @@ var useProcessOrder = () => {
8037
8028
  var use_process_order_default = useProcessOrder;
8038
8029
 
8039
8030
  // src/hooks/view/use-generate-payment-qr-info.ts
8040
- import { useMutation as useMutation76 } from "@tanstack/react-query";
8031
+ import { useMutation as useMutation75 } from "@tanstack/react-query";
8041
8032
  var useGeneratePaymentQrInfo = () => {
8042
8033
  const { generatePaymentQRInfo } = useViewService();
8043
- return useMutation76({
8034
+ return useMutation75({
8044
8035
  mutationFn: ({
8045
8036
  orderId,
8046
8037
  amount,
@@ -8061,10 +8052,10 @@ var useGeneratePaymentQrInfo = () => {
8061
8052
  var use_generate_payment_qr_info_default = useGeneratePaymentQrInfo;
8062
8053
 
8063
8054
  // src/hooks/view/use-save-pin-code.ts
8064
- import { useMutation as useMutation77 } from "@tanstack/react-query";
8055
+ import { useMutation as useMutation76 } from "@tanstack/react-query";
8065
8056
  var useSavePinCode = () => {
8066
8057
  const { savePinCode } = useViewService();
8067
- return useMutation77({
8058
+ return useMutation76({
8068
8059
  mutationFn: ({
8069
8060
  serialNumber,
8070
8061
  pinCode,
@@ -8083,10 +8074,10 @@ var useSavePinCode = () => {
8083
8074
  var use_save_pin_code_default = useSavePinCode;
8084
8075
 
8085
8076
  // src/hooks/view/use-get-pin-code.ts
8086
- import { useMutation as useMutation78 } from "@tanstack/react-query";
8077
+ import { useMutation as useMutation77 } from "@tanstack/react-query";
8087
8078
  var useGetPinCode = () => {
8088
8079
  const { getPinCode } = useViewService();
8089
- return useMutation78({
8080
+ return useMutation77({
8090
8081
  mutationFn: ({
8091
8082
  serialNumber,
8092
8083
  xNode,
@@ -8124,10 +8115,10 @@ var useGetNotifications = ({
8124
8115
  var use_get_notifications_default = useGetNotifications;
8125
8116
 
8126
8117
  // src/hooks/view/use-get-version.ts
8127
- import { useMutation as useMutation79 } from "@tanstack/react-query";
8118
+ import { useMutation as useMutation78 } from "@tanstack/react-query";
8128
8119
  var useGetVersion = () => {
8129
8120
  const { getVersion } = useViewService();
8130
- return useMutation79({
8121
+ return useMutation78({
8131
8122
  mutationFn: () => {
8132
8123
  return getVersion();
8133
8124
  }
@@ -8136,10 +8127,10 @@ var useGetVersion = () => {
8136
8127
  var use_get_version_default = useGetVersion;
8137
8128
 
8138
8129
  // src/hooks/view/use-create-e-invoice.ts
8139
- import { useMutation as useMutation80 } from "@tanstack/react-query";
8130
+ import { useMutation as useMutation79 } from "@tanstack/react-query";
8140
8131
  var useCreateEInvoice = () => {
8141
8132
  const { createEInvoice } = useViewService();
8142
- return useMutation80({
8133
+ return useMutation79({
8143
8134
  mutationFn: ({
8144
8135
  service,
8145
8136
  xNode,
@@ -8160,10 +8151,10 @@ var useCreateEInvoice = () => {
8160
8151
  var use_create_e_invoice_default = useCreateEInvoice;
8161
8152
 
8162
8153
  // src/hooks/view/use-get-current-user.ts
8163
- import { useMutation as useMutation81 } from "@tanstack/react-query";
8154
+ import { useMutation as useMutation80 } from "@tanstack/react-query";
8164
8155
  var useGetCurrentUser = () => {
8165
8156
  const { getCurrentUser } = useViewService();
8166
- return useMutation81({
8157
+ return useMutation80({
8167
8158
  mutationFn: ({
8168
8159
  service,
8169
8160
  xNode,
@@ -8177,10 +8168,10 @@ var useGetCurrentUser = () => {
8177
8168
  var use_get_current_user_default = useGetCurrentUser;
8178
8169
 
8179
8170
  // src/hooks/view/use-get-ward.ts
8180
- import { useMutation as useMutation82 } from "@tanstack/react-query";
8171
+ import { useMutation as useMutation81 } from "@tanstack/react-query";
8181
8172
  var useGetWard = () => {
8182
8173
  const { getWard } = useViewService();
8183
- return useMutation82({
8174
+ return useMutation81({
8184
8175
  mutationFn: ({
8185
8176
  service,
8186
8177
  xNode,
@@ -8197,10 +8188,10 @@ var useGetWard = () => {
8197
8188
  var use_get_ward_default = useGetWard;
8198
8189
 
8199
8190
  // src/hooks/view/use-get-city.ts
8200
- import { useMutation as useMutation83 } from "@tanstack/react-query";
8191
+ import { useMutation as useMutation82 } from "@tanstack/react-query";
8201
8192
  var useGetCity = () => {
8202
8193
  const { getCity } = useViewService();
8203
- return useMutation83({
8194
+ return useMutation82({
8204
8195
  mutationFn: ({
8205
8196
  service,
8206
8197
  xNode,
@@ -8219,10 +8210,10 @@ var useGetCity = () => {
8219
8210
  var use_get_city_default = useGetCity;
8220
8211
 
8221
8212
  // src/hooks/view/use-get-country.ts
8222
- import { useMutation as useMutation84 } from "@tanstack/react-query";
8213
+ import { useMutation as useMutation83 } from "@tanstack/react-query";
8223
8214
  var useGetCountry = () => {
8224
8215
  const { getCountry } = useViewService();
8225
- return useMutation84({
8216
+ return useMutation83({
8226
8217
  mutationFn: ({
8227
8218
  service,
8228
8219
  xNode,
@@ -8241,10 +8232,10 @@ var useGetCountry = () => {
8241
8232
  var use_get_country_default = useGetCountry;
8242
8233
 
8243
8234
  // src/hooks/view/use-get-partner-title.ts
8244
- import { useMutation as useMutation85 } from "@tanstack/react-query";
8235
+ import { useMutation as useMutation84 } from "@tanstack/react-query";
8245
8236
  var useGetPartnerTitle = () => {
8246
8237
  const { getPartnerTitle } = useViewService();
8247
- return useMutation85({
8238
+ return useMutation84({
8248
8239
  mutationFn: ({
8249
8240
  service,
8250
8241
  xNode,
@@ -8297,6 +8288,16 @@ var useGetDataChart = (services, xNode, body, enabled, path, method, queryKey) =
8297
8288
  });
8298
8289
  };
8299
8290
  var use_get_data_chart_default = useGetDataChart;
8291
+
8292
+ // src/hooks/pos/use-add-entity.ts
8293
+ import { useMutation as useMutation85 } from "@tanstack/react-query";
8294
+ var useAddEntity = () => {
8295
+ const { addEntity } = usePosService();
8296
+ return useMutation85({
8297
+ mutationFn: addEntity
8298
+ });
8299
+ };
8300
+ var use_add_entity_default = useAddEntity;
8300
8301
  export {
8301
8302
  use_add_entity_default as useAddEntity,
8302
8303
  use_button_default as useButton,