@timardex/cluemart-shared 1.3.88 → 1.3.90

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/index.cjs CHANGED
@@ -6242,15 +6242,34 @@ var eventInfoSchema = yup2.object().shape({
6242
6242
  // src/yupSchema/vendor.ts
6243
6243
  var yup3 = __toESM(require("yup"));
6244
6244
  var vendroMenuSchema = yup3.object().shape({
6245
- description: yup3.string().trim().optional().nullable(),
6246
- price: yup3.number().transform((value, originalValue) => originalValue === "" ? null : value).min(0).optional().nullable(),
6247
- title: yup3.string().trim().optional().nullable()
6245
+ description: yup3.string().trim().nullable().defined().test(
6246
+ "description-required",
6247
+ "Product description is required",
6248
+ function(value) {
6249
+ return value !== null && value !== void 0 && value.trim().length > 0;
6250
+ }
6251
+ ),
6252
+ name: yup3.string().trim().nullable().defined().test("name-required", "Product name is required", function(value) {
6253
+ return value !== null && value !== void 0 && value.trim().length > 0;
6254
+ }),
6255
+ price: yup3.number().transform((value, originalValue) => originalValue === "" ? null : value).min(0).nullable().defined().test("price-required", "Product price is required", function(value) {
6256
+ return value !== null && value !== void 0;
6257
+ }),
6258
+ productGroups: yup3.array().of(yup3.string().defined()).transform(
6259
+ (value, originalValue) => originalValue === void 0 ? null : value
6260
+ ).nullable().test(
6261
+ "productGroups-required",
6262
+ "Product groups are required",
6263
+ function(value) {
6264
+ return value !== null && Array.isArray(value) && value.length > 0;
6265
+ }
6266
+ ).defined()
6248
6267
  });
6249
6268
  var vendorSchema = globalResourceSchema.shape({
6250
6269
  categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
6251
6270
  foodTruck: yup3.boolean().label("Food Truck").required("Please specify if the vendor is a food truck"),
6252
6271
  multiLocation: yup3.boolean().required("Multi location is required"),
6253
- products: yup3.array().of(vendroMenuSchema).nullable().default(null),
6272
+ products: yup3.array().of(vendroMenuSchema).nullable().optional(),
6254
6273
  vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
6255
6274
  });
6256
6275
  var unregisteredVendorSchema = yup3.object().shape({