@timardex/cluemart-shared 1.7.35 → 1.7.36
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/auth/index.cjs +1 -0
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.mjs +1 -0
- package/dist/auth/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +6 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +6 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/hooks/index.mjs
CHANGED
|
@@ -688,8 +688,12 @@ var appSettingsSchema = yup9.object({
|
|
|
688
688
|
// src/yupSchema/coupon.ts
|
|
689
689
|
import * as yup10 from "yup";
|
|
690
690
|
var couponPurchaseOptionSchema = yup10.object().shape({
|
|
691
|
-
buy: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("
|
|
692
|
-
get: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("
|
|
691
|
+
buy: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("How many do they need to buy?").typeError("Buy must be a number").integer("Buy must be a whole number").min(1, "Buy must be at least 1").required("Buy is required"),
|
|
692
|
+
get: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("How many do they get?").typeError("Get must be a number").integer("Get must be a whole number").min(1, "Get must be at least 1").required("Get is required").test("get-less-than-buy", "Get must be less than Buy", function(value) {
|
|
693
|
+
const { buy } = this.parent;
|
|
694
|
+
if (value === void 0 || buy === void 0) return true;
|
|
695
|
+
return value < buy;
|
|
696
|
+
}),
|
|
693
697
|
type: yup10.mixed().oneOf(["PURCHASE" /* PURCHASE */], "Type must be PURCHASE").required("Type is required"),
|
|
694
698
|
unit: yup10.string().label("Unit").trim().required("Unit is required")
|
|
695
699
|
});
|