data-validation-proximity 1.1.3 → 1.2.1
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/index.js +46 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -208,6 +208,27 @@ const userSchema = joi.object({
|
|
|
208
208
|
cart: joi.string().allow(null).allow(''),
|
|
209
209
|
google: joi.boolean(),
|
|
210
210
|
profileImage: joi.string(),
|
|
211
|
+
// Google Sign-In fields for mobile authentication
|
|
212
|
+
serverAuthCode: joi.string().when('google', {
|
|
213
|
+
is: true,
|
|
214
|
+
then: joi.required(),
|
|
215
|
+
otherwise: joi.forbidden()
|
|
216
|
+
}),
|
|
217
|
+
googleId: joi.string().when('google', {
|
|
218
|
+
is: true,
|
|
219
|
+
then: joi.required(),
|
|
220
|
+
otherwise: joi.forbidden()
|
|
221
|
+
}),
|
|
222
|
+
photoUrl: joi.string().when('google', {
|
|
223
|
+
is: true,
|
|
224
|
+
then: joi.required(),
|
|
225
|
+
otherwise: joi.forbidden()
|
|
226
|
+
}),
|
|
227
|
+
displayName: joi.string().when('google', {
|
|
228
|
+
is: true,
|
|
229
|
+
then: joi.required(),
|
|
230
|
+
otherwise: joi.forbidden()
|
|
231
|
+
}),
|
|
211
232
|
});
|
|
212
233
|
|
|
213
234
|
exports.userSchemaValidation = createValidationMiddleware(userSchema);
|
|
@@ -231,6 +252,27 @@ const userLoginSchema = joi.object({
|
|
|
231
252
|
password: joi.string().min(6),
|
|
232
253
|
google: joi.boolean(),
|
|
233
254
|
name: joi.string(),
|
|
255
|
+
// Google Sign-In fields for mobile authentication
|
|
256
|
+
serverAuthCode: joi.string().when('google', {
|
|
257
|
+
is: true,
|
|
258
|
+
then: joi.required(),
|
|
259
|
+
otherwise: joi.forbidden()
|
|
260
|
+
}),
|
|
261
|
+
googleId: joi.string().when('google', {
|
|
262
|
+
is: true,
|
|
263
|
+
then: joi.required(),
|
|
264
|
+
otherwise: joi.forbidden()
|
|
265
|
+
}),
|
|
266
|
+
photoUrl: joi.string().when('google', {
|
|
267
|
+
is: true,
|
|
268
|
+
then: joi.required(),
|
|
269
|
+
otherwise: joi.forbidden()
|
|
270
|
+
}),
|
|
271
|
+
displayName: joi.string().when('google', {
|
|
272
|
+
is: true,
|
|
273
|
+
then: joi.required(),
|
|
274
|
+
otherwise: joi.forbidden()
|
|
275
|
+
}),
|
|
234
276
|
});
|
|
235
277
|
|
|
236
278
|
exports.userLoginSchemaValidation = createValidationMiddleware(userLoginSchema);
|
|
@@ -302,7 +344,6 @@ exports.itemSchemaValidation = createValidationMiddleware(itemSchema);
|
|
|
302
344
|
|
|
303
345
|
const createCategorySchema = joi.object({
|
|
304
346
|
name: joi.string().required(),
|
|
305
|
-
description: joi.string().required(),
|
|
306
347
|
});
|
|
307
348
|
|
|
308
349
|
exports.createCategorySchemaValidation = createValidationMiddleware(createCategorySchema);
|
|
@@ -520,6 +561,10 @@ const schemaStore = joi.object({
|
|
|
520
561
|
workingTime: workingTimeSchema,
|
|
521
562
|
policy: policySchema,
|
|
522
563
|
image: joi.string().min(3),
|
|
564
|
+
storeCategories: joi.array(),
|
|
565
|
+
productCategories: joi.array(),
|
|
566
|
+
storeRayons: joi.array(),
|
|
567
|
+
template: joi.number(),
|
|
523
568
|
});
|
|
524
569
|
|
|
525
570
|
exports.schemaStoreValidation = (req, res, next) => {
|