@fctc/interface-logic 4.8.2 → 4.8.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/hooks.d.mts +16 -1
- package/dist/hooks.d.ts +16 -1
- package/dist/hooks.js +86 -3
- package/dist/hooks.mjs +85 -3
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +107 -25
- package/dist/provider.mjs +96 -14
- package/dist/services.d.mts +15 -0
- package/dist/services.d.ts +15 -0
- package/dist/services.js +171 -97
- package/dist/services.mjs +168 -94
- package/package.json +1 -1
package/dist/services.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/services/action-service/index.ts
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as useCallback52 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -4949,6 +4949,76 @@ var updateSessionPaymentMethodsSupabaseService = () => {
|
|
|
4949
4949
|
};
|
|
4950
4950
|
};
|
|
4951
4951
|
|
|
4952
|
+
// src/services/pos-service/supabase/create-payment.ts
|
|
4953
|
+
import { useCallback as useCallback51 } from "react";
|
|
4954
|
+
var createPaymentSupabaseService = () => {
|
|
4955
|
+
const supabase = useSupabaseOptional();
|
|
4956
|
+
const createPaymentSupabase = useCallback51(
|
|
4957
|
+
async (values) => {
|
|
4958
|
+
if (!supabase) {
|
|
4959
|
+
console.error("Supabase client not initialized");
|
|
4960
|
+
return null;
|
|
4961
|
+
}
|
|
4962
|
+
try {
|
|
4963
|
+
const { data: paymentData, error: paymentError } = await supabase.from("payments" /* PAYMENTS */).insert({
|
|
4964
|
+
pos_order_id: values.pos_order_id,
|
|
4965
|
+
payment_method_id: values.payment_method_id,
|
|
4966
|
+
session_id: values.session_id,
|
|
4967
|
+
amount: values.amount
|
|
4968
|
+
}).select("id, amount").single();
|
|
4969
|
+
if (paymentError) {
|
|
4970
|
+
console.error("Error creating payment:", paymentError);
|
|
4971
|
+
return null;
|
|
4972
|
+
}
|
|
4973
|
+
const { data: orderData, error: orderError } = await supabase.from("orders" /* ORDERS */).select("amount_paid, state").eq("id", values.pos_order_id).single();
|
|
4974
|
+
if (orderError) {
|
|
4975
|
+
console.error("Error fetching order:", orderError);
|
|
4976
|
+
return null;
|
|
4977
|
+
}
|
|
4978
|
+
const amountPaid = orderData.amount_paid;
|
|
4979
|
+
const isComplete = amountPaid >= values.order_total;
|
|
4980
|
+
const amountReturn = isComplete ? amountPaid - values.order_total : 0;
|
|
4981
|
+
let orderState = orderData.state;
|
|
4982
|
+
if (isComplete) {
|
|
4983
|
+
const { error: updateError } = await supabase.from("orders" /* ORDERS */).update({
|
|
4984
|
+
state: "paid",
|
|
4985
|
+
amount_return: amountReturn,
|
|
4986
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4987
|
+
}).eq("id", values.pos_order_id);
|
|
4988
|
+
if (updateError) {
|
|
4989
|
+
console.error("Error updating order state:", updateError);
|
|
4990
|
+
} else {
|
|
4991
|
+
orderState = "paid";
|
|
4992
|
+
}
|
|
4993
|
+
} else if (orderData.state === "new") {
|
|
4994
|
+
const { error: updateError } = await supabase.from("orders" /* ORDERS */).update({
|
|
4995
|
+
state: "in_paid",
|
|
4996
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4997
|
+
}).eq("id", values.pos_order_id);
|
|
4998
|
+
if (!updateError) {
|
|
4999
|
+
orderState = "in_paid";
|
|
5000
|
+
}
|
|
5001
|
+
}
|
|
5002
|
+
return {
|
|
5003
|
+
id: paymentData.id,
|
|
5004
|
+
amount: paymentData.amount,
|
|
5005
|
+
amount_paid: amountPaid,
|
|
5006
|
+
amount_return: amountReturn,
|
|
5007
|
+
is_complete: isComplete,
|
|
5008
|
+
order_state: orderState
|
|
5009
|
+
};
|
|
5010
|
+
} catch (error) {
|
|
5011
|
+
console.error("Error creating payment:", error);
|
|
5012
|
+
return null;
|
|
5013
|
+
}
|
|
5014
|
+
},
|
|
5015
|
+
[supabase]
|
|
5016
|
+
);
|
|
5017
|
+
return {
|
|
5018
|
+
createPaymentSupabase
|
|
5019
|
+
};
|
|
5020
|
+
};
|
|
5021
|
+
|
|
4952
5022
|
// src/services/pos-service/index.ts
|
|
4953
5023
|
var serviceFactories = [
|
|
4954
5024
|
addEntityService,
|
|
@@ -4998,7 +5068,8 @@ var serviceFactories = [
|
|
|
4998
5068
|
addProductSupabaseService,
|
|
4999
5069
|
getFunctionalModulesService,
|
|
5000
5070
|
addPaymentMethodSupabaseService,
|
|
5001
|
-
updateSessionPaymentMethodsSupabaseService
|
|
5071
|
+
updateSessionPaymentMethodsSupabaseService,
|
|
5072
|
+
createPaymentSupabaseService
|
|
5002
5073
|
];
|
|
5003
5074
|
var usePosService = () => {
|
|
5004
5075
|
const { env } = useEnv();
|
|
@@ -5151,6 +5222,9 @@ import { useMutation as useMutation104 } from "@tanstack/react-query";
|
|
|
5151
5222
|
// src/hooks/pos/supabase/use-update-session-payment-methods.ts
|
|
5152
5223
|
import { useMutation as useMutation105 } from "@tanstack/react-query";
|
|
5153
5224
|
|
|
5225
|
+
// src/hooks/pos/supabase/use-create-payment.ts
|
|
5226
|
+
import { useMutation as useMutation106 } from "@tanstack/react-query";
|
|
5227
|
+
|
|
5154
5228
|
// src/provider/service-provider.tsx
|
|
5155
5229
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5156
5230
|
var ServiceContext = createContext3(null);
|
|
@@ -5162,7 +5236,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5162
5236
|
// src/services/action-service/index.ts
|
|
5163
5237
|
function useActionService() {
|
|
5164
5238
|
const { env } = useEnv();
|
|
5165
|
-
const loadAction =
|
|
5239
|
+
const loadAction = useCallback52(
|
|
5166
5240
|
async ({
|
|
5167
5241
|
idAction,
|
|
5168
5242
|
context,
|
|
@@ -5186,7 +5260,7 @@ function useActionService() {
|
|
|
5186
5260
|
},
|
|
5187
5261
|
[env]
|
|
5188
5262
|
);
|
|
5189
|
-
const callButton =
|
|
5263
|
+
const callButton = useCallback52(
|
|
5190
5264
|
async ({
|
|
5191
5265
|
model,
|
|
5192
5266
|
ids = [],
|
|
@@ -5220,7 +5294,7 @@ function useActionService() {
|
|
|
5220
5294
|
},
|
|
5221
5295
|
[env]
|
|
5222
5296
|
);
|
|
5223
|
-
const removeRows =
|
|
5297
|
+
const removeRows = useCallback52(
|
|
5224
5298
|
async ({
|
|
5225
5299
|
model,
|
|
5226
5300
|
ids,
|
|
@@ -5246,7 +5320,7 @@ function useActionService() {
|
|
|
5246
5320
|
},
|
|
5247
5321
|
[env]
|
|
5248
5322
|
);
|
|
5249
|
-
const duplicateRecord =
|
|
5323
|
+
const duplicateRecord = useCallback52(
|
|
5250
5324
|
async ({
|
|
5251
5325
|
model,
|
|
5252
5326
|
id,
|
|
@@ -5272,7 +5346,7 @@ function useActionService() {
|
|
|
5272
5346
|
},
|
|
5273
5347
|
[env]
|
|
5274
5348
|
);
|
|
5275
|
-
const getPrintReportName =
|
|
5349
|
+
const getPrintReportName = useCallback52(
|
|
5276
5350
|
async ({ id }) => {
|
|
5277
5351
|
const jsonData = {
|
|
5278
5352
|
model: "ir.actions.report",
|
|
@@ -5290,7 +5364,7 @@ function useActionService() {
|
|
|
5290
5364
|
},
|
|
5291
5365
|
[env]
|
|
5292
5366
|
);
|
|
5293
|
-
const print =
|
|
5367
|
+
const print = useCallback52(
|
|
5294
5368
|
async ({ id, report, db }) => {
|
|
5295
5369
|
const jsonData = {
|
|
5296
5370
|
report,
|
|
@@ -5308,7 +5382,7 @@ function useActionService() {
|
|
|
5308
5382
|
},
|
|
5309
5383
|
[env]
|
|
5310
5384
|
);
|
|
5311
|
-
const runAction =
|
|
5385
|
+
const runAction = useCallback52(
|
|
5312
5386
|
async ({
|
|
5313
5387
|
idAction,
|
|
5314
5388
|
context,
|
|
@@ -5335,7 +5409,7 @@ function useActionService() {
|
|
|
5335
5409
|
},
|
|
5336
5410
|
[env]
|
|
5337
5411
|
);
|
|
5338
|
-
const generateSerialNumber =
|
|
5412
|
+
const generateSerialNumber = useCallback52(
|
|
5339
5413
|
async ({
|
|
5340
5414
|
kwargs,
|
|
5341
5415
|
context,
|
|
@@ -5373,11 +5447,11 @@ function useActionService() {
|
|
|
5373
5447
|
}
|
|
5374
5448
|
|
|
5375
5449
|
// src/services/auth-service/index.ts
|
|
5376
|
-
import { useCallback as
|
|
5450
|
+
import { useCallback as useCallback53 } from "react";
|
|
5377
5451
|
function useAuthService() {
|
|
5378
5452
|
const { env } = useEnv();
|
|
5379
5453
|
const supabase = useSupabaseOptional();
|
|
5380
|
-
const login =
|
|
5454
|
+
const login = useCallback53(
|
|
5381
5455
|
async (body) => {
|
|
5382
5456
|
const payload = Object.fromEntries(
|
|
5383
5457
|
Object.entries({
|
|
@@ -5402,7 +5476,7 @@ function useAuthService() {
|
|
|
5402
5476
|
},
|
|
5403
5477
|
[env]
|
|
5404
5478
|
);
|
|
5405
|
-
const loginSupabase =
|
|
5479
|
+
const loginSupabase = useCallback53(
|
|
5406
5480
|
async (body) => {
|
|
5407
5481
|
if (!supabase) {
|
|
5408
5482
|
return {
|
|
@@ -5418,7 +5492,7 @@ function useAuthService() {
|
|
|
5418
5492
|
},
|
|
5419
5493
|
[supabase]
|
|
5420
5494
|
);
|
|
5421
|
-
const forgotPassword =
|
|
5495
|
+
const forgotPassword = useCallback53(
|
|
5422
5496
|
async (email) => {
|
|
5423
5497
|
const bodyData = {
|
|
5424
5498
|
login: email,
|
|
@@ -5432,7 +5506,7 @@ function useAuthService() {
|
|
|
5432
5506
|
},
|
|
5433
5507
|
[env]
|
|
5434
5508
|
);
|
|
5435
|
-
const forgotPasswordSSO =
|
|
5509
|
+
const forgotPasswordSSO = useCallback53(
|
|
5436
5510
|
async ({
|
|
5437
5511
|
email,
|
|
5438
5512
|
with_context,
|
|
@@ -5455,7 +5529,7 @@ function useAuthService() {
|
|
|
5455
5529
|
},
|
|
5456
5530
|
[env]
|
|
5457
5531
|
);
|
|
5458
|
-
const resetPassword =
|
|
5532
|
+
const resetPassword = useCallback53(
|
|
5459
5533
|
async (data, token) => {
|
|
5460
5534
|
const bodyData = {
|
|
5461
5535
|
token,
|
|
@@ -5470,7 +5544,7 @@ function useAuthService() {
|
|
|
5470
5544
|
},
|
|
5471
5545
|
[env]
|
|
5472
5546
|
);
|
|
5473
|
-
const resetPasswordSSO =
|
|
5547
|
+
const resetPasswordSSO = useCallback53(
|
|
5474
5548
|
async ({
|
|
5475
5549
|
method,
|
|
5476
5550
|
password,
|
|
@@ -5493,7 +5567,7 @@ function useAuthService() {
|
|
|
5493
5567
|
},
|
|
5494
5568
|
[env]
|
|
5495
5569
|
);
|
|
5496
|
-
const updatePassword =
|
|
5570
|
+
const updatePassword = useCallback53(
|
|
5497
5571
|
async (data, token) => {
|
|
5498
5572
|
const bodyData = {
|
|
5499
5573
|
token,
|
|
@@ -5508,7 +5582,7 @@ function useAuthService() {
|
|
|
5508
5582
|
},
|
|
5509
5583
|
[env]
|
|
5510
5584
|
);
|
|
5511
|
-
const isValidToken =
|
|
5585
|
+
const isValidToken = useCallback53(
|
|
5512
5586
|
async (token) => {
|
|
5513
5587
|
const bodyData = {
|
|
5514
5588
|
token
|
|
@@ -5521,7 +5595,7 @@ function useAuthService() {
|
|
|
5521
5595
|
},
|
|
5522
5596
|
[env]
|
|
5523
5597
|
);
|
|
5524
|
-
const isValidActionToken =
|
|
5598
|
+
const isValidActionToken = useCallback53(
|
|
5525
5599
|
async (actionToken) => {
|
|
5526
5600
|
const bodyData = {};
|
|
5527
5601
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5534,7 +5608,7 @@ function useAuthService() {
|
|
|
5534
5608
|
},
|
|
5535
5609
|
[env]
|
|
5536
5610
|
);
|
|
5537
|
-
const loginSocial =
|
|
5611
|
+
const loginSocial = useCallback53(
|
|
5538
5612
|
async ({
|
|
5539
5613
|
db,
|
|
5540
5614
|
state,
|
|
@@ -5552,13 +5626,13 @@ function useAuthService() {
|
|
|
5552
5626
|
},
|
|
5553
5627
|
[env]
|
|
5554
5628
|
);
|
|
5555
|
-
const getProviders =
|
|
5629
|
+
const getProviders = useCallback53(
|
|
5556
5630
|
async (db) => {
|
|
5557
5631
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5558
5632
|
},
|
|
5559
5633
|
[env]
|
|
5560
5634
|
);
|
|
5561
|
-
const getAccessByCode =
|
|
5635
|
+
const getAccessByCode = useCallback53(
|
|
5562
5636
|
async (code) => {
|
|
5563
5637
|
const data = new URLSearchParams();
|
|
5564
5638
|
data.append("code", code);
|
|
@@ -5578,7 +5652,7 @@ function useAuthService() {
|
|
|
5578
5652
|
},
|
|
5579
5653
|
[env]
|
|
5580
5654
|
);
|
|
5581
|
-
const logout =
|
|
5655
|
+
const logout = useCallback53(
|
|
5582
5656
|
async (service) => {
|
|
5583
5657
|
return env?.requests?.post(
|
|
5584
5658
|
"/logout" /* LOGOUT */,
|
|
@@ -5595,7 +5669,7 @@ function useAuthService() {
|
|
|
5595
5669
|
},
|
|
5596
5670
|
[env]
|
|
5597
5671
|
);
|
|
5598
|
-
const getTenantMapping =
|
|
5672
|
+
const getTenantMapping = useCallback53(
|
|
5599
5673
|
async ({ shortName, service }) => {
|
|
5600
5674
|
const bodyData = {
|
|
5601
5675
|
short_name: shortName
|
|
@@ -5613,7 +5687,7 @@ function useAuthService() {
|
|
|
5613
5687
|
},
|
|
5614
5688
|
[env]
|
|
5615
5689
|
);
|
|
5616
|
-
const getToken =
|
|
5690
|
+
const getToken = useCallback53(
|
|
5617
5691
|
async ({
|
|
5618
5692
|
phone,
|
|
5619
5693
|
name,
|
|
@@ -5658,10 +5732,10 @@ function useAuthService() {
|
|
|
5658
5732
|
}
|
|
5659
5733
|
|
|
5660
5734
|
// src/services/company-service/index.ts
|
|
5661
|
-
import { useCallback as
|
|
5735
|
+
import { useCallback as useCallback54 } from "react";
|
|
5662
5736
|
function useCompanyService() {
|
|
5663
5737
|
const { env } = useEnv();
|
|
5664
|
-
const getCurrentCompany =
|
|
5738
|
+
const getCurrentCompany = useCallback54(
|
|
5665
5739
|
async (service, extraHeaders) => {
|
|
5666
5740
|
return await env.requests.get(
|
|
5667
5741
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5678,7 +5752,7 @@ function useCompanyService() {
|
|
|
5678
5752
|
},
|
|
5679
5753
|
[env]
|
|
5680
5754
|
);
|
|
5681
|
-
const getInfoCompany =
|
|
5755
|
+
const getInfoCompany = useCallback54(
|
|
5682
5756
|
async (id, service) => {
|
|
5683
5757
|
const jsonData = {
|
|
5684
5758
|
ids: [id],
|
|
@@ -5714,10 +5788,10 @@ function useCompanyService() {
|
|
|
5714
5788
|
}
|
|
5715
5789
|
|
|
5716
5790
|
// src/services/excel-service/index.ts
|
|
5717
|
-
import { useCallback as
|
|
5791
|
+
import { useCallback as useCallback55 } from "react";
|
|
5718
5792
|
function useExcelService() {
|
|
5719
5793
|
const { env } = useEnv();
|
|
5720
|
-
const uploadFileExcel =
|
|
5794
|
+
const uploadFileExcel = useCallback55(
|
|
5721
5795
|
async ({
|
|
5722
5796
|
formData,
|
|
5723
5797
|
service,
|
|
@@ -5734,7 +5808,7 @@ function useExcelService() {
|
|
|
5734
5808
|
},
|
|
5735
5809
|
[env]
|
|
5736
5810
|
);
|
|
5737
|
-
const uploadIdFile =
|
|
5811
|
+
const uploadIdFile = useCallback55(
|
|
5738
5812
|
async ({
|
|
5739
5813
|
formData,
|
|
5740
5814
|
service,
|
|
@@ -5751,7 +5825,7 @@ function useExcelService() {
|
|
|
5751
5825
|
},
|
|
5752
5826
|
[env]
|
|
5753
5827
|
);
|
|
5754
|
-
const parsePreview =
|
|
5828
|
+
const parsePreview = useCallback55(
|
|
5755
5829
|
async ({
|
|
5756
5830
|
id,
|
|
5757
5831
|
selectedSheet,
|
|
@@ -5800,7 +5874,7 @@ function useExcelService() {
|
|
|
5800
5874
|
},
|
|
5801
5875
|
[env]
|
|
5802
5876
|
);
|
|
5803
|
-
const executeImport =
|
|
5877
|
+
const executeImport = useCallback55(
|
|
5804
5878
|
async ({
|
|
5805
5879
|
columns,
|
|
5806
5880
|
fields,
|
|
@@ -5834,7 +5908,7 @@ function useExcelService() {
|
|
|
5834
5908
|
},
|
|
5835
5909
|
[env]
|
|
5836
5910
|
);
|
|
5837
|
-
const getFileExcel =
|
|
5911
|
+
const getFileExcel = useCallback55(
|
|
5838
5912
|
async ({
|
|
5839
5913
|
model,
|
|
5840
5914
|
service,
|
|
@@ -5858,7 +5932,7 @@ function useExcelService() {
|
|
|
5858
5932
|
},
|
|
5859
5933
|
[env]
|
|
5860
5934
|
);
|
|
5861
|
-
const getFieldExport =
|
|
5935
|
+
const getFieldExport = useCallback55(
|
|
5862
5936
|
async ({
|
|
5863
5937
|
ids,
|
|
5864
5938
|
model,
|
|
@@ -5898,7 +5972,7 @@ function useExcelService() {
|
|
|
5898
5972
|
},
|
|
5899
5973
|
[env]
|
|
5900
5974
|
);
|
|
5901
|
-
const exportExcel =
|
|
5975
|
+
const exportExcel = useCallback55(
|
|
5902
5976
|
async ({
|
|
5903
5977
|
model,
|
|
5904
5978
|
domain,
|
|
@@ -5946,10 +6020,10 @@ function useExcelService() {
|
|
|
5946
6020
|
}
|
|
5947
6021
|
|
|
5948
6022
|
// src/services/form-service/index.ts
|
|
5949
|
-
import { useCallback as
|
|
6023
|
+
import { useCallback as useCallback56 } from "react";
|
|
5950
6024
|
function useFormService() {
|
|
5951
6025
|
const { env } = useEnv();
|
|
5952
|
-
const getComment =
|
|
6026
|
+
const getComment = useCallback56(
|
|
5953
6027
|
async ({ data }) => {
|
|
5954
6028
|
const jsonData = {
|
|
5955
6029
|
thread_id: data.thread_id,
|
|
@@ -5967,7 +6041,7 @@ function useFormService() {
|
|
|
5967
6041
|
},
|
|
5968
6042
|
[env]
|
|
5969
6043
|
);
|
|
5970
|
-
const getThreadData =
|
|
6044
|
+
const getThreadData = useCallback56(
|
|
5971
6045
|
async ({
|
|
5972
6046
|
data,
|
|
5973
6047
|
xNode,
|
|
@@ -5994,7 +6068,7 @@ function useFormService() {
|
|
|
5994
6068
|
},
|
|
5995
6069
|
[env]
|
|
5996
6070
|
);
|
|
5997
|
-
const getThreadMessages =
|
|
6071
|
+
const getThreadMessages = useCallback56(
|
|
5998
6072
|
async ({
|
|
5999
6073
|
data,
|
|
6000
6074
|
xNode,
|
|
@@ -6020,7 +6094,7 @@ function useFormService() {
|
|
|
6020
6094
|
},
|
|
6021
6095
|
[env]
|
|
6022
6096
|
);
|
|
6023
|
-
const sentComment =
|
|
6097
|
+
const sentComment = useCallback56(
|
|
6024
6098
|
async ({ data }) => {
|
|
6025
6099
|
const jsonData = {
|
|
6026
6100
|
context: {
|
|
@@ -6048,7 +6122,7 @@ function useFormService() {
|
|
|
6048
6122
|
},
|
|
6049
6123
|
[env]
|
|
6050
6124
|
);
|
|
6051
|
-
const deleteComment =
|
|
6125
|
+
const deleteComment = useCallback56(
|
|
6052
6126
|
async ({ data }) => {
|
|
6053
6127
|
const jsonData = {
|
|
6054
6128
|
attachment_ids: [],
|
|
@@ -6064,7 +6138,7 @@ function useFormService() {
|
|
|
6064
6138
|
},
|
|
6065
6139
|
[env]
|
|
6066
6140
|
);
|
|
6067
|
-
const getImage =
|
|
6141
|
+
const getImage = useCallback56(
|
|
6068
6142
|
async ({ data }) => {
|
|
6069
6143
|
return env.requests.get(
|
|
6070
6144
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6077,7 +6151,7 @@ function useFormService() {
|
|
|
6077
6151
|
},
|
|
6078
6152
|
[env]
|
|
6079
6153
|
);
|
|
6080
|
-
const uploadImage =
|
|
6154
|
+
const uploadImage = useCallback56(
|
|
6081
6155
|
async ({
|
|
6082
6156
|
formData,
|
|
6083
6157
|
service,
|
|
@@ -6096,7 +6170,7 @@ function useFormService() {
|
|
|
6096
6170
|
},
|
|
6097
6171
|
[env]
|
|
6098
6172
|
);
|
|
6099
|
-
const uploadFile =
|
|
6173
|
+
const uploadFile = useCallback56(
|
|
6100
6174
|
async ({
|
|
6101
6175
|
formData,
|
|
6102
6176
|
service,
|
|
@@ -6116,7 +6190,7 @@ function useFormService() {
|
|
|
6116
6190
|
},
|
|
6117
6191
|
[env]
|
|
6118
6192
|
);
|
|
6119
|
-
const getFormView =
|
|
6193
|
+
const getFormView = useCallback56(
|
|
6120
6194
|
async ({ data }) => {
|
|
6121
6195
|
const jsonData = {
|
|
6122
6196
|
model: data.model,
|
|
@@ -6132,7 +6206,7 @@ function useFormService() {
|
|
|
6132
6206
|
},
|
|
6133
6207
|
[env]
|
|
6134
6208
|
);
|
|
6135
|
-
const changeStatus =
|
|
6209
|
+
const changeStatus = useCallback56(
|
|
6136
6210
|
async ({ data }) => {
|
|
6137
6211
|
const vals = {
|
|
6138
6212
|
[data.name]: data.stage_id
|
|
@@ -6161,7 +6235,7 @@ function useFormService() {
|
|
|
6161
6235
|
},
|
|
6162
6236
|
[env]
|
|
6163
6237
|
);
|
|
6164
|
-
const getExternalTab =
|
|
6238
|
+
const getExternalTab = useCallback56(
|
|
6165
6239
|
async ({ method, context, service, xNode }) => {
|
|
6166
6240
|
return env?.requests?.post(
|
|
6167
6241
|
"/call" /* CALL_PATH */,
|
|
@@ -6196,10 +6270,10 @@ function useFormService() {
|
|
|
6196
6270
|
}
|
|
6197
6271
|
|
|
6198
6272
|
// src/services/kanban-service/index.ts
|
|
6199
|
-
import { useCallback as
|
|
6273
|
+
import { useCallback as useCallback57 } from "react";
|
|
6200
6274
|
function useKanbanService() {
|
|
6201
6275
|
const { env } = useEnv();
|
|
6202
|
-
const getGroups =
|
|
6276
|
+
const getGroups = useCallback57(
|
|
6203
6277
|
async ({ model, width_context }) => {
|
|
6204
6278
|
const jsonData = {
|
|
6205
6279
|
model,
|
|
@@ -6219,7 +6293,7 @@ function useKanbanService() {
|
|
|
6219
6293
|
},
|
|
6220
6294
|
[env]
|
|
6221
6295
|
);
|
|
6222
|
-
const getProgressBar =
|
|
6296
|
+
const getProgressBar = useCallback57(
|
|
6223
6297
|
async ({ field, color, model, width_context }) => {
|
|
6224
6298
|
const jsonData = {
|
|
6225
6299
|
model,
|
|
@@ -6249,10 +6323,10 @@ function useKanbanService() {
|
|
|
6249
6323
|
}
|
|
6250
6324
|
|
|
6251
6325
|
// src/services/model-service/index.ts
|
|
6252
|
-
import { useCallback as
|
|
6326
|
+
import { useCallback as useCallback58 } from "react";
|
|
6253
6327
|
function useModelService() {
|
|
6254
6328
|
const { env } = useEnv();
|
|
6255
|
-
const getListMyBankAccount =
|
|
6329
|
+
const getListMyBankAccount = useCallback58(
|
|
6256
6330
|
async ({
|
|
6257
6331
|
domain,
|
|
6258
6332
|
spectification,
|
|
@@ -6276,7 +6350,7 @@ function useModelService() {
|
|
|
6276
6350
|
},
|
|
6277
6351
|
[env]
|
|
6278
6352
|
);
|
|
6279
|
-
const getCurrency =
|
|
6353
|
+
const getCurrency = useCallback58(async () => {
|
|
6280
6354
|
const jsonData = {
|
|
6281
6355
|
model: "res.currency",
|
|
6282
6356
|
method: "web_search_read",
|
|
@@ -6296,7 +6370,7 @@ function useModelService() {
|
|
|
6296
6370
|
}
|
|
6297
6371
|
});
|
|
6298
6372
|
}, [env]);
|
|
6299
|
-
const getConversionRate =
|
|
6373
|
+
const getConversionRate = useCallback58(async () => {
|
|
6300
6374
|
const jsonData = {
|
|
6301
6375
|
model: "res.currency",
|
|
6302
6376
|
method: "web_search_read",
|
|
@@ -6322,7 +6396,7 @@ function useModelService() {
|
|
|
6322
6396
|
}
|
|
6323
6397
|
});
|
|
6324
6398
|
}, [env]);
|
|
6325
|
-
const getAll =
|
|
6399
|
+
const getAll = useCallback58(
|
|
6326
6400
|
async ({
|
|
6327
6401
|
data,
|
|
6328
6402
|
service,
|
|
@@ -6364,7 +6438,7 @@ function useModelService() {
|
|
|
6364
6438
|
},
|
|
6365
6439
|
[env]
|
|
6366
6440
|
);
|
|
6367
|
-
const getListCalendar =
|
|
6441
|
+
const getListCalendar = useCallback58(
|
|
6368
6442
|
async ({ data }) => {
|
|
6369
6443
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6370
6444
|
fields: data.fields,
|
|
@@ -6395,7 +6469,7 @@ function useModelService() {
|
|
|
6395
6469
|
},
|
|
6396
6470
|
[env]
|
|
6397
6471
|
);
|
|
6398
|
-
const getList =
|
|
6472
|
+
const getList = useCallback58(
|
|
6399
6473
|
async ({
|
|
6400
6474
|
model,
|
|
6401
6475
|
ids = [],
|
|
@@ -6427,7 +6501,7 @@ function useModelService() {
|
|
|
6427
6501
|
},
|
|
6428
6502
|
[env]
|
|
6429
6503
|
);
|
|
6430
|
-
const getDetail =
|
|
6504
|
+
const getDetail = useCallback58(
|
|
6431
6505
|
async ({
|
|
6432
6506
|
ids = [],
|
|
6433
6507
|
model,
|
|
@@ -6459,7 +6533,7 @@ function useModelService() {
|
|
|
6459
6533
|
},
|
|
6460
6534
|
[env]
|
|
6461
6535
|
);
|
|
6462
|
-
const save =
|
|
6536
|
+
const save = useCallback58(
|
|
6463
6537
|
async ({
|
|
6464
6538
|
model,
|
|
6465
6539
|
ids = [],
|
|
@@ -6494,7 +6568,7 @@ function useModelService() {
|
|
|
6494
6568
|
},
|
|
6495
6569
|
[env]
|
|
6496
6570
|
);
|
|
6497
|
-
const deleteApi =
|
|
6571
|
+
const deleteApi = useCallback58(
|
|
6498
6572
|
async ({ ids = [], model, service }) => {
|
|
6499
6573
|
const jsonData = {
|
|
6500
6574
|
model,
|
|
@@ -6514,7 +6588,7 @@ function useModelService() {
|
|
|
6514
6588
|
},
|
|
6515
6589
|
[env]
|
|
6516
6590
|
);
|
|
6517
|
-
const onChange =
|
|
6591
|
+
const onChange = useCallback58(
|
|
6518
6592
|
async ({
|
|
6519
6593
|
ids = [],
|
|
6520
6594
|
model,
|
|
@@ -6550,7 +6624,7 @@ function useModelService() {
|
|
|
6550
6624
|
},
|
|
6551
6625
|
[env]
|
|
6552
6626
|
);
|
|
6553
|
-
const getListFieldsOnchange =
|
|
6627
|
+
const getListFieldsOnchange = useCallback58(
|
|
6554
6628
|
async ({
|
|
6555
6629
|
model,
|
|
6556
6630
|
service,
|
|
@@ -6574,7 +6648,7 @@ function useModelService() {
|
|
|
6574
6648
|
},
|
|
6575
6649
|
[env]
|
|
6576
6650
|
);
|
|
6577
|
-
const parseORMOdoo =
|
|
6651
|
+
const parseORMOdoo = useCallback58((data) => {
|
|
6578
6652
|
for (const key in data) {
|
|
6579
6653
|
if (key === "display_name") {
|
|
6580
6654
|
delete data[key];
|
|
@@ -6585,7 +6659,7 @@ function useModelService() {
|
|
|
6585
6659
|
}
|
|
6586
6660
|
return { ...data };
|
|
6587
6661
|
}, []);
|
|
6588
|
-
const toDataJS =
|
|
6662
|
+
const toDataJS = useCallback58(
|
|
6589
6663
|
(data, viewData, model) => {
|
|
6590
6664
|
for (const key in data) {
|
|
6591
6665
|
if (data[key] === false) {
|
|
@@ -6643,10 +6717,10 @@ function useModelService() {
|
|
|
6643
6717
|
}
|
|
6644
6718
|
|
|
6645
6719
|
// src/services/user-service/index.ts
|
|
6646
|
-
import { useCallback as
|
|
6720
|
+
import { useCallback as useCallback59 } from "react";
|
|
6647
6721
|
function useUserService() {
|
|
6648
6722
|
const { env } = useEnv();
|
|
6649
|
-
const getProfile =
|
|
6723
|
+
const getProfile = useCallback59(
|
|
6650
6724
|
async (service, path, extraHeaders) => {
|
|
6651
6725
|
return env?.requests?.get(
|
|
6652
6726
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6663,7 +6737,7 @@ function useUserService() {
|
|
|
6663
6737
|
},
|
|
6664
6738
|
[env]
|
|
6665
6739
|
);
|
|
6666
|
-
const getUser =
|
|
6740
|
+
const getUser = useCallback59(
|
|
6667
6741
|
async ({ context, id }) => {
|
|
6668
6742
|
const jsonData = {
|
|
6669
6743
|
model: "res.users",
|
|
@@ -6701,7 +6775,7 @@ function useUserService() {
|
|
|
6701
6775
|
},
|
|
6702
6776
|
[env]
|
|
6703
6777
|
);
|
|
6704
|
-
const switchUserLocale =
|
|
6778
|
+
const switchUserLocale = useCallback59(
|
|
6705
6779
|
async ({ id, values, service }) => {
|
|
6706
6780
|
const jsonData = {
|
|
6707
6781
|
model: "res.users",
|
|
@@ -6729,10 +6803,10 @@ function useUserService() {
|
|
|
6729
6803
|
}
|
|
6730
6804
|
|
|
6731
6805
|
// src/services/view-service/index.ts
|
|
6732
|
-
import { useCallback as
|
|
6806
|
+
import { useCallback as useCallback60 } from "react";
|
|
6733
6807
|
function useViewService() {
|
|
6734
6808
|
const { env } = useEnv();
|
|
6735
|
-
const getView =
|
|
6809
|
+
const getView = useCallback60(
|
|
6736
6810
|
async ({
|
|
6737
6811
|
model,
|
|
6738
6812
|
views,
|
|
@@ -6772,7 +6846,7 @@ function useViewService() {
|
|
|
6772
6846
|
},
|
|
6773
6847
|
[env]
|
|
6774
6848
|
);
|
|
6775
|
-
const getMenu =
|
|
6849
|
+
const getMenu = useCallback60(
|
|
6776
6850
|
async (context, specification, domain, service) => {
|
|
6777
6851
|
const jsonData = {
|
|
6778
6852
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6803,7 +6877,7 @@ function useViewService() {
|
|
|
6803
6877
|
},
|
|
6804
6878
|
[env]
|
|
6805
6879
|
);
|
|
6806
|
-
const getActionDetail =
|
|
6880
|
+
const getActionDetail = useCallback60(
|
|
6807
6881
|
async (aid, context) => {
|
|
6808
6882
|
const jsonData = {
|
|
6809
6883
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -6833,7 +6907,7 @@ function useViewService() {
|
|
|
6833
6907
|
},
|
|
6834
6908
|
[env]
|
|
6835
6909
|
);
|
|
6836
|
-
const getResequence =
|
|
6910
|
+
const getResequence = useCallback60(
|
|
6837
6911
|
async ({
|
|
6838
6912
|
model,
|
|
6839
6913
|
ids,
|
|
@@ -6863,7 +6937,7 @@ function useViewService() {
|
|
|
6863
6937
|
},
|
|
6864
6938
|
[env]
|
|
6865
6939
|
);
|
|
6866
|
-
const getSelectionItem =
|
|
6940
|
+
const getSelectionItem = useCallback60(
|
|
6867
6941
|
async ({
|
|
6868
6942
|
data,
|
|
6869
6943
|
service,
|
|
@@ -6900,7 +6974,7 @@ function useViewService() {
|
|
|
6900
6974
|
},
|
|
6901
6975
|
[env]
|
|
6902
6976
|
);
|
|
6903
|
-
const loadMessages =
|
|
6977
|
+
const loadMessages = useCallback60(async () => {
|
|
6904
6978
|
return env.requests.post(
|
|
6905
6979
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
6906
6980
|
{},
|
|
@@ -6911,14 +6985,14 @@ function useViewService() {
|
|
|
6911
6985
|
}
|
|
6912
6986
|
);
|
|
6913
6987
|
}, [env]);
|
|
6914
|
-
const getVersion =
|
|
6988
|
+
const getVersion = useCallback60(async () => {
|
|
6915
6989
|
return env?.requests?.get("", {
|
|
6916
6990
|
headers: {
|
|
6917
6991
|
"Content-Type": "application/json"
|
|
6918
6992
|
}
|
|
6919
6993
|
});
|
|
6920
6994
|
}, [env]);
|
|
6921
|
-
const grantAccess =
|
|
6995
|
+
const grantAccess = useCallback60(
|
|
6922
6996
|
async ({
|
|
6923
6997
|
redirect_uri,
|
|
6924
6998
|
state,
|
|
@@ -6945,7 +7019,7 @@ function useViewService() {
|
|
|
6945
7019
|
},
|
|
6946
7020
|
[env]
|
|
6947
7021
|
);
|
|
6948
|
-
const removeTotpSetUp =
|
|
7022
|
+
const removeTotpSetUp = useCallback60(
|
|
6949
7023
|
async ({ method, token }) => {
|
|
6950
7024
|
const jsonData = {
|
|
6951
7025
|
method,
|
|
@@ -6966,7 +7040,7 @@ function useViewService() {
|
|
|
6966
7040
|
},
|
|
6967
7041
|
[env]
|
|
6968
7042
|
);
|
|
6969
|
-
const requestSetupTotp =
|
|
7043
|
+
const requestSetupTotp = useCallback60(
|
|
6970
7044
|
async ({ method, token }) => {
|
|
6971
7045
|
const jsonData = {
|
|
6972
7046
|
method,
|
|
@@ -6985,7 +7059,7 @@ function useViewService() {
|
|
|
6985
7059
|
},
|
|
6986
7060
|
[env]
|
|
6987
7061
|
);
|
|
6988
|
-
const settingsWebRead2fa =
|
|
7062
|
+
const settingsWebRead2fa = useCallback60(
|
|
6989
7063
|
async ({
|
|
6990
7064
|
method,
|
|
6991
7065
|
model,
|
|
@@ -7013,7 +7087,7 @@ function useViewService() {
|
|
|
7013
7087
|
},
|
|
7014
7088
|
[env]
|
|
7015
7089
|
);
|
|
7016
|
-
const signInSSO =
|
|
7090
|
+
const signInSSO = useCallback60(
|
|
7017
7091
|
async ({
|
|
7018
7092
|
redirect_uri,
|
|
7019
7093
|
state,
|
|
@@ -7045,7 +7119,7 @@ function useViewService() {
|
|
|
7045
7119
|
},
|
|
7046
7120
|
[env]
|
|
7047
7121
|
);
|
|
7048
|
-
const verify2FA =
|
|
7122
|
+
const verify2FA = useCallback60(
|
|
7049
7123
|
({
|
|
7050
7124
|
method,
|
|
7051
7125
|
with_context,
|
|
@@ -7078,7 +7152,7 @@ function useViewService() {
|
|
|
7078
7152
|
},
|
|
7079
7153
|
[env]
|
|
7080
7154
|
);
|
|
7081
|
-
const get2FAMethods =
|
|
7155
|
+
const get2FAMethods = useCallback60(
|
|
7082
7156
|
({ method, with_context }) => {
|
|
7083
7157
|
const jsonData = {
|
|
7084
7158
|
method,
|
|
@@ -7097,7 +7171,7 @@ function useViewService() {
|
|
|
7097
7171
|
},
|
|
7098
7172
|
[env]
|
|
7099
7173
|
);
|
|
7100
|
-
const verifyTotp =
|
|
7174
|
+
const verifyTotp = useCallback60(
|
|
7101
7175
|
({
|
|
7102
7176
|
method,
|
|
7103
7177
|
action_token,
|
|
@@ -7122,7 +7196,7 @@ function useViewService() {
|
|
|
7122
7196
|
},
|
|
7123
7197
|
[env]
|
|
7124
7198
|
);
|
|
7125
|
-
const getNotifications =
|
|
7199
|
+
const getNotifications = useCallback60(
|
|
7126
7200
|
async ({
|
|
7127
7201
|
service,
|
|
7128
7202
|
xNode,
|
|
@@ -7142,7 +7216,7 @@ function useViewService() {
|
|
|
7142
7216
|
},
|
|
7143
7217
|
[env]
|
|
7144
7218
|
);
|
|
7145
|
-
const getCountry =
|
|
7219
|
+
const getCountry = useCallback60(
|
|
7146
7220
|
async ({
|
|
7147
7221
|
service,
|
|
7148
7222
|
xNode,
|
|
@@ -7169,7 +7243,7 @@ function useViewService() {
|
|
|
7169
7243
|
},
|
|
7170
7244
|
[env]
|
|
7171
7245
|
);
|
|
7172
|
-
const getCity =
|
|
7246
|
+
const getCity = useCallback60(
|
|
7173
7247
|
async ({
|
|
7174
7248
|
service,
|
|
7175
7249
|
xNode,
|
|
@@ -7196,7 +7270,7 @@ function useViewService() {
|
|
|
7196
7270
|
},
|
|
7197
7271
|
[env]
|
|
7198
7272
|
);
|
|
7199
|
-
const getWard =
|
|
7273
|
+
const getWard = useCallback60(
|
|
7200
7274
|
async ({
|
|
7201
7275
|
service,
|
|
7202
7276
|
xNode,
|
|
@@ -7221,7 +7295,7 @@ function useViewService() {
|
|
|
7221
7295
|
},
|
|
7222
7296
|
[env]
|
|
7223
7297
|
);
|
|
7224
|
-
const getPartnerTitle =
|
|
7298
|
+
const getPartnerTitle = useCallback60(
|
|
7225
7299
|
async ({
|
|
7226
7300
|
service,
|
|
7227
7301
|
xNode,
|
|
@@ -7273,10 +7347,10 @@ function useViewService() {
|
|
|
7273
7347
|
}
|
|
7274
7348
|
|
|
7275
7349
|
// src/services/dashboard-service/index.ts
|
|
7276
|
-
import { useCallback as
|
|
7350
|
+
import { useCallback as useCallback61 } from "react";
|
|
7277
7351
|
function useDashboardService() {
|
|
7278
7352
|
const { env } = useEnv();
|
|
7279
|
-
const readGroup =
|
|
7353
|
+
const readGroup = useCallback61(
|
|
7280
7354
|
async ({
|
|
7281
7355
|
service,
|
|
7282
7356
|
xNode,
|
|
@@ -7293,7 +7367,7 @@ function useDashboardService() {
|
|
|
7293
7367
|
},
|
|
7294
7368
|
[env]
|
|
7295
7369
|
);
|
|
7296
|
-
const getDataChart =
|
|
7370
|
+
const getDataChart = useCallback61(
|
|
7297
7371
|
async ({
|
|
7298
7372
|
service,
|
|
7299
7373
|
xNode,
|