@fctc/interface-logic 4.8.0 → 4.8.2

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/services.js CHANGED
@@ -45,7 +45,7 @@ __export(services_exports, {
45
45
  module.exports = __toCommonJS(services_exports);
46
46
 
47
47
  // src/services/action-service/index.ts
48
- var import_react55 = require("react");
48
+ var import_react57 = require("react");
49
49
 
50
50
  // src/constants/api/uri-constant.ts
51
51
  var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
@@ -2956,7 +2956,7 @@ function useEnv() {
2956
2956
  }
2957
2957
 
2958
2958
  // src/provider/service-provider.tsx
2959
- var import_react53 = require("react");
2959
+ var import_react55 = require("react");
2960
2960
 
2961
2961
  // src/hooks/auth/use-forgot-password.ts
2962
2962
  var import_react_query3 = require("@tanstack/react-query");
@@ -4627,7 +4627,6 @@ var createOrderSupabaseService = () => {
4627
4627
  }
4628
4628
  try {
4629
4629
  const { data, error } = await supabase.from("orders" /* ORDERS */).insert({
4630
- name: values.pos_reference,
4631
4630
  session_id: values.session_id,
4632
4631
  pos_reference: values.pos_reference,
4633
4632
  amount_tax: values.amount_tax,
@@ -4635,8 +4634,7 @@ var createOrderSupabaseService = () => {
4635
4634
  amount_paid: values.amount_paid,
4636
4635
  amount_return: values.amount_return,
4637
4636
  table_id: values.table_id,
4638
- partner_id: values.partner_id,
4639
- date_order: (/* @__PURE__ */ new Date()).toISOString()
4637
+ partner_id: values.partner_id
4640
4638
  }).select("id, pos_reference").single();
4641
4639
  if (error) {
4642
4640
  console.error("Error creating order:", error);
@@ -4774,12 +4772,10 @@ var updateOrderSupabaseService = () => {
4774
4772
  return [];
4775
4773
  }
4776
4774
  const { order_id, ...rest } = values;
4777
- const updateData = Object.fromEntries(
4778
- Object.entries({
4779
- ...rest,
4780
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
4781
- }).filter(([_, v]) => v !== void 0)
4782
- );
4775
+ const updateData = cleanObject({
4776
+ ...rest,
4777
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
4778
+ });
4783
4779
  try {
4784
4780
  const { error, data } = await supabase.from("orders" /* ORDERS */).update(updateData).eq("id", order_id).select("id").single();
4785
4781
  if (error) {
@@ -4898,24 +4894,22 @@ var addProductSupabaseService = () => {
4898
4894
  console.error("Supabase client not initialized");
4899
4895
  return null;
4900
4896
  }
4901
- const insertData = Object.fromEntries(
4902
- Object.entries({
4903
- name: values.name,
4904
- product_tmpl_id: values.product_tmpl_id,
4905
- product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
4906
- combo_ids: values.combo_ids ?? [],
4907
- categ_id: values.categ_id,
4908
- pos_categ_ids: values.pos_categ_ids ?? [],
4909
- display_name: values.display_name || values.name,
4910
- default_code: values.default_code ?? "",
4911
- description_sale: values.description_sale ?? "",
4912
- lst_price: values.lst_price ?? 0,
4913
- standard_price: values.standard_price ?? 0,
4914
- barcode: values.barcode ?? "",
4915
- image_url: values.image_url ?? "",
4916
- active: values.active ?? true
4917
- }).filter(([_, v]) => v !== void 0)
4918
- );
4897
+ const insertData = cleanObject({
4898
+ name: values.name,
4899
+ product_tmpl_id: values.product_tmpl_id,
4900
+ product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
4901
+ combo_ids: values.combo_ids ?? [],
4902
+ categ_id: values.categ_id,
4903
+ pos_categ_ids: values.pos_categ_ids ?? [],
4904
+ display_name: values.display_name || values.name,
4905
+ default_code: values.default_code ?? "",
4906
+ description_sale: values.description_sale ?? "",
4907
+ lst_price: values.lst_price ?? 0,
4908
+ standard_price: values.standard_price ?? 0,
4909
+ barcode: values.barcode ?? "",
4910
+ image_url: values.image_url ?? "",
4911
+ active: values.active ?? true
4912
+ });
4919
4913
  try {
4920
4914
  const { data, error } = await supabase.from("products" /* PRODUCTS */).insert(insertData).select("id, name").single();
4921
4915
  if (error) {
@@ -4935,6 +4929,72 @@ var addProductSupabaseService = () => {
4935
4929
  };
4936
4930
  };
4937
4931
 
4932
+ // src/services/pos-service/supabase/add-payment-method.ts
4933
+ var import_react53 = require("react");
4934
+ var addPaymentMethodSupabaseService = () => {
4935
+ const supabase = useSupabaseOptional();
4936
+ const addPaymentMethodSupabase = (0, import_react53.useCallback)(
4937
+ async (values) => {
4938
+ if (!supabase) {
4939
+ console.error("Supabase client not initialized");
4940
+ return null;
4941
+ }
4942
+ const { name, ...rest } = values;
4943
+ const insertData = cleanObject({
4944
+ name,
4945
+ ...rest
4946
+ });
4947
+ try {
4948
+ const { data, error } = await supabase.from("payment_methods" /* PAYMENT_METHODS */).insert(insertData).select("id, name").single();
4949
+ if (error) {
4950
+ console.error("Error adding payment method:", error);
4951
+ return null;
4952
+ }
4953
+ return [[data.id, data.name]];
4954
+ } catch (error) {
4955
+ console.error("Error adding payment method:", error);
4956
+ return null;
4957
+ }
4958
+ },
4959
+ [supabase]
4960
+ );
4961
+ return {
4962
+ addPaymentMethodSupabase
4963
+ };
4964
+ };
4965
+
4966
+ // src/services/pos-service/supabase/update-session-payment-methods.ts
4967
+ var import_react54 = require("react");
4968
+ var updateSessionPaymentMethodsSupabaseService = () => {
4969
+ const supabase = useSupabaseOptional();
4970
+ const updateSessionPaymentMethodsSupabase = (0, import_react54.useCallback)(
4971
+ async (values) => {
4972
+ if (!supabase) {
4973
+ console.error("Supabase client not initialized");
4974
+ return null;
4975
+ }
4976
+ try {
4977
+ const { data, error } = await supabase.from("pos_sessions" /* POS_SESSIONS */).update({
4978
+ payment_method_ids: values.payment_method_ids,
4979
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
4980
+ }).eq("id", values.session_id).select("id").single();
4981
+ if (error) {
4982
+ console.error("Error updating session payment methods:", error);
4983
+ return null;
4984
+ }
4985
+ return [data.id];
4986
+ } catch (error) {
4987
+ console.error("Error updating session payment methods:", error);
4988
+ return null;
4989
+ }
4990
+ },
4991
+ [supabase]
4992
+ );
4993
+ return {
4994
+ updateSessionPaymentMethodsSupabase
4995
+ };
4996
+ };
4997
+
4938
4998
  // src/services/pos-service/index.ts
4939
4999
  var serviceFactories = [
4940
5000
  addEntityService,
@@ -4982,7 +5042,9 @@ var serviceFactories = [
4982
5042
  deleteOrderSupabaseService,
4983
5043
  deleteOrderLineSupabaseService,
4984
5044
  addProductSupabaseService,
4985
- getFunctionalModulesService
5045
+ getFunctionalModulesService,
5046
+ addPaymentMethodSupabaseService,
5047
+ updateSessionPaymentMethodsSupabaseService
4986
5048
  ];
4987
5049
  var usePosService = () => {
4988
5050
  const { env } = useEnv();
@@ -5129,18 +5191,24 @@ var import_react_query129 = require("@tanstack/react-query");
5129
5191
  // src/hooks/pos/use-get-functional-modules.ts
5130
5192
  var import_react_query130 = require("@tanstack/react-query");
5131
5193
 
5194
+ // src/hooks/pos/supabase/use-add-payment-method.ts
5195
+ var import_react_query131 = require("@tanstack/react-query");
5196
+
5197
+ // src/hooks/pos/supabase/use-update-session-payment-methods.ts
5198
+ var import_react_query132 = require("@tanstack/react-query");
5199
+
5132
5200
  // src/provider/service-provider.tsx
5133
5201
  var import_jsx_runtime7 = require("react/jsx-runtime");
5134
- var ServiceContext = (0, import_react53.createContext)(null);
5202
+ var ServiceContext = (0, import_react55.createContext)(null);
5135
5203
 
5136
5204
  // src/provider/meta-provider.tsx
5137
- var import_react54 = require("react");
5205
+ var import_react56 = require("react");
5138
5206
  var import_jsx_runtime8 = require("react/jsx-runtime");
5139
5207
 
5140
5208
  // src/services/action-service/index.ts
5141
5209
  function useActionService() {
5142
5210
  const { env } = useEnv();
5143
- const loadAction = (0, import_react55.useCallback)(
5211
+ const loadAction = (0, import_react57.useCallback)(
5144
5212
  async ({
5145
5213
  idAction,
5146
5214
  context,
@@ -5164,7 +5232,7 @@ function useActionService() {
5164
5232
  },
5165
5233
  [env]
5166
5234
  );
5167
- const callButton = (0, import_react55.useCallback)(
5235
+ const callButton = (0, import_react57.useCallback)(
5168
5236
  async ({
5169
5237
  model,
5170
5238
  ids = [],
@@ -5198,7 +5266,7 @@ function useActionService() {
5198
5266
  },
5199
5267
  [env]
5200
5268
  );
5201
- const removeRows = (0, import_react55.useCallback)(
5269
+ const removeRows = (0, import_react57.useCallback)(
5202
5270
  async ({
5203
5271
  model,
5204
5272
  ids,
@@ -5224,7 +5292,7 @@ function useActionService() {
5224
5292
  },
5225
5293
  [env]
5226
5294
  );
5227
- const duplicateRecord = (0, import_react55.useCallback)(
5295
+ const duplicateRecord = (0, import_react57.useCallback)(
5228
5296
  async ({
5229
5297
  model,
5230
5298
  id,
@@ -5250,7 +5318,7 @@ function useActionService() {
5250
5318
  },
5251
5319
  [env]
5252
5320
  );
5253
- const getPrintReportName = (0, import_react55.useCallback)(
5321
+ const getPrintReportName = (0, import_react57.useCallback)(
5254
5322
  async ({ id }) => {
5255
5323
  const jsonData = {
5256
5324
  model: "ir.actions.report",
@@ -5268,7 +5336,7 @@ function useActionService() {
5268
5336
  },
5269
5337
  [env]
5270
5338
  );
5271
- const print = (0, import_react55.useCallback)(
5339
+ const print = (0, import_react57.useCallback)(
5272
5340
  async ({ id, report, db }) => {
5273
5341
  const jsonData = {
5274
5342
  report,
@@ -5286,7 +5354,7 @@ function useActionService() {
5286
5354
  },
5287
5355
  [env]
5288
5356
  );
5289
- const runAction = (0, import_react55.useCallback)(
5357
+ const runAction = (0, import_react57.useCallback)(
5290
5358
  async ({
5291
5359
  idAction,
5292
5360
  context,
@@ -5313,7 +5381,7 @@ function useActionService() {
5313
5381
  },
5314
5382
  [env]
5315
5383
  );
5316
- const generateSerialNumber = (0, import_react55.useCallback)(
5384
+ const generateSerialNumber = (0, import_react57.useCallback)(
5317
5385
  async ({
5318
5386
  kwargs,
5319
5387
  context,
@@ -5351,11 +5419,11 @@ function useActionService() {
5351
5419
  }
5352
5420
 
5353
5421
  // src/services/auth-service/index.ts
5354
- var import_react56 = require("react");
5422
+ var import_react58 = require("react");
5355
5423
  function useAuthService() {
5356
5424
  const { env } = useEnv();
5357
5425
  const supabase = useSupabaseOptional();
5358
- const login = (0, import_react56.useCallback)(
5426
+ const login = (0, import_react58.useCallback)(
5359
5427
  async (body) => {
5360
5428
  const payload = Object.fromEntries(
5361
5429
  Object.entries({
@@ -5380,7 +5448,7 @@ function useAuthService() {
5380
5448
  },
5381
5449
  [env]
5382
5450
  );
5383
- const loginSupabase = (0, import_react56.useCallback)(
5451
+ const loginSupabase = (0, import_react58.useCallback)(
5384
5452
  async (body) => {
5385
5453
  if (!supabase) {
5386
5454
  return {
@@ -5396,7 +5464,7 @@ function useAuthService() {
5396
5464
  },
5397
5465
  [supabase]
5398
5466
  );
5399
- const forgotPassword = (0, import_react56.useCallback)(
5467
+ const forgotPassword = (0, import_react58.useCallback)(
5400
5468
  async (email) => {
5401
5469
  const bodyData = {
5402
5470
  login: email,
@@ -5410,7 +5478,7 @@ function useAuthService() {
5410
5478
  },
5411
5479
  [env]
5412
5480
  );
5413
- const forgotPasswordSSO = (0, import_react56.useCallback)(
5481
+ const forgotPasswordSSO = (0, import_react58.useCallback)(
5414
5482
  async ({
5415
5483
  email,
5416
5484
  with_context,
@@ -5433,7 +5501,7 @@ function useAuthService() {
5433
5501
  },
5434
5502
  [env]
5435
5503
  );
5436
- const resetPassword = (0, import_react56.useCallback)(
5504
+ const resetPassword = (0, import_react58.useCallback)(
5437
5505
  async (data, token) => {
5438
5506
  const bodyData = {
5439
5507
  token,
@@ -5448,7 +5516,7 @@ function useAuthService() {
5448
5516
  },
5449
5517
  [env]
5450
5518
  );
5451
- const resetPasswordSSO = (0, import_react56.useCallback)(
5519
+ const resetPasswordSSO = (0, import_react58.useCallback)(
5452
5520
  async ({
5453
5521
  method,
5454
5522
  password,
@@ -5471,7 +5539,7 @@ function useAuthService() {
5471
5539
  },
5472
5540
  [env]
5473
5541
  );
5474
- const updatePassword = (0, import_react56.useCallback)(
5542
+ const updatePassword = (0, import_react58.useCallback)(
5475
5543
  async (data, token) => {
5476
5544
  const bodyData = {
5477
5545
  token,
@@ -5486,7 +5554,7 @@ function useAuthService() {
5486
5554
  },
5487
5555
  [env]
5488
5556
  );
5489
- const isValidToken = (0, import_react56.useCallback)(
5557
+ const isValidToken = (0, import_react58.useCallback)(
5490
5558
  async (token) => {
5491
5559
  const bodyData = {
5492
5560
  token
@@ -5499,7 +5567,7 @@ function useAuthService() {
5499
5567
  },
5500
5568
  [env]
5501
5569
  );
5502
- const isValidActionToken = (0, import_react56.useCallback)(
5570
+ const isValidActionToken = (0, import_react58.useCallback)(
5503
5571
  async (actionToken) => {
5504
5572
  const bodyData = {};
5505
5573
  return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
@@ -5512,7 +5580,7 @@ function useAuthService() {
5512
5580
  },
5513
5581
  [env]
5514
5582
  );
5515
- const loginSocial = (0, import_react56.useCallback)(
5583
+ const loginSocial = (0, import_react58.useCallback)(
5516
5584
  async ({
5517
5585
  db,
5518
5586
  state,
@@ -5530,13 +5598,13 @@ function useAuthService() {
5530
5598
  },
5531
5599
  [env]
5532
5600
  );
5533
- const getProviders = (0, import_react56.useCallback)(
5601
+ const getProviders = (0, import_react58.useCallback)(
5534
5602
  async (db) => {
5535
5603
  return env?.requests?.get("/oauth/providers", { params: { db } });
5536
5604
  },
5537
5605
  [env]
5538
5606
  );
5539
- const getAccessByCode = (0, import_react56.useCallback)(
5607
+ const getAccessByCode = (0, import_react58.useCallback)(
5540
5608
  async (code) => {
5541
5609
  const data = new URLSearchParams();
5542
5610
  data.append("code", code);
@@ -5556,7 +5624,7 @@ function useAuthService() {
5556
5624
  },
5557
5625
  [env]
5558
5626
  );
5559
- const logout = (0, import_react56.useCallback)(
5627
+ const logout = (0, import_react58.useCallback)(
5560
5628
  async (service) => {
5561
5629
  return env?.requests?.post(
5562
5630
  "/logout" /* LOGOUT */,
@@ -5573,7 +5641,7 @@ function useAuthService() {
5573
5641
  },
5574
5642
  [env]
5575
5643
  );
5576
- const getTenantMapping = (0, import_react56.useCallback)(
5644
+ const getTenantMapping = (0, import_react58.useCallback)(
5577
5645
  async ({ shortName, service }) => {
5578
5646
  const bodyData = {
5579
5647
  short_name: shortName
@@ -5591,7 +5659,7 @@ function useAuthService() {
5591
5659
  },
5592
5660
  [env]
5593
5661
  );
5594
- const getToken = (0, import_react56.useCallback)(
5662
+ const getToken = (0, import_react58.useCallback)(
5595
5663
  async ({
5596
5664
  phone,
5597
5665
  name,
@@ -5636,10 +5704,10 @@ function useAuthService() {
5636
5704
  }
5637
5705
 
5638
5706
  // src/services/company-service/index.ts
5639
- var import_react57 = require("react");
5707
+ var import_react59 = require("react");
5640
5708
  function useCompanyService() {
5641
5709
  const { env } = useEnv();
5642
- const getCurrentCompany = (0, import_react57.useCallback)(
5710
+ const getCurrentCompany = (0, import_react59.useCallback)(
5643
5711
  async (service, extraHeaders) => {
5644
5712
  return await env.requests.get(
5645
5713
  "/company" /* COMPANY_PATH */,
@@ -5656,7 +5724,7 @@ function useCompanyService() {
5656
5724
  },
5657
5725
  [env]
5658
5726
  );
5659
- const getInfoCompany = (0, import_react57.useCallback)(
5727
+ const getInfoCompany = (0, import_react59.useCallback)(
5660
5728
  async (id, service) => {
5661
5729
  const jsonData = {
5662
5730
  ids: [id],
@@ -5692,10 +5760,10 @@ function useCompanyService() {
5692
5760
  }
5693
5761
 
5694
5762
  // src/services/excel-service/index.ts
5695
- var import_react58 = require("react");
5763
+ var import_react60 = require("react");
5696
5764
  function useExcelService() {
5697
5765
  const { env } = useEnv();
5698
- const uploadFileExcel = (0, import_react58.useCallback)(
5766
+ const uploadFileExcel = (0, import_react60.useCallback)(
5699
5767
  async ({
5700
5768
  formData,
5701
5769
  service,
@@ -5712,7 +5780,7 @@ function useExcelService() {
5712
5780
  },
5713
5781
  [env]
5714
5782
  );
5715
- const uploadIdFile = (0, import_react58.useCallback)(
5783
+ const uploadIdFile = (0, import_react60.useCallback)(
5716
5784
  async ({
5717
5785
  formData,
5718
5786
  service,
@@ -5729,7 +5797,7 @@ function useExcelService() {
5729
5797
  },
5730
5798
  [env]
5731
5799
  );
5732
- const parsePreview = (0, import_react58.useCallback)(
5800
+ const parsePreview = (0, import_react60.useCallback)(
5733
5801
  async ({
5734
5802
  id,
5735
5803
  selectedSheet,
@@ -5778,7 +5846,7 @@ function useExcelService() {
5778
5846
  },
5779
5847
  [env]
5780
5848
  );
5781
- const executeImport = (0, import_react58.useCallback)(
5849
+ const executeImport = (0, import_react60.useCallback)(
5782
5850
  async ({
5783
5851
  columns,
5784
5852
  fields,
@@ -5812,7 +5880,7 @@ function useExcelService() {
5812
5880
  },
5813
5881
  [env]
5814
5882
  );
5815
- const getFileExcel = (0, import_react58.useCallback)(
5883
+ const getFileExcel = (0, import_react60.useCallback)(
5816
5884
  async ({
5817
5885
  model,
5818
5886
  service,
@@ -5836,7 +5904,7 @@ function useExcelService() {
5836
5904
  },
5837
5905
  [env]
5838
5906
  );
5839
- const getFieldExport = (0, import_react58.useCallback)(
5907
+ const getFieldExport = (0, import_react60.useCallback)(
5840
5908
  async ({
5841
5909
  ids,
5842
5910
  model,
@@ -5876,7 +5944,7 @@ function useExcelService() {
5876
5944
  },
5877
5945
  [env]
5878
5946
  );
5879
- const exportExcel = (0, import_react58.useCallback)(
5947
+ const exportExcel = (0, import_react60.useCallback)(
5880
5948
  async ({
5881
5949
  model,
5882
5950
  domain,
@@ -5924,10 +5992,10 @@ function useExcelService() {
5924
5992
  }
5925
5993
 
5926
5994
  // src/services/form-service/index.ts
5927
- var import_react59 = require("react");
5995
+ var import_react61 = require("react");
5928
5996
  function useFormService() {
5929
5997
  const { env } = useEnv();
5930
- const getComment = (0, import_react59.useCallback)(
5998
+ const getComment = (0, import_react61.useCallback)(
5931
5999
  async ({ data }) => {
5932
6000
  const jsonData = {
5933
6001
  thread_id: data.thread_id,
@@ -5945,7 +6013,7 @@ function useFormService() {
5945
6013
  },
5946
6014
  [env]
5947
6015
  );
5948
- const getThreadData = (0, import_react59.useCallback)(
6016
+ const getThreadData = (0, import_react61.useCallback)(
5949
6017
  async ({
5950
6018
  data,
5951
6019
  xNode,
@@ -5972,7 +6040,7 @@ function useFormService() {
5972
6040
  },
5973
6041
  [env]
5974
6042
  );
5975
- const getThreadMessages = (0, import_react59.useCallback)(
6043
+ const getThreadMessages = (0, import_react61.useCallback)(
5976
6044
  async ({
5977
6045
  data,
5978
6046
  xNode,
@@ -5998,7 +6066,7 @@ function useFormService() {
5998
6066
  },
5999
6067
  [env]
6000
6068
  );
6001
- const sentComment = (0, import_react59.useCallback)(
6069
+ const sentComment = (0, import_react61.useCallback)(
6002
6070
  async ({ data }) => {
6003
6071
  const jsonData = {
6004
6072
  context: {
@@ -6026,7 +6094,7 @@ function useFormService() {
6026
6094
  },
6027
6095
  [env]
6028
6096
  );
6029
- const deleteComment = (0, import_react59.useCallback)(
6097
+ const deleteComment = (0, import_react61.useCallback)(
6030
6098
  async ({ data }) => {
6031
6099
  const jsonData = {
6032
6100
  attachment_ids: [],
@@ -6042,7 +6110,7 @@ function useFormService() {
6042
6110
  },
6043
6111
  [env]
6044
6112
  );
6045
- const getImage = (0, import_react59.useCallback)(
6113
+ const getImage = (0, import_react61.useCallback)(
6046
6114
  async ({ data }) => {
6047
6115
  return env.requests.get(
6048
6116
  `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
@@ -6055,7 +6123,7 @@ function useFormService() {
6055
6123
  },
6056
6124
  [env]
6057
6125
  );
6058
- const uploadImage = (0, import_react59.useCallback)(
6126
+ const uploadImage = (0, import_react61.useCallback)(
6059
6127
  async ({
6060
6128
  formData,
6061
6129
  service,
@@ -6074,7 +6142,7 @@ function useFormService() {
6074
6142
  },
6075
6143
  [env]
6076
6144
  );
6077
- const uploadFile = (0, import_react59.useCallback)(
6145
+ const uploadFile = (0, import_react61.useCallback)(
6078
6146
  async ({
6079
6147
  formData,
6080
6148
  service,
@@ -6094,7 +6162,7 @@ function useFormService() {
6094
6162
  },
6095
6163
  [env]
6096
6164
  );
6097
- const getFormView = (0, import_react59.useCallback)(
6165
+ const getFormView = (0, import_react61.useCallback)(
6098
6166
  async ({ data }) => {
6099
6167
  const jsonData = {
6100
6168
  model: data.model,
@@ -6110,7 +6178,7 @@ function useFormService() {
6110
6178
  },
6111
6179
  [env]
6112
6180
  );
6113
- const changeStatus = (0, import_react59.useCallback)(
6181
+ const changeStatus = (0, import_react61.useCallback)(
6114
6182
  async ({ data }) => {
6115
6183
  const vals = {
6116
6184
  [data.name]: data.stage_id
@@ -6139,7 +6207,7 @@ function useFormService() {
6139
6207
  },
6140
6208
  [env]
6141
6209
  );
6142
- const getExternalTab = (0, import_react59.useCallback)(
6210
+ const getExternalTab = (0, import_react61.useCallback)(
6143
6211
  async ({ method, context, service, xNode }) => {
6144
6212
  return env?.requests?.post(
6145
6213
  "/call" /* CALL_PATH */,
@@ -6174,10 +6242,10 @@ function useFormService() {
6174
6242
  }
6175
6243
 
6176
6244
  // src/services/kanban-service/index.ts
6177
- var import_react60 = require("react");
6245
+ var import_react62 = require("react");
6178
6246
  function useKanbanService() {
6179
6247
  const { env } = useEnv();
6180
- const getGroups = (0, import_react60.useCallback)(
6248
+ const getGroups = (0, import_react62.useCallback)(
6181
6249
  async ({ model, width_context }) => {
6182
6250
  const jsonData = {
6183
6251
  model,
@@ -6197,7 +6265,7 @@ function useKanbanService() {
6197
6265
  },
6198
6266
  [env]
6199
6267
  );
6200
- const getProgressBar = (0, import_react60.useCallback)(
6268
+ const getProgressBar = (0, import_react62.useCallback)(
6201
6269
  async ({ field, color, model, width_context }) => {
6202
6270
  const jsonData = {
6203
6271
  model,
@@ -6227,10 +6295,10 @@ function useKanbanService() {
6227
6295
  }
6228
6296
 
6229
6297
  // src/services/model-service/index.ts
6230
- var import_react61 = require("react");
6298
+ var import_react63 = require("react");
6231
6299
  function useModelService() {
6232
6300
  const { env } = useEnv();
6233
- const getListMyBankAccount = (0, import_react61.useCallback)(
6301
+ const getListMyBankAccount = (0, import_react63.useCallback)(
6234
6302
  async ({
6235
6303
  domain,
6236
6304
  spectification,
@@ -6254,7 +6322,7 @@ function useModelService() {
6254
6322
  },
6255
6323
  [env]
6256
6324
  );
6257
- const getCurrency = (0, import_react61.useCallback)(async () => {
6325
+ const getCurrency = (0, import_react63.useCallback)(async () => {
6258
6326
  const jsonData = {
6259
6327
  model: "res.currency",
6260
6328
  method: "web_search_read",
@@ -6274,7 +6342,7 @@ function useModelService() {
6274
6342
  }
6275
6343
  });
6276
6344
  }, [env]);
6277
- const getConversionRate = (0, import_react61.useCallback)(async () => {
6345
+ const getConversionRate = (0, import_react63.useCallback)(async () => {
6278
6346
  const jsonData = {
6279
6347
  model: "res.currency",
6280
6348
  method: "web_search_read",
@@ -6300,7 +6368,7 @@ function useModelService() {
6300
6368
  }
6301
6369
  });
6302
6370
  }, [env]);
6303
- const getAll = (0, import_react61.useCallback)(
6371
+ const getAll = (0, import_react63.useCallback)(
6304
6372
  async ({
6305
6373
  data,
6306
6374
  service,
@@ -6342,7 +6410,7 @@ function useModelService() {
6342
6410
  },
6343
6411
  [env]
6344
6412
  );
6345
- const getListCalendar = (0, import_react61.useCallback)(
6413
+ const getListCalendar = (0, import_react63.useCallback)(
6346
6414
  async ({ data }) => {
6347
6415
  const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
6348
6416
  fields: data.fields,
@@ -6373,7 +6441,7 @@ function useModelService() {
6373
6441
  },
6374
6442
  [env]
6375
6443
  );
6376
- const getList = (0, import_react61.useCallback)(
6444
+ const getList = (0, import_react63.useCallback)(
6377
6445
  async ({
6378
6446
  model,
6379
6447
  ids = [],
@@ -6405,7 +6473,7 @@ function useModelService() {
6405
6473
  },
6406
6474
  [env]
6407
6475
  );
6408
- const getDetail = (0, import_react61.useCallback)(
6476
+ const getDetail = (0, import_react63.useCallback)(
6409
6477
  async ({
6410
6478
  ids = [],
6411
6479
  model,
@@ -6437,7 +6505,7 @@ function useModelService() {
6437
6505
  },
6438
6506
  [env]
6439
6507
  );
6440
- const save = (0, import_react61.useCallback)(
6508
+ const save = (0, import_react63.useCallback)(
6441
6509
  async ({
6442
6510
  model,
6443
6511
  ids = [],
@@ -6472,7 +6540,7 @@ function useModelService() {
6472
6540
  },
6473
6541
  [env]
6474
6542
  );
6475
- const deleteApi = (0, import_react61.useCallback)(
6543
+ const deleteApi = (0, import_react63.useCallback)(
6476
6544
  async ({ ids = [], model, service }) => {
6477
6545
  const jsonData = {
6478
6546
  model,
@@ -6492,7 +6560,7 @@ function useModelService() {
6492
6560
  },
6493
6561
  [env]
6494
6562
  );
6495
- const onChange = (0, import_react61.useCallback)(
6563
+ const onChange = (0, import_react63.useCallback)(
6496
6564
  async ({
6497
6565
  ids = [],
6498
6566
  model,
@@ -6528,7 +6596,7 @@ function useModelService() {
6528
6596
  },
6529
6597
  [env]
6530
6598
  );
6531
- const getListFieldsOnchange = (0, import_react61.useCallback)(
6599
+ const getListFieldsOnchange = (0, import_react63.useCallback)(
6532
6600
  async ({
6533
6601
  model,
6534
6602
  service,
@@ -6552,7 +6620,7 @@ function useModelService() {
6552
6620
  },
6553
6621
  [env]
6554
6622
  );
6555
- const parseORMOdoo = (0, import_react61.useCallback)((data) => {
6623
+ const parseORMOdoo = (0, import_react63.useCallback)((data) => {
6556
6624
  for (const key in data) {
6557
6625
  if (key === "display_name") {
6558
6626
  delete data[key];
@@ -6563,7 +6631,7 @@ function useModelService() {
6563
6631
  }
6564
6632
  return { ...data };
6565
6633
  }, []);
6566
- const toDataJS = (0, import_react61.useCallback)(
6634
+ const toDataJS = (0, import_react63.useCallback)(
6567
6635
  (data, viewData, model) => {
6568
6636
  for (const key in data) {
6569
6637
  if (data[key] === false) {
@@ -6621,10 +6689,10 @@ function useModelService() {
6621
6689
  }
6622
6690
 
6623
6691
  // src/services/user-service/index.ts
6624
- var import_react62 = require("react");
6692
+ var import_react64 = require("react");
6625
6693
  function useUserService() {
6626
6694
  const { env } = useEnv();
6627
- const getProfile = (0, import_react62.useCallback)(
6695
+ const getProfile = (0, import_react64.useCallback)(
6628
6696
  async (service, path, extraHeaders) => {
6629
6697
  return env?.requests?.get(
6630
6698
  path || "/userinfo" /* PROFILE_PATH */,
@@ -6641,7 +6709,7 @@ function useUserService() {
6641
6709
  },
6642
6710
  [env]
6643
6711
  );
6644
- const getUser = (0, import_react62.useCallback)(
6712
+ const getUser = (0, import_react64.useCallback)(
6645
6713
  async ({ context, id }) => {
6646
6714
  const jsonData = {
6647
6715
  model: "res.users",
@@ -6679,7 +6747,7 @@ function useUserService() {
6679
6747
  },
6680
6748
  [env]
6681
6749
  );
6682
- const switchUserLocale = (0, import_react62.useCallback)(
6750
+ const switchUserLocale = (0, import_react64.useCallback)(
6683
6751
  async ({ id, values, service }) => {
6684
6752
  const jsonData = {
6685
6753
  model: "res.users",
@@ -6707,10 +6775,10 @@ function useUserService() {
6707
6775
  }
6708
6776
 
6709
6777
  // src/services/view-service/index.ts
6710
- var import_react63 = require("react");
6778
+ var import_react65 = require("react");
6711
6779
  function useViewService() {
6712
6780
  const { env } = useEnv();
6713
- const getView = (0, import_react63.useCallback)(
6781
+ const getView = (0, import_react65.useCallback)(
6714
6782
  async ({
6715
6783
  model,
6716
6784
  views,
@@ -6750,7 +6818,7 @@ function useViewService() {
6750
6818
  },
6751
6819
  [env]
6752
6820
  );
6753
- const getMenu = (0, import_react63.useCallback)(
6821
+ const getMenu = (0, import_react65.useCallback)(
6754
6822
  async (context, specification, domain, service) => {
6755
6823
  const jsonData = {
6756
6824
  model: "ir.ui.menu" /* MENU */,
@@ -6781,7 +6849,7 @@ function useViewService() {
6781
6849
  },
6782
6850
  [env]
6783
6851
  );
6784
- const getActionDetail = (0, import_react63.useCallback)(
6852
+ const getActionDetail = (0, import_react65.useCallback)(
6785
6853
  async (aid, context) => {
6786
6854
  const jsonData = {
6787
6855
  model: "ir.actions.act_window" /* WINDOW_ACTION */,
@@ -6811,7 +6879,7 @@ function useViewService() {
6811
6879
  },
6812
6880
  [env]
6813
6881
  );
6814
- const getResequence = (0, import_react63.useCallback)(
6882
+ const getResequence = (0, import_react65.useCallback)(
6815
6883
  async ({
6816
6884
  model,
6817
6885
  ids,
@@ -6841,7 +6909,7 @@ function useViewService() {
6841
6909
  },
6842
6910
  [env]
6843
6911
  );
6844
- const getSelectionItem = (0, import_react63.useCallback)(
6912
+ const getSelectionItem = (0, import_react65.useCallback)(
6845
6913
  async ({
6846
6914
  data,
6847
6915
  service,
@@ -6878,7 +6946,7 @@ function useViewService() {
6878
6946
  },
6879
6947
  [env]
6880
6948
  );
6881
- const loadMessages = (0, import_react63.useCallback)(async () => {
6949
+ const loadMessages = (0, import_react65.useCallback)(async () => {
6882
6950
  return env.requests.post(
6883
6951
  "/load_message_failures" /* LOAD_MESSAGE */,
6884
6952
  {},
@@ -6889,14 +6957,14 @@ function useViewService() {
6889
6957
  }
6890
6958
  );
6891
6959
  }, [env]);
6892
- const getVersion = (0, import_react63.useCallback)(async () => {
6960
+ const getVersion = (0, import_react65.useCallback)(async () => {
6893
6961
  return env?.requests?.get("", {
6894
6962
  headers: {
6895
6963
  "Content-Type": "application/json"
6896
6964
  }
6897
6965
  });
6898
6966
  }, [env]);
6899
- const grantAccess = (0, import_react63.useCallback)(
6967
+ const grantAccess = (0, import_react65.useCallback)(
6900
6968
  async ({
6901
6969
  redirect_uri,
6902
6970
  state,
@@ -6923,7 +6991,7 @@ function useViewService() {
6923
6991
  },
6924
6992
  [env]
6925
6993
  );
6926
- const removeTotpSetUp = (0, import_react63.useCallback)(
6994
+ const removeTotpSetUp = (0, import_react65.useCallback)(
6927
6995
  async ({ method, token }) => {
6928
6996
  const jsonData = {
6929
6997
  method,
@@ -6944,7 +7012,7 @@ function useViewService() {
6944
7012
  },
6945
7013
  [env]
6946
7014
  );
6947
- const requestSetupTotp = (0, import_react63.useCallback)(
7015
+ const requestSetupTotp = (0, import_react65.useCallback)(
6948
7016
  async ({ method, token }) => {
6949
7017
  const jsonData = {
6950
7018
  method,
@@ -6963,7 +7031,7 @@ function useViewService() {
6963
7031
  },
6964
7032
  [env]
6965
7033
  );
6966
- const settingsWebRead2fa = (0, import_react63.useCallback)(
7034
+ const settingsWebRead2fa = (0, import_react65.useCallback)(
6967
7035
  async ({
6968
7036
  method,
6969
7037
  model,
@@ -6991,7 +7059,7 @@ function useViewService() {
6991
7059
  },
6992
7060
  [env]
6993
7061
  );
6994
- const signInSSO = (0, import_react63.useCallback)(
7062
+ const signInSSO = (0, import_react65.useCallback)(
6995
7063
  async ({
6996
7064
  redirect_uri,
6997
7065
  state,
@@ -7023,7 +7091,7 @@ function useViewService() {
7023
7091
  },
7024
7092
  [env]
7025
7093
  );
7026
- const verify2FA = (0, import_react63.useCallback)(
7094
+ const verify2FA = (0, import_react65.useCallback)(
7027
7095
  ({
7028
7096
  method,
7029
7097
  with_context,
@@ -7056,7 +7124,7 @@ function useViewService() {
7056
7124
  },
7057
7125
  [env]
7058
7126
  );
7059
- const get2FAMethods = (0, import_react63.useCallback)(
7127
+ const get2FAMethods = (0, import_react65.useCallback)(
7060
7128
  ({ method, with_context }) => {
7061
7129
  const jsonData = {
7062
7130
  method,
@@ -7075,7 +7143,7 @@ function useViewService() {
7075
7143
  },
7076
7144
  [env]
7077
7145
  );
7078
- const verifyTotp = (0, import_react63.useCallback)(
7146
+ const verifyTotp = (0, import_react65.useCallback)(
7079
7147
  ({
7080
7148
  method,
7081
7149
  action_token,
@@ -7100,7 +7168,7 @@ function useViewService() {
7100
7168
  },
7101
7169
  [env]
7102
7170
  );
7103
- const getNotifications = (0, import_react63.useCallback)(
7171
+ const getNotifications = (0, import_react65.useCallback)(
7104
7172
  async ({
7105
7173
  service,
7106
7174
  xNode,
@@ -7120,7 +7188,7 @@ function useViewService() {
7120
7188
  },
7121
7189
  [env]
7122
7190
  );
7123
- const getCountry = (0, import_react63.useCallback)(
7191
+ const getCountry = (0, import_react65.useCallback)(
7124
7192
  async ({
7125
7193
  service,
7126
7194
  xNode,
@@ -7147,7 +7215,7 @@ function useViewService() {
7147
7215
  },
7148
7216
  [env]
7149
7217
  );
7150
- const getCity = (0, import_react63.useCallback)(
7218
+ const getCity = (0, import_react65.useCallback)(
7151
7219
  async ({
7152
7220
  service,
7153
7221
  xNode,
@@ -7174,7 +7242,7 @@ function useViewService() {
7174
7242
  },
7175
7243
  [env]
7176
7244
  );
7177
- const getWard = (0, import_react63.useCallback)(
7245
+ const getWard = (0, import_react65.useCallback)(
7178
7246
  async ({
7179
7247
  service,
7180
7248
  xNode,
@@ -7199,7 +7267,7 @@ function useViewService() {
7199
7267
  },
7200
7268
  [env]
7201
7269
  );
7202
- const getPartnerTitle = (0, import_react63.useCallback)(
7270
+ const getPartnerTitle = (0, import_react65.useCallback)(
7203
7271
  async ({
7204
7272
  service,
7205
7273
  xNode,
@@ -7251,10 +7319,10 @@ function useViewService() {
7251
7319
  }
7252
7320
 
7253
7321
  // src/services/dashboard-service/index.ts
7254
- var import_react64 = require("react");
7322
+ var import_react66 = require("react");
7255
7323
  function useDashboardService() {
7256
7324
  const { env } = useEnv();
7257
- const readGroup = (0, import_react64.useCallback)(
7325
+ const readGroup = (0, import_react66.useCallback)(
7258
7326
  async ({
7259
7327
  service,
7260
7328
  xNode,
@@ -7271,7 +7339,7 @@ function useDashboardService() {
7271
7339
  },
7272
7340
  [env]
7273
7341
  );
7274
- const getDataChart = (0, import_react64.useCallback)(
7342
+ const getDataChart = (0, import_react66.useCallback)(
7275
7343
  async ({
7276
7344
  service,
7277
7345
  xNode,