@timardex/cluemart-shared 1.2.1 → 1.2.3
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/{ad-utcwpkKv.d.mts → ad-CjJ4eOXQ.d.mts} +1 -1
- package/dist/{ad-BTebYGa6.d.ts → ad-bZBXVzB4.d.ts} +1 -1
- package/dist/{auth-DO7TRji8.d.ts → auth-CUFK_NWr.d.ts} +1 -1
- package/dist/{auth-BH5KfDFw.d.mts → auth-DD3sE2bg.d.mts} +1 -1
- package/dist/formFields/index.cjs +35 -24
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +4 -3
- package/dist/formFields/index.d.ts +4 -3
- package/dist/formFields/index.mjs +34 -24
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-CntHxpmg.d.mts → global-CuI_od8W.d.mts} +19 -11
- package/dist/{global-K1ennCrw.d.ts → global-DB_pNCpw.d.ts} +19 -11
- package/dist/graphql/index.cjs +29 -13
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.mjs +29 -13
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +21 -18
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +21 -18
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +85 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.mjs +84 -55
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/hooks/index.cjs
CHANGED
|
@@ -521,9 +521,16 @@ var eventInfoSchema = yup2.object().shape({
|
|
|
521
521
|
|
|
522
522
|
// src/yupSchema/vendor.ts
|
|
523
523
|
var yup3 = __toESM(require("yup"));
|
|
524
|
+
var vendroMenuSchema = yup3.object().shape({
|
|
525
|
+
description: yup3.string().trim().max(100).optional().nullable(),
|
|
526
|
+
price: yup3.number().transform((value, originalValue) => originalValue === "" ? null : value).min(0).optional().nullable(),
|
|
527
|
+
title: yup3.string().trim().max(50).optional().nullable()
|
|
528
|
+
});
|
|
524
529
|
var vendorSchema = globalResourceSchema.shape({
|
|
525
530
|
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
526
531
|
multiLocation: yup3.boolean().required("Multi location is required"),
|
|
532
|
+
products: yup3.array().of(vendroMenuSchema).optional().nullable(),
|
|
533
|
+
specialties: yup3.array().of(vendroMenuSchema).optional().nullable(),
|
|
527
534
|
vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
528
535
|
});
|
|
529
536
|
var vendorInfoSchema = yup3.object().shape({
|
|
@@ -725,7 +732,7 @@ var globalDefaultValues = {
|
|
|
725
732
|
logoUpload: null,
|
|
726
733
|
name: "",
|
|
727
734
|
partners: null,
|
|
728
|
-
|
|
735
|
+
promoCodes: [],
|
|
729
736
|
region: "",
|
|
730
737
|
socialMedia: []
|
|
731
738
|
};
|
|
@@ -782,19 +789,18 @@ var defaultEventInfoFormValues = {
|
|
|
782
789
|
};
|
|
783
790
|
var defaultVendorFormValues = {
|
|
784
791
|
...globalDefaultValues,
|
|
792
|
+
availability: {
|
|
793
|
+
corporate: false,
|
|
794
|
+
private: false,
|
|
795
|
+
school: false
|
|
796
|
+
},
|
|
785
797
|
categories: [],
|
|
786
798
|
locations: null,
|
|
787
799
|
multiLocation: false,
|
|
788
800
|
products: null,
|
|
789
|
-
specialities: null,
|
|
790
801
|
vendorType: "stallholder" /* STALLHOLDER */
|
|
791
802
|
};
|
|
792
803
|
var defaultVendorInfoFormValues = {
|
|
793
|
-
availability: {
|
|
794
|
-
corporate: false,
|
|
795
|
-
private: false,
|
|
796
|
-
school: false
|
|
797
|
-
},
|
|
798
804
|
compliance: { foodBeverageLicense: false, liabilityInsurance: false },
|
|
799
805
|
contactDetails: {
|
|
800
806
|
email: null,
|
|
@@ -833,7 +839,7 @@ function mapBaseResourceTypeToFormData(data) {
|
|
|
833
839
|
name: data.name,
|
|
834
840
|
owner: data.owner,
|
|
835
841
|
partners: data.partners,
|
|
836
|
-
|
|
842
|
+
promoCodes: data.promoCodes,
|
|
837
843
|
region: data.region,
|
|
838
844
|
socialMedia: data.socialMedia
|
|
839
845
|
};
|
|
@@ -857,11 +863,11 @@ function useVendorForm(data) {
|
|
|
857
863
|
if (data) {
|
|
858
864
|
reset({
|
|
859
865
|
...mapBaseResourceTypeToFormData(data),
|
|
866
|
+
availability: data.availability,
|
|
860
867
|
categories: data.categories,
|
|
861
868
|
locations: data.locations,
|
|
862
869
|
multiLocation: data.multiLocation,
|
|
863
870
|
products: data.products,
|
|
864
|
-
specialities: data.specialities,
|
|
865
871
|
vendorType: data.vendorType
|
|
866
872
|
});
|
|
867
873
|
} else {
|
|
@@ -871,6 +877,7 @@ function useVendorForm(data) {
|
|
|
871
877
|
const {
|
|
872
878
|
_id,
|
|
873
879
|
active,
|
|
880
|
+
availability,
|
|
874
881
|
categories,
|
|
875
882
|
cover,
|
|
876
883
|
coverUpload,
|
|
@@ -885,10 +892,9 @@ function useVendorForm(data) {
|
|
|
885
892
|
owner,
|
|
886
893
|
partners,
|
|
887
894
|
products,
|
|
888
|
-
|
|
895
|
+
promoCodes,
|
|
889
896
|
region,
|
|
890
897
|
socialMedia,
|
|
891
|
-
specialities,
|
|
892
898
|
vendorType
|
|
893
899
|
} = getValues();
|
|
894
900
|
return {
|
|
@@ -896,6 +902,7 @@ function useVendorForm(data) {
|
|
|
896
902
|
fields: {
|
|
897
903
|
_id,
|
|
898
904
|
active,
|
|
905
|
+
availability,
|
|
899
906
|
categories,
|
|
900
907
|
cover,
|
|
901
908
|
coverUpload,
|
|
@@ -910,10 +917,9 @@ function useVendorForm(data) {
|
|
|
910
917
|
owner,
|
|
911
918
|
partners,
|
|
912
919
|
products,
|
|
913
|
-
|
|
920
|
+
promoCodes,
|
|
914
921
|
region,
|
|
915
922
|
socialMedia,
|
|
916
|
-
specialities,
|
|
917
923
|
vendorType
|
|
918
924
|
},
|
|
919
925
|
formState: { errors },
|
|
@@ -945,7 +951,6 @@ function useVendorInfoForm(data) {
|
|
|
945
951
|
if (data) {
|
|
946
952
|
reset({
|
|
947
953
|
_id: data._id,
|
|
948
|
-
availability: data.availability,
|
|
949
954
|
compliance: data.compliance,
|
|
950
955
|
contactDetails: data.contactDetails,
|
|
951
956
|
documents: data.documents,
|
|
@@ -961,7 +966,6 @@ function useVendorInfoForm(data) {
|
|
|
961
966
|
}, [data]);
|
|
962
967
|
const {
|
|
963
968
|
_id,
|
|
964
|
-
availability,
|
|
965
969
|
compliance,
|
|
966
970
|
contactDetails,
|
|
967
971
|
documents,
|
|
@@ -975,7 +979,6 @@ function useVendorInfoForm(data) {
|
|
|
975
979
|
control,
|
|
976
980
|
fields: {
|
|
977
981
|
_id,
|
|
978
|
-
availability,
|
|
979
982
|
compliance,
|
|
980
983
|
contactDetails,
|
|
981
984
|
documents,
|
|
@@ -1043,7 +1046,7 @@ function useEventForm(data) {
|
|
|
1043
1046
|
nzbn,
|
|
1044
1047
|
owner,
|
|
1045
1048
|
partners,
|
|
1046
|
-
|
|
1049
|
+
promoCodes,
|
|
1047
1050
|
provider,
|
|
1048
1051
|
rainOrShine,
|
|
1049
1052
|
region,
|
|
@@ -1069,7 +1072,7 @@ function useEventForm(data) {
|
|
|
1069
1072
|
nzbn,
|
|
1070
1073
|
owner,
|
|
1071
1074
|
partners,
|
|
1072
|
-
|
|
1075
|
+
promoCodes,
|
|
1073
1076
|
provider,
|
|
1074
1077
|
rainOrShine,
|
|
1075
1078
|
region,
|