We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 691ace4 commit faac0c2Copy full SHA for faac0c2
components/coupon/coupon_validation.js
@@ -0,0 +1,29 @@
1
+import Joi from "joi";
2
+
3
+const createCouponValidation = Joi.object({
4
+ code: Joi.string().required().trim(),
5
+ expires: Joi.date().required(),
6
+ discount: Joi.number().required().min(0),
7
+});
8
9
+const getSpecificCouponValidation = Joi.object({
10
+ id: Joi.string().hex().length(24).required(),
11
12
13
+const updateCouponValidation = Joi.object({
14
15
+ code: Joi.string().trim(),
16
+ expires: Joi.date(),
17
+ discount: Joi.number().min(0),
18
19
20
+const deleteCouponValidation = Joi.object({
21
22
23
24
+export {
25
+ createCouponValidation,
26
+ getSpecificCouponValidation,
27
+ updateCouponValidation,
28
+ deleteCouponValidation,
29
+};
0 commit comments