@fctc/interface-logic 4.5.0 → 4.5.1
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 +27 -1
- package/dist/hooks.d.ts +27 -1
- package/dist/hooks.js +242 -72
- package/dist/hooks.mjs +238 -72
- package/dist/provider.d.mts +5 -1
- package/dist/provider.d.ts +5 -1
- package/dist/provider.js +260 -94
- package/dist/provider.mjs +249 -83
- package/dist/services.d.mts +42 -0
- package/dist/services.d.ts +42 -0
- package/dist/services.js +300 -103
- package/dist/services.mjs +297 -100
- 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_react53 = 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);
|
|
@@ -9007,75 +9198,6 @@ var use_complete_current_stage_default = useCompleteCurrentStage;
|
|
|
9007
9198
|
|
|
9008
9199
|
// src/hooks/pos/supabase/use-add-floor.ts
|
|
9009
9200
|
var import_react_query115 = require("@tanstack/react-query");
|
|
9010
|
-
|
|
9011
|
-
// src/services/pos-service/supabase/add-floor.ts
|
|
9012
|
-
var import_react47 = require("react");
|
|
9013
|
-
var addFloorSupabaseService = () => {
|
|
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 = () => {
|
|
9048
|
-
const supabase = useSupabaseOptional();
|
|
9049
|
-
const addTableSupabase = (0, import_react48.useCallback)(
|
|
9050
|
-
async (values) => {
|
|
9051
|
-
if (!supabase) {
|
|
9052
|
-
console.error("Supabase client not initialized");
|
|
9053
|
-
return null;
|
|
9054
|
-
}
|
|
9055
|
-
try {
|
|
9056
|
-
const { data, error } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).insert({
|
|
9057
|
-
floor_id: values.floor_id,
|
|
9058
|
-
table_number: values.table_number ?? 0,
|
|
9059
|
-
seats: values.seats ?? 1
|
|
9060
|
-
}).select("id, table_number").single();
|
|
9061
|
-
if (error) {
|
|
9062
|
-
console.error("Error adding table:", error);
|
|
9063
|
-
return null;
|
|
9064
|
-
}
|
|
9065
|
-
return [[data.id, data.table_number]];
|
|
9066
|
-
} catch (error) {
|
|
9067
|
-
console.error("Error adding table:", error);
|
|
9068
|
-
return null;
|
|
9069
|
-
}
|
|
9070
|
-
},
|
|
9071
|
-
[supabase]
|
|
9072
|
-
);
|
|
9073
|
-
return {
|
|
9074
|
-
addTableSupabase
|
|
9075
|
-
};
|
|
9076
|
-
};
|
|
9077
|
-
|
|
9078
|
-
// src/hooks/pos/supabase/use-add-floor.ts
|
|
9079
9201
|
var useAddFloor = () => {
|
|
9080
9202
|
const { addFloorSupabase } = addFloorSupabaseService();
|
|
9081
9203
|
return (0, import_react_query115.useMutation)({
|
|
@@ -9094,9 +9216,49 @@ var useAddTable = () => {
|
|
|
9094
9216
|
};
|
|
9095
9217
|
var use_add_table_default = useAddTable;
|
|
9096
9218
|
|
|
9219
|
+
// src/hooks/pos/supabase/use-update-floor.ts
|
|
9220
|
+
var import_react_query117 = require("@tanstack/react-query");
|
|
9221
|
+
var useUpdateFloor = () => {
|
|
9222
|
+
const { updateFloorSupabase } = updateFloorSupabaseService();
|
|
9223
|
+
return (0, import_react_query117.useMutation)({
|
|
9224
|
+
mutationFn: updateFloorSupabase
|
|
9225
|
+
});
|
|
9226
|
+
};
|
|
9227
|
+
var use_update_floor_default = useUpdateFloor;
|
|
9228
|
+
|
|
9229
|
+
// src/hooks/pos/supabase/use-update-table.ts
|
|
9230
|
+
var import_react_query118 = require("@tanstack/react-query");
|
|
9231
|
+
var useUpdateTable = () => {
|
|
9232
|
+
const { updateTableSupabase } = updateTableSupabaseService();
|
|
9233
|
+
return (0, import_react_query118.useMutation)({
|
|
9234
|
+
mutationFn: updateTableSupabase
|
|
9235
|
+
});
|
|
9236
|
+
};
|
|
9237
|
+
var use_update_table_default = useUpdateTable;
|
|
9238
|
+
|
|
9239
|
+
// src/hooks/pos/supabase/use-delete-floor.ts
|
|
9240
|
+
var import_react_query119 = require("@tanstack/react-query");
|
|
9241
|
+
var useDeleteFloor = () => {
|
|
9242
|
+
const { deleteFloorSupabase } = deleteFloorSupabaseService();
|
|
9243
|
+
return (0, import_react_query119.useMutation)({
|
|
9244
|
+
mutationFn: deleteFloorSupabase
|
|
9245
|
+
});
|
|
9246
|
+
};
|
|
9247
|
+
var use_delete_floor_default = useDeleteFloor;
|
|
9248
|
+
|
|
9249
|
+
// src/hooks/pos/supabase/use-delete-table.ts
|
|
9250
|
+
var import_react_query120 = require("@tanstack/react-query");
|
|
9251
|
+
var useDeleteTable = () => {
|
|
9252
|
+
const { deleteTableSupabase } = deleteTableSupabaseService();
|
|
9253
|
+
return (0, import_react_query120.useMutation)({
|
|
9254
|
+
mutationFn: deleteTableSupabase
|
|
9255
|
+
});
|
|
9256
|
+
};
|
|
9257
|
+
var use_delete_table_default = useDeleteTable;
|
|
9258
|
+
|
|
9097
9259
|
// src/provider/service-provider.tsx
|
|
9098
9260
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
9099
|
-
var ServiceContext = (0,
|
|
9261
|
+
var ServiceContext = (0, import_react53.createContext)(null);
|
|
9100
9262
|
var ServiceProvider = ({
|
|
9101
9263
|
children
|
|
9102
9264
|
}) => {
|
|
@@ -9216,12 +9378,16 @@ var ServiceProvider = ({
|
|
|
9216
9378
|
useCompleteCurrentStage: use_complete_current_stage_default,
|
|
9217
9379
|
useLoginSupa: use_login_supa_default,
|
|
9218
9380
|
useAddFloor: use_add_floor_default,
|
|
9219
|
-
useAddTable: use_add_table_default
|
|
9381
|
+
useAddTable: use_add_table_default,
|
|
9382
|
+
useDeleteFloor: use_delete_floor_default,
|
|
9383
|
+
useDeleteTable: use_delete_table_default,
|
|
9384
|
+
useUpdateFloor: use_update_floor_default,
|
|
9385
|
+
useUpdateTable: use_update_table_default
|
|
9220
9386
|
};
|
|
9221
9387
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ServiceContext.Provider, { value: services, children });
|
|
9222
9388
|
};
|
|
9223
9389
|
var useService = () => {
|
|
9224
|
-
const context = (0,
|
|
9390
|
+
const context = (0, import_react53.useContext)(ServiceContext);
|
|
9225
9391
|
if (!context) {
|
|
9226
9392
|
throw new Error("useService must be used within a ServiceProvider");
|
|
9227
9393
|
}
|
|
@@ -9229,7 +9395,7 @@ var useService = () => {
|
|
|
9229
9395
|
};
|
|
9230
9396
|
|
|
9231
9397
|
// src/provider/meta-provider.tsx
|
|
9232
|
-
var
|
|
9398
|
+
var import_react54 = require("react");
|
|
9233
9399
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
9234
9400
|
var MetaProvider = ({ children }) => {
|
|
9235
9401
|
const { env } = useEnv();
|
|
@@ -9278,7 +9444,7 @@ var MetaProvider = ({ children }) => {
|
|
|
9278
9444
|
}
|
|
9279
9445
|
}
|
|
9280
9446
|
}
|
|
9281
|
-
(0,
|
|
9447
|
+
(0, import_react54.useEffect)(() => {
|
|
9282
9448
|
updateMetadata();
|
|
9283
9449
|
}, [env?.defaultCompany]);
|
|
9284
9450
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|