Shoppings Cart
1.0.0
#عربة_التسوق
groupXDatabase
. يمكنك تنظيف قاعدة البيانات التي استخدمتها مسبقًا وإعادة ذلك.project/productsManagementGroupX
{
fname : {string, mandatory},
lname : {string, mandatory},
email : {string, mandatory, valid email, unique},
profileImage : {string, mandatory}, // s3 link
phone : {string, mandatory, unique, valid Indian mobile number},
password : {string, mandatory, minLen 8, maxLen 15}, // encrypted password
address : {
shipping : {
street : {string, mandatory},
city : {string, mandatory},
pincode : {number, mandatory}
},
billing : {
street : {string, mandatory},
city : {string, mandatory},
pincode : {number, mandatory}
}
},
createdAt : {timestamp},
updatedAt : {timestamp}
}
{
" status " : true,
" message " : " User created successfully " ,
" data " : {
" fname " : " John " ,
" lname " : " Doe " ,
" email " : " [email protected] " ,
" profileImage " : " https://classroom-training-bucket.s3.ap-south-1.amazonaws.com/user/copernico-p_kICQCOM4s-unsplash.jpg " ,
" phone " : 9876543210,
" password " : " $2b$10$DpOSGb0B7cT0f6L95RnpWO2P/AtEoE6OF9diIiAEP7QrTMaV29Kmm " ,
" address " : {
" shipping " : {
" street " : " MG Road " ,
" city " : " Indore " ,
" pincode " : 452001
},
" billing " : {
" street " : " MG Road " ,
" city " : " Indore " ,
" pincode " : 452001
}
},
" _id " : " 6162876abdcb70afeeaf9cf5 " ,
" createdAt " : " 2021-10-10T06:25:46.051Z " ,
" updatedAt " : " 2021-10-10T06:25:46.051Z " ,
" __v " : 0
}
}
ملاحظة: هناك تغيير طفيف في نص الاستجابة. يجب عليك أيضًا إرجاع معرف المستخدم بالإضافة إلى رمز JWT.
{
" status " : true,
" message " : " User login successfull " ,
" data " : {
" userId " : " 6165f29cfe83625cf2c10a5c " ,
" token " : " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MTYyODc2YWJkY2I3MGFmZWVhZjljZjUiLCJpYXQiOjE2MzM4NDczNzYsImV4cCI6MTYzMzg4MzM3Nn0.PgcBPLLg4J01Hyin-zR6BCk7JHBY-RpuWMG_oIK7aV8 "
}
}
{
" status " : true,
" message " : " User profile details " ,
" data " : {
" address " : {
" shipping " : {
" street " : " MG Road " ,
" city " : " Indore " ,
" pincode " : 452001
},
" billing " : {
" street " : " MG Road " ,
" city " : " Indore " ,
" pincode " : 452001
}
},
" _id " : " 6162876abdcb70afeeaf9cf5 " ,
" fname " : " John " ,
" lname " : " Doe " ,
" email " : " [email protected] " ,
" profileImage " : " https://classroom-training-bucket.s3.ap-south-1.amazonaws.com/user/copernico-p_kICQCOM4s-unsplash.jpg " ,
" phone " : 9876543210,
" password " : " $2b$10$DpOSGb0B7cT0f6L95RnpWO2P/AtEoE6OF9diIiAEP7QrTMaV29Kmm " ,
" createdAt " : " 2021-10-10T06:25:46.051Z " ,
" updatedAt " : " 2021-10-10T06:25:46.051Z " ,
" __v " : 0
}
}
{
" status " : true,
" message " : " User profile updated " ,
" data " : {
" address " : {
" shipping " : {
" street " : " MG Road " ,
" city " : " Delhi " ,
" pincode " : 110001
},
" billing " : {
" street " : " MG Road " ,
" city " : " Indore " ,
" pincode " : 452010
}
},
" _id " : " 6162876abdcb70afeeaf9cf5 " ,
" fname " : " Jane " ,
" lname " : " Austin " ,
" email " : " [email protected] " ,
" profileImage " : " https://classroom-training-bucket.s3.ap-south-1.amazonaws.com/user/laura-davidson-QBAH4IldaZY-unsplash.jpg " ,
" phone " : 9876543210,
" password " : " $2b$10$jgF/j/clYBq.3uly6Tijce4GEGJn9EIXEcw9NI3prgKwJ/6.sWT6O " ,
" createdAt " : " 2021-10-10T06:25:46.051Z " ,
" updatedAt " : " 2021-10-10T08:47:15.297Z " ,
" __v " : 0
}
}
ملاحظة: Bcrypt إرسال بيانات النموذج
{
title : {string, mandatory, unique},
description : {string, mandatory},
price : {number, mandatory, valid number/decimal},
currencyId : {string, mandatory, INR},
currencyFormat : {string, mandatory, Rupee symbol},
isFreeShipping : {boolean, default: false},
productImage : {string, mandatory}, // s3 link
style : {string},
availableSizes : {array of string, at least one size, enum["S", "XS","M","X", "L","XXL", "XL"]},
installments : {number},
deletedAt : {Date, when the document is deleted},
isDeleted : {boolean, default: false},
createdAt : {timestamp},
updatedAt : {timestamp},
}
ملاحظة: بالنسبة لطلب مرشح الأسعار، يمكن أن يحتوي على كلا المفتاحين أو أي منهما. على سبيل المثال، يمكن أن يبدو الاستعلام في الطلب بالشكل التالي {priceGreaterThan: 500, PriceLessThan: 2000 } أو {priceLessThan: 1000 } فقط)
{
userId : {ObjectId, refs to User, mandatory, unique},
items : [{
productId : {ObjectId, refs to Product model, mandatory},
quantity : {number, mandatory, min 1}
}],
totalPrice : {number, mandatory, comment: "Holds total price of all the items in the cart"},
totalItems : {number, mandatory, comment: "Holds total number of items in the cart"},
createdAt : {timestamp},
updatedAt : {timestamp},
}
{
userId : {ObjectId, refs to User, mandatory},
items : [{
productId : {ObjectId, refs to Product model, mandatory},
quantity : {number, mandatory, min 1}
}],
totalPrice : {number, mandatory, comment: "Holds total price of all the items in the cart"},
totalItems : {number, mandatory, comment: "Holds total number of items in the cart"},
totalQuantity : {number, mandatory, comment: "Holds total number of quantity in the cart"},
cancellable : {boolean, default: true},
status : {string, default: 'pending', enum[pending, completed, cancled]},
deletedAt : {Date, when the document is deleted},
isDeleted : {boolean, default: false},
createdAt : {timestamp},
updatedAt : {timestamp},
}
الرجوع أدناه عينة
{
status : true,
message : ' Success ' ,
data : {
}
}
{
status : false,
message : " "
}
{
_id : ObjectId("88abc190ef0288abc190ef02"),
fname : ' John ' ,
lname : ' Doe ' ,
email : ' [email protected] ' ,
profileImage : ' http://function-up-test.s3.amazonaws.com/users/user/johndoe.jpg ' , // s3 link
phone : 9876543210,
password : ' $2b$10$O.hrbBPCioVm237nAHYQ5OZy6k15TOoQSFhTT.recHBfQpZhM55Ty ' , // encrypted password
address : {
shipping : {
street : " 110, Ridhi Sidhi Tower " ,
city : " Jaipur " ,
pincode : 400001
}, {mandatory}
billing : {
street : " 110, Ridhi Sidhi Tower " ,
city : " Jaipur " ,
pincode : 400001
}
},
createdAt : " 2021-09-17T04:25:07.803Z " ,
updatedAt : " 2021-09-17T04:25:07.803Z " ,
}
{
_id : ObjectId("88abc190ef0288abc190ef55"),
title : ' Nit Grit ' ,
description : ' Dummy description ' ,
price : 23.0,
currencyId : ' INR ' ,
currencyFormat : ' ₹ ' ,
isFreeShipping : false,
productImage : ' http://function-up-test.s3.amazonaws.com/products/product/nitgrit.jpg ' , // s3 link
style : ' Colloar ' ,
availableSizes : ["S", "XS","M","X", "L","XXL", "XL"],
installments : 5,
deletedAt : null,
isDeleted : false,
createdAt : " 2021-09-17T04:25:07.803Z " ,
updatedAt : " 2021-09-17T04:25:07.803Z " ,
}
{
" _id " : ObjectId("88abc190ef0288abc190ef88"),
userId : ObjectId("88abc190ef0288abc190ef02"),
items : [{
productId : ObjectId("88abc190ef0288abc190ef55"),
quantity : 2
}, {
productId : ObjectId("88abc190ef0288abc190ef60"),
quantity : 1
}],
totalPrice : 50.99,
totalItems : 2,
createdAt : " 2021-09-17T04:25:07.803Z " ,
updatedAt : " 2021-09-17T04:25:07.803Z " ,
}
{
" _id " : ObjectId("88abc190ef0288abc190ef88"),
userId : ObjectId("88abc190ef0288abc190ef02"),
items : [{
productId : ObjectId("88abc190ef0288abc190ef55"),
quantity : 2
}, {
productId : ObjectId("88abc190ef0288abc190ef60"),
quantity : 1
}],
totalPrice : 50.99,
totalItems : 2,
totalQuantity : 3,
cancellable : true,
status : ' pending '
createdAt : " 2021-09-17T04:25:07.803Z " ,
updatedAt : " 2021-09-17T04:25:07.803Z " ,
}