@timardex/cluemart-shared 1.4.61 → 1.4.62

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
@@ -6362,32 +6362,19 @@ var eventInfoSchema = yup2.object().shape({
6362
6362
 
6363
6363
  // src/yupSchema/vendor.ts
6364
6364
  var yup3 = __toESM(require("yup"));
6365
- var vendroMenuSchema = yup3.object().shape({
6366
- description: yup3.string().trim().nullable(),
6367
- name: yup3.string().trim().nullable().defined().test("name-required", "Product name is required", function(value) {
6368
- return value !== null && value !== void 0 && value.trim().length > 0;
6369
- }),
6370
- price: yup3.number().transform((value, originalValue) => originalValue === "" ? null : value).min(0).nullable().defined().test("price-required", "Product price is required", function(value) {
6371
- return value !== null && value !== void 0;
6372
- }),
6373
- priceUnit: yup3.string().trim().nullable().defined().test("unit-required", "Product unit is required", function(value) {
6374
- return value !== null && value !== void 0 && value.trim().length > 0;
6375
- }),
6376
- productGroups: yup3.array().of(yup3.string().defined()).transform(
6377
- (value, originalValue) => originalValue === void 0 ? null : value
6378
- ).nullable().test(
6379
- "productGroups-required",
6380
- "Product groups are required",
6381
- function(value) {
6382
- return value !== null && Array.isArray(value) && value.length > 0;
6383
- }
6384
- ).defined()
6365
+ var vendorMenuSchema = yup3.object({
6366
+ description: yup3.string().nullable().optional(),
6367
+ name: yup3.string().nullable().required("Product name is required"),
6368
+ price: yup3.number().transform((v, o) => o === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
6369
+ priceUnit: yup3.string().required("Product unit is required"),
6370
+ productGroups: yup3.array().of(yup3.string().defined()).min(1, "Product groups are required").required("Product groups are required")
6385
6371
  });
6386
6372
  var vendorSchema = globalResourceSchema.shape({
6387
6373
  categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
6388
6374
  foodTruck: yup3.boolean().label("Food Truck").required("Please specify if the vendor is a food truck"),
6389
6375
  products: yup3.object().shape({
6390
- productsList: yup3.array().of(vendroMenuSchema).nullable().optional()
6376
+ active: yup3.boolean().nullable().optional(),
6377
+ productsList: yup3.array().of(vendorMenuSchema).nullable().optional()
6391
6378
  }).nullable().optional(),
6392
6379
  vendorType: yup3.mixed().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
6393
6380
  });