@fctc/interface-logic 5.4.4 → 5.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-KNKM7FIC.js → chunk-BDDF7KXT.js} +342 -975
- package/dist/{chunk-242W3QUZ.mjs → chunk-VIPA4WIY.mjs} +318 -951
- package/dist/hooks.d.mts +50 -207
- package/dist/hooks.d.ts +50 -207
- package/dist/hooks.js +159 -159
- package/dist/hooks.mjs +1 -1
- package/dist/index.js +180 -180
- package/dist/index.mjs +1 -1
- package/dist/provider.d.mts +3 -3
- package/dist/provider.d.ts +3 -3
- package/dist/provider.js +11 -11
- package/dist/provider.mjs +1 -1
- package/dist/services.d.mts +5 -206
- package/dist/services.d.ts +5 -206
- package/dist/services.js +12 -12
- package/dist/services.mjs +1 -1
- package/package.json +1 -1
|
@@ -3694,465 +3694,6 @@ var getBankProductChannelService = (env) => {
|
|
|
3694
3694
|
getBankProductChannel
|
|
3695
3695
|
};
|
|
3696
3696
|
};
|
|
3697
|
-
var addFloorSupabaseService = () => {
|
|
3698
|
-
const supabase = useSupabaseOptional();
|
|
3699
|
-
const addFloorSupabase = react.useCallback(
|
|
3700
|
-
async (values) => {
|
|
3701
|
-
if (!supabase) {
|
|
3702
|
-
console.error("Supabase client not initialized");
|
|
3703
|
-
return null;
|
|
3704
|
-
}
|
|
3705
|
-
try {
|
|
3706
|
-
const { data, error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).insert({
|
|
3707
|
-
name: values.name,
|
|
3708
|
-
sequence: values.sequence ?? 1,
|
|
3709
|
-
pos_config_ids: values.pos_config_ids ?? [],
|
|
3710
|
-
table_ids: values.table_ids ?? []
|
|
3711
|
-
}).select("id, name").single();
|
|
3712
|
-
if (error) {
|
|
3713
|
-
console.error("Error adding floor:", error);
|
|
3714
|
-
return null;
|
|
3715
|
-
}
|
|
3716
|
-
return [[data.id, data.name]];
|
|
3717
|
-
} catch (error) {
|
|
3718
|
-
console.error("Error adding floor:", error);
|
|
3719
|
-
return null;
|
|
3720
|
-
}
|
|
3721
|
-
},
|
|
3722
|
-
[supabase]
|
|
3723
|
-
);
|
|
3724
|
-
return {
|
|
3725
|
-
addFloorSupabase
|
|
3726
|
-
};
|
|
3727
|
-
};
|
|
3728
|
-
var addTableSupabaseService = () => {
|
|
3729
|
-
const supabase = useSupabaseOptional();
|
|
3730
|
-
const addTableSupabase = react.useCallback(
|
|
3731
|
-
async (values) => {
|
|
3732
|
-
if (!supabase) {
|
|
3733
|
-
console.error("Supabase client not initialized");
|
|
3734
|
-
return null;
|
|
3735
|
-
}
|
|
3736
|
-
try {
|
|
3737
|
-
const { data, error } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).insert({
|
|
3738
|
-
floor_id: values.floor_id,
|
|
3739
|
-
table_number: values.table_number ?? 0,
|
|
3740
|
-
seats: values.seats ?? 1
|
|
3741
|
-
}).select("id, table_number").single();
|
|
3742
|
-
if (error) {
|
|
3743
|
-
console.error("Error adding table:", error);
|
|
3744
|
-
return null;
|
|
3745
|
-
}
|
|
3746
|
-
return [[data.id, data.table_number]];
|
|
3747
|
-
} catch (error) {
|
|
3748
|
-
console.error("Error adding table:", error);
|
|
3749
|
-
return null;
|
|
3750
|
-
}
|
|
3751
|
-
},
|
|
3752
|
-
[supabase]
|
|
3753
|
-
);
|
|
3754
|
-
return {
|
|
3755
|
-
addTableSupabase
|
|
3756
|
-
};
|
|
3757
|
-
};
|
|
3758
|
-
var updateFloorSupabaseService = () => {
|
|
3759
|
-
const supabase = useSupabaseOptional();
|
|
3760
|
-
const updateFloorSupabase = react.useCallback(
|
|
3761
|
-
async (values) => {
|
|
3762
|
-
if (!supabase) {
|
|
3763
|
-
console.error("Supabase client not initialized");
|
|
3764
|
-
return [];
|
|
3765
|
-
}
|
|
3766
|
-
try {
|
|
3767
|
-
const { id, ...updateData } = values;
|
|
3768
|
-
const { error, data } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).update(updateData).eq("id", id).select("id").single();
|
|
3769
|
-
if (error) {
|
|
3770
|
-
console.error("Error updating floor:", error);
|
|
3771
|
-
return [];
|
|
3772
|
-
}
|
|
3773
|
-
return [data.id];
|
|
3774
|
-
} catch (error) {
|
|
3775
|
-
console.error("Error updating floor:", error);
|
|
3776
|
-
return [];
|
|
3777
|
-
}
|
|
3778
|
-
},
|
|
3779
|
-
[supabase]
|
|
3780
|
-
);
|
|
3781
|
-
return {
|
|
3782
|
-
updateFloorSupabase
|
|
3783
|
-
};
|
|
3784
|
-
};
|
|
3785
|
-
var updateTableSupabaseService = () => {
|
|
3786
|
-
const supabase = useSupabaseOptional();
|
|
3787
|
-
const updateTableSupabase = react.useCallback(
|
|
3788
|
-
async (values) => {
|
|
3789
|
-
if (!supabase) {
|
|
3790
|
-
console.error("Supabase client not initialized");
|
|
3791
|
-
return [];
|
|
3792
|
-
}
|
|
3793
|
-
try {
|
|
3794
|
-
const { id, ...updateData } = values;
|
|
3795
|
-
const { error, data } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).update(updateData).eq("id", id).select("id").single();
|
|
3796
|
-
if (error) {
|
|
3797
|
-
console.error("Error updating table:", error);
|
|
3798
|
-
return [];
|
|
3799
|
-
}
|
|
3800
|
-
return [data.id];
|
|
3801
|
-
} catch (error) {
|
|
3802
|
-
console.error("Error updating table:", error);
|
|
3803
|
-
return [];
|
|
3804
|
-
}
|
|
3805
|
-
},
|
|
3806
|
-
[supabase]
|
|
3807
|
-
);
|
|
3808
|
-
return {
|
|
3809
|
-
updateTableSupabase
|
|
3810
|
-
};
|
|
3811
|
-
};
|
|
3812
|
-
var deleteFloorSupabaseService = () => {
|
|
3813
|
-
const supabase = useSupabaseOptional();
|
|
3814
|
-
const deleteFloorSupabase = react.useCallback(
|
|
3815
|
-
async (values) => {
|
|
3816
|
-
if (!supabase) {
|
|
3817
|
-
console.error("Supabase client not initialized");
|
|
3818
|
-
return [];
|
|
3819
|
-
}
|
|
3820
|
-
try {
|
|
3821
|
-
const { error } = await supabase.from("restaurant_floors" /* RESTAURANT_FLOORS */).delete().eq("id", values.id);
|
|
3822
|
-
if (error) {
|
|
3823
|
-
console.error("Error deleting floor:", error);
|
|
3824
|
-
return [];
|
|
3825
|
-
}
|
|
3826
|
-
return [values.id];
|
|
3827
|
-
} catch (error) {
|
|
3828
|
-
console.error("Error deleting floor:", error);
|
|
3829
|
-
return [];
|
|
3830
|
-
}
|
|
3831
|
-
},
|
|
3832
|
-
[supabase]
|
|
3833
|
-
);
|
|
3834
|
-
return {
|
|
3835
|
-
deleteFloorSupabase
|
|
3836
|
-
};
|
|
3837
|
-
};
|
|
3838
|
-
var deleteTableSupabaseService = () => {
|
|
3839
|
-
const supabase = useSupabaseOptional();
|
|
3840
|
-
const deleteTableSupabase = react.useCallback(
|
|
3841
|
-
async (values) => {
|
|
3842
|
-
if (!supabase) {
|
|
3843
|
-
console.error("Supabase client not initialized");
|
|
3844
|
-
return [];
|
|
3845
|
-
}
|
|
3846
|
-
try {
|
|
3847
|
-
const { error, data } = await supabase.from("restaurant_tables" /* RESTAURANT_TABLES */).delete().eq("id", values.id).select("id").single();
|
|
3848
|
-
if (error) {
|
|
3849
|
-
console.error("Error deleting table:", error);
|
|
3850
|
-
return [];
|
|
3851
|
-
}
|
|
3852
|
-
return [data.id];
|
|
3853
|
-
} catch (error) {
|
|
3854
|
-
console.error("Error deleting table:", error);
|
|
3855
|
-
return [];
|
|
3856
|
-
}
|
|
3857
|
-
},
|
|
3858
|
-
[supabase]
|
|
3859
|
-
);
|
|
3860
|
-
return {
|
|
3861
|
-
deleteTableSupabase
|
|
3862
|
-
};
|
|
3863
|
-
};
|
|
3864
|
-
var createOrderSupabaseService = () => {
|
|
3865
|
-
const supabase = useSupabaseOptional();
|
|
3866
|
-
const createOrderSupabase = react.useCallback(
|
|
3867
|
-
async (values) => {
|
|
3868
|
-
if (!supabase) {
|
|
3869
|
-
console.error("Supabase client not initialized");
|
|
3870
|
-
return null;
|
|
3871
|
-
}
|
|
3872
|
-
try {
|
|
3873
|
-
const { data, error } = await supabase.from("orders" /* ORDERS */).insert({
|
|
3874
|
-
session_id: values.session_id,
|
|
3875
|
-
pos_reference: values.pos_reference,
|
|
3876
|
-
amount_tax: values.amount_tax,
|
|
3877
|
-
amount_total: values.amount_total,
|
|
3878
|
-
amount_paid: values.amount_paid,
|
|
3879
|
-
amount_return: values.amount_return,
|
|
3880
|
-
table_id: values.table_id,
|
|
3881
|
-
partner_id: values.partner_id || null
|
|
3882
|
-
}).select("id, pos_reference").single();
|
|
3883
|
-
if (error) {
|
|
3884
|
-
console.error("Error creating order:", error);
|
|
3885
|
-
return null;
|
|
3886
|
-
}
|
|
3887
|
-
return [[data.id, data.pos_reference]];
|
|
3888
|
-
} catch (error) {
|
|
3889
|
-
console.error("Error creating order:", error);
|
|
3890
|
-
return null;
|
|
3891
|
-
}
|
|
3892
|
-
},
|
|
3893
|
-
[supabase]
|
|
3894
|
-
);
|
|
3895
|
-
return {
|
|
3896
|
-
createOrderSupabase
|
|
3897
|
-
};
|
|
3898
|
-
};
|
|
3899
|
-
var addProductToOrderSupabaseService = () => {
|
|
3900
|
-
const supabase = useSupabaseOptional();
|
|
3901
|
-
const addProductToOrderSupabase = react.useCallback(
|
|
3902
|
-
async (values) => {
|
|
3903
|
-
if (!supabase) {
|
|
3904
|
-
console.error("Supabase client not initialized");
|
|
3905
|
-
return null;
|
|
3906
|
-
}
|
|
3907
|
-
try {
|
|
3908
|
-
const { data, error } = await supabase.from("order_line" /* ORDER_LINE */).insert({
|
|
3909
|
-
order_id: values.order_id,
|
|
3910
|
-
product_id: values.product_id,
|
|
3911
|
-
qty: values.qty,
|
|
3912
|
-
price_unit: values.price_unit,
|
|
3913
|
-
price_subtotal: values.price_subtotal,
|
|
3914
|
-
price_subtotal_incl: values.price_subtotal_incl,
|
|
3915
|
-
tax_ids: values.tax_ids ?? [],
|
|
3916
|
-
uuid: values.uuid,
|
|
3917
|
-
attribute_value_ids: values.attribute_value_ids ?? [],
|
|
3918
|
-
note: values.note
|
|
3919
|
-
}).select("id").single();
|
|
3920
|
-
if (error) {
|
|
3921
|
-
console.error("Error adding product to order:", error);
|
|
3922
|
-
return null;
|
|
3923
|
-
}
|
|
3924
|
-
return [data.id];
|
|
3925
|
-
} catch (error) {
|
|
3926
|
-
console.error("Error adding product to order:", error);
|
|
3927
|
-
return null;
|
|
3928
|
-
}
|
|
3929
|
-
},
|
|
3930
|
-
[supabase]
|
|
3931
|
-
);
|
|
3932
|
-
return {
|
|
3933
|
-
addProductToOrderSupabase
|
|
3934
|
-
};
|
|
3935
|
-
};
|
|
3936
|
-
var updateOrderTotalAmountSupabaseService = () => {
|
|
3937
|
-
const supabase = useSupabaseOptional();
|
|
3938
|
-
const updateOrderTotalAmountSupabase = react.useCallback(
|
|
3939
|
-
async (values) => {
|
|
3940
|
-
if (!supabase) {
|
|
3941
|
-
console.error("Supabase client not initialized");
|
|
3942
|
-
return [];
|
|
3943
|
-
}
|
|
3944
|
-
try {
|
|
3945
|
-
const { error } = await supabase.from("orders" /* ORDERS */).update({
|
|
3946
|
-
amount_tax: values.amount_tax,
|
|
3947
|
-
amount_total: values.amount_total,
|
|
3948
|
-
note: values.note
|
|
3949
|
-
}).eq("id", values.order_id);
|
|
3950
|
-
if (error) {
|
|
3951
|
-
console.error("Error updating order total amount:", error);
|
|
3952
|
-
return [];
|
|
3953
|
-
}
|
|
3954
|
-
return [values.order_id];
|
|
3955
|
-
} catch (error) {
|
|
3956
|
-
console.error("Error updating order total amount:", error);
|
|
3957
|
-
return [];
|
|
3958
|
-
}
|
|
3959
|
-
},
|
|
3960
|
-
[supabase]
|
|
3961
|
-
);
|
|
3962
|
-
return {
|
|
3963
|
-
updateOrderTotalAmountSupabase
|
|
3964
|
-
};
|
|
3965
|
-
};
|
|
3966
|
-
var updateOrderSupabaseService = () => {
|
|
3967
|
-
const supabase = useSupabaseOptional();
|
|
3968
|
-
const updateOrderSupabase = react.useCallback(
|
|
3969
|
-
async (values) => {
|
|
3970
|
-
if (!supabase) {
|
|
3971
|
-
console.error("Supabase client not initialized");
|
|
3972
|
-
return [];
|
|
3973
|
-
}
|
|
3974
|
-
const { order_id, ...rest } = values;
|
|
3975
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
3976
|
-
...rest,
|
|
3977
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3978
|
-
});
|
|
3979
|
-
if (rest.partner_id === 0) {
|
|
3980
|
-
Object.assign(updateData, { partner_id: null });
|
|
3981
|
-
}
|
|
3982
|
-
try {
|
|
3983
|
-
const { error, data } = await supabase.from("orders" /* ORDERS */).update(updateData).eq("id", order_id).select("id").single();
|
|
3984
|
-
if (error) {
|
|
3985
|
-
console.error("Error updating order:", error);
|
|
3986
|
-
return [];
|
|
3987
|
-
}
|
|
3988
|
-
return [data.id];
|
|
3989
|
-
} catch (error) {
|
|
3990
|
-
console.error("Error updating order:", error);
|
|
3991
|
-
return [];
|
|
3992
|
-
}
|
|
3993
|
-
},
|
|
3994
|
-
[supabase]
|
|
3995
|
-
);
|
|
3996
|
-
return {
|
|
3997
|
-
updateOrderSupabase
|
|
3998
|
-
};
|
|
3999
|
-
};
|
|
4000
|
-
var deleteOrderSupabaseService = () => {
|
|
4001
|
-
const supabase = useSupabaseOptional();
|
|
4002
|
-
const deleteOrderSupabase = react.useCallback(
|
|
4003
|
-
async (values) => {
|
|
4004
|
-
if (!supabase) {
|
|
4005
|
-
console.error("Supabase client not initialized");
|
|
4006
|
-
return [];
|
|
4007
|
-
}
|
|
4008
|
-
try {
|
|
4009
|
-
const { error, data } = await supabase.from("orders" /* ORDERS */).delete().eq("id", values.id).select("id").single();
|
|
4010
|
-
if (error) {
|
|
4011
|
-
console.error("Error deleting order:", error);
|
|
4012
|
-
return [];
|
|
4013
|
-
}
|
|
4014
|
-
return [data.id];
|
|
4015
|
-
} catch (error) {
|
|
4016
|
-
console.error("Error deleting order:", error);
|
|
4017
|
-
return [];
|
|
4018
|
-
}
|
|
4019
|
-
},
|
|
4020
|
-
[supabase]
|
|
4021
|
-
);
|
|
4022
|
-
return {
|
|
4023
|
-
deleteOrderSupabase
|
|
4024
|
-
};
|
|
4025
|
-
};
|
|
4026
|
-
var addCategorySupabaseService = () => {
|
|
4027
|
-
const supabase = useSupabaseOptional();
|
|
4028
|
-
const addCategorySupabase = react.useCallback(
|
|
4029
|
-
async (values) => {
|
|
4030
|
-
if (!supabase) {
|
|
4031
|
-
console.error("Supabase client not initialized");
|
|
4032
|
-
return null;
|
|
4033
|
-
}
|
|
4034
|
-
try {
|
|
4035
|
-
const { data, error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).insert({
|
|
4036
|
-
name: values.name
|
|
4037
|
-
}).select("id, name").single();
|
|
4038
|
-
if (error) {
|
|
4039
|
-
console.error("Error adding Category:", error);
|
|
4040
|
-
return null;
|
|
4041
|
-
}
|
|
4042
|
-
return [[data.id, data.name]];
|
|
4043
|
-
} catch (error) {
|
|
4044
|
-
console.error("Error adding Category:", error);
|
|
4045
|
-
return null;
|
|
4046
|
-
}
|
|
4047
|
-
},
|
|
4048
|
-
[supabase]
|
|
4049
|
-
);
|
|
4050
|
-
return {
|
|
4051
|
-
addCategorySupabase
|
|
4052
|
-
};
|
|
4053
|
-
};
|
|
4054
|
-
var addProductSupabaseService = () => {
|
|
4055
|
-
const supabase = useSupabaseOptional();
|
|
4056
|
-
const addProductSupabase = react.useCallback(
|
|
4057
|
-
async (values) => {
|
|
4058
|
-
if (!supabase) {
|
|
4059
|
-
console.error("Supabase client not initialized");
|
|
4060
|
-
return null;
|
|
4061
|
-
}
|
|
4062
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4063
|
-
name: values.name,
|
|
4064
|
-
product_tmpl_id: values.product_tmpl_id,
|
|
4065
|
-
product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
|
|
4066
|
-
combo_ids: values.combo_ids ?? [],
|
|
4067
|
-
categ_id: values.categ_id,
|
|
4068
|
-
pos_categ_ids: values.pos_categ_ids ?? [],
|
|
4069
|
-
display_name: values.display_name || values.name,
|
|
4070
|
-
default_code: values.default_code ?? "",
|
|
4071
|
-
description_sale: values.description_sale ?? "",
|
|
4072
|
-
lst_price: values.lst_price ?? 0,
|
|
4073
|
-
standard_price: values.standard_price ?? 0,
|
|
4074
|
-
barcode: values.barcode ?? "",
|
|
4075
|
-
image_url: values.image_url ?? "",
|
|
4076
|
-
active: values.active ?? true
|
|
4077
|
-
});
|
|
4078
|
-
try {
|
|
4079
|
-
const { data, error } = await supabase.from("products" /* PRODUCTS */).insert(insertData).select("id, name").single();
|
|
4080
|
-
if (error) {
|
|
4081
|
-
console.error("Error adding product:", error);
|
|
4082
|
-
return null;
|
|
4083
|
-
}
|
|
4084
|
-
return [[data.id, data.name]];
|
|
4085
|
-
} catch (error) {
|
|
4086
|
-
console.error("Error adding product:", error);
|
|
4087
|
-
return null;
|
|
4088
|
-
}
|
|
4089
|
-
},
|
|
4090
|
-
[supabase]
|
|
4091
|
-
);
|
|
4092
|
-
return {
|
|
4093
|
-
addProductSupabase
|
|
4094
|
-
};
|
|
4095
|
-
};
|
|
4096
|
-
var addPaymentMethodSupabaseService = () => {
|
|
4097
|
-
const supabase = useSupabaseOptional();
|
|
4098
|
-
const addPaymentMethodSupabase = react.useCallback(
|
|
4099
|
-
async (values) => {
|
|
4100
|
-
if (!supabase) {
|
|
4101
|
-
console.error("Supabase client not initialized");
|
|
4102
|
-
return null;
|
|
4103
|
-
}
|
|
4104
|
-
const { name, ...rest } = values;
|
|
4105
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4106
|
-
name,
|
|
4107
|
-
...rest
|
|
4108
|
-
});
|
|
4109
|
-
try {
|
|
4110
|
-
const { data, error } = await supabase.from("payment_methods" /* PAYMENT_METHODS */).insert(insertData).select("id, name").single();
|
|
4111
|
-
if (error) {
|
|
4112
|
-
console.error("Error adding payment method:", error);
|
|
4113
|
-
return null;
|
|
4114
|
-
}
|
|
4115
|
-
return [[data.id, data.name]];
|
|
4116
|
-
} catch (error) {
|
|
4117
|
-
console.error("Error adding payment method:", error);
|
|
4118
|
-
return null;
|
|
4119
|
-
}
|
|
4120
|
-
},
|
|
4121
|
-
[supabase]
|
|
4122
|
-
);
|
|
4123
|
-
return {
|
|
4124
|
-
addPaymentMethodSupabase
|
|
4125
|
-
};
|
|
4126
|
-
};
|
|
4127
|
-
var updateSessionPaymentMethodsSupabaseService = () => {
|
|
4128
|
-
const supabase = useSupabaseOptional();
|
|
4129
|
-
const updateSessionPaymentMethodsSupabase = react.useCallback(
|
|
4130
|
-
async (values) => {
|
|
4131
|
-
if (!supabase) {
|
|
4132
|
-
console.error("Supabase client not initialized");
|
|
4133
|
-
return null;
|
|
4134
|
-
}
|
|
4135
|
-
try {
|
|
4136
|
-
const { data, error } = await supabase.from("pos_sessions" /* POS_SESSIONS */).update({
|
|
4137
|
-
payment_method_ids: values.payment_method_ids,
|
|
4138
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4139
|
-
}).eq("id", values.session_id).select("id").single();
|
|
4140
|
-
if (error) {
|
|
4141
|
-
console.error("Error updating session payment methods:", error);
|
|
4142
|
-
return null;
|
|
4143
|
-
}
|
|
4144
|
-
return [data.id];
|
|
4145
|
-
} catch (error) {
|
|
4146
|
-
console.error("Error updating session payment methods:", error);
|
|
4147
|
-
return null;
|
|
4148
|
-
}
|
|
4149
|
-
},
|
|
4150
|
-
[supabase]
|
|
4151
|
-
);
|
|
4152
|
-
return {
|
|
4153
|
-
updateSessionPaymentMethodsSupabase
|
|
4154
|
-
};
|
|
4155
|
-
};
|
|
4156
3697
|
var createPaymentSupabaseService = () => {
|
|
4157
3698
|
const supabase = useSupabaseOptional();
|
|
4158
3699
|
const createPaymentSupabase = react.useCallback(
|
|
@@ -4194,101 +3735,6 @@ var createPaymentSupabaseService = () => {
|
|
|
4194
3735
|
createPaymentSupabase
|
|
4195
3736
|
};
|
|
4196
3737
|
};
|
|
4197
|
-
var createCustomerSupabaseService = () => {
|
|
4198
|
-
const supabase = useSupabaseOptional();
|
|
4199
|
-
const createCustomerSupabase = react.useCallback(
|
|
4200
|
-
async (values) => {
|
|
4201
|
-
if (!supabase) {
|
|
4202
|
-
console.error("Supabase client not initialized");
|
|
4203
|
-
return null;
|
|
4204
|
-
}
|
|
4205
|
-
try {
|
|
4206
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4207
|
-
name: values.name,
|
|
4208
|
-
phone: values.phone,
|
|
4209
|
-
email: values.email,
|
|
4210
|
-
address: values.address,
|
|
4211
|
-
street2: values.street2,
|
|
4212
|
-
city: values.city,
|
|
4213
|
-
birth_date: values.birth_date,
|
|
4214
|
-
country_id: values.country_id,
|
|
4215
|
-
state_id: values.state_id,
|
|
4216
|
-
ward_id: values.ward_id
|
|
4217
|
-
});
|
|
4218
|
-
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).insert(insertData).select("id, name").single();
|
|
4219
|
-
if (error) {
|
|
4220
|
-
console.error("Error creating customer:", error);
|
|
4221
|
-
return null;
|
|
4222
|
-
}
|
|
4223
|
-
return [[data.id, data.name]];
|
|
4224
|
-
} catch (error) {
|
|
4225
|
-
console.error("Error creating customer:", error);
|
|
4226
|
-
return null;
|
|
4227
|
-
}
|
|
4228
|
-
},
|
|
4229
|
-
[supabase]
|
|
4230
|
-
);
|
|
4231
|
-
return {
|
|
4232
|
-
createCustomerSupabase
|
|
4233
|
-
};
|
|
4234
|
-
};
|
|
4235
|
-
var updateCustomerSupabaseService = () => {
|
|
4236
|
-
const supabase = useSupabaseOptional();
|
|
4237
|
-
const updateCustomerSupabase = react.useCallback(
|
|
4238
|
-
async (values) => {
|
|
4239
|
-
if (!supabase) {
|
|
4240
|
-
console.error("Supabase client not initialized");
|
|
4241
|
-
return null;
|
|
4242
|
-
}
|
|
4243
|
-
try {
|
|
4244
|
-
const { customer_id, ...rest } = values;
|
|
4245
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
4246
|
-
...rest,
|
|
4247
|
-
write_date: (/* @__PURE__ */ new Date()).toISOString()
|
|
4248
|
-
});
|
|
4249
|
-
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).update(updateData).eq("id", customer_id).select("id").single();
|
|
4250
|
-
if (error) {
|
|
4251
|
-
console.error("Error updating customer:", error);
|
|
4252
|
-
return null;
|
|
4253
|
-
}
|
|
4254
|
-
return [data.id];
|
|
4255
|
-
} catch (error) {
|
|
4256
|
-
console.error("Error updating customer:", error);
|
|
4257
|
-
return null;
|
|
4258
|
-
}
|
|
4259
|
-
},
|
|
4260
|
-
[supabase]
|
|
4261
|
-
);
|
|
4262
|
-
return {
|
|
4263
|
-
updateCustomerSupabase
|
|
4264
|
-
};
|
|
4265
|
-
};
|
|
4266
|
-
var deleteCustomerSupabaseService = () => {
|
|
4267
|
-
const supabase = useSupabaseOptional();
|
|
4268
|
-
const deleteCustomerSupabase = react.useCallback(
|
|
4269
|
-
async (values) => {
|
|
4270
|
-
if (!supabase) {
|
|
4271
|
-
console.error("Supabase client not initialized");
|
|
4272
|
-
return null;
|
|
4273
|
-
}
|
|
4274
|
-
try {
|
|
4275
|
-
const { error } = await supabase.from("customers" /* CUSTOMERS */).delete().eq("id", values.customer_id);
|
|
4276
|
-
if (error) {
|
|
4277
|
-
console.error("Error deleting customer:", error);
|
|
4278
|
-
return null;
|
|
4279
|
-
}
|
|
4280
|
-
return [values.customer_id];
|
|
4281
|
-
} catch (error) {
|
|
4282
|
-
console.error("Error deleting customer:", error);
|
|
4283
|
-
return null;
|
|
4284
|
-
}
|
|
4285
|
-
},
|
|
4286
|
-
[supabase]
|
|
4287
|
-
);
|
|
4288
|
-
return {
|
|
4289
|
-
deleteCustomerSupabase
|
|
4290
|
-
};
|
|
4291
|
-
};
|
|
4292
3738
|
var uploadImageSupabaseService = () => {
|
|
4293
3739
|
const supabase = useSupabaseOptional();
|
|
4294
3740
|
const uploadImageSupabase = react.useCallback(
|
|
@@ -4411,156 +3857,49 @@ var getStatesSupabaseService = () => {
|
|
|
4411
3857
|
var getWardsSupabaseService = () => {
|
|
4412
3858
|
const supabase = useSupabaseOptional();
|
|
4413
3859
|
const getWardsSupabase = react.useCallback(async () => {
|
|
4414
|
-
if (!supabase) return { length: 0, records: [] };
|
|
4415
|
-
const { data, error } = await supabase.from("wards" /* WARDS */).select("*");
|
|
4416
|
-
if (error) {
|
|
4417
|
-
console.error("Error fetching wards:", error);
|
|
4418
|
-
return { length: 0, records: [] };
|
|
4419
|
-
}
|
|
4420
|
-
const records = data || [];
|
|
4421
|
-
return { length: records.length, records };
|
|
4422
|
-
}, [supabase]);
|
|
4423
|
-
return {
|
|
4424
|
-
getWardsSupabase
|
|
4425
|
-
};
|
|
4426
|
-
};
|
|
4427
|
-
var getPartnerTitlesSupabaseService = () => {
|
|
4428
|
-
const supabase = useSupabaseOptional();
|
|
4429
|
-
const getPartnerTitlesSupabase = react.useCallback(async () => {
|
|
4430
|
-
if (!supabase) return { length: 0, records: [] };
|
|
4431
|
-
const { data, error } = await supabase.from("partner_titles" /* PARTNER_TITLES */).select("*");
|
|
4432
|
-
if (error) {
|
|
4433
|
-
console.error("Error fetching partner titles:", error);
|
|
4434
|
-
return { length: 0, records: [] };
|
|
4435
|
-
}
|
|
4436
|
-
const records = data || [];
|
|
4437
|
-
return { length: records.length, records };
|
|
4438
|
-
}, [supabase]);
|
|
4439
|
-
return {
|
|
4440
|
-
getPartnerTitlesSupabase
|
|
4441
|
-
};
|
|
4442
|
-
};
|
|
4443
|
-
var getSupaCurrentUser = (env) => {
|
|
4444
|
-
const getSupaCurrentUser2 = react.useCallback(
|
|
4445
|
-
({ tenantId }) => {
|
|
4446
|
-
return env?.requests.get("/api/v2/auth/me" /* SUPABASE_CURRENT_USER */, {
|
|
4447
|
-
headers: {
|
|
4448
|
-
"Content-Type": "application/json",
|
|
4449
|
-
"x-tenant-id": tenantId
|
|
4450
|
-
}
|
|
4451
|
-
});
|
|
4452
|
-
},
|
|
4453
|
-
[env]
|
|
4454
|
-
);
|
|
4455
|
-
return {
|
|
4456
|
-
getSupaCurrentUser: getSupaCurrentUser2
|
|
4457
|
-
};
|
|
4458
|
-
};
|
|
4459
|
-
var updateCategorySupabaseService = () => {
|
|
4460
|
-
const supabase = useSupabaseOptional();
|
|
4461
|
-
const updateCategorySupabase = react.useCallback(
|
|
4462
|
-
async (values) => {
|
|
4463
|
-
if (!supabase) {
|
|
4464
|
-
console.error("Supabase client not initialized");
|
|
4465
|
-
return null;
|
|
4466
|
-
}
|
|
4467
|
-
try {
|
|
4468
|
-
const { category_id, ...rest } = values;
|
|
4469
|
-
const { data, error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).update(rest).eq("id", category_id).select("id").single();
|
|
4470
|
-
if (error) {
|
|
4471
|
-
console.error("Error updating category:", error);
|
|
4472
|
-
return null;
|
|
4473
|
-
}
|
|
4474
|
-
return [data.id];
|
|
4475
|
-
} catch (error) {
|
|
4476
|
-
console.error("Error updating category:", error);
|
|
4477
|
-
return null;
|
|
4478
|
-
}
|
|
4479
|
-
},
|
|
4480
|
-
[supabase]
|
|
4481
|
-
);
|
|
4482
|
-
return {
|
|
4483
|
-
updateCategorySupabase
|
|
4484
|
-
};
|
|
4485
|
-
};
|
|
4486
|
-
var deleteCategorySupabaseService = () => {
|
|
4487
|
-
const supabase = useSupabaseOptional();
|
|
4488
|
-
const deleteCategorySupabase = react.useCallback(
|
|
4489
|
-
async (values) => {
|
|
4490
|
-
if (!supabase) {
|
|
4491
|
-
console.error("Supabase client not initialized");
|
|
4492
|
-
return null;
|
|
4493
|
-
}
|
|
4494
|
-
try {
|
|
4495
|
-
const { error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).delete().eq("id", values.category_id);
|
|
4496
|
-
if (error) {
|
|
4497
|
-
console.error("Error deleting category:", error);
|
|
4498
|
-
return null;
|
|
4499
|
-
}
|
|
4500
|
-
return [values.category_id];
|
|
4501
|
-
} catch (error) {
|
|
4502
|
-
console.error("Error deleting category:", error);
|
|
4503
|
-
return null;
|
|
4504
|
-
}
|
|
4505
|
-
},
|
|
4506
|
-
[supabase]
|
|
4507
|
-
);
|
|
3860
|
+
if (!supabase) return { length: 0, records: [] };
|
|
3861
|
+
const { data, error } = await supabase.from("wards" /* WARDS */).select("*");
|
|
3862
|
+
if (error) {
|
|
3863
|
+
console.error("Error fetching wards:", error);
|
|
3864
|
+
return { length: 0, records: [] };
|
|
3865
|
+
}
|
|
3866
|
+
const records = data || [];
|
|
3867
|
+
return { length: records.length, records };
|
|
3868
|
+
}, [supabase]);
|
|
4508
3869
|
return {
|
|
4509
|
-
|
|
3870
|
+
getWardsSupabase
|
|
4510
3871
|
};
|
|
4511
3872
|
};
|
|
4512
|
-
var
|
|
3873
|
+
var getPartnerTitlesSupabaseService = () => {
|
|
4513
3874
|
const supabase = useSupabaseOptional();
|
|
4514
|
-
const
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
}
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
if (error) {
|
|
4525
|
-
console.error("Error updating product:", error);
|
|
4526
|
-
return null;
|
|
4527
|
-
}
|
|
4528
|
-
return [data.id];
|
|
4529
|
-
} catch (error) {
|
|
4530
|
-
console.error("Error updating product:", error);
|
|
4531
|
-
return null;
|
|
4532
|
-
}
|
|
4533
|
-
},
|
|
4534
|
-
[supabase]
|
|
4535
|
-
);
|
|
3875
|
+
const getPartnerTitlesSupabase = react.useCallback(async () => {
|
|
3876
|
+
if (!supabase) return { length: 0, records: [] };
|
|
3877
|
+
const { data, error } = await supabase.from("partner_titles" /* PARTNER_TITLES */).select("*");
|
|
3878
|
+
if (error) {
|
|
3879
|
+
console.error("Error fetching partner titles:", error);
|
|
3880
|
+
return { length: 0, records: [] };
|
|
3881
|
+
}
|
|
3882
|
+
const records = data || [];
|
|
3883
|
+
return { length: records.length, records };
|
|
3884
|
+
}, [supabase]);
|
|
4536
3885
|
return {
|
|
4537
|
-
|
|
3886
|
+
getPartnerTitlesSupabase
|
|
4538
3887
|
};
|
|
4539
3888
|
};
|
|
4540
|
-
var
|
|
4541
|
-
const
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
}
|
|
4548
|
-
try {
|
|
4549
|
-
const { error } = await supabase.from("products" /* PRODUCTS */).delete().eq("id", values.product_id);
|
|
4550
|
-
if (error) {
|
|
4551
|
-
console.error("Error deleting product:", error);
|
|
4552
|
-
return null;
|
|
3889
|
+
var getSupaCurrentUser = (env) => {
|
|
3890
|
+
const getSupaCurrentUser2 = react.useCallback(
|
|
3891
|
+
({ tenantId }) => {
|
|
3892
|
+
return env?.requests.get("/api/v2/auth/me" /* SUPABASE_CURRENT_USER */, {
|
|
3893
|
+
headers: {
|
|
3894
|
+
"Content-Type": "application/json",
|
|
3895
|
+
"x-tenant-id": tenantId
|
|
4553
3896
|
}
|
|
4554
|
-
|
|
4555
|
-
} catch (error) {
|
|
4556
|
-
console.error("Error deleting product:", error);
|
|
4557
|
-
return null;
|
|
4558
|
-
}
|
|
3897
|
+
});
|
|
4559
3898
|
},
|
|
4560
|
-
[
|
|
3899
|
+
[env]
|
|
4561
3900
|
);
|
|
4562
3901
|
return {
|
|
4563
|
-
|
|
3902
|
+
getSupaCurrentUser: getSupaCurrentUser2
|
|
4564
3903
|
};
|
|
4565
3904
|
};
|
|
4566
3905
|
var togglePosRestaurantSupabaseService = () => {
|
|
@@ -4609,36 +3948,6 @@ var publicBucketService = (env) => {
|
|
|
4609
3948
|
publicBucket
|
|
4610
3949
|
};
|
|
4611
3950
|
};
|
|
4612
|
-
var updatePaymentMethodSupabaseService = () => {
|
|
4613
|
-
const supabase = useSupabaseOptional();
|
|
4614
|
-
const updatePaymentMethodSupabase = react.useCallback(
|
|
4615
|
-
async (values) => {
|
|
4616
|
-
if (!supabase) {
|
|
4617
|
-
console.error("Supabase client not initialized");
|
|
4618
|
-
return null;
|
|
4619
|
-
}
|
|
4620
|
-
const { id, ...rest } = values;
|
|
4621
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
4622
|
-
...rest
|
|
4623
|
-
});
|
|
4624
|
-
try {
|
|
4625
|
-
const { data, error } = await supabase.from("payment_methods" /* PAYMENT_METHODS */).update(updateData).eq("id", id).select("id, name").single();
|
|
4626
|
-
if (error) {
|
|
4627
|
-
console.error("Error updating payment method:", error);
|
|
4628
|
-
return null;
|
|
4629
|
-
}
|
|
4630
|
-
return [[data.id, data.name]];
|
|
4631
|
-
} catch (error) {
|
|
4632
|
-
console.error("Error updating payment method:", error);
|
|
4633
|
-
return null;
|
|
4634
|
-
}
|
|
4635
|
-
},
|
|
4636
|
-
[supabase]
|
|
4637
|
-
);
|
|
4638
|
-
return {
|
|
4639
|
-
updatePaymentMethodSupabase
|
|
4640
|
-
};
|
|
4641
|
-
};
|
|
4642
3951
|
|
|
4643
3952
|
// src/services/pos-service/index.ts
|
|
4644
3953
|
var serviceFactories = [
|
|
@@ -4678,26 +3987,7 @@ var serviceFactories = [
|
|
|
4678
3987
|
removeVoucherService,
|
|
4679
3988
|
syncFromUiService,
|
|
4680
3989
|
getCustomerLoyaltyPointService,
|
|
4681
|
-
addFloorSupabaseService,
|
|
4682
|
-
addTableSupabaseService,
|
|
4683
|
-
updateFloorSupabaseService,
|
|
4684
|
-
updateTableSupabaseService,
|
|
4685
|
-
deleteFloorSupabaseService,
|
|
4686
|
-
deleteTableSupabaseService,
|
|
4687
|
-
addCategorySupabaseService,
|
|
4688
|
-
createOrderSupabaseService,
|
|
4689
|
-
addProductToOrderSupabaseService,
|
|
4690
|
-
updateOrderTotalAmountSupabaseService,
|
|
4691
|
-
updateOrderSupabaseService,
|
|
4692
|
-
deleteOrderSupabaseService,
|
|
4693
|
-
addProductSupabaseService,
|
|
4694
|
-
getFunctionalModulesService,
|
|
4695
|
-
addPaymentMethodSupabaseService,
|
|
4696
|
-
updateSessionPaymentMethodsSupabaseService,
|
|
4697
3990
|
createPaymentSupabaseService,
|
|
4698
|
-
createCustomerSupabaseService,
|
|
4699
|
-
updateCustomerSupabaseService,
|
|
4700
|
-
deleteCustomerSupabaseService,
|
|
4701
3991
|
uploadImageSupabaseService,
|
|
4702
3992
|
getListUsersService,
|
|
4703
3993
|
getListRolesService,
|
|
@@ -4706,16 +3996,12 @@ var serviceFactories = [
|
|
|
4706
3996
|
getWardsSupabaseService,
|
|
4707
3997
|
getPartnerTitlesSupabaseService,
|
|
4708
3998
|
getSupaCurrentUser,
|
|
4709
|
-
updateCategorySupabaseService,
|
|
4710
|
-
deleteCategorySupabaseService,
|
|
4711
|
-
updateProductSupabaseService,
|
|
4712
|
-
deleteProductSupabaseService,
|
|
4713
3999
|
togglePosRestaurantSupabaseService,
|
|
4714
4000
|
publicBucketService,
|
|
4715
|
-
updatePaymentMethodSupabaseService,
|
|
4716
4001
|
confirmCouponProgramsService,
|
|
4717
4002
|
validateCouponProgramsService,
|
|
4718
|
-
getBankProductChannelService
|
|
4003
|
+
getBankProductChannelService,
|
|
4004
|
+
getFunctionalModulesService
|
|
4719
4005
|
];
|
|
4720
4006
|
var usePosService = () => {
|
|
4721
4007
|
const { env } = useEnv();
|
|
@@ -6486,220 +5772,329 @@ var useGetCustomerLoyaltyPoint = () => {
|
|
|
6486
5772
|
});
|
|
6487
5773
|
};
|
|
6488
5774
|
var use_get_customer_loyalty_point_default = useGetCustomerLoyaltyPoint;
|
|
6489
|
-
var useAddFloor = () => {
|
|
6490
|
-
const { addFloorSupabase } = addFloorSupabaseService();
|
|
6491
|
-
return reactQuery.useMutation({
|
|
6492
|
-
mutationFn: addFloorSupabase
|
|
6493
|
-
});
|
|
6494
|
-
};
|
|
6495
|
-
var use_add_floor_default = useAddFloor;
|
|
6496
|
-
var useAddTable = () => {
|
|
6497
|
-
const { addTableSupabase } = addTableSupabaseService();
|
|
6498
|
-
return reactQuery.useMutation({
|
|
6499
|
-
mutationFn: addTableSupabase
|
|
6500
|
-
});
|
|
6501
|
-
};
|
|
6502
|
-
var use_add_table_default = useAddTable;
|
|
6503
|
-
var useUpdateFloor = () => {
|
|
6504
|
-
const { updateFloorSupabase } = updateFloorSupabaseService();
|
|
6505
|
-
return reactQuery.useMutation({
|
|
6506
|
-
mutationFn: updateFloorSupabase
|
|
6507
|
-
});
|
|
6508
|
-
};
|
|
6509
|
-
var use_update_floor_default = useUpdateFloor;
|
|
6510
|
-
var useUpdateTable = () => {
|
|
6511
|
-
const { updateTableSupabase } = updateTableSupabaseService();
|
|
6512
|
-
return reactQuery.useMutation({
|
|
6513
|
-
mutationFn: updateTableSupabase
|
|
6514
|
-
});
|
|
6515
|
-
};
|
|
6516
|
-
var use_update_table_default = useUpdateTable;
|
|
6517
|
-
var useDeleteFloor = () => {
|
|
6518
|
-
const { deleteFloorSupabase } = deleteFloorSupabaseService();
|
|
6519
|
-
return reactQuery.useMutation({
|
|
6520
|
-
mutationFn: deleteFloorSupabase
|
|
6521
|
-
});
|
|
6522
|
-
};
|
|
6523
|
-
var use_delete_floor_default = useDeleteFloor;
|
|
6524
|
-
var useDeleteTable = () => {
|
|
6525
|
-
const { deleteTableSupabase } = deleteTableSupabaseService();
|
|
6526
|
-
return reactQuery.useMutation({
|
|
6527
|
-
mutationFn: deleteTableSupabase
|
|
6528
|
-
});
|
|
6529
|
-
};
|
|
6530
|
-
var use_delete_table_default = useDeleteTable;
|
|
6531
|
-
var useCreateOrder = () => {
|
|
6532
|
-
const { createOrderSupabase } = createOrderSupabaseService();
|
|
6533
|
-
return reactQuery.useMutation({
|
|
6534
|
-
mutationFn: createOrderSupabase
|
|
6535
|
-
});
|
|
6536
|
-
};
|
|
6537
|
-
var use_create_order_default = useCreateOrder;
|
|
6538
|
-
var useAddCategory = () => {
|
|
6539
|
-
const { addCategorySupabase } = addCategorySupabaseService();
|
|
6540
|
-
return reactQuery.useMutation({
|
|
6541
|
-
mutationFn: addCategorySupabase
|
|
6542
|
-
});
|
|
6543
|
-
};
|
|
6544
|
-
var use_add_category_default = useAddCategory;
|
|
6545
|
-
var useAddProductToOrder = () => {
|
|
6546
|
-
const { addProductToOrderSupabase } = addProductToOrderSupabaseService();
|
|
6547
|
-
return reactQuery.useMutation({
|
|
6548
|
-
mutationFn: addProductToOrderSupabase
|
|
6549
|
-
});
|
|
6550
|
-
};
|
|
6551
|
-
var use_add_product_to_order_default = useAddProductToOrder;
|
|
6552
|
-
var useUpdateOrderTotalAmount = () => {
|
|
6553
|
-
const { updateOrderTotalAmountSupabase } = updateOrderTotalAmountSupabaseService();
|
|
6554
|
-
return reactQuery.useMutation({
|
|
6555
|
-
mutationFn: updateOrderTotalAmountSupabase
|
|
6556
|
-
});
|
|
6557
|
-
};
|
|
6558
|
-
var use_update_order_total_amount_default = useUpdateOrderTotalAmount;
|
|
6559
5775
|
var createSupabaseMutations = (tableName, primaryKeyColumn = "id") => {
|
|
6560
5776
|
return {
|
|
6561
|
-
useCreate: () => {
|
|
5777
|
+
useCreate: (options) => {
|
|
6562
5778
|
const supabase = useSupabaseOptional();
|
|
6563
5779
|
return reactQuery.useMutation({
|
|
6564
|
-
|
|
5780
|
+
...options,
|
|
5781
|
+
mutationFn: async (variables) => {
|
|
6565
5782
|
if (!supabase) throw new Error("Supabase client not initialized");
|
|
6566
|
-
const
|
|
5783
|
+
const values = options?.mapInput ? options.mapInput(variables) : variables;
|
|
5784
|
+
const selectStmt = options?.selectQuery || primaryKeyColumn;
|
|
5785
|
+
const { error, data } = await supabase.from(tableName).insert(values).select(selectStmt).single();
|
|
6567
5786
|
if (error) {
|
|
6568
5787
|
console.error(`Error creating ${tableName}:`, error);
|
|
6569
5788
|
throw error;
|
|
6570
5789
|
}
|
|
5790
|
+
if (options?.mapReturn) {
|
|
5791
|
+
return options.mapReturn(data, values);
|
|
5792
|
+
}
|
|
6571
5793
|
return [data[primaryKeyColumn]];
|
|
6572
5794
|
}
|
|
6573
5795
|
});
|
|
6574
5796
|
},
|
|
6575
|
-
useUpdate: () => {
|
|
5797
|
+
useUpdate: (options) => {
|
|
6576
5798
|
const supabase = useSupabaseOptional();
|
|
6577
5799
|
return reactQuery.useMutation({
|
|
6578
|
-
|
|
5800
|
+
...options,
|
|
5801
|
+
mutationFn: async (variables) => {
|
|
6579
5802
|
if (!supabase) throw new Error("Supabase client not initialized");
|
|
6580
|
-
const
|
|
5803
|
+
const mapped = options?.mapInput ? options.mapInput(variables) : variables;
|
|
5804
|
+
const { id, ...values } = mapped;
|
|
5805
|
+
const selectStmt = options?.selectQuery || primaryKeyColumn;
|
|
5806
|
+
const { error, data } = await supabase.from(tableName).update(values).eq(primaryKeyColumn, id).select(selectStmt).single();
|
|
6581
5807
|
if (error) {
|
|
6582
5808
|
console.error(`Error updating ${tableName}:`, error);
|
|
6583
5809
|
throw error;
|
|
6584
5810
|
}
|
|
5811
|
+
if (options?.mapReturn) {
|
|
5812
|
+
return options.mapReturn(data, { id, ...values });
|
|
5813
|
+
}
|
|
6585
5814
|
return [data[primaryKeyColumn]];
|
|
6586
5815
|
}
|
|
6587
5816
|
});
|
|
6588
5817
|
},
|
|
6589
|
-
useDelete: () => {
|
|
5818
|
+
useDelete: (options) => {
|
|
6590
5819
|
const supabase = useSupabaseOptional();
|
|
6591
5820
|
return reactQuery.useMutation({
|
|
6592
|
-
|
|
5821
|
+
...options,
|
|
5822
|
+
mutationFn: async (variables) => {
|
|
6593
5823
|
if (!supabase) throw new Error("Supabase client not initialized");
|
|
6594
|
-
const
|
|
6595
|
-
const
|
|
5824
|
+
const mappedId = options?.mapInput ? options.mapInput(variables) : variables;
|
|
5825
|
+
const idValue = typeof mappedId === "object" && mappedId !== null && "id" in mappedId ? mappedId.id : typeof mappedId === "object" && mappedId !== null ? Object.values(mappedId)[0] : mappedId;
|
|
5826
|
+
const { error } = await supabase.from(tableName).delete().eq(primaryKeyColumn, idValue);
|
|
6596
5827
|
if (error) {
|
|
6597
5828
|
console.error(`Error deleting ${tableName}:`, error);
|
|
6598
5829
|
throw error;
|
|
6599
5830
|
}
|
|
6600
|
-
|
|
5831
|
+
if (options?.mapReturn) {
|
|
5832
|
+
return options.mapReturn(null, variables);
|
|
5833
|
+
}
|
|
5834
|
+
return [idValue];
|
|
6601
5835
|
}
|
|
6602
5836
|
});
|
|
6603
5837
|
}
|
|
6604
5838
|
};
|
|
6605
5839
|
};
|
|
6606
5840
|
|
|
6607
|
-
// src/hooks/pos/supabase/use-
|
|
6608
|
-
var
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
const mutation = generatedUseUpdate();
|
|
6614
|
-
return reactQuery.useMutation({
|
|
6615
|
-
mutationFn: async (values) => {
|
|
6616
|
-
const { order_line_id, ...updatePayload } = values;
|
|
6617
|
-
return mutation.mutateAsync({
|
|
6618
|
-
id: order_line_id,
|
|
6619
|
-
...updatePayload
|
|
6620
|
-
});
|
|
6621
|
-
}
|
|
5841
|
+
// src/hooks/pos/supabase/use-table.ts
|
|
5842
|
+
var mutations = createSupabaseMutations("restaurant_tables" /* RESTAURANT_TABLES */);
|
|
5843
|
+
var useAddTable = () => {
|
|
5844
|
+
return mutations.useCreate({
|
|
5845
|
+
selectQuery: "id, table_number",
|
|
5846
|
+
mapReturn: (data) => [[data.id, data.table_number]]
|
|
6622
5847
|
});
|
|
6623
5848
|
};
|
|
6624
|
-
var
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
5849
|
+
var useUpdateTable = () => {
|
|
5850
|
+
return mutations.useUpdate();
|
|
5851
|
+
};
|
|
5852
|
+
var useDeleteTable = () => {
|
|
5853
|
+
return mutations.useDelete();
|
|
5854
|
+
};
|
|
5855
|
+
|
|
5856
|
+
// src/hooks/pos/supabase/use-floor.ts
|
|
5857
|
+
var mutations2 = createSupabaseMutations("restaurant_floors" /* RESTAURANT_FLOORS */);
|
|
5858
|
+
var useAddFloor = () => {
|
|
5859
|
+
return mutations2.useCreate({
|
|
5860
|
+
selectQuery: "id, name",
|
|
5861
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
5862
|
+
});
|
|
5863
|
+
};
|
|
5864
|
+
var useUpdateFloor = () => {
|
|
5865
|
+
return mutations2.useUpdate();
|
|
5866
|
+
};
|
|
5867
|
+
var useDeleteFloor = () => {
|
|
5868
|
+
return mutations2.useDelete();
|
|
5869
|
+
};
|
|
5870
|
+
|
|
5871
|
+
// src/hooks/pos/supabase/use-order.ts
|
|
5872
|
+
var mutations3 = createSupabaseMutations("orders" /* ORDERS */);
|
|
5873
|
+
var useCreateOrder = () => {
|
|
5874
|
+
return mutations3.useCreate({
|
|
5875
|
+
selectQuery: "id, pos_reference",
|
|
5876
|
+
mapInput: (values) => ({
|
|
5877
|
+
session_id: values.session_id,
|
|
5878
|
+
pos_reference: values.pos_reference,
|
|
5879
|
+
amount_tax: values.amount_tax,
|
|
5880
|
+
amount_total: values.amount_total,
|
|
5881
|
+
amount_paid: values.amount_paid,
|
|
5882
|
+
amount_return: values.amount_return,
|
|
5883
|
+
table_id: values.table_id,
|
|
5884
|
+
partner_id: values.partner_id || null
|
|
5885
|
+
}),
|
|
5886
|
+
mapReturn: (data) => [[data.id, data.pos_reference]]
|
|
6631
5887
|
});
|
|
6632
5888
|
};
|
|
6633
5889
|
var useUpdateOrder = () => {
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
5890
|
+
return mutations3.useUpdate({
|
|
5891
|
+
mapInput: (values) => {
|
|
5892
|
+
const { order_id, ...rest } = values;
|
|
5893
|
+
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
5894
|
+
...rest,
|
|
5895
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5896
|
+
});
|
|
5897
|
+
if (rest.partner_id === 0) {
|
|
5898
|
+
Object.assign(updateData, { partner_id: null });
|
|
5899
|
+
}
|
|
5900
|
+
return {
|
|
5901
|
+
id: order_id,
|
|
5902
|
+
...updateData
|
|
5903
|
+
};
|
|
5904
|
+
}
|
|
5905
|
+
});
|
|
5906
|
+
};
|
|
5907
|
+
var useUpdateOrderTotalAmount = () => {
|
|
5908
|
+
return mutations3.useUpdate({
|
|
5909
|
+
mapInput: (values) => ({
|
|
5910
|
+
id: values.order_id,
|
|
5911
|
+
amount_tax: values.amount_tax,
|
|
5912
|
+
amount_total: values.amount_total,
|
|
5913
|
+
note: values.note
|
|
5914
|
+
})
|
|
6637
5915
|
});
|
|
6638
5916
|
};
|
|
6639
|
-
var use_update_order_default = useUpdateOrder;
|
|
6640
5917
|
var useDeleteOrder = () => {
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
5918
|
+
return mutations3.useDelete();
|
|
5919
|
+
};
|
|
5920
|
+
|
|
5921
|
+
// src/hooks/pos/supabase/use-category.ts
|
|
5922
|
+
var mutations4 = createSupabaseMutations("pos_categories" /* POS_CATEGORIES */);
|
|
5923
|
+
var useAddCategory = () => {
|
|
5924
|
+
return mutations4.useCreate({
|
|
5925
|
+
selectQuery: "id, name",
|
|
5926
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
5927
|
+
});
|
|
5928
|
+
};
|
|
5929
|
+
var useUpdateCategory = () => {
|
|
5930
|
+
return mutations4.useUpdate({
|
|
5931
|
+
mapInput: ({ category_id, ...updatePayload }) => ({
|
|
5932
|
+
id: category_id,
|
|
5933
|
+
...updatePayload
|
|
5934
|
+
})
|
|
5935
|
+
});
|
|
5936
|
+
};
|
|
5937
|
+
var useDeleteCategory = () => {
|
|
5938
|
+
return mutations4.useDelete({
|
|
5939
|
+
mapInput: (values) => typeof values === "object" && values !== null && "category_id" in values ? values.category_id : values
|
|
6644
5940
|
});
|
|
6645
5941
|
};
|
|
6646
|
-
|
|
5942
|
+
|
|
5943
|
+
// src/hooks/pos/supabase/use-product.ts
|
|
5944
|
+
var mutations5 = createSupabaseMutations("products" /* PRODUCTS */);
|
|
6647
5945
|
var useAddProduct = () => {
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
5946
|
+
return mutations5.useCreate({
|
|
5947
|
+
selectQuery: "id, name",
|
|
5948
|
+
mapInput: (values) => chunkJDXUTKMX_js.cleanObject({
|
|
5949
|
+
name: values.name,
|
|
5950
|
+
product_tmpl_id: values.product_tmpl_id,
|
|
5951
|
+
product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
|
|
5952
|
+
combo_ids: values.combo_ids ?? [],
|
|
5953
|
+
categ_id: values.categ_id,
|
|
5954
|
+
pos_categ_ids: values.pos_categ_ids ?? [],
|
|
5955
|
+
display_name: values.display_name || values.name,
|
|
5956
|
+
default_code: values.default_code ?? "",
|
|
5957
|
+
description_sale: values.description_sale ?? "",
|
|
5958
|
+
lst_price: values.lst_price ?? 0,
|
|
5959
|
+
standard_price: values.standard_price ?? 0,
|
|
5960
|
+
barcode: values.barcode ?? "",
|
|
5961
|
+
image_url: values.image_url ?? "",
|
|
5962
|
+
active: values.active ?? true
|
|
5963
|
+
}),
|
|
5964
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
6651
5965
|
});
|
|
6652
5966
|
};
|
|
6653
|
-
var
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
5967
|
+
var useUpdateProduct = () => {
|
|
5968
|
+
return mutations5.useUpdate({
|
|
5969
|
+
mapInput: ({ product_id, ...updatePayload }) => {
|
|
5970
|
+
const updateData = chunkJDXUTKMX_js.cleanObject(updatePayload);
|
|
5971
|
+
return {
|
|
5972
|
+
id: product_id,
|
|
5973
|
+
...updateData
|
|
5974
|
+
};
|
|
5975
|
+
}
|
|
6658
5976
|
});
|
|
6659
5977
|
};
|
|
6660
|
-
var
|
|
5978
|
+
var useDeleteProduct = () => {
|
|
5979
|
+
return mutations5.useDelete({
|
|
5980
|
+
mapInput: (values) => typeof values === "object" && values !== null && "product_id" in values ? values.product_id : values
|
|
5981
|
+
});
|
|
5982
|
+
};
|
|
5983
|
+
|
|
5984
|
+
// src/hooks/pos/supabase/use-payment-method.ts
|
|
5985
|
+
var paymentMethodMutations = createSupabaseMutations("payment_methods" /* PAYMENT_METHODS */);
|
|
5986
|
+
var posSessionMutations = createSupabaseMutations("pos_sessions" /* POS_SESSIONS */);
|
|
6661
5987
|
var useAddPaymentMethod = () => {
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
5988
|
+
return paymentMethodMutations.useCreate({
|
|
5989
|
+
selectQuery: "id, name",
|
|
5990
|
+
mapInput: ({ name, ...rest }) => chunkJDXUTKMX_js.cleanObject({
|
|
5991
|
+
name,
|
|
5992
|
+
...rest
|
|
5993
|
+
}),
|
|
5994
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
6665
5995
|
});
|
|
6666
5996
|
};
|
|
6667
|
-
var
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
5997
|
+
var useUpdatePaymentMethod = () => {
|
|
5998
|
+
return paymentMethodMutations.useUpdate({
|
|
5999
|
+
selectQuery: "id, name",
|
|
6000
|
+
mapInput: ({ id, ...rest }) => {
|
|
6001
|
+
const updateData = chunkJDXUTKMX_js.cleanObject(rest);
|
|
6002
|
+
return {
|
|
6003
|
+
id,
|
|
6004
|
+
...updateData
|
|
6005
|
+
};
|
|
6006
|
+
},
|
|
6007
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
6672
6008
|
});
|
|
6673
6009
|
};
|
|
6674
|
-
var
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6010
|
+
var useUpdateSessionPaymentMethods = () => {
|
|
6011
|
+
return posSessionMutations.useUpdate({
|
|
6012
|
+
mapInput: (values) => ({
|
|
6013
|
+
id: values.session_id,
|
|
6014
|
+
payment_method_ids: values.payment_method_ids,
|
|
6015
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6016
|
+
})
|
|
6679
6017
|
});
|
|
6680
6018
|
};
|
|
6681
|
-
|
|
6019
|
+
|
|
6020
|
+
// src/hooks/pos/supabase/use-customer.ts
|
|
6021
|
+
var mutations6 = createSupabaseMutations("customers" /* CUSTOMERS */);
|
|
6682
6022
|
var useCreateCustomer = () => {
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6023
|
+
return mutations6.useCreate({
|
|
6024
|
+
selectQuery: "id, name",
|
|
6025
|
+
mapInput: (values) => chunkJDXUTKMX_js.cleanObject({
|
|
6026
|
+
name: values.name,
|
|
6027
|
+
phone: values.phone,
|
|
6028
|
+
email: values.email,
|
|
6029
|
+
address: values.address,
|
|
6030
|
+
street2: values.street2,
|
|
6031
|
+
city: values.city,
|
|
6032
|
+
birth_date: values.birth_date,
|
|
6033
|
+
country_id: values.country_id,
|
|
6034
|
+
state_id: values.state_id,
|
|
6035
|
+
ward_id: values.ward_id
|
|
6036
|
+
}),
|
|
6037
|
+
mapReturn: (data) => [[data.id, data.name]]
|
|
6686
6038
|
});
|
|
6687
6039
|
};
|
|
6688
|
-
var use_create_customer_default = useCreateCustomer;
|
|
6689
6040
|
var useUpdateCustomer = () => {
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6041
|
+
return mutations6.useUpdate({
|
|
6042
|
+
mapInput: ({ customer_id, ...rest }) => {
|
|
6043
|
+
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
6044
|
+
...rest,
|
|
6045
|
+
write_date: (/* @__PURE__ */ new Date()).toISOString()
|
|
6046
|
+
});
|
|
6047
|
+
return {
|
|
6048
|
+
id: customer_id,
|
|
6049
|
+
...updateData
|
|
6050
|
+
};
|
|
6051
|
+
}
|
|
6693
6052
|
});
|
|
6694
6053
|
};
|
|
6695
|
-
var use_update_customer_default = useUpdateCustomer;
|
|
6696
6054
|
var useDeleteCustomer = () => {
|
|
6697
|
-
|
|
6055
|
+
return mutations6.useDelete({
|
|
6056
|
+
mapInput: (values) => typeof values === "object" && values !== null && "customer_id" in values ? values.customer_id : values
|
|
6057
|
+
});
|
|
6058
|
+
};
|
|
6059
|
+
|
|
6060
|
+
// src/hooks/pos/supabase/use-order-line.ts
|
|
6061
|
+
var mutations7 = createSupabaseMutations("order_line" /* ORDER_LINE */);
|
|
6062
|
+
var useAddProductToOrder = () => {
|
|
6063
|
+
return mutations7.useCreate({
|
|
6064
|
+
mapInput: (values) => ({
|
|
6065
|
+
order_id: values.order_id,
|
|
6066
|
+
product_id: values.product_id,
|
|
6067
|
+
qty: values.qty,
|
|
6068
|
+
price_unit: values.price_unit,
|
|
6069
|
+
price_subtotal: values.price_subtotal,
|
|
6070
|
+
price_subtotal_incl: values.price_subtotal_incl,
|
|
6071
|
+
tax_ids: values.tax_ids ?? [],
|
|
6072
|
+
uuid: values.uuid,
|
|
6073
|
+
attribute_value_ids: values.attribute_value_ids ?? [],
|
|
6074
|
+
note: values.note
|
|
6075
|
+
})
|
|
6076
|
+
});
|
|
6077
|
+
};
|
|
6078
|
+
var useUpdateOrderLine = () => {
|
|
6079
|
+
return mutations7.useUpdate({
|
|
6080
|
+
mapInput: ({ order_line_id, ...updatePayload }) => ({
|
|
6081
|
+
id: order_line_id,
|
|
6082
|
+
...updatePayload
|
|
6083
|
+
})
|
|
6084
|
+
});
|
|
6085
|
+
};
|
|
6086
|
+
var useDeleteOrderLine = () => {
|
|
6087
|
+
return mutations7.useDelete({
|
|
6088
|
+
mapInput: (values) => typeof values === "object" && values !== null && "line_id" in values ? values.line_id : values
|
|
6089
|
+
});
|
|
6090
|
+
};
|
|
6091
|
+
var useCreatePayment = () => {
|
|
6092
|
+
const { createPaymentSupabase } = createPaymentSupabaseService();
|
|
6698
6093
|
return reactQuery.useMutation({
|
|
6699
|
-
mutationFn:
|
|
6094
|
+
mutationFn: createPaymentSupabase
|
|
6700
6095
|
});
|
|
6701
6096
|
};
|
|
6702
|
-
var
|
|
6097
|
+
var use_create_payment_default = useCreatePayment;
|
|
6703
6098
|
var useSupaUploadImage = () => {
|
|
6704
6099
|
const { uploadImageSupabase } = uploadImageSupabaseService();
|
|
6705
6100
|
return reactQuery.useMutation({
|
|
@@ -6735,34 +6130,6 @@ var useGetSupaCurrentUser = () => {
|
|
|
6735
6130
|
});
|
|
6736
6131
|
};
|
|
6737
6132
|
var use_get_supa_current_user_default = useGetSupaCurrentUser;
|
|
6738
|
-
var useUpdateCategory = () => {
|
|
6739
|
-
const pos = usePosService();
|
|
6740
|
-
return reactQuery.useMutation({
|
|
6741
|
-
mutationFn: pos.updateCategorySupabase
|
|
6742
|
-
});
|
|
6743
|
-
};
|
|
6744
|
-
var use_update_category_default = useUpdateCategory;
|
|
6745
|
-
var useDeleteCategory = () => {
|
|
6746
|
-
const pos = usePosService();
|
|
6747
|
-
return reactQuery.useMutation({
|
|
6748
|
-
mutationFn: pos.deleteCategorySupabase
|
|
6749
|
-
});
|
|
6750
|
-
};
|
|
6751
|
-
var use_delete_category_default = useDeleteCategory;
|
|
6752
|
-
var useUpdateProduct = () => {
|
|
6753
|
-
const pos = usePosService();
|
|
6754
|
-
return reactQuery.useMutation({
|
|
6755
|
-
mutationFn: pos.updateProductSupabase
|
|
6756
|
-
});
|
|
6757
|
-
};
|
|
6758
|
-
var use_update_product_default = useUpdateProduct;
|
|
6759
|
-
var useDeleteProduct = () => {
|
|
6760
|
-
const pos = usePosService();
|
|
6761
|
-
return reactQuery.useMutation({
|
|
6762
|
-
mutationFn: pos.deleteProductSupabase
|
|
6763
|
-
});
|
|
6764
|
-
};
|
|
6765
|
-
var use_delete_product_default = useDeleteProduct;
|
|
6766
6133
|
var useTogglePosRestaurant = () => {
|
|
6767
6134
|
const pos = usePosService();
|
|
6768
6135
|
return reactQuery.useMutation({
|
|
@@ -6777,13 +6144,13 @@ var usePublicBucket = () => {
|
|
|
6777
6144
|
});
|
|
6778
6145
|
};
|
|
6779
6146
|
var use_public_bucket_default = usePublicBucket;
|
|
6780
|
-
var
|
|
6781
|
-
const
|
|
6147
|
+
var useGetFunctionalModules = () => {
|
|
6148
|
+
const pos = usePosService();
|
|
6782
6149
|
return reactQuery.useMutation({
|
|
6783
|
-
mutationFn:
|
|
6150
|
+
mutationFn: pos.getFunctionalModules
|
|
6784
6151
|
});
|
|
6785
6152
|
};
|
|
6786
|
-
var
|
|
6153
|
+
var use_get_functional_modules_default = useGetFunctionalModules;
|
|
6787
6154
|
var useConfirmCouponPrograms = () => {
|
|
6788
6155
|
const pos = usePosService();
|
|
6789
6156
|
return reactQuery.useMutation({
|
|
@@ -6929,37 +6296,37 @@ var ServiceProvider = ({
|
|
|
6929
6296
|
useRemoveVoucher: use_remove_voucher_default,
|
|
6930
6297
|
useSyncFromUi: use_sync_from_ui_default,
|
|
6931
6298
|
useLoginTenantUser: use_login_tenant_user_default,
|
|
6932
|
-
useAddFloor
|
|
6933
|
-
useAddTable
|
|
6934
|
-
useDeleteFloor
|
|
6935
|
-
useDeleteTable
|
|
6936
|
-
useUpdateFloor
|
|
6937
|
-
useUpdateTable
|
|
6938
|
-
useCreateOrder
|
|
6939
|
-
useAddCategory
|
|
6940
|
-
useAddProductToOrder
|
|
6941
|
-
useUpdateOrderTotalAmount
|
|
6942
|
-
useUpdateOrderLine
|
|
6943
|
-
useUpdateOrder
|
|
6944
|
-
useDeleteOrder
|
|
6945
|
-
useDeleteOrderLine
|
|
6946
|
-
useAddProduct
|
|
6299
|
+
useAddFloor,
|
|
6300
|
+
useAddTable,
|
|
6301
|
+
useDeleteFloor,
|
|
6302
|
+
useDeleteTable,
|
|
6303
|
+
useUpdateFloor,
|
|
6304
|
+
useUpdateTable,
|
|
6305
|
+
useCreateOrder,
|
|
6306
|
+
useAddCategory,
|
|
6307
|
+
useAddProductToOrder,
|
|
6308
|
+
useUpdateOrderTotalAmount,
|
|
6309
|
+
useUpdateOrderLine,
|
|
6310
|
+
useUpdateOrder,
|
|
6311
|
+
useDeleteOrder,
|
|
6312
|
+
useDeleteOrderLine,
|
|
6313
|
+
useAddProduct,
|
|
6947
6314
|
useGetFunctionalModules: use_get_functional_modules_default,
|
|
6948
|
-
useAddPaymentMethod
|
|
6949
|
-
useUpdateSessionPaymentMethods
|
|
6315
|
+
useAddPaymentMethod,
|
|
6316
|
+
useUpdateSessionPaymentMethods,
|
|
6950
6317
|
useCreatePayment: use_create_payment_default,
|
|
6951
|
-
useCreateCustomer
|
|
6952
|
-
useUpdateCustomer
|
|
6953
|
-
useDeleteCustomer
|
|
6318
|
+
useCreateCustomer,
|
|
6319
|
+
useUpdateCustomer,
|
|
6320
|
+
useDeleteCustomer,
|
|
6954
6321
|
useUploadImage: use_upload_image_default,
|
|
6955
6322
|
useGetListUsers: use_get_list_users_default,
|
|
6956
6323
|
useGetListRoles: use_get_list_roles_default,
|
|
6957
6324
|
useAssignRole: use_assign_role_default,
|
|
6958
6325
|
useGetSupaCurrentUser: use_get_supa_current_user_default,
|
|
6959
|
-
useUpdateCategory
|
|
6960
|
-
useDeleteCategory
|
|
6961
|
-
useUpdateProduct
|
|
6962
|
-
useDeleteProduct
|
|
6326
|
+
useUpdateCategory,
|
|
6327
|
+
useDeleteCategory,
|
|
6328
|
+
useUpdateProduct,
|
|
6329
|
+
useDeleteProduct,
|
|
6963
6330
|
useTogglePosRestaurant: use_toggle_pos_restaurant_default,
|
|
6964
6331
|
useActionServerHome: use_action_server_home_default,
|
|
6965
6332
|
useGetCustomerLoyaltyPoint: use_get_customer_loyalty_point_default,
|
|
@@ -6967,7 +6334,7 @@ var ServiceProvider = ({
|
|
|
6967
6334
|
useValidateCouponPrograms: use_validate_coupon_programs_default,
|
|
6968
6335
|
useGetBankProductChannel: use_get_bank_product_channel_default,
|
|
6969
6336
|
usePublicBucket: use_public_bucket_default,
|
|
6970
|
-
useUpdatePaymentMethod
|
|
6337
|
+
useUpdatePaymentMethod
|
|
6971
6338
|
};
|
|
6972
6339
|
return /* @__PURE__ */ jsxRuntime.jsx(ServiceContext.Provider, { value: services, children });
|
|
6973
6340
|
};
|
|
@@ -7039,10 +6406,24 @@ exports.ServiceProvider = ServiceProvider;
|
|
|
7039
6406
|
exports.SupabaseProvider = SupabaseProvider;
|
|
7040
6407
|
exports.VersionGate = VersionGate;
|
|
7041
6408
|
exports.useActionService = useActionService;
|
|
6409
|
+
exports.useAddCategory = useAddCategory;
|
|
6410
|
+
exports.useAddFloor = useAddFloor;
|
|
6411
|
+
exports.useAddPaymentMethod = useAddPaymentMethod;
|
|
6412
|
+
exports.useAddProduct = useAddProduct;
|
|
6413
|
+
exports.useAddProductToOrder = useAddProductToOrder;
|
|
6414
|
+
exports.useAddTable = useAddTable;
|
|
7042
6415
|
exports.useAuthService = useAuthService;
|
|
7043
6416
|
exports.useCompanyService = useCompanyService;
|
|
6417
|
+
exports.useCreateCustomer = useCreateCustomer;
|
|
6418
|
+
exports.useCreateOrder = useCreateOrder;
|
|
7044
6419
|
exports.useDashboardService = useDashboardService;
|
|
7045
|
-
exports.
|
|
6420
|
+
exports.useDeleteCategory = useDeleteCategory;
|
|
6421
|
+
exports.useDeleteCustomer = useDeleteCustomer;
|
|
6422
|
+
exports.useDeleteFloor = useDeleteFloor;
|
|
6423
|
+
exports.useDeleteOrder = useDeleteOrder;
|
|
6424
|
+
exports.useDeleteOrderLine = useDeleteOrderLine;
|
|
6425
|
+
exports.useDeleteProduct = useDeleteProduct;
|
|
6426
|
+
exports.useDeleteTable = useDeleteTable;
|
|
7046
6427
|
exports.useEnv = useEnv;
|
|
7047
6428
|
exports.useExcelService = useExcelService;
|
|
7048
6429
|
exports.useFormService = useFormService;
|
|
@@ -7051,17 +6432,20 @@ exports.useModelService = useModelService;
|
|
|
7051
6432
|
exports.usePosService = usePosService;
|
|
7052
6433
|
exports.useService = useService;
|
|
7053
6434
|
exports.useSupabase = useSupabase;
|
|
7054
|
-
exports.
|
|
6435
|
+
exports.useUpdateCategory = useUpdateCategory;
|
|
6436
|
+
exports.useUpdateCustomer = useUpdateCustomer;
|
|
6437
|
+
exports.useUpdateFloor = useUpdateFloor;
|
|
6438
|
+
exports.useUpdateOrder = useUpdateOrder;
|
|
6439
|
+
exports.useUpdateOrderLine = useUpdateOrderLine;
|
|
6440
|
+
exports.useUpdateOrderTotalAmount = useUpdateOrderTotalAmount;
|
|
6441
|
+
exports.useUpdatePaymentMethod = useUpdatePaymentMethod;
|
|
6442
|
+
exports.useUpdateProduct = useUpdateProduct;
|
|
6443
|
+
exports.useUpdateSessionPaymentMethods = useUpdateSessionPaymentMethods;
|
|
6444
|
+
exports.useUpdateTable = useUpdateTable;
|
|
7055
6445
|
exports.useUserService = useUserService;
|
|
7056
6446
|
exports.useViewService = useViewService;
|
|
7057
6447
|
exports.use_action_server_home_default = use_action_server_home_default;
|
|
7058
|
-
exports.use_add_category_default = use_add_category_default;
|
|
7059
6448
|
exports.use_add_entity_default = use_add_entity_default;
|
|
7060
|
-
exports.use_add_floor_default = use_add_floor_default;
|
|
7061
|
-
exports.use_add_payment_method_default = use_add_payment_method_default;
|
|
7062
|
-
exports.use_add_product_default = use_add_product_default;
|
|
7063
|
-
exports.use_add_product_to_order_default = use_add_product_to_order_default;
|
|
7064
|
-
exports.use_add_table_default = use_add_table_default;
|
|
7065
6449
|
exports.use_app_authenticate_default = use_app_authenticate_default;
|
|
7066
6450
|
exports.use_apply_voucher_default = use_apply_voucher_default;
|
|
7067
6451
|
exports.use_assign_role_default = use_assign_role_default;
|
|
@@ -7071,22 +6455,14 @@ exports.use_change_status_default = use_change_status_default;
|
|
|
7071
6455
|
exports.use_check_payment_default = use_check_payment_default;
|
|
7072
6456
|
exports.use_complete_current_stage_default = use_complete_current_stage_default;
|
|
7073
6457
|
exports.use_confirm_coupon_programs_default = use_confirm_coupon_programs_default;
|
|
7074
|
-
exports.use_create_customer_default = use_create_customer_default;
|
|
7075
6458
|
exports.use_create_e_invoice_default = use_create_e_invoice_default;
|
|
7076
6459
|
exports.use_create_entity_default = use_create_entity_default;
|
|
7077
|
-
exports.use_create_order_default = use_create_order_default;
|
|
7078
6460
|
exports.use_create_payment_default = use_create_payment_default;
|
|
7079
6461
|
exports.use_create_pos_config_default = use_create_pos_config_default;
|
|
7080
6462
|
exports.use_create_session_default = use_create_session_default;
|
|
7081
|
-
exports.use_delete_category_default = use_delete_category_default;
|
|
7082
6463
|
exports.use_delete_comment_default = use_delete_comment_default;
|
|
7083
|
-
exports.use_delete_customer_default = use_delete_customer_default;
|
|
7084
6464
|
exports.use_delete_default = use_delete_default;
|
|
7085
6465
|
exports.use_delete_entity_default = use_delete_entity_default;
|
|
7086
|
-
exports.use_delete_floor_default = use_delete_floor_default;
|
|
7087
|
-
exports.use_delete_order_default = use_delete_order_default;
|
|
7088
|
-
exports.use_delete_product_default = use_delete_product_default;
|
|
7089
|
-
exports.use_delete_table_default = use_delete_table_default;
|
|
7090
6466
|
exports.use_duplicate_record_default = use_duplicate_record_default;
|
|
7091
6467
|
exports.use_export_excel_default = use_export_excel_default;
|
|
7092
6468
|
exports.use_forgot_password_default = use_forgot_password_default;
|
|
@@ -7187,19 +6563,10 @@ exports.use_supa_upload_image_default = use_supa_upload_image_default;
|
|
|
7187
6563
|
exports.use_switch_locale_default = use_switch_locale_default;
|
|
7188
6564
|
exports.use_sync_from_ui_default = use_sync_from_ui_default;
|
|
7189
6565
|
exports.use_toggle_pos_restaurant_default = use_toggle_pos_restaurant_default;
|
|
7190
|
-
exports.use_update_category_default = use_update_category_default;
|
|
7191
6566
|
exports.use_update_closed_session_default = use_update_closed_session_default;
|
|
7192
|
-
exports.use_update_customer_default = use_update_customer_default;
|
|
7193
6567
|
exports.use_update_entity_default = use_update_entity_default;
|
|
7194
|
-
exports.use_update_floor_default = use_update_floor_default;
|
|
7195
|
-
exports.use_update_order_default = use_update_order_default;
|
|
7196
6568
|
exports.use_update_order_status_default = use_update_order_status_default;
|
|
7197
|
-
exports.use_update_order_total_amount_default = use_update_order_total_amount_default;
|
|
7198
6569
|
exports.use_update_password_default = use_update_password_default;
|
|
7199
|
-
exports.use_update_payment_method_default = use_update_payment_method_default;
|
|
7200
|
-
exports.use_update_product_default = use_update_product_default;
|
|
7201
|
-
exports.use_update_session_payment_methods_default = use_update_session_payment_methods_default;
|
|
7202
|
-
exports.use_update_table_default = use_update_table_default;
|
|
7203
6570
|
exports.use_upload_file_default = use_upload_file_default;
|
|
7204
6571
|
exports.use_upload_file_excel_default = use_upload_file_excel_default;
|
|
7205
6572
|
exports.use_upload_id_file_default = use_upload_id_file_default;
|