@fctc/interface-logic 5.4.3 → 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-WVML5L6V.js → chunk-BDDF7KXT.js} +377 -1011
- package/dist/{chunk-PFJ7KPIX.mjs → chunk-VIPA4WIY.mjs} +353 -987
- package/dist/hooks.d.mts +49 -217
- package/dist/hooks.d.ts +49 -217
- 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.js +11 -11
- package/dist/provider.mjs +1 -1
- package/dist/services.d.mts +5 -220
- package/dist/services.d.ts +5 -220
- package/dist/services.js +12 -12
- package/dist/services.mjs +1 -1
- package/package.json +1 -1
|
@@ -3694,524 +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 updateOrderLineSupabaseService = () => {
|
|
3967
|
-
const supabase = useSupabaseOptional();
|
|
3968
|
-
const updateOrderLineSupabase = react.useCallback(
|
|
3969
|
-
async (values) => {
|
|
3970
|
-
if (!supabase) {
|
|
3971
|
-
console.error("Supabase client not initialized");
|
|
3972
|
-
return [];
|
|
3973
|
-
}
|
|
3974
|
-
try {
|
|
3975
|
-
const { error, data } = await supabase.from("order_line" /* ORDER_LINE */).update({
|
|
3976
|
-
order_id: values.order_id,
|
|
3977
|
-
qty: values.qty,
|
|
3978
|
-
price_subtotal: values.price_subtotal,
|
|
3979
|
-
price_subtotal_incl: values.price_subtotal_incl,
|
|
3980
|
-
attribute_value_ids: values.attribute_value_ids ?? [],
|
|
3981
|
-
note: values.note ?? ""
|
|
3982
|
-
}).eq("id", values.order_line_id).select("id").single();
|
|
3983
|
-
if (error) {
|
|
3984
|
-
console.error("Error updating order line:", error);
|
|
3985
|
-
return [];
|
|
3986
|
-
}
|
|
3987
|
-
return [data.id];
|
|
3988
|
-
} catch (error) {
|
|
3989
|
-
console.error("Error updating order line:", error);
|
|
3990
|
-
return [];
|
|
3991
|
-
}
|
|
3992
|
-
},
|
|
3993
|
-
[supabase]
|
|
3994
|
-
);
|
|
3995
|
-
return {
|
|
3996
|
-
updateOrderLineSupabase
|
|
3997
|
-
};
|
|
3998
|
-
};
|
|
3999
|
-
var updateOrderSupabaseService = () => {
|
|
4000
|
-
const supabase = useSupabaseOptional();
|
|
4001
|
-
const updateOrderSupabase = react.useCallback(
|
|
4002
|
-
async (values) => {
|
|
4003
|
-
if (!supabase) {
|
|
4004
|
-
console.error("Supabase client not initialized");
|
|
4005
|
-
return [];
|
|
4006
|
-
}
|
|
4007
|
-
const { order_id, ...rest } = values;
|
|
4008
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
4009
|
-
...rest,
|
|
4010
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4011
|
-
});
|
|
4012
|
-
if (rest.partner_id === 0) {
|
|
4013
|
-
Object.assign(updateData, { partner_id: null });
|
|
4014
|
-
}
|
|
4015
|
-
try {
|
|
4016
|
-
const { error, data } = await supabase.from("orders" /* ORDERS */).update(updateData).eq("id", order_id).select("id").single();
|
|
4017
|
-
if (error) {
|
|
4018
|
-
console.error("Error updating order:", error);
|
|
4019
|
-
return [];
|
|
4020
|
-
}
|
|
4021
|
-
return [data.id];
|
|
4022
|
-
} catch (error) {
|
|
4023
|
-
console.error("Error updating order:", error);
|
|
4024
|
-
return [];
|
|
4025
|
-
}
|
|
4026
|
-
},
|
|
4027
|
-
[supabase]
|
|
4028
|
-
);
|
|
4029
|
-
return {
|
|
4030
|
-
updateOrderSupabase
|
|
4031
|
-
};
|
|
4032
|
-
};
|
|
4033
|
-
var deleteOrderSupabaseService = () => {
|
|
4034
|
-
const supabase = useSupabaseOptional();
|
|
4035
|
-
const deleteOrderSupabase = react.useCallback(
|
|
4036
|
-
async (values) => {
|
|
4037
|
-
if (!supabase) {
|
|
4038
|
-
console.error("Supabase client not initialized");
|
|
4039
|
-
return [];
|
|
4040
|
-
}
|
|
4041
|
-
try {
|
|
4042
|
-
const { error, data } = await supabase.from("orders" /* ORDERS */).delete().eq("id", values.id).select("id").single();
|
|
4043
|
-
if (error) {
|
|
4044
|
-
console.error("Error deleting order:", error);
|
|
4045
|
-
return [];
|
|
4046
|
-
}
|
|
4047
|
-
return [data.id];
|
|
4048
|
-
} catch (error) {
|
|
4049
|
-
console.error("Error deleting order:", error);
|
|
4050
|
-
return [];
|
|
4051
|
-
}
|
|
4052
|
-
},
|
|
4053
|
-
[supabase]
|
|
4054
|
-
);
|
|
4055
|
-
return {
|
|
4056
|
-
deleteOrderSupabase
|
|
4057
|
-
};
|
|
4058
|
-
};
|
|
4059
|
-
var deleteOrderLineSupabaseService = () => {
|
|
4060
|
-
const supabase = useSupabaseOptional();
|
|
4061
|
-
const deleteOrderLineSupabase = react.useCallback(
|
|
4062
|
-
async (values) => {
|
|
4063
|
-
if (!supabase) {
|
|
4064
|
-
console.error("Supabase client not initialized");
|
|
4065
|
-
return [];
|
|
4066
|
-
}
|
|
4067
|
-
try {
|
|
4068
|
-
const { error, data } = await supabase.from("order_line" /* ORDER_LINE */).delete().eq("id", values.line_id).select("id").single();
|
|
4069
|
-
if (error) {
|
|
4070
|
-
console.error("Error deleting order line:", error);
|
|
4071
|
-
return [];
|
|
4072
|
-
}
|
|
4073
|
-
return [data.id];
|
|
4074
|
-
} catch (error) {
|
|
4075
|
-
console.error("Error deleting order line:", error);
|
|
4076
|
-
return [];
|
|
4077
|
-
}
|
|
4078
|
-
},
|
|
4079
|
-
[supabase]
|
|
4080
|
-
);
|
|
4081
|
-
return {
|
|
4082
|
-
deleteOrderLineSupabase
|
|
4083
|
-
};
|
|
4084
|
-
};
|
|
4085
|
-
var addCategorySupabaseService = () => {
|
|
4086
|
-
const supabase = useSupabaseOptional();
|
|
4087
|
-
const addCategorySupabase = react.useCallback(
|
|
4088
|
-
async (values) => {
|
|
4089
|
-
if (!supabase) {
|
|
4090
|
-
console.error("Supabase client not initialized");
|
|
4091
|
-
return null;
|
|
4092
|
-
}
|
|
4093
|
-
try {
|
|
4094
|
-
const { data, error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).insert({
|
|
4095
|
-
name: values.name
|
|
4096
|
-
}).select("id, name").single();
|
|
4097
|
-
if (error) {
|
|
4098
|
-
console.error("Error adding Category:", error);
|
|
4099
|
-
return null;
|
|
4100
|
-
}
|
|
4101
|
-
return [[data.id, data.name]];
|
|
4102
|
-
} catch (error) {
|
|
4103
|
-
console.error("Error adding Category:", error);
|
|
4104
|
-
return null;
|
|
4105
|
-
}
|
|
4106
|
-
},
|
|
4107
|
-
[supabase]
|
|
4108
|
-
);
|
|
4109
|
-
return {
|
|
4110
|
-
addCategorySupabase
|
|
4111
|
-
};
|
|
4112
|
-
};
|
|
4113
|
-
var addProductSupabaseService = () => {
|
|
4114
|
-
const supabase = useSupabaseOptional();
|
|
4115
|
-
const addProductSupabase = react.useCallback(
|
|
4116
|
-
async (values) => {
|
|
4117
|
-
if (!supabase) {
|
|
4118
|
-
console.error("Supabase client not initialized");
|
|
4119
|
-
return null;
|
|
4120
|
-
}
|
|
4121
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4122
|
-
name: values.name,
|
|
4123
|
-
product_tmpl_id: values.product_tmpl_id,
|
|
4124
|
-
product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
|
|
4125
|
-
combo_ids: values.combo_ids ?? [],
|
|
4126
|
-
categ_id: values.categ_id,
|
|
4127
|
-
pos_categ_ids: values.pos_categ_ids ?? [],
|
|
4128
|
-
display_name: values.display_name || values.name,
|
|
4129
|
-
default_code: values.default_code ?? "",
|
|
4130
|
-
description_sale: values.description_sale ?? "",
|
|
4131
|
-
lst_price: values.lst_price ?? 0,
|
|
4132
|
-
standard_price: values.standard_price ?? 0,
|
|
4133
|
-
barcode: values.barcode ?? "",
|
|
4134
|
-
image_url: values.image_url ?? "",
|
|
4135
|
-
active: values.active ?? true
|
|
4136
|
-
});
|
|
4137
|
-
try {
|
|
4138
|
-
const { data, error } = await supabase.from("products" /* PRODUCTS */).insert(insertData).select("id, name").single();
|
|
4139
|
-
if (error) {
|
|
4140
|
-
console.error("Error adding product:", error);
|
|
4141
|
-
return null;
|
|
4142
|
-
}
|
|
4143
|
-
return [[data.id, data.name]];
|
|
4144
|
-
} catch (error) {
|
|
4145
|
-
console.error("Error adding product:", error);
|
|
4146
|
-
return null;
|
|
4147
|
-
}
|
|
4148
|
-
},
|
|
4149
|
-
[supabase]
|
|
4150
|
-
);
|
|
4151
|
-
return {
|
|
4152
|
-
addProductSupabase
|
|
4153
|
-
};
|
|
4154
|
-
};
|
|
4155
|
-
var addPaymentMethodSupabaseService = () => {
|
|
4156
|
-
const supabase = useSupabaseOptional();
|
|
4157
|
-
const addPaymentMethodSupabase = react.useCallback(
|
|
4158
|
-
async (values) => {
|
|
4159
|
-
if (!supabase) {
|
|
4160
|
-
console.error("Supabase client not initialized");
|
|
4161
|
-
return null;
|
|
4162
|
-
}
|
|
4163
|
-
const { name, ...rest } = values;
|
|
4164
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4165
|
-
name,
|
|
4166
|
-
...rest
|
|
4167
|
-
});
|
|
4168
|
-
try {
|
|
4169
|
-
const { data, error } = await supabase.from("payment_methods" /* PAYMENT_METHODS */).insert(insertData).select("id, name").single();
|
|
4170
|
-
if (error) {
|
|
4171
|
-
console.error("Error adding payment method:", error);
|
|
4172
|
-
return null;
|
|
4173
|
-
}
|
|
4174
|
-
return [[data.id, data.name]];
|
|
4175
|
-
} catch (error) {
|
|
4176
|
-
console.error("Error adding payment method:", error);
|
|
4177
|
-
return null;
|
|
4178
|
-
}
|
|
4179
|
-
},
|
|
4180
|
-
[supabase]
|
|
4181
|
-
);
|
|
4182
|
-
return {
|
|
4183
|
-
addPaymentMethodSupabase
|
|
4184
|
-
};
|
|
4185
|
-
};
|
|
4186
|
-
var updateSessionPaymentMethodsSupabaseService = () => {
|
|
4187
|
-
const supabase = useSupabaseOptional();
|
|
4188
|
-
const updateSessionPaymentMethodsSupabase = react.useCallback(
|
|
4189
|
-
async (values) => {
|
|
4190
|
-
if (!supabase) {
|
|
4191
|
-
console.error("Supabase client not initialized");
|
|
4192
|
-
return null;
|
|
4193
|
-
}
|
|
4194
|
-
try {
|
|
4195
|
-
const { data, error } = await supabase.from("pos_sessions" /* POS_SESSIONS */).update({
|
|
4196
|
-
payment_method_ids: values.payment_method_ids,
|
|
4197
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4198
|
-
}).eq("id", values.session_id).select("id").single();
|
|
4199
|
-
if (error) {
|
|
4200
|
-
console.error("Error updating session payment methods:", error);
|
|
4201
|
-
return null;
|
|
4202
|
-
}
|
|
4203
|
-
return [data.id];
|
|
4204
|
-
} catch (error) {
|
|
4205
|
-
console.error("Error updating session payment methods:", error);
|
|
4206
|
-
return null;
|
|
4207
|
-
}
|
|
4208
|
-
},
|
|
4209
|
-
[supabase]
|
|
4210
|
-
);
|
|
4211
|
-
return {
|
|
4212
|
-
updateSessionPaymentMethodsSupabase
|
|
4213
|
-
};
|
|
4214
|
-
};
|
|
4215
3697
|
var createPaymentSupabaseService = () => {
|
|
4216
3698
|
const supabase = useSupabaseOptional();
|
|
4217
3699
|
const createPaymentSupabase = react.useCallback(
|
|
@@ -4253,101 +3735,6 @@ var createPaymentSupabaseService = () => {
|
|
|
4253
3735
|
createPaymentSupabase
|
|
4254
3736
|
};
|
|
4255
3737
|
};
|
|
4256
|
-
var createCustomerSupabaseService = () => {
|
|
4257
|
-
const supabase = useSupabaseOptional();
|
|
4258
|
-
const createCustomerSupabase = react.useCallback(
|
|
4259
|
-
async (values) => {
|
|
4260
|
-
if (!supabase) {
|
|
4261
|
-
console.error("Supabase client not initialized");
|
|
4262
|
-
return null;
|
|
4263
|
-
}
|
|
4264
|
-
try {
|
|
4265
|
-
const insertData = chunkJDXUTKMX_js.cleanObject({
|
|
4266
|
-
name: values.name,
|
|
4267
|
-
phone: values.phone,
|
|
4268
|
-
email: values.email,
|
|
4269
|
-
address: values.address,
|
|
4270
|
-
street2: values.street2,
|
|
4271
|
-
city: values.city,
|
|
4272
|
-
birth_date: values.birth_date,
|
|
4273
|
-
country_id: values.country_id,
|
|
4274
|
-
state_id: values.state_id,
|
|
4275
|
-
ward_id: values.ward_id
|
|
4276
|
-
});
|
|
4277
|
-
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).insert(insertData).select("id, name").single();
|
|
4278
|
-
if (error) {
|
|
4279
|
-
console.error("Error creating customer:", error);
|
|
4280
|
-
return null;
|
|
4281
|
-
}
|
|
4282
|
-
return [[data.id, data.name]];
|
|
4283
|
-
} catch (error) {
|
|
4284
|
-
console.error("Error creating customer:", error);
|
|
4285
|
-
return null;
|
|
4286
|
-
}
|
|
4287
|
-
},
|
|
4288
|
-
[supabase]
|
|
4289
|
-
);
|
|
4290
|
-
return {
|
|
4291
|
-
createCustomerSupabase
|
|
4292
|
-
};
|
|
4293
|
-
};
|
|
4294
|
-
var updateCustomerSupabaseService = () => {
|
|
4295
|
-
const supabase = useSupabaseOptional();
|
|
4296
|
-
const updateCustomerSupabase = react.useCallback(
|
|
4297
|
-
async (values) => {
|
|
4298
|
-
if (!supabase) {
|
|
4299
|
-
console.error("Supabase client not initialized");
|
|
4300
|
-
return null;
|
|
4301
|
-
}
|
|
4302
|
-
try {
|
|
4303
|
-
const { customer_id, ...rest } = values;
|
|
4304
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
4305
|
-
...rest,
|
|
4306
|
-
write_date: (/* @__PURE__ */ new Date()).toISOString()
|
|
4307
|
-
});
|
|
4308
|
-
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).update(updateData).eq("id", customer_id).select("id").single();
|
|
4309
|
-
if (error) {
|
|
4310
|
-
console.error("Error updating customer:", error);
|
|
4311
|
-
return null;
|
|
4312
|
-
}
|
|
4313
|
-
return [data.id];
|
|
4314
|
-
} catch (error) {
|
|
4315
|
-
console.error("Error updating customer:", error);
|
|
4316
|
-
return null;
|
|
4317
|
-
}
|
|
4318
|
-
},
|
|
4319
|
-
[supabase]
|
|
4320
|
-
);
|
|
4321
|
-
return {
|
|
4322
|
-
updateCustomerSupabase
|
|
4323
|
-
};
|
|
4324
|
-
};
|
|
4325
|
-
var deleteCustomerSupabaseService = () => {
|
|
4326
|
-
const supabase = useSupabaseOptional();
|
|
4327
|
-
const deleteCustomerSupabase = react.useCallback(
|
|
4328
|
-
async (values) => {
|
|
4329
|
-
if (!supabase) {
|
|
4330
|
-
console.error("Supabase client not initialized");
|
|
4331
|
-
return null;
|
|
4332
|
-
}
|
|
4333
|
-
try {
|
|
4334
|
-
const { error } = await supabase.from("customers" /* CUSTOMERS */).delete().eq("id", values.customer_id);
|
|
4335
|
-
if (error) {
|
|
4336
|
-
console.error("Error deleting customer:", error);
|
|
4337
|
-
return null;
|
|
4338
|
-
}
|
|
4339
|
-
return [values.customer_id];
|
|
4340
|
-
} catch (error) {
|
|
4341
|
-
console.error("Error deleting customer:", error);
|
|
4342
|
-
return null;
|
|
4343
|
-
}
|
|
4344
|
-
},
|
|
4345
|
-
[supabase]
|
|
4346
|
-
);
|
|
4347
|
-
return {
|
|
4348
|
-
deleteCustomerSupabase
|
|
4349
|
-
};
|
|
4350
|
-
};
|
|
4351
3738
|
var uploadImageSupabaseService = () => {
|
|
4352
3739
|
const supabase = useSupabaseOptional();
|
|
4353
3740
|
const uploadImageSupabase = react.useCallback(
|
|
@@ -4457,169 +3844,62 @@ var getStatesSupabaseService = () => {
|
|
|
4457
3844
|
if (!supabase) return { length: 0, records: [] };
|
|
4458
3845
|
const { data, error } = await supabase.from("states" /* STATES */).select("*");
|
|
4459
3846
|
if (error) {
|
|
4460
|
-
console.error("Error fetching states:", error);
|
|
4461
|
-
return { length: 0, records: [] };
|
|
4462
|
-
}
|
|
4463
|
-
const records = data || [];
|
|
4464
|
-
return { length: records.length, records };
|
|
4465
|
-
}, [supabase]);
|
|
4466
|
-
return {
|
|
4467
|
-
getStatesSupabase
|
|
4468
|
-
};
|
|
4469
|
-
};
|
|
4470
|
-
var getWardsSupabaseService = () => {
|
|
4471
|
-
const supabase = useSupabaseOptional();
|
|
4472
|
-
const getWardsSupabase = react.useCallback(async () => {
|
|
4473
|
-
if (!supabase) return { length: 0, records: [] };
|
|
4474
|
-
const { data, error } = await supabase.from("wards" /* WARDS */).select("*");
|
|
4475
|
-
if (error) {
|
|
4476
|
-
console.error("Error fetching wards:", error);
|
|
4477
|
-
return { length: 0, records: [] };
|
|
4478
|
-
}
|
|
4479
|
-
const records = data || [];
|
|
4480
|
-
return { length: records.length, records };
|
|
4481
|
-
}, [supabase]);
|
|
4482
|
-
return {
|
|
4483
|
-
getWardsSupabase
|
|
4484
|
-
};
|
|
4485
|
-
};
|
|
4486
|
-
var getPartnerTitlesSupabaseService = () => {
|
|
4487
|
-
const supabase = useSupabaseOptional();
|
|
4488
|
-
const getPartnerTitlesSupabase = react.useCallback(async () => {
|
|
4489
|
-
if (!supabase) return { length: 0, records: [] };
|
|
4490
|
-
const { data, error } = await supabase.from("partner_titles" /* PARTNER_TITLES */).select("*");
|
|
4491
|
-
if (error) {
|
|
4492
|
-
console.error("Error fetching partner titles:", error);
|
|
4493
|
-
return { length: 0, records: [] };
|
|
4494
|
-
}
|
|
4495
|
-
const records = data || [];
|
|
4496
|
-
return { length: records.length, records };
|
|
4497
|
-
}, [supabase]);
|
|
4498
|
-
return {
|
|
4499
|
-
getPartnerTitlesSupabase
|
|
4500
|
-
};
|
|
4501
|
-
};
|
|
4502
|
-
var getSupaCurrentUser = (env) => {
|
|
4503
|
-
const getSupaCurrentUser2 = react.useCallback(
|
|
4504
|
-
({ tenantId }) => {
|
|
4505
|
-
return env?.requests.get("/api/v2/auth/me" /* SUPABASE_CURRENT_USER */, {
|
|
4506
|
-
headers: {
|
|
4507
|
-
"Content-Type": "application/json",
|
|
4508
|
-
"x-tenant-id": tenantId
|
|
4509
|
-
}
|
|
4510
|
-
});
|
|
4511
|
-
},
|
|
4512
|
-
[env]
|
|
4513
|
-
);
|
|
4514
|
-
return {
|
|
4515
|
-
getSupaCurrentUser: getSupaCurrentUser2
|
|
4516
|
-
};
|
|
4517
|
-
};
|
|
4518
|
-
var updateCategorySupabaseService = () => {
|
|
4519
|
-
const supabase = useSupabaseOptional();
|
|
4520
|
-
const updateCategorySupabase = react.useCallback(
|
|
4521
|
-
async (values) => {
|
|
4522
|
-
if (!supabase) {
|
|
4523
|
-
console.error("Supabase client not initialized");
|
|
4524
|
-
return null;
|
|
4525
|
-
}
|
|
4526
|
-
try {
|
|
4527
|
-
const { category_id, ...rest } = values;
|
|
4528
|
-
const { data, error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).update(rest).eq("id", category_id).select("id").single();
|
|
4529
|
-
if (error) {
|
|
4530
|
-
console.error("Error updating category:", error);
|
|
4531
|
-
return null;
|
|
4532
|
-
}
|
|
4533
|
-
return [data.id];
|
|
4534
|
-
} catch (error) {
|
|
4535
|
-
console.error("Error updating category:", error);
|
|
4536
|
-
return null;
|
|
4537
|
-
}
|
|
4538
|
-
},
|
|
4539
|
-
[supabase]
|
|
4540
|
-
);
|
|
4541
|
-
return {
|
|
4542
|
-
updateCategorySupabase
|
|
4543
|
-
};
|
|
4544
|
-
};
|
|
4545
|
-
var deleteCategorySupabaseService = () => {
|
|
4546
|
-
const supabase = useSupabaseOptional();
|
|
4547
|
-
const deleteCategorySupabase = react.useCallback(
|
|
4548
|
-
async (values) => {
|
|
4549
|
-
if (!supabase) {
|
|
4550
|
-
console.error("Supabase client not initialized");
|
|
4551
|
-
return null;
|
|
4552
|
-
}
|
|
4553
|
-
try {
|
|
4554
|
-
const { error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).delete().eq("id", values.category_id);
|
|
4555
|
-
if (error) {
|
|
4556
|
-
console.error("Error deleting category:", error);
|
|
4557
|
-
return null;
|
|
4558
|
-
}
|
|
4559
|
-
return [values.category_id];
|
|
4560
|
-
} catch (error) {
|
|
4561
|
-
console.error("Error deleting category:", error);
|
|
4562
|
-
return null;
|
|
4563
|
-
}
|
|
4564
|
-
},
|
|
4565
|
-
[supabase]
|
|
4566
|
-
);
|
|
3847
|
+
console.error("Error fetching states:", error);
|
|
3848
|
+
return { length: 0, records: [] };
|
|
3849
|
+
}
|
|
3850
|
+
const records = data || [];
|
|
3851
|
+
return { length: records.length, records };
|
|
3852
|
+
}, [supabase]);
|
|
4567
3853
|
return {
|
|
4568
|
-
|
|
3854
|
+
getStatesSupabase
|
|
4569
3855
|
};
|
|
4570
3856
|
};
|
|
4571
|
-
var
|
|
3857
|
+
var getWardsSupabaseService = () => {
|
|
4572
3858
|
const supabase = useSupabaseOptional();
|
|
4573
|
-
const
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
}
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
if (error) {
|
|
4584
|
-
console.error("Error updating product:", error);
|
|
4585
|
-
return null;
|
|
4586
|
-
}
|
|
4587
|
-
return [data.id];
|
|
4588
|
-
} catch (error) {
|
|
4589
|
-
console.error("Error updating product:", error);
|
|
4590
|
-
return null;
|
|
4591
|
-
}
|
|
4592
|
-
},
|
|
4593
|
-
[supabase]
|
|
4594
|
-
);
|
|
3859
|
+
const getWardsSupabase = react.useCallback(async () => {
|
|
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]);
|
|
4595
3869
|
return {
|
|
4596
|
-
|
|
3870
|
+
getWardsSupabase
|
|
4597
3871
|
};
|
|
4598
3872
|
};
|
|
4599
|
-
var
|
|
3873
|
+
var getPartnerTitlesSupabaseService = () => {
|
|
4600
3874
|
const supabase = useSupabaseOptional();
|
|
4601
|
-
const
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
}
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
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]);
|
|
3885
|
+
return {
|
|
3886
|
+
getPartnerTitlesSupabase
|
|
3887
|
+
};
|
|
3888
|
+
};
|
|
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
|
|
4612
3896
|
}
|
|
4613
|
-
|
|
4614
|
-
} catch (error) {
|
|
4615
|
-
console.error("Error deleting product:", error);
|
|
4616
|
-
return null;
|
|
4617
|
-
}
|
|
3897
|
+
});
|
|
4618
3898
|
},
|
|
4619
|
-
[
|
|
3899
|
+
[env]
|
|
4620
3900
|
);
|
|
4621
3901
|
return {
|
|
4622
|
-
|
|
3902
|
+
getSupaCurrentUser: getSupaCurrentUser2
|
|
4623
3903
|
};
|
|
4624
3904
|
};
|
|
4625
3905
|
var togglePosRestaurantSupabaseService = () => {
|
|
@@ -4668,36 +3948,6 @@ var publicBucketService = (env) => {
|
|
|
4668
3948
|
publicBucket
|
|
4669
3949
|
};
|
|
4670
3950
|
};
|
|
4671
|
-
var updatePaymentMethodSupabaseService = () => {
|
|
4672
|
-
const supabase = useSupabaseOptional();
|
|
4673
|
-
const updatePaymentMethodSupabase = react.useCallback(
|
|
4674
|
-
async (values) => {
|
|
4675
|
-
if (!supabase) {
|
|
4676
|
-
console.error("Supabase client not initialized");
|
|
4677
|
-
return null;
|
|
4678
|
-
}
|
|
4679
|
-
const { id, ...rest } = values;
|
|
4680
|
-
const updateData = chunkJDXUTKMX_js.cleanObject({
|
|
4681
|
-
...rest
|
|
4682
|
-
});
|
|
4683
|
-
try {
|
|
4684
|
-
const { data, error } = await supabase.from("payment_methods" /* PAYMENT_METHODS */).update(updateData).eq("id", id).select("id, name").single();
|
|
4685
|
-
if (error) {
|
|
4686
|
-
console.error("Error updating payment method:", error);
|
|
4687
|
-
return null;
|
|
4688
|
-
}
|
|
4689
|
-
return [[data.id, data.name]];
|
|
4690
|
-
} catch (error) {
|
|
4691
|
-
console.error("Error updating payment method:", error);
|
|
4692
|
-
return null;
|
|
4693
|
-
}
|
|
4694
|
-
},
|
|
4695
|
-
[supabase]
|
|
4696
|
-
);
|
|
4697
|
-
return {
|
|
4698
|
-
updatePaymentMethodSupabase
|
|
4699
|
-
};
|
|
4700
|
-
};
|
|
4701
3951
|
|
|
4702
3952
|
// src/services/pos-service/index.ts
|
|
4703
3953
|
var serviceFactories = [
|
|
@@ -4737,28 +3987,7 @@ var serviceFactories = [
|
|
|
4737
3987
|
removeVoucherService,
|
|
4738
3988
|
syncFromUiService,
|
|
4739
3989
|
getCustomerLoyaltyPointService,
|
|
4740
|
-
addFloorSupabaseService,
|
|
4741
|
-
addTableSupabaseService,
|
|
4742
|
-
updateFloorSupabaseService,
|
|
4743
|
-
updateTableSupabaseService,
|
|
4744
|
-
deleteFloorSupabaseService,
|
|
4745
|
-
deleteTableSupabaseService,
|
|
4746
|
-
addCategorySupabaseService,
|
|
4747
|
-
createOrderSupabaseService,
|
|
4748
|
-
addProductToOrderSupabaseService,
|
|
4749
|
-
updateOrderTotalAmountSupabaseService,
|
|
4750
|
-
updateOrderLineSupabaseService,
|
|
4751
|
-
updateOrderSupabaseService,
|
|
4752
|
-
deleteOrderSupabaseService,
|
|
4753
|
-
deleteOrderLineSupabaseService,
|
|
4754
|
-
addProductSupabaseService,
|
|
4755
|
-
getFunctionalModulesService,
|
|
4756
|
-
addPaymentMethodSupabaseService,
|
|
4757
|
-
updateSessionPaymentMethodsSupabaseService,
|
|
4758
3990
|
createPaymentSupabaseService,
|
|
4759
|
-
createCustomerSupabaseService,
|
|
4760
|
-
updateCustomerSupabaseService,
|
|
4761
|
-
deleteCustomerSupabaseService,
|
|
4762
3991
|
uploadImageSupabaseService,
|
|
4763
3992
|
getListUsersService,
|
|
4764
3993
|
getListRolesService,
|
|
@@ -4767,16 +3996,12 @@ var serviceFactories = [
|
|
|
4767
3996
|
getWardsSupabaseService,
|
|
4768
3997
|
getPartnerTitlesSupabaseService,
|
|
4769
3998
|
getSupaCurrentUser,
|
|
4770
|
-
updateCategorySupabaseService,
|
|
4771
|
-
deleteCategorySupabaseService,
|
|
4772
|
-
updateProductSupabaseService,
|
|
4773
|
-
deleteProductSupabaseService,
|
|
4774
3999
|
togglePosRestaurantSupabaseService,
|
|
4775
4000
|
publicBucketService,
|
|
4776
|
-
updatePaymentMethodSupabaseService,
|
|
4777
4001
|
confirmCouponProgramsService,
|
|
4778
4002
|
validateCouponProgramsService,
|
|
4779
|
-
getBankProductChannelService
|
|
4003
|
+
getBankProductChannelService,
|
|
4004
|
+
getFunctionalModulesService
|
|
4780
4005
|
];
|
|
4781
4006
|
var usePosService = () => {
|
|
4782
4007
|
const { env } = useEnv();
|
|
@@ -6547,160 +5772,329 @@ var useGetCustomerLoyaltyPoint = () => {
|
|
|
6547
5772
|
});
|
|
6548
5773
|
};
|
|
6549
5774
|
var use_get_customer_loyalty_point_default = useGetCustomerLoyaltyPoint;
|
|
6550
|
-
var
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
5775
|
+
var createSupabaseMutations = (tableName, primaryKeyColumn = "id") => {
|
|
5776
|
+
return {
|
|
5777
|
+
useCreate: (options) => {
|
|
5778
|
+
const supabase = useSupabaseOptional();
|
|
5779
|
+
return reactQuery.useMutation({
|
|
5780
|
+
...options,
|
|
5781
|
+
mutationFn: async (variables) => {
|
|
5782
|
+
if (!supabase) throw new Error("Supabase client not initialized");
|
|
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();
|
|
5786
|
+
if (error) {
|
|
5787
|
+
console.error(`Error creating ${tableName}:`, error);
|
|
5788
|
+
throw error;
|
|
5789
|
+
}
|
|
5790
|
+
if (options?.mapReturn) {
|
|
5791
|
+
return options.mapReturn(data, values);
|
|
5792
|
+
}
|
|
5793
|
+
return [data[primaryKeyColumn]];
|
|
5794
|
+
}
|
|
5795
|
+
});
|
|
5796
|
+
},
|
|
5797
|
+
useUpdate: (options) => {
|
|
5798
|
+
const supabase = useSupabaseOptional();
|
|
5799
|
+
return reactQuery.useMutation({
|
|
5800
|
+
...options,
|
|
5801
|
+
mutationFn: async (variables) => {
|
|
5802
|
+
if (!supabase) throw new Error("Supabase client not initialized");
|
|
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();
|
|
5807
|
+
if (error) {
|
|
5808
|
+
console.error(`Error updating ${tableName}:`, error);
|
|
5809
|
+
throw error;
|
|
5810
|
+
}
|
|
5811
|
+
if (options?.mapReturn) {
|
|
5812
|
+
return options.mapReturn(data, { id, ...values });
|
|
5813
|
+
}
|
|
5814
|
+
return [data[primaryKeyColumn]];
|
|
5815
|
+
}
|
|
5816
|
+
});
|
|
5817
|
+
},
|
|
5818
|
+
useDelete: (options) => {
|
|
5819
|
+
const supabase = useSupabaseOptional();
|
|
5820
|
+
return reactQuery.useMutation({
|
|
5821
|
+
...options,
|
|
5822
|
+
mutationFn: async (variables) => {
|
|
5823
|
+
if (!supabase) throw new Error("Supabase client not initialized");
|
|
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);
|
|
5827
|
+
if (error) {
|
|
5828
|
+
console.error(`Error deleting ${tableName}:`, error);
|
|
5829
|
+
throw error;
|
|
5830
|
+
}
|
|
5831
|
+
if (options?.mapReturn) {
|
|
5832
|
+
return options.mapReturn(null, variables);
|
|
5833
|
+
}
|
|
5834
|
+
return [idValue];
|
|
5835
|
+
}
|
|
5836
|
+
});
|
|
5837
|
+
}
|
|
5838
|
+
};
|
|
6555
5839
|
};
|
|
6556
|
-
|
|
5840
|
+
|
|
5841
|
+
// src/hooks/pos/supabase/use-table.ts
|
|
5842
|
+
var mutations = createSupabaseMutations("restaurant_tables" /* RESTAURANT_TABLES */);
|
|
6557
5843
|
var useAddTable = () => {
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
});
|
|
6562
|
-
};
|
|
6563
|
-
var use_add_table_default = useAddTable;
|
|
6564
|
-
var useUpdateFloor = () => {
|
|
6565
|
-
const { updateFloorSupabase } = updateFloorSupabaseService();
|
|
6566
|
-
return reactQuery.useMutation({
|
|
6567
|
-
mutationFn: updateFloorSupabase
|
|
5844
|
+
return mutations.useCreate({
|
|
5845
|
+
selectQuery: "id, table_number",
|
|
5846
|
+
mapReturn: (data) => [[data.id, data.table_number]]
|
|
6568
5847
|
});
|
|
6569
5848
|
};
|
|
6570
|
-
var use_update_floor_default = useUpdateFloor;
|
|
6571
5849
|
var useUpdateTable = () => {
|
|
6572
|
-
|
|
6573
|
-
return reactQuery.useMutation({
|
|
6574
|
-
mutationFn: updateTableSupabase
|
|
6575
|
-
});
|
|
6576
|
-
};
|
|
6577
|
-
var use_update_table_default = useUpdateTable;
|
|
6578
|
-
var useDeleteFloor = () => {
|
|
6579
|
-
const { deleteFloorSupabase } = deleteFloorSupabaseService();
|
|
6580
|
-
return reactQuery.useMutation({
|
|
6581
|
-
mutationFn: deleteFloorSupabase
|
|
6582
|
-
});
|
|
5850
|
+
return mutations.useUpdate();
|
|
6583
5851
|
};
|
|
6584
|
-
var use_delete_floor_default = useDeleteFloor;
|
|
6585
5852
|
var useDeleteTable = () => {
|
|
6586
|
-
|
|
6587
|
-
return reactQuery.useMutation({
|
|
6588
|
-
mutationFn: deleteTableSupabase
|
|
6589
|
-
});
|
|
5853
|
+
return mutations.useDelete();
|
|
6590
5854
|
};
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
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]]
|
|
6596
5862
|
});
|
|
6597
5863
|
};
|
|
6598
|
-
var
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
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]]
|
|
6603
5887
|
});
|
|
6604
5888
|
};
|
|
6605
|
-
var
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
5889
|
+
var useUpdateOrder = () => {
|
|
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
|
+
}
|
|
6610
5905
|
});
|
|
6611
5906
|
};
|
|
6612
|
-
var use_add_product_to_order_default = useAddProductToOrder;
|
|
6613
5907
|
var useUpdateOrderTotalAmount = () => {
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
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
|
+
})
|
|
6617
5915
|
});
|
|
6618
5916
|
};
|
|
6619
|
-
var
|
|
6620
|
-
|
|
6621
|
-
const { updateOrderLineSupabase } = updateOrderLineSupabaseService();
|
|
6622
|
-
return reactQuery.useMutation({
|
|
6623
|
-
mutationFn: updateOrderLineSupabase
|
|
6624
|
-
});
|
|
5917
|
+
var useDeleteOrder = () => {
|
|
5918
|
+
return mutations3.useDelete();
|
|
6625
5919
|
};
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
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]]
|
|
6631
5927
|
});
|
|
6632
5928
|
};
|
|
6633
|
-
var
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
5929
|
+
var useUpdateCategory = () => {
|
|
5930
|
+
return mutations4.useUpdate({
|
|
5931
|
+
mapInput: ({ category_id, ...updatePayload }) => ({
|
|
5932
|
+
id: category_id,
|
|
5933
|
+
...updatePayload
|
|
5934
|
+
})
|
|
6638
5935
|
});
|
|
6639
5936
|
};
|
|
6640
|
-
var
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
return reactQuery.useMutation({
|
|
6644
|
-
mutationFn: deleteOrderLineSupabase
|
|
5937
|
+
var useDeleteCategory = () => {
|
|
5938
|
+
return mutations4.useDelete({
|
|
5939
|
+
mapInput: (values) => typeof values === "object" && values !== null && "category_id" in values ? values.category_id : values
|
|
6645
5940
|
});
|
|
6646
5941
|
};
|
|
6647
|
-
|
|
5942
|
+
|
|
5943
|
+
// src/hooks/pos/supabase/use-product.ts
|
|
5944
|
+
var mutations5 = createSupabaseMutations("products" /* PRODUCTS */);
|
|
6648
5945
|
var useAddProduct = () => {
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
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]]
|
|
6652
5965
|
});
|
|
6653
5966
|
};
|
|
6654
|
-
var
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
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
|
+
}
|
|
6659
5976
|
});
|
|
6660
5977
|
};
|
|
6661
|
-
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 */);
|
|
6662
5987
|
var useAddPaymentMethod = () => {
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
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]]
|
|
6666
5995
|
});
|
|
6667
5996
|
};
|
|
6668
|
-
var
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
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]]
|
|
6673
6008
|
});
|
|
6674
6009
|
};
|
|
6675
|
-
var
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
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
|
+
})
|
|
6680
6017
|
});
|
|
6681
6018
|
};
|
|
6682
|
-
|
|
6019
|
+
|
|
6020
|
+
// src/hooks/pos/supabase/use-customer.ts
|
|
6021
|
+
var mutations6 = createSupabaseMutations("customers" /* CUSTOMERS */);
|
|
6683
6022
|
var useCreateCustomer = () => {
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
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]]
|
|
6687
6038
|
});
|
|
6688
6039
|
};
|
|
6689
|
-
var use_create_customer_default = useCreateCustomer;
|
|
6690
6040
|
var useUpdateCustomer = () => {
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
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
|
+
}
|
|
6694
6052
|
});
|
|
6695
6053
|
};
|
|
6696
|
-
var use_update_customer_default = useUpdateCustomer;
|
|
6697
6054
|
var useDeleteCustomer = () => {
|
|
6698
|
-
|
|
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();
|
|
6699
6093
|
return reactQuery.useMutation({
|
|
6700
|
-
mutationFn:
|
|
6094
|
+
mutationFn: createPaymentSupabase
|
|
6701
6095
|
});
|
|
6702
6096
|
};
|
|
6703
|
-
var
|
|
6097
|
+
var use_create_payment_default = useCreatePayment;
|
|
6704
6098
|
var useSupaUploadImage = () => {
|
|
6705
6099
|
const { uploadImageSupabase } = uploadImageSupabaseService();
|
|
6706
6100
|
return reactQuery.useMutation({
|
|
@@ -6736,34 +6130,6 @@ var useGetSupaCurrentUser = () => {
|
|
|
6736
6130
|
});
|
|
6737
6131
|
};
|
|
6738
6132
|
var use_get_supa_current_user_default = useGetSupaCurrentUser;
|
|
6739
|
-
var useUpdateCategory = () => {
|
|
6740
|
-
const pos = usePosService();
|
|
6741
|
-
return reactQuery.useMutation({
|
|
6742
|
-
mutationFn: pos.updateCategorySupabase
|
|
6743
|
-
});
|
|
6744
|
-
};
|
|
6745
|
-
var use_update_category_default = useUpdateCategory;
|
|
6746
|
-
var useDeleteCategory = () => {
|
|
6747
|
-
const pos = usePosService();
|
|
6748
|
-
return reactQuery.useMutation({
|
|
6749
|
-
mutationFn: pos.deleteCategorySupabase
|
|
6750
|
-
});
|
|
6751
|
-
};
|
|
6752
|
-
var use_delete_category_default = useDeleteCategory;
|
|
6753
|
-
var useUpdateProduct = () => {
|
|
6754
|
-
const pos = usePosService();
|
|
6755
|
-
return reactQuery.useMutation({
|
|
6756
|
-
mutationFn: pos.updateProductSupabase
|
|
6757
|
-
});
|
|
6758
|
-
};
|
|
6759
|
-
var use_update_product_default = useUpdateProduct;
|
|
6760
|
-
var useDeleteProduct = () => {
|
|
6761
|
-
const pos = usePosService();
|
|
6762
|
-
return reactQuery.useMutation({
|
|
6763
|
-
mutationFn: pos.deleteProductSupabase
|
|
6764
|
-
});
|
|
6765
|
-
};
|
|
6766
|
-
var use_delete_product_default = useDeleteProduct;
|
|
6767
6133
|
var useTogglePosRestaurant = () => {
|
|
6768
6134
|
const pos = usePosService();
|
|
6769
6135
|
return reactQuery.useMutation({
|
|
@@ -6778,13 +6144,13 @@ var usePublicBucket = () => {
|
|
|
6778
6144
|
});
|
|
6779
6145
|
};
|
|
6780
6146
|
var use_public_bucket_default = usePublicBucket;
|
|
6781
|
-
var
|
|
6782
|
-
const
|
|
6147
|
+
var useGetFunctionalModules = () => {
|
|
6148
|
+
const pos = usePosService();
|
|
6783
6149
|
return reactQuery.useMutation({
|
|
6784
|
-
mutationFn:
|
|
6150
|
+
mutationFn: pos.getFunctionalModules
|
|
6785
6151
|
});
|
|
6786
6152
|
};
|
|
6787
|
-
var
|
|
6153
|
+
var use_get_functional_modules_default = useGetFunctionalModules;
|
|
6788
6154
|
var useConfirmCouponPrograms = () => {
|
|
6789
6155
|
const pos = usePosService();
|
|
6790
6156
|
return reactQuery.useMutation({
|
|
@@ -6930,37 +6296,37 @@ var ServiceProvider = ({
|
|
|
6930
6296
|
useRemoveVoucher: use_remove_voucher_default,
|
|
6931
6297
|
useSyncFromUi: use_sync_from_ui_default,
|
|
6932
6298
|
useLoginTenantUser: use_login_tenant_user_default,
|
|
6933
|
-
useAddFloor
|
|
6934
|
-
useAddTable
|
|
6935
|
-
useDeleteFloor
|
|
6936
|
-
useDeleteTable
|
|
6937
|
-
useUpdateFloor
|
|
6938
|
-
useUpdateTable
|
|
6939
|
-
useCreateOrder
|
|
6940
|
-
useAddCategory
|
|
6941
|
-
useAddProductToOrder
|
|
6942
|
-
useUpdateOrderTotalAmount
|
|
6943
|
-
useUpdateOrderLine
|
|
6944
|
-
useUpdateOrder
|
|
6945
|
-
useDeleteOrder
|
|
6946
|
-
useDeleteOrderLine
|
|
6947
|
-
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,
|
|
6948
6314
|
useGetFunctionalModules: use_get_functional_modules_default,
|
|
6949
|
-
useAddPaymentMethod
|
|
6950
|
-
useUpdateSessionPaymentMethods
|
|
6315
|
+
useAddPaymentMethod,
|
|
6316
|
+
useUpdateSessionPaymentMethods,
|
|
6951
6317
|
useCreatePayment: use_create_payment_default,
|
|
6952
|
-
useCreateCustomer
|
|
6953
|
-
useUpdateCustomer
|
|
6954
|
-
useDeleteCustomer
|
|
6318
|
+
useCreateCustomer,
|
|
6319
|
+
useUpdateCustomer,
|
|
6320
|
+
useDeleteCustomer,
|
|
6955
6321
|
useUploadImage: use_upload_image_default,
|
|
6956
6322
|
useGetListUsers: use_get_list_users_default,
|
|
6957
6323
|
useGetListRoles: use_get_list_roles_default,
|
|
6958
6324
|
useAssignRole: use_assign_role_default,
|
|
6959
6325
|
useGetSupaCurrentUser: use_get_supa_current_user_default,
|
|
6960
|
-
useUpdateCategory
|
|
6961
|
-
useDeleteCategory
|
|
6962
|
-
useUpdateProduct
|
|
6963
|
-
useDeleteProduct
|
|
6326
|
+
useUpdateCategory,
|
|
6327
|
+
useDeleteCategory,
|
|
6328
|
+
useUpdateProduct,
|
|
6329
|
+
useDeleteProduct,
|
|
6964
6330
|
useTogglePosRestaurant: use_toggle_pos_restaurant_default,
|
|
6965
6331
|
useActionServerHome: use_action_server_home_default,
|
|
6966
6332
|
useGetCustomerLoyaltyPoint: use_get_customer_loyalty_point_default,
|
|
@@ -6968,7 +6334,7 @@ var ServiceProvider = ({
|
|
|
6968
6334
|
useValidateCouponPrograms: use_validate_coupon_programs_default,
|
|
6969
6335
|
useGetBankProductChannel: use_get_bank_product_channel_default,
|
|
6970
6336
|
usePublicBucket: use_public_bucket_default,
|
|
6971
|
-
useUpdatePaymentMethod
|
|
6337
|
+
useUpdatePaymentMethod
|
|
6972
6338
|
};
|
|
6973
6339
|
return /* @__PURE__ */ jsxRuntime.jsx(ServiceContext.Provider, { value: services, children });
|
|
6974
6340
|
};
|
|
@@ -7040,9 +6406,24 @@ exports.ServiceProvider = ServiceProvider;
|
|
|
7040
6406
|
exports.SupabaseProvider = SupabaseProvider;
|
|
7041
6407
|
exports.VersionGate = VersionGate;
|
|
7042
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;
|
|
7043
6415
|
exports.useAuthService = useAuthService;
|
|
7044
6416
|
exports.useCompanyService = useCompanyService;
|
|
6417
|
+
exports.useCreateCustomer = useCreateCustomer;
|
|
6418
|
+
exports.useCreateOrder = useCreateOrder;
|
|
7045
6419
|
exports.useDashboardService = useDashboardService;
|
|
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,16 +6432,20 @@ exports.useModelService = useModelService;
|
|
|
7051
6432
|
exports.usePosService = usePosService;
|
|
7052
6433
|
exports.useService = useService;
|
|
7053
6434
|
exports.useSupabase = useSupabase;
|
|
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;
|
|
7054
6445
|
exports.useUserService = useUserService;
|
|
7055
6446
|
exports.useViewService = useViewService;
|
|
7056
6447
|
exports.use_action_server_home_default = use_action_server_home_default;
|
|
7057
|
-
exports.use_add_category_default = use_add_category_default;
|
|
7058
6448
|
exports.use_add_entity_default = use_add_entity_default;
|
|
7059
|
-
exports.use_add_floor_default = use_add_floor_default;
|
|
7060
|
-
exports.use_add_payment_method_default = use_add_payment_method_default;
|
|
7061
|
-
exports.use_add_product_default = use_add_product_default;
|
|
7062
|
-
exports.use_add_product_to_order_default = use_add_product_to_order_default;
|
|
7063
|
-
exports.use_add_table_default = use_add_table_default;
|
|
7064
6449
|
exports.use_app_authenticate_default = use_app_authenticate_default;
|
|
7065
6450
|
exports.use_apply_voucher_default = use_apply_voucher_default;
|
|
7066
6451
|
exports.use_assign_role_default = use_assign_role_default;
|
|
@@ -7070,23 +6455,14 @@ exports.use_change_status_default = use_change_status_default;
|
|
|
7070
6455
|
exports.use_check_payment_default = use_check_payment_default;
|
|
7071
6456
|
exports.use_complete_current_stage_default = use_complete_current_stage_default;
|
|
7072
6457
|
exports.use_confirm_coupon_programs_default = use_confirm_coupon_programs_default;
|
|
7073
|
-
exports.use_create_customer_default = use_create_customer_default;
|
|
7074
6458
|
exports.use_create_e_invoice_default = use_create_e_invoice_default;
|
|
7075
6459
|
exports.use_create_entity_default = use_create_entity_default;
|
|
7076
|
-
exports.use_create_order_default = use_create_order_default;
|
|
7077
6460
|
exports.use_create_payment_default = use_create_payment_default;
|
|
7078
6461
|
exports.use_create_pos_config_default = use_create_pos_config_default;
|
|
7079
6462
|
exports.use_create_session_default = use_create_session_default;
|
|
7080
|
-
exports.use_delete_category_default = use_delete_category_default;
|
|
7081
6463
|
exports.use_delete_comment_default = use_delete_comment_default;
|
|
7082
|
-
exports.use_delete_customer_default = use_delete_customer_default;
|
|
7083
6464
|
exports.use_delete_default = use_delete_default;
|
|
7084
6465
|
exports.use_delete_entity_default = use_delete_entity_default;
|
|
7085
|
-
exports.use_delete_floor_default = use_delete_floor_default;
|
|
7086
|
-
exports.use_delete_order_default = use_delete_order_default;
|
|
7087
|
-
exports.use_delete_order_line_default = use_delete_order_line_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,20 +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
|
-
exports.use_update_order_line_default = use_update_order_line_default;
|
|
7197
6568
|
exports.use_update_order_status_default = use_update_order_status_default;
|
|
7198
|
-
exports.use_update_order_total_amount_default = use_update_order_total_amount_default;
|
|
7199
6569
|
exports.use_update_password_default = use_update_password_default;
|
|
7200
|
-
exports.use_update_payment_method_default = use_update_payment_method_default;
|
|
7201
|
-
exports.use_update_product_default = use_update_product_default;
|
|
7202
|
-
exports.use_update_session_payment_methods_default = use_update_session_payment_methods_default;
|
|
7203
|
-
exports.use_update_table_default = use_update_table_default;
|
|
7204
6570
|
exports.use_upload_file_default = use_upload_file_default;
|
|
7205
6571
|
exports.use_upload_file_excel_default = use_upload_file_excel_default;
|
|
7206
6572
|
exports.use_upload_id_file_default = use_upload_id_file_default;
|