@fctc/interface-logic 4.5.0 → 4.5.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/hooks.d.mts +38 -1
- package/dist/hooks.d.ts +38 -1
- package/dist/hooks.js +274 -50
- package/dist/hooks.mjs +269 -50
- package/dist/provider.d.mts +6 -1
- package/dist/provider.d.ts +6 -1
- package/dist/provider.js +291 -72
- package/dist/provider.mjs +280 -61
- package/dist/services.d.mts +42 -0
- package/dist/services.d.ts +42 -0
- package/dist/services.js +305 -102
- package/dist/services.mjs +302 -99
- package/package.json +1 -1
package/dist/provider.js
CHANGED
|
@@ -700,7 +700,7 @@ var MainProvider = ({ children }) => {
|
|
|
700
700
|
};
|
|
701
701
|
|
|
702
702
|
// src/provider/version-gate-provider.tsx
|
|
703
|
-
var
|
|
703
|
+
var import_react50 = require("react");
|
|
704
704
|
var import_react_query2 = require("@tanstack/react-query");
|
|
705
705
|
|
|
706
706
|
// src/services/action-service/index.ts
|
|
@@ -6465,6 +6465,191 @@ var completeCurrentStageService = (env) => {
|
|
|
6465
6465
|
};
|
|
6466
6466
|
};
|
|
6467
6467
|
|
|
6468
|
+
// src/services/pos-service/supabase/add-floor.ts
|
|
6469
|
+
var import_react44 = require("react");
|
|
6470
|
+
var addFloorSupabaseService = () => {
|
|
6471
|
+
const supabase = useSupabaseOptional();
|
|
6472
|
+
const addFloorSupabase = (0, import_react44.useCallback)(
|
|
6473
|
+
async (values) => {
|
|
6474
|
+
if (!supabase) {
|
|
6475
|
+
console.error("Supabase client not initialized");
|
|
6476
|
+
return null;
|
|
6477
|
+
}
|
|
6478
|
+
try {
|
|
6479
|
+
const { data, error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).insert({
|
|
6480
|
+
name: values.name,
|
|
6481
|
+
sequence: values.sequence ?? 1,
|
|
6482
|
+
pos_config_ids: values.pos_config_ids ?? [],
|
|
6483
|
+
table_ids: values.table_ids ?? []
|
|
6484
|
+
}).select("id, name").single();
|
|
6485
|
+
if (error) {
|
|
6486
|
+
console.error("Error adding floor:", error);
|
|
6487
|
+
return null;
|
|
6488
|
+
}
|
|
6489
|
+
return [[data.id, data.name]];
|
|
6490
|
+
} catch (error) {
|
|
6491
|
+
console.error("Error adding floor:", error);
|
|
6492
|
+
return null;
|
|
6493
|
+
}
|
|
6494
|
+
},
|
|
6495
|
+
[supabase]
|
|
6496
|
+
);
|
|
6497
|
+
return {
|
|
6498
|
+
addFloorSupabase
|
|
6499
|
+
};
|
|
6500
|
+
};
|
|
6501
|
+
|
|
6502
|
+
// src/services/pos-service/supabase/add-table.ts
|
|
6503
|
+
var import_react45 = require("react");
|
|
6504
|
+
var addTableSupabaseService = () => {
|
|
6505
|
+
const supabase = useSupabaseOptional();
|
|
6506
|
+
const addTableSupabase = (0, import_react45.useCallback)(
|
|
6507
|
+
async (values) => {
|
|
6508
|
+
if (!supabase) {
|
|
6509
|
+
console.error("Supabase client not initialized");
|
|
6510
|
+
return null;
|
|
6511
|
+
}
|
|
6512
|
+
try {
|
|
6513
|
+
const { data, error } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).insert({
|
|
6514
|
+
floor_id: values.floor_id,
|
|
6515
|
+
table_number: values.table_number ?? 0,
|
|
6516
|
+
seats: values.seats ?? 1
|
|
6517
|
+
}).select("id, table_number").single();
|
|
6518
|
+
if (error) {
|
|
6519
|
+
console.error("Error adding table:", error);
|
|
6520
|
+
return null;
|
|
6521
|
+
}
|
|
6522
|
+
return [[data.id, data.table_number]];
|
|
6523
|
+
} catch (error) {
|
|
6524
|
+
console.error("Error adding table:", error);
|
|
6525
|
+
return null;
|
|
6526
|
+
}
|
|
6527
|
+
},
|
|
6528
|
+
[supabase]
|
|
6529
|
+
);
|
|
6530
|
+
return {
|
|
6531
|
+
addTableSupabase
|
|
6532
|
+
};
|
|
6533
|
+
};
|
|
6534
|
+
|
|
6535
|
+
// src/services/pos-service/supabase/update-floor.ts
|
|
6536
|
+
var import_react46 = require("react");
|
|
6537
|
+
var updateFloorSupabaseService = () => {
|
|
6538
|
+
const supabase = useSupabaseOptional();
|
|
6539
|
+
const updateFloorSupabase = (0, import_react46.useCallback)(
|
|
6540
|
+
async (values) => {
|
|
6541
|
+
if (!supabase) {
|
|
6542
|
+
console.error("Supabase client not initialized");
|
|
6543
|
+
return false;
|
|
6544
|
+
}
|
|
6545
|
+
try {
|
|
6546
|
+
const { id, ...updateData } = values;
|
|
6547
|
+
const { error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).update(updateData).eq("id", id);
|
|
6548
|
+
if (error) {
|
|
6549
|
+
console.error("Error updating floor:", error);
|
|
6550
|
+
return false;
|
|
6551
|
+
}
|
|
6552
|
+
return true;
|
|
6553
|
+
} catch (error) {
|
|
6554
|
+
console.error("Error updating floor:", error);
|
|
6555
|
+
return false;
|
|
6556
|
+
}
|
|
6557
|
+
},
|
|
6558
|
+
[supabase]
|
|
6559
|
+
);
|
|
6560
|
+
return {
|
|
6561
|
+
updateFloorSupabase
|
|
6562
|
+
};
|
|
6563
|
+
};
|
|
6564
|
+
|
|
6565
|
+
// src/services/pos-service/supabase/update-table.ts
|
|
6566
|
+
var import_react47 = require("react");
|
|
6567
|
+
var updateTableSupabaseService = () => {
|
|
6568
|
+
const supabase = useSupabaseOptional();
|
|
6569
|
+
const updateTableSupabase = (0, import_react47.useCallback)(
|
|
6570
|
+
async (values) => {
|
|
6571
|
+
if (!supabase) {
|
|
6572
|
+
console.error("Supabase client not initialized");
|
|
6573
|
+
return false;
|
|
6574
|
+
}
|
|
6575
|
+
try {
|
|
6576
|
+
const { id, ...updateData } = values;
|
|
6577
|
+
const { error } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).update(updateData).eq("id", id);
|
|
6578
|
+
if (error) {
|
|
6579
|
+
console.error("Error updating table:", error);
|
|
6580
|
+
return false;
|
|
6581
|
+
}
|
|
6582
|
+
return true;
|
|
6583
|
+
} catch (error) {
|
|
6584
|
+
console.error("Error updating table:", error);
|
|
6585
|
+
return false;
|
|
6586
|
+
}
|
|
6587
|
+
},
|
|
6588
|
+
[supabase]
|
|
6589
|
+
);
|
|
6590
|
+
return {
|
|
6591
|
+
updateTableSupabase
|
|
6592
|
+
};
|
|
6593
|
+
};
|
|
6594
|
+
|
|
6595
|
+
// src/services/pos-service/supabase/delete-floor.ts
|
|
6596
|
+
var import_react48 = require("react");
|
|
6597
|
+
var deleteFloorSupabaseService = () => {
|
|
6598
|
+
const supabase = useSupabaseOptional();
|
|
6599
|
+
const deleteFloorSupabase = (0, import_react48.useCallback)(
|
|
6600
|
+
async (values) => {
|
|
6601
|
+
if (!supabase) {
|
|
6602
|
+
console.error("Supabase client not initialized");
|
|
6603
|
+
return false;
|
|
6604
|
+
}
|
|
6605
|
+
try {
|
|
6606
|
+
const { error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).delete().eq("id", values.id);
|
|
6607
|
+
if (error) {
|
|
6608
|
+
console.error("Error deleting floor:", error);
|
|
6609
|
+
return false;
|
|
6610
|
+
}
|
|
6611
|
+
return true;
|
|
6612
|
+
} catch (error) {
|
|
6613
|
+
console.error("Error deleting floor:", error);
|
|
6614
|
+
return false;
|
|
6615
|
+
}
|
|
6616
|
+
},
|
|
6617
|
+
[supabase]
|
|
6618
|
+
);
|
|
6619
|
+
return {
|
|
6620
|
+
deleteFloorSupabase
|
|
6621
|
+
};
|
|
6622
|
+
};
|
|
6623
|
+
|
|
6624
|
+
// src/services/pos-service/supabase/delete-table.ts
|
|
6625
|
+
var import_react49 = require("react");
|
|
6626
|
+
var deleteTableSupabaseService = () => {
|
|
6627
|
+
const supabase = useSupabaseOptional();
|
|
6628
|
+
const deleteTableSupabase = (0, import_react49.useCallback)(
|
|
6629
|
+
async (values) => {
|
|
6630
|
+
if (!supabase) {
|
|
6631
|
+
console.error("Supabase client not initialized");
|
|
6632
|
+
return false;
|
|
6633
|
+
}
|
|
6634
|
+
try {
|
|
6635
|
+
const { error } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).delete().eq("id", values.id);
|
|
6636
|
+
if (error) {
|
|
6637
|
+
console.error("Error deleting table:", error);
|
|
6638
|
+
return false;
|
|
6639
|
+
}
|
|
6640
|
+
return true;
|
|
6641
|
+
} catch (error) {
|
|
6642
|
+
console.error("Error deleting table:", error);
|
|
6643
|
+
return false;
|
|
6644
|
+
}
|
|
6645
|
+
},
|
|
6646
|
+
[supabase]
|
|
6647
|
+
);
|
|
6648
|
+
return {
|
|
6649
|
+
deleteTableSupabase
|
|
6650
|
+
};
|
|
6651
|
+
};
|
|
6652
|
+
|
|
6468
6653
|
// src/services/pos-service/index.ts
|
|
6469
6654
|
var serviceFactories = [
|
|
6470
6655
|
addEntityService,
|
|
@@ -6496,7 +6681,13 @@ var serviceFactories = [
|
|
|
6496
6681
|
updateClosedSessionService,
|
|
6497
6682
|
updateEntityService,
|
|
6498
6683
|
updateOrderStatusService,
|
|
6499
|
-
completeCurrentStageService
|
|
6684
|
+
completeCurrentStageService,
|
|
6685
|
+
addFloorSupabaseService,
|
|
6686
|
+
addTableSupabaseService,
|
|
6687
|
+
updateFloorSupabaseService,
|
|
6688
|
+
updateTableSupabaseService,
|
|
6689
|
+
deleteFloorSupabaseService,
|
|
6690
|
+
deleteTableSupabaseService
|
|
6500
6691
|
];
|
|
6501
6692
|
var usePosService = () => {
|
|
6502
6693
|
const { env } = useEnv();
|
|
@@ -6512,9 +6703,9 @@ var usePosService = () => {
|
|
|
6512
6703
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
6513
6704
|
var VersionGate = ({ children }) => {
|
|
6514
6705
|
const queryClient = (0, import_react_query2.useQueryClient)();
|
|
6515
|
-
const [ready, setReady] = (0,
|
|
6706
|
+
const [ready, setReady] = (0, import_react50.useState)(false);
|
|
6516
6707
|
const { getVersion } = useViewService();
|
|
6517
|
-
(0,
|
|
6708
|
+
(0, import_react50.useEffect)(() => {
|
|
6518
6709
|
const clearVersion = () => {
|
|
6519
6710
|
queryClient.clear();
|
|
6520
6711
|
localStorage.removeItem("__api_version__");
|
|
@@ -6545,7 +6736,7 @@ var VersionGate = ({ children }) => {
|
|
|
6545
6736
|
};
|
|
6546
6737
|
|
|
6547
6738
|
// src/provider/env-provider.tsx
|
|
6548
|
-
var
|
|
6739
|
+
var import_react51 = require("react");
|
|
6549
6740
|
|
|
6550
6741
|
// src/configs/axios-client.ts
|
|
6551
6742
|
var import_axios = __toESM(require("axios"));
|
|
@@ -6898,18 +7089,18 @@ var initialEnvState = {
|
|
|
6898
7089
|
excludeLanguages: [],
|
|
6899
7090
|
isSupaMode: false
|
|
6900
7091
|
};
|
|
6901
|
-
var EnvContext = (0,
|
|
7092
|
+
var EnvContext = (0, import_react51.createContext)(null);
|
|
6902
7093
|
function EnvProvider({
|
|
6903
7094
|
children,
|
|
6904
7095
|
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
6905
7096
|
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils
|
|
6906
7097
|
}) {
|
|
6907
|
-
const [env, setEnvState] = (0,
|
|
7098
|
+
const [env, setEnvState] = (0, import_react51.useState)({
|
|
6908
7099
|
...initialEnvState,
|
|
6909
7100
|
localStorageUtils: localStorageUtil,
|
|
6910
7101
|
sessionStorageUtils: sessionStorageUtil
|
|
6911
7102
|
});
|
|
6912
|
-
const setupEnv = (0,
|
|
7103
|
+
const setupEnv = (0, import_react51.useCallback)(
|
|
6913
7104
|
(envConfig) => {
|
|
6914
7105
|
const updatedEnv = {
|
|
6915
7106
|
...env,
|
|
@@ -6923,31 +7114,31 @@ function EnvProvider({
|
|
|
6923
7114
|
},
|
|
6924
7115
|
[env, localStorageUtil, sessionStorageUtil]
|
|
6925
7116
|
);
|
|
6926
|
-
const setUid2 = (0,
|
|
7117
|
+
const setUid2 = (0, import_react51.useCallback)((uid) => {
|
|
6927
7118
|
setEnvState((prev) => ({
|
|
6928
7119
|
...prev,
|
|
6929
7120
|
context: { ...prev.context, uid }
|
|
6930
7121
|
}));
|
|
6931
7122
|
}, []);
|
|
6932
|
-
const setLang2 = (0,
|
|
7123
|
+
const setLang2 = (0, import_react51.useCallback)((lang) => {
|
|
6933
7124
|
setEnvState((prev) => ({
|
|
6934
7125
|
...prev,
|
|
6935
7126
|
context: { ...prev.context, lang }
|
|
6936
7127
|
}));
|
|
6937
7128
|
}, []);
|
|
6938
|
-
const setAllowCompanies2 = (0,
|
|
7129
|
+
const setAllowCompanies2 = (0, import_react51.useCallback)((allowed_company_ids) => {
|
|
6939
7130
|
setEnvState((prev) => ({
|
|
6940
7131
|
...prev,
|
|
6941
7132
|
context: { ...prev.context, allowed_company_ids }
|
|
6942
7133
|
}));
|
|
6943
7134
|
}, []);
|
|
6944
|
-
const setCompanies2 = (0,
|
|
7135
|
+
const setCompanies2 = (0, import_react51.useCallback)((companies) => {
|
|
6945
7136
|
setEnvState((prev) => ({
|
|
6946
7137
|
...prev,
|
|
6947
7138
|
companies
|
|
6948
7139
|
}));
|
|
6949
7140
|
}, []);
|
|
6950
|
-
const setDefaultCompany2 = (0,
|
|
7141
|
+
const setDefaultCompany2 = (0, import_react51.useCallback)(
|
|
6951
7142
|
(defaultCompany) => {
|
|
6952
7143
|
setEnvState((prev) => ({
|
|
6953
7144
|
...prev,
|
|
@@ -6956,19 +7147,19 @@ function EnvProvider({
|
|
|
6956
7147
|
},
|
|
6957
7148
|
[]
|
|
6958
7149
|
);
|
|
6959
|
-
const setUserInfo = (0,
|
|
7150
|
+
const setUserInfo = (0, import_react51.useCallback)((user) => {
|
|
6960
7151
|
setEnvState((prev) => ({
|
|
6961
7152
|
...prev,
|
|
6962
7153
|
user
|
|
6963
7154
|
}));
|
|
6964
7155
|
}, []);
|
|
6965
|
-
const setConfig2 = (0,
|
|
7156
|
+
const setConfig2 = (0, import_react51.useCallback)((config) => {
|
|
6966
7157
|
setEnvState((prev) => ({
|
|
6967
7158
|
...prev,
|
|
6968
7159
|
config
|
|
6969
7160
|
}));
|
|
6970
7161
|
}, []);
|
|
6971
|
-
const setEnvFile2 = (0,
|
|
7162
|
+
const setEnvFile2 = (0, import_react51.useCallback)((envFile) => {
|
|
6972
7163
|
setEnvState((prev) => ({
|
|
6973
7164
|
...prev,
|
|
6974
7165
|
envFile
|
|
@@ -6994,7 +7185,7 @@ function EnvProvider({
|
|
|
6994
7185
|
);
|
|
6995
7186
|
}
|
|
6996
7187
|
function useEnv() {
|
|
6997
|
-
const context = (0,
|
|
7188
|
+
const context = (0, import_react51.useContext)(EnvContext);
|
|
6998
7189
|
if (!context) {
|
|
6999
7190
|
throw new Error("useEnv must be used within an EnvProvider");
|
|
7000
7191
|
}
|
|
@@ -7002,7 +7193,7 @@ function useEnv() {
|
|
|
7002
7193
|
}
|
|
7003
7194
|
|
|
7004
7195
|
// src/provider/service-provider.tsx
|
|
7005
|
-
var
|
|
7196
|
+
var import_react54 = require("react");
|
|
7006
7197
|
|
|
7007
7198
|
// src/hooks/auth/use-forgot-password.ts
|
|
7008
7199
|
var import_react_query3 = require("@tanstack/react-query");
|
|
@@ -7889,9 +8080,9 @@ var BaseModel = class {
|
|
|
7889
8080
|
};
|
|
7890
8081
|
|
|
7891
8082
|
// src/hooks/model/use-model.ts
|
|
7892
|
-
var
|
|
8083
|
+
var import_react52 = require("react");
|
|
7893
8084
|
var useModel = () => {
|
|
7894
|
-
const initModel = (0,
|
|
8085
|
+
const initModel = (0, import_react52.useCallback)((modelData) => {
|
|
7895
8086
|
switch (modelData?.name) {
|
|
7896
8087
|
default:
|
|
7897
8088
|
return new BaseModel(modelData);
|
|
@@ -9008,70 +9199,43 @@ var use_complete_current_stage_default = useCompleteCurrentStage;
|
|
|
9008
9199
|
// src/hooks/pos/supabase/use-add-floor.ts
|
|
9009
9200
|
var import_react_query115 = require("@tanstack/react-query");
|
|
9010
9201
|
|
|
9011
|
-
// src/services/pos-service/supabase/
|
|
9012
|
-
var
|
|
9013
|
-
var
|
|
9014
|
-
const supabase = useSupabaseOptional();
|
|
9015
|
-
const addFloorSupabase = (0, import_react47.useCallback)(
|
|
9016
|
-
async (values) => {
|
|
9017
|
-
if (!supabase) {
|
|
9018
|
-
console.error("Supabase client not initialized");
|
|
9019
|
-
return null;
|
|
9020
|
-
}
|
|
9021
|
-
try {
|
|
9022
|
-
const { data, error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).insert({
|
|
9023
|
-
name: values.name,
|
|
9024
|
-
sequence: values.sequence ?? 1,
|
|
9025
|
-
pos_config_ids: values.pos_config_ids ?? [],
|
|
9026
|
-
table_ids: values.table_ids ?? []
|
|
9027
|
-
}).select("id, name").single();
|
|
9028
|
-
if (error) {
|
|
9029
|
-
console.error("Error adding floor:", error);
|
|
9030
|
-
return null;
|
|
9031
|
-
}
|
|
9032
|
-
return [[data.id, data.name]];
|
|
9033
|
-
} catch (error) {
|
|
9034
|
-
console.error("Error adding floor:", error);
|
|
9035
|
-
return null;
|
|
9036
|
-
}
|
|
9037
|
-
},
|
|
9038
|
-
[supabase]
|
|
9039
|
-
);
|
|
9040
|
-
return {
|
|
9041
|
-
addFloorSupabase
|
|
9042
|
-
};
|
|
9043
|
-
};
|
|
9044
|
-
|
|
9045
|
-
// src/services/pos-service/supabase/add-table.ts
|
|
9046
|
-
var import_react48 = require("react");
|
|
9047
|
-
var addTableSupabaseService = () => {
|
|
9202
|
+
// src/services/pos-service/supabase/create-order.ts
|
|
9203
|
+
var import_react53 = require("react");
|
|
9204
|
+
var createOrderSupabaseService = () => {
|
|
9048
9205
|
const supabase = useSupabaseOptional();
|
|
9049
|
-
const
|
|
9206
|
+
const createOrderSupabase = (0, import_react53.useCallback)(
|
|
9050
9207
|
async (values) => {
|
|
9051
9208
|
if (!supabase) {
|
|
9052
9209
|
console.error("Supabase client not initialized");
|
|
9053
9210
|
return null;
|
|
9054
9211
|
}
|
|
9055
9212
|
try {
|
|
9056
|
-
const { data, error } = await supabase.from("
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9213
|
+
const { data, error } = await supabase.from("orders" /* ORDERS */).insert({
|
|
9214
|
+
name: values.pos_reference,
|
|
9215
|
+
date_order: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9216
|
+
session_id: values.session_id,
|
|
9217
|
+
pos_reference: values.pos_reference,
|
|
9218
|
+
amount_tax: values.amount_tax,
|
|
9219
|
+
amount_total: values.amount_total,
|
|
9220
|
+
amount_paid: values.amount_paid,
|
|
9221
|
+
amount_return: values.amount_return,
|
|
9222
|
+
table_id: values.table_id,
|
|
9223
|
+
partner_id: values.partner_id
|
|
9224
|
+
}).select("id, pos_reference").single();
|
|
9061
9225
|
if (error) {
|
|
9062
|
-
console.error("Error
|
|
9226
|
+
console.error("Error creating order:", error);
|
|
9063
9227
|
return null;
|
|
9064
9228
|
}
|
|
9065
|
-
return [[data.id, data.
|
|
9229
|
+
return [[data.id, data.pos_reference]];
|
|
9066
9230
|
} catch (error) {
|
|
9067
|
-
console.error("Error
|
|
9231
|
+
console.error("Error creating order:", error);
|
|
9068
9232
|
return null;
|
|
9069
9233
|
}
|
|
9070
9234
|
},
|
|
9071
9235
|
[supabase]
|
|
9072
9236
|
);
|
|
9073
9237
|
return {
|
|
9074
|
-
|
|
9238
|
+
createOrderSupabase
|
|
9075
9239
|
};
|
|
9076
9240
|
};
|
|
9077
9241
|
|
|
@@ -9094,9 +9258,59 @@ var useAddTable = () => {
|
|
|
9094
9258
|
};
|
|
9095
9259
|
var use_add_table_default = useAddTable;
|
|
9096
9260
|
|
|
9261
|
+
// src/hooks/pos/supabase/use-update-floor.ts
|
|
9262
|
+
var import_react_query117 = require("@tanstack/react-query");
|
|
9263
|
+
var useUpdateFloor = () => {
|
|
9264
|
+
const { updateFloorSupabase } = updateFloorSupabaseService();
|
|
9265
|
+
return (0, import_react_query117.useMutation)({
|
|
9266
|
+
mutationFn: updateFloorSupabase
|
|
9267
|
+
});
|
|
9268
|
+
};
|
|
9269
|
+
var use_update_floor_default = useUpdateFloor;
|
|
9270
|
+
|
|
9271
|
+
// src/hooks/pos/supabase/use-update-table.ts
|
|
9272
|
+
var import_react_query118 = require("@tanstack/react-query");
|
|
9273
|
+
var useUpdateTable = () => {
|
|
9274
|
+
const { updateTableSupabase } = updateTableSupabaseService();
|
|
9275
|
+
return (0, import_react_query118.useMutation)({
|
|
9276
|
+
mutationFn: updateTableSupabase
|
|
9277
|
+
});
|
|
9278
|
+
};
|
|
9279
|
+
var use_update_table_default = useUpdateTable;
|
|
9280
|
+
|
|
9281
|
+
// src/hooks/pos/supabase/use-delete-floor.ts
|
|
9282
|
+
var import_react_query119 = require("@tanstack/react-query");
|
|
9283
|
+
var useDeleteFloor = () => {
|
|
9284
|
+
const { deleteFloorSupabase } = deleteFloorSupabaseService();
|
|
9285
|
+
return (0, import_react_query119.useMutation)({
|
|
9286
|
+
mutationFn: deleteFloorSupabase
|
|
9287
|
+
});
|
|
9288
|
+
};
|
|
9289
|
+
var use_delete_floor_default = useDeleteFloor;
|
|
9290
|
+
|
|
9291
|
+
// src/hooks/pos/supabase/use-delete-table.ts
|
|
9292
|
+
var import_react_query120 = require("@tanstack/react-query");
|
|
9293
|
+
var useDeleteTable = () => {
|
|
9294
|
+
const { deleteTableSupabase } = deleteTableSupabaseService();
|
|
9295
|
+
return (0, import_react_query120.useMutation)({
|
|
9296
|
+
mutationFn: deleteTableSupabase
|
|
9297
|
+
});
|
|
9298
|
+
};
|
|
9299
|
+
var use_delete_table_default = useDeleteTable;
|
|
9300
|
+
|
|
9301
|
+
// src/hooks/pos/supabase/use-create-order.ts
|
|
9302
|
+
var import_react_query121 = require("@tanstack/react-query");
|
|
9303
|
+
var useCreateOrder = () => {
|
|
9304
|
+
const { createOrderSupabase } = createOrderSupabaseService();
|
|
9305
|
+
return (0, import_react_query121.useMutation)({
|
|
9306
|
+
mutationFn: createOrderSupabase
|
|
9307
|
+
});
|
|
9308
|
+
};
|
|
9309
|
+
var use_create_order_default = useCreateOrder;
|
|
9310
|
+
|
|
9097
9311
|
// src/provider/service-provider.tsx
|
|
9098
9312
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
9099
|
-
var ServiceContext = (0,
|
|
9313
|
+
var ServiceContext = (0, import_react54.createContext)(null);
|
|
9100
9314
|
var ServiceProvider = ({
|
|
9101
9315
|
children
|
|
9102
9316
|
}) => {
|
|
@@ -9216,12 +9430,17 @@ var ServiceProvider = ({
|
|
|
9216
9430
|
useCompleteCurrentStage: use_complete_current_stage_default,
|
|
9217
9431
|
useLoginSupa: use_login_supa_default,
|
|
9218
9432
|
useAddFloor: use_add_floor_default,
|
|
9219
|
-
useAddTable: use_add_table_default
|
|
9433
|
+
useAddTable: use_add_table_default,
|
|
9434
|
+
useDeleteFloor: use_delete_floor_default,
|
|
9435
|
+
useDeleteTable: use_delete_table_default,
|
|
9436
|
+
useUpdateFloor: use_update_floor_default,
|
|
9437
|
+
useUpdateTable: use_update_table_default,
|
|
9438
|
+
useCreateOrder: use_create_order_default
|
|
9220
9439
|
};
|
|
9221
9440
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ServiceContext.Provider, { value: services, children });
|
|
9222
9441
|
};
|
|
9223
9442
|
var useService = () => {
|
|
9224
|
-
const context = (0,
|
|
9443
|
+
const context = (0, import_react54.useContext)(ServiceContext);
|
|
9225
9444
|
if (!context) {
|
|
9226
9445
|
throw new Error("useService must be used within a ServiceProvider");
|
|
9227
9446
|
}
|
|
@@ -9229,7 +9448,7 @@ var useService = () => {
|
|
|
9229
9448
|
};
|
|
9230
9449
|
|
|
9231
9450
|
// src/provider/meta-provider.tsx
|
|
9232
|
-
var
|
|
9451
|
+
var import_react55 = require("react");
|
|
9233
9452
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
9234
9453
|
var MetaProvider = ({ children }) => {
|
|
9235
9454
|
const { env } = useEnv();
|
|
@@ -9278,7 +9497,7 @@ var MetaProvider = ({ children }) => {
|
|
|
9278
9497
|
}
|
|
9279
9498
|
}
|
|
9280
9499
|
}
|
|
9281
|
-
(0,
|
|
9500
|
+
(0, import_react55.useEffect)(() => {
|
|
9282
9501
|
updateMetadata();
|
|
9283
9502
|
}, [env?.defaultCompany]);
|
|
9284
9503
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|